Merge lp:~jaypipes/drizzle/bug552420 into lp:~drizzle-trunk/drizzle/development

Proposed by Jay Pipes
Status: Merged
Merged at revision: 1575
Proposed branch: lp:~jaypipes/drizzle/bug552420
Merge into: lp:~drizzle-trunk/drizzle/development
Prerequisite: lp:~stewart/drizzle/embedded-innodb
Diff against target: 40 lines (+11/-6)
2 files modified
drizzled/statement/alter_table.cc (+9/-0)
plugin/embedded_innodb/embedded_innodb_engine.cc (+2/-6)
To merge this branch: bzr merge lp:~jaypipes/drizzle/bug552420
Reviewer Review Type Date Requested Status
Stewart Smith (community) Approve
Brian Aker Needs Information
Drizzle Developers Pending
Review via email: mp+24513@code.launchpad.net

Description of the change

Fixes Bug #552420 by manually calling plugin::StorageEngine::startStatement() during ALTER TABLE. Since the copied-to table in ALTER TABLE is temporary, mysql_lock_tables() is never called, meaning the automatic call to plugin::StorageEngine::startStatement() is also not called, and that meant transactional storage engines weren't notified of a new transaction.

To post a comment you must log in.
Revision history for this message
Brian Aker (brianaker) wrote :

This will need Monty's fix for one/other Innodb.

review: Needs Information
Revision history for this message
Stewart Smith (stewart) wrote :

I gather that commitTransaction is called okay later. the assert about transaction != NULL in embedded_innodb is actually superfluous because of quite liberal asserts in libinnodb, but i'm okay with it being there :)

looks good!

review: Approve
Revision history for this message
Brian Aker (brianaker) wrote :

Stewart, did you get a chance to merge this into your tree?

Revision history for this message
Stewart Smith (stewart) wrote :

On Thu, 27 May 2010 04:27:26 -0000, Brian Aker <email address hidden> wrote:
> Stewart, did you get a chance to merge this into your tree?

on TODO for tomorrow morning.
--
Stewart Smith

Revision history for this message
Stewart Smith (stewart) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'drizzled/statement/alter_table.cc'
2--- drizzled/statement/alter_table.cc 2010-04-20 18:14:52 +0000
3+++ drizzled/statement/alter_table.cc 2010-04-30 17:32:30 +0000
4@@ -1344,6 +1344,15 @@
5 */
6 TransactionServices &transaction_services= TransactionServices::singleton();
7
8+ /*
9+ * LP Bug #552420
10+ *
11+ * Since open_temporary_table() doesn't invoke mysql_lock_tables(), we
12+ * don't get the usual automatic call to StorageEngine::startStatement(), so
13+ * we manually call it here...
14+ */
15+ to->s->getEngine()->startStatement(session);
16+
17 if (!(copy= new CopyField[to->s->fields]))
18 return -1;
19
20
21=== modified file 'plugin/embedded_innodb/embedded_innodb_engine.cc'
22--- plugin/embedded_innodb/embedded_innodb_engine.cc 2010-04-30 17:32:29 +0000
23+++ plugin/embedded_innodb/embedded_innodb_engine.cc 2010-04-30 17:32:30 +0000
24@@ -1639,14 +1639,10 @@
25 {
26 ib_trx_t transaction;
27
28- if(*get_trx(current_session) == NULL)
29- {
30- EmbeddedInnoDBEngine *innodb_engine= static_cast<EmbeddedInnoDBEngine*>(engine);
31- innodb_engine->doStartTransaction(current_session, START_TRANS_NO_OPTIONS);
32- }
33-
34 transaction= *get_trx(ha_session());
35
36+ assert(transaction != NULL);
37+
38 ib_cursor_attach_trx(cursor, transaction);
39
40 tuple= ib_clust_read_tuple_create(cursor);