From 5151b5520edafd3374093a73635ef52d4044f10e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 7 Mar 2001 23:50:44 +0200 Subject: Fixed test cases for innobase Fixed bug introduced with last ORDER BY optimization Changed log position to longlong to avoid warnings. Docs/manual.texi: Update for innobase mysql-test/r/innobase.result: Fixed test cases mysql-test/t/bdb.test: Removed not used tables mysql-test/t/innobase.test: Fixed test cases sql/field.h: Fixed bug introduced with last ORDER BY optimization sql/ha_berkeley.cc: Fixed bug when index_init() was called twice. sql/mysql_priv.h: Added option to not get stack trace (when using gdb) sql/mysqld.cc: Added option to not get stack trace (when using gdb) sql/slave.cc: Changed log position to longlong to avoid warnings. sql/slave.h: Changed log position to longlong to avoid warnings. sql/sql_parse.cc: Removed warnings sql/sql_select.cc: Cleanups --- sql/ha_berkeley.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'sql/ha_berkeley.cc') diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index 9a0300b4fcb..3f6b2629e16 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -1307,13 +1307,19 @@ int ha_berkeley::index_init(uint keynr) int error; DBUG_ENTER("index_init"); DBUG_PRINT("enter",("table: '%s' key: %d", table->real_name, keynr)); + + /* + Under some very rare conditions (like full joins) we may already have + an active cursor at this point + */ + if (cursor) + cursor->c_close(cursor); active_index=keynr; - dbug_assert(cursor == 0); if ((error=key_file[keynr]->cursor(key_file[keynr], transaction, &cursor, table->reginfo.lock_type > TL_WRITE_ALLOW_READ ? 0 : 0))) - cursor=0; // Safety /* purecov: inspected */ + cursor=0; // Safety /* purecov: inspected */ bzero((char*) &last_key,sizeof(last_key)); DBUG_RETURN(error); } -- cgit v1.2.1