diff options
author | dlenev@mysql.com <> | 2005-08-08 17:46:06 +0400 |
---|---|---|
committer | dlenev@mysql.com <> | 2005-08-08 17:46:06 +0400 |
commit | 615baa9f237b30ec590a4405ecb222643d1792a5 (patch) | |
tree | 8007d727be724e17f5c651d47f354821dec91991 /sql/sql_prepare.cc | |
parent | 6fd6fa517b9a660b8d0c81dcebcd880058f9561a (diff) | |
download | mariadb-git-615baa9f237b30ec590a4405ecb222643d1792a5.tar.gz |
Fix for bug #10055 "Using stored function with information_schema causes empty
result set".
To enable full access to contents of I_S tables from stored functions
or statements that use them, we manipulate with thread's open tables
state and ensure that we won't cause deadlock when we open tables by
ignoring flushes and name-locks.
Building of contents of I_S.TABLES no longer requires locking of tables
since we use use handler::info() method with HA_STATUS_AUTO flag instead
of handler::update_auto_increment() for obtaining information about
auto-increment values. But this also means that handlers have to implement
support for HA_STATUS_AUTO flag (particularly InnoDB needs it).
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r-- | sql/sql_prepare.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index e163e71e416..413ee486e55 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -925,7 +925,7 @@ static bool mysql_test_insert(Prepared_statement *stmt, If we would use locks, then we have to ensure we are not using TL_WRITE_DELAYED as having two such locks can cause table corruption. */ - if (open_normal_and_derived_tables(thd, table_list)) + if (open_normal_and_derived_tables(thd, table_list, 0)) goto error; if ((values= its++)) @@ -1005,7 +1005,7 @@ static int mysql_test_update(Prepared_statement *stmt, if (update_precheck(thd, table_list)) goto error; - if (open_tables(thd, &table_list, &table_count)) + if (open_tables(thd, &table_list, &table_count, 0)) goto error; if (table_list->multitable_view) |