Commit 786810e6 authored by unknown's avatar unknown

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...).
parent 8ac19767
......@@ -22,8 +22,6 @@
#include <m_ctype.h>
#include <hash.h>
LEX_STRING tmp_table_alias= {(char*) "tmp-table",8};
/* Macros to look like lex */
#define yyGet() *(lex->ptr++)
......
......@@ -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)
......@@ -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:
......
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