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.
parent c095ce82
...@@ -22,8 +22,6 @@ ...@@ -22,8 +22,6 @@
#include <m_ctype.h> #include <m_ctype.h>
#include <hash.h> #include <hash.h>
LEX_STRING tmp_table_alias= {(char*) "tmp-table",8};
/* Macros to look like lex */ /* Macros to look like lex */
#define yyGet() *(lex->ptr++) #define yyGet() *(lex->ptr++)
......
...@@ -642,6 +642,4 @@ void lex_end(LEX *lex); ...@@ -642,6 +642,4 @@ void lex_end(LEX *lex);
extern pthread_key(LEX*,THR_LEX); extern pthread_key(LEX*,THR_LEX);
extern LEX_STRING tmp_table_alias;
#define current_lex (current_thd->lex) #define current_lex (current_thd->lex)
...@@ -917,11 +917,7 @@ create: ...@@ -917,11 +917,7 @@ create:
THD *thd= YYTHD; THD *thd= YYTHD;
LEX *lex=Lex; LEX *lex=Lex;
lex->sql_command= SQLCOM_CREATE_TABLE; lex->sql_command= SQLCOM_CREATE_TABLE;
if (!lex->select_lex.add_table_to_list(thd,$5, if (!lex->select_lex.add_table_to_list(thd, $5, NULL,
($2 &
HA_LEX_CREATE_TMP_TABLE ?
&tmp_table_alias :
(LEX_STRING*) 0),
TL_OPTION_UPDATING, TL_OPTION_UPDATING,
(using_update_log ? (using_update_log ?
TL_READ_NO_INSERT: TL_READ_NO_INSERT:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment