diff options
author | unknown <monty@donna.mysql.fi> | 2001-04-19 20:41:19 +0300 |
---|---|---|
committer | unknown <monty@donna.mysql.fi> | 2001-04-19 20:41:19 +0300 |
commit | e69d8fb32a97cd7269f01ecc60b74f710e4a7c6b (patch) | |
tree | b9a43fcdfcccfe2291c2db879da2011530b4339f /sql/sql_base.cc | |
parent | 19a2e7c16b8faf0264a0ee046374784e2a4158ad (diff) | |
download | mariadb-git-e69d8fb32a97cd7269f01ecc60b74f710e4a7c6b.tar.gz |
Fix for BDB and LOCK TABLES
BitKeeper/deleted/.del-ib_config.h.in~9e57db8504e55b7:
Delete: innobase/ib_config.h.in
BitKeeper/deleted/.del-ib_config.h~7539e26ffc614439:
Delete: innobase/ib_config.h
Docs/manual.texi:
Changelog
myisam/mi_locking.c:
Cleanup
mysql-test/r/bdb.result:
Test for LOCK TABLES
mysql-test/r/innodb.result:
Test for LOCK TABLES
mysql-test/t/bdb.test:
Test for LOCK TABLES
mysql-test/t/innodb.test:
Test for LOCK TABLES
sql-bench/test-insert.sh:
Allow loop to be small
sql/ha_berkeley.cc:
Fixed bug when using LOCK TABLES with BDB
sql/ha_berkeley.h:
Fixed bug when using LOCK TABLES with BDB
sql/handler.h:
Fixed bug when using LOCK TABLES with BDB
sql/sql_base.cc:
Fixed bug when using LOCK TABLES with BDB
sql/sql_parse.cc:
UNLOCK TABLES ends transaction
sql/sql_select.cc:
Fix to not call index_end() twice
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r-- | sql/sql_base.cc | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 49c858b7a16..134449fd20a 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1399,6 +1399,7 @@ TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type lock_type) &refresh)) && refresh) ; if (table) { + int error; table_list->table=table; table->grant= table_list->grant; if (thd->locked_tables) @@ -1410,7 +1411,12 @@ TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type lock_type) my_printf_error(ER_TABLE_NOT_LOCKED_FOR_WRITE, ER(ER_TABLE_NOT_LOCKED_FOR_WRITE), MYF(0),table_list->name); - DBUG_RETURN(0); + table=0; + } + else if ((error=table->file->start_stmt(thd))) + { + table->file->print_error(error,MYF(0)); + table=0; } thd->proc_info=0; DBUG_RETURN(table); @@ -1437,10 +1443,10 @@ int open_and_lock_tables(THD *thd,TABLE_LIST *tables) int lock_tables(THD *thd,TABLE_LIST *tables) { + TABLE_LIST *table; if (tables && !thd->locked_tables) { uint count=0; - TABLE_LIST *table; for (table = tables ; table ; table=table->next) count++; TABLE **start,**ptr; @@ -1451,6 +1457,18 @@ int lock_tables(THD *thd,TABLE_LIST *tables) if (!(thd->lock=mysql_lock_tables(thd,start,count))) return -1; /* purecov: inspected */ } + else + { + for (table = tables ; table ; table=table->next) + { + int error; + if ((error=table->table->file->start_stmt(thd))) + { + table->table->file->print_error(error,MYF(0)); + return -1; + } + } + } return 0; } |