summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorbell@sanja.is.com.ua <>2004-02-17 01:14:51 +0200
committerbell@sanja.is.com.ua <>2004-02-17 01:14:51 +0200
commit3f86f10a57f0401d81cd66209383cd10f6ef7cf7 (patch)
treea619c58eaa61934c229e4af77c6ea8c60678beb5 /sql/sql_lex.cc
parent80b01886631a813273da930583bb089c48e201bb (diff)
downloadmariadb-git-3f86f10a57f0401d81cd66209383cd10f6ef7cf7.tar.gz
ulternative bugfix for BUG#2508 and fix for BUG#2809 - every table has its own TABLE structure
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc29
1 files changed, 9 insertions, 20 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 5ffe8c1c365..96a0a86c43d 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -1376,28 +1376,17 @@ create_total_list_n_last_return(THD *thd_arg,
{
TABLE_LIST *cursor;
next_table= aux->next;
- for (cursor= **result_arg; cursor; cursor= cursor->next)
- if (!strcmp(cursor->db, aux->db) &&
- !strcmp(cursor->real_name, aux->real_name) &&
- !strcmp(cursor->alias, aux->alias))
- break;
- if (!cursor)
+ /* Add not used table to the total table list */
+ if (!(cursor= (TABLE_LIST *) thd->memdup((char*) aux,
+ sizeof(*aux))))
{
- /* Add not used table to the total table list */
- if (!(cursor= (TABLE_LIST *) thd->memdup((char*) aux,
- sizeof(*aux))))
- {
- send_error(thd,0);
- return 1;
- }
- *new_table_list= cursor;
- cursor->table_list= aux; //to be able mark this table as shared
- new_table_list= &cursor->next;
- *new_table_list= 0; // end result list
+ send_error(thd,0);
+ return 1;
}
- else
- // Mark that it's used twice
- cursor->table_list->shared= aux->shared= 1;
+ *new_table_list= cursor;
+ cursor->table_list= aux;
+ new_table_list= &cursor->next;
+ *new_table_list= 0; // end result list
aux->table_list= cursor;
}
}