diff options
author | pem@mysql.comhem.se <> | 2005-02-08 20:52:50 +0100 |
---|---|---|
committer | pem@mysql.comhem.se <> | 2005-02-08 20:52:50 +0100 |
commit | 2c26ebe3594077cd90b95aaf591eaacc4eb2cdbe (patch) | |
tree | e0f8f8584de8f0be190160f0562d6a75d0039e60 /sql/sql_derived.cc | |
parent | 6e6daf818943e34d72017f64e496d6d94c90134f (diff) | |
download | mariadb-git-2c26ebe3594077cd90b95aaf591eaacc4eb2cdbe.tar.gz |
WL#2130: Table locking for stored FUNCTIONs
Collect all tables and SPs refered by a statement, and open all tables
with an implicit LOCK TABLES. Do find things refered by triggers and views,
we open them first (and then repeat this until nothing new is found), before
doing the actual lock tables.
Diffstat (limited to 'sql/sql_derived.cc')
-rw-r--r-- | sql/sql_derived.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index bed65f90c00..c01728e68d5 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -165,16 +165,21 @@ exit: else { if (!thd->fill_derived_tables()) + { delete derived_result; + derived_result= NULL; + } orig_table_list->derived_result= derived_result; orig_table_list->table= table; orig_table_list->table_name= (char*) table->s->table_name; + orig_table_list->table_name_length= strlen((char*)table->s->table_name); table->derived_select_number= first_select->select_number; table->s->tmp_table= TMP_TABLE; #ifndef NO_EMBEDDED_ACCESS_CHECKS table->grant.privilege= SELECT_ACL; #endif orig_table_list->db= (char *)""; + orig_table_list->db_length= 0; // Force read of table stats in the optimizer table->file->info(HA_STATUS_VARIABLE); /* Add new temporary table to list of open derived tables */ |