From 0bf85cfdfaf8eb7315005760e9516bba5e530ce2 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 24 May 2004 15:48:19 +0400 Subject: [PATCH] Fix for bug which caused temp_table.test fail on Darwin 7.3 The code in mysql_create_table() code assumes that if lower_case_names==2 then table alias should contain unchanged table name, and this was not true for temporary tables which had 'tmp-table' constant as alias. Now we are using table name as alias for such tables. sql/sql_lex.cc: Removed tmp_table_alias constant which is no longer used. sql/sql_lex.h: Removed tmp_table_alias constant which is no longer used. sql/sql_yacc.yy: Let us use table name instead of 'tmp-table' as alias for table being created by CREATE TEMPORARY TABLE statement. This fixes failing temp_table.test on Darwin 7.3 since mysql_create_table() code assumes that if lower_case_names==2 then table alias should contain unchanged table name (and now this assumtion is true but it were false for temporary tables before...). --- sql/sql_lex.cc | 2 -- sql/sql_lex.h | 2 -- sql/sql_yacc.yy | 6 +----- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 0d3ab196aa5..f98a6b43846 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -22,8 +22,6 @@ #include #include -LEX_STRING tmp_table_alias= {(char*) "tmp-table",8}; - /* Macros to look like lex */ #define yyGet() *(lex->ptr++) diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 2df2c998ff0..e458fe96cff 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -642,6 +642,4 @@ void lex_end(LEX *lex); extern pthread_key(LEX*,THR_LEX); -extern LEX_STRING tmp_table_alias; - #define current_lex (current_thd->lex) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 45e8e6e67e2..6c544030b41 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -917,11 +917,7 @@ create: THD *thd= YYTHD; LEX *lex=Lex; lex->sql_command= SQLCOM_CREATE_TABLE; - if (!lex->select_lex.add_table_to_list(thd,$5, - ($2 & - HA_LEX_CREATE_TMP_TABLE ? - &tmp_table_alias : - (LEX_STRING*) 0), + if (!lex->select_lex.add_table_to_list(thd, $5, NULL, TL_OPTION_UPDATING, (using_update_log ? TL_READ_NO_INSERT: