1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fix for BUG#6808.

The problem was in that add_table_to_list was testing for duplicate tables
in a list of tables that included the created view.


mysql-test/r/view.result:
  Test for BUG#6808
mysql-test/t/view.test:
  Test for BUG#6808
sql/sql_parse.cc:
  When testing for table name uniquness, skip the first table the current
  statement is CREATE VIEW. Notice that the first table is skipped differently
  for CREATE TABLE ... SELECT ... statements, so we don't have to handle that
  case here (see production 'create_select', the call 'to save_and_clear').
This commit is contained in:
unknown
2005-09-12 17:01:17 +03:00
parent 0fd4d20c53
commit d2789003b3
3 changed files with 21 additions and 5 deletions

View File

@ -6059,7 +6059,10 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
/* check that used name is unique */
if (lock_type != TL_IGNORE)
{
for (TABLE_LIST *tables=(TABLE_LIST*) table_list.first ;
TABLE_LIST *first_table= (TABLE_LIST*) table_list.first;
if (lex->sql_command == SQLCOM_CREATE_VIEW)
first_table= first_table ? first_table->next_local : NULL;
for (TABLE_LIST *tables= first_table ;
tables ;
tables=tables->next_local)
{