Cursor::doStartTableScan can be called twice without any cleanup
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Drizzle |
Confirmed
|
Low
|
Stewart Smith |
Bug Description
first select query in count_distinct.
hit assert in libinnodb with embedded_innodb engine.
Breakpoint 1, drizzled:
inBuf=0x14de808 "drop table if exists t1,t2,t3", length=29)
at drizzled/
715 lex_start(session);
(gdb) b EmbeddedInnoDBC
Breakpoint 2 at 0x7ffff3f2e9d8: file plugin/
(gdb) c
Continuing.
Breakpoint 2, EmbeddedInnoDBC
at plugin/
1735 if(*get_
(gdb) b EmbeddedInnoDBC
Breakpoint 3 at 0x7ffff3f2efee: file plugin/
(gdb) b EmbeddedInnoDBC
Breakpoint 4 at 0x7ffff3f2b6b6: file plugin/
(gdb) b EmbeddedInnoDBC
Breakpoint 5 at 0x7ffff3f2fe12: file plugin/
(gdb) c
Continuing.
Breakpoint 2, EmbeddedInnoDBC
at plugin/
1735 if(*get_
(gdb)
Changed in drizzle: | |
importance: | Undecided → Low |
Changed in drizzle: | |
assignee: | nobody → Stewart Smith (stewart) |
=== modified file 'plugin/ embedded_ innodb/ embedded_ innodb_ engine. cc' embedded_ innodb/ embedded_ innodb_ engine. cc 2010-05-26 10:19:08 +0000 embedded_ innodb/ embedded_ innodb_ engine. cc 2010-05-26 13:14:09 +0000
--- plugin/
+++ plugin/
@@ -620,6 +620,8 @@
ref_length= 0; // FIXME: this is a bug. we need to work out what index it is.
}
+ in_table_scan= false;
+
return(0);
}
@@ -1732,6 +1734,10 @@
{
ib_trx_t transaction;
+ if (in_table_scan) get_trx( current_ session) == NULL) noDBEngine *innodb_engine= static_ cast<EmbeddedIn noDBEngine* >(engine) ; delete( tuple); reset(cursor) ;
+ doEndTableScan();
+ in_table_scan= true;
+
if(*
{
EmbeddedIn
@@ -1859,7 +1865,7 @@
ib_tuple_
err= ib_cursor_
assert(err == DB_SUCCESS);
-
+ in_table_scan= false;
return 0;
}
You need to do something like this:
=== modified file 'plugin/ embedded_ innodb/ embedded_ innodb_ engine. h' embedded_ innodb/ embedded_ innodb_ engine. h 2010-05-26 10:19:08 +0000 embedded_ innodb/ embedded_ innodb_ engine. h 2010-05-26 13:14:09 +0000 autoinc_ pkey_position; :memory: :Root *blobroot;
--- plugin/
+++ plugin/
@@ -123,6 +123,8 @@
bool write_can_replace;
uint64_t hidden_
drizzled:
+
+ bool in_table_scan;
};
#endif /* PLUGIN_ EMBEDDED_ INNODB_ EMBEDDED_ INNODB_ ENGINE_ H */