summaryrefslogtreecommitdiff
path: root/sql/sql_lex.h
diff options
context:
space:
mode:
authorunknown <ramil/ram@mysql.com/ramil.myoffice.izhnet.ru>2007-10-09 19:16:39 +0500
committerunknown <ramil/ram@mysql.com/ramil.myoffice.izhnet.ru>2007-10-09 19:16:39 +0500
commit8ae794bbd6cf2de6d9abe63c068aff067829c0b1 (patch)
treec448012ac6951fe6ea62bbb0865cd44493e13145 /sql/sql_lex.h
parent6b957bcba4b54168219c92152e2f7ab158db5c74 (diff)
downloadmariadb-git-8ae794bbd6cf2de6d9abe63c068aff067829c0b1.tar.gz
Fix for bug #29444: crash with partition refering to table in create-select
Problem: creating a partitioned table during name resolution for the partition function we search for column names in all parts of the CREATE TABLE query. It is superfluous (and wrong) sometimes. Fix: launch name resolution for the partition function against the table we're creating. mysql-test/r/partition.result: Fix for bug #29444: crash with partition refering to table in create-select - test result. mysql-test/t/partition.test: Fix for bug #29444: crash with partition refering to table in create-select - test result. sql/item.cc: Fix for bug #29444: crash with partition refering to table in create-select - LEX::use_only_table_context introduced, which is used in the Item_field::fix_fields() to resolve names only against context->first_name_resolution_table/last_name_resolution_table. sql/sql_lex.cc: Fix for bug #29444: crash with partition refering to table in create-select - LEX::use_only_table_context introduced, which is used in the Item_field::fix_fields() to resolve names only against context->first_name_resolution_table/last_name_resolution_table. sql/sql_lex.h: Fix for bug #29444: crash with partition refering to table in create-select - LEX::use_only_table_context introduced, which is used in the Item_field::fix_fields() to resolve names only against context->first_name_resolution_table/last_name_resolution_table. sql/sql_partition.cc: Fix for bug #29444: crash with partition refering to table in create-select - set the lex->use_only_table_context before the func_expr->fix_fields() call to ensure we're resolving names against the table we're creating; then restore it back after the call.
Diffstat (limited to 'sql/sql_lex.h')
-rw-r--r--sql/sql_lex.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 08104769704..50211f6b3f9 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -1693,6 +1693,14 @@ typedef struct st_lex : public Query_tables_list
*/
const char *fname_start;
const char *fname_end;
+
+ /**
+ During name resolution search only in the table list given by
+ Name_resolution_context::first_name_resolution_table and
+ Name_resolution_context::last_name_resolution_table
+ (see Item_field::fix_fields()).
+ */
+ bool use_only_table_context;
LEX_STRING view_body_utf8;