diff options
author | unknown <ibabaev@bk-internal.mysql.com> | 2007-06-02 00:57:25 +0200 |
---|---|---|
committer | unknown <ibabaev@bk-internal.mysql.com> | 2007-06-02 00:57:25 +0200 |
commit | 5697c0c10ceeace7e14f47dd6e9c2d2e0552e78b (patch) | |
tree | 5339c6747631cb919dd972d0b8a25a0958bceba5 /sql/sql_base.cc | |
parent | 865f294fcfe14bf69a85eb8ba1260b7a4af45d7d (diff) | |
parent | e21076463c4c1721bfd7150ff2350d634009755a (diff) | |
download | mariadb-git-5697c0c10ceeace7e14f47dd6e9c2d2e0552e78b.tar.gz |
Merge bk-internal.mysql.com:/data0/bk/mysql-5.0
into bk-internal.mysql.com:/data0/bk/mysql-5.0-opt
mysql-test/r/sp.result:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/t/strict.test:
Auto merged
mysql-test/t/subselect3.test:
Auto merged
sql/mysqld.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql/sql_view.cc:
Manual merge
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r-- | sql/sql_base.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 999a05ca616..a7abe0e1167 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1669,10 +1669,17 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root, VOID(pthread_mutex_unlock(&LOCK_open)); } } - if ((thd->locked_tables) && (thd->locked_tables->lock_count > 0)) - my_error(ER_TABLE_NOT_LOCKED, MYF(0), alias); - else + /* + No table in the locked tables list. In case of explicit LOCK TABLES + this can happen if a user did not include the able into the list. + In case of pre-locked mode locked tables list is generated automatically, + so we may only end up here if the table did not exist when + locked tables list was created. + */ + if (thd->prelocked_mode == PRELOCKED) my_error(ER_NO_SUCH_TABLE, MYF(0), table_list->db, table_list->alias); + else + my_error(ER_TABLE_NOT_LOCKED, MYF(0), alias); DBUG_RETURN(0); } |