Below is the list of changes that have just been committed into a local
5.0 repository of evgen. When evgen does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-02-28 23:43:02+03:00, evgen@stripped +7 -0
Merge epotemkin@stripped:/home/bk/mysql-5.0-opt
into moonbone.local:/mnt/gentoo64/work/25122-bug-5.0-opt-mysql
MERGE: 1.2411.5.6
sql/mysql_priv.h@stripped, 2007-02-28 23:42:59+03:00, evgen@stripped +0 -0
Auto merged
MERGE: 1.429.8.1
sql/sql_base.cc@stripped, 2007-02-28 23:43:00+03:00, evgen@stripped +0 -0
Auto merged
MERGE: 1.366.1.1
sql/sql_delete.cc@stripped, 2007-02-28 23:43:00+03:00, evgen@stripped +0 -0
Auto merged
MERGE: 1.191.1.1
sql/sql_insert.cc@stripped, 2007-02-28 23:43:00+03:00, evgen@stripped +0 -0
Auto merged
MERGE: 1.211.3.6
sql/sql_load.cc@stripped, 2007-02-28 23:43:00+03:00, evgen@stripped +0 -0
Auto merged
MERGE: 1.102.1.3
sql/sql_parse.cc@stripped, 2007-02-28 23:43:00+03:00, evgen@stripped +0 -0
Auto merged
MERGE: 1.601.1.4
sql/sql_update.cc@stripped, 2007-02-28 23:43:00+03:00, evgen@stripped +0 -0
Auto merged
MERGE: 1.205.3.1
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: evgen
# Host: moonbone.local
# Root: /mnt/gentoo64/work/25122-bug-5.0-opt-mysql/RESYNC
--- 1.433/sql/mysql_priv.h 2007-02-26 15:57:41 +03:00
+++ 1.434/sql/mysql_priv.h 2007-02-28 23:42:59 +03:00
@@ -1066,7 +1066,8 @@
st_table_list *TABLE_LIST::*link,
const char *db_name,
const char *table_name);
-TABLE_LIST *unique_table(THD *thd, TABLE_LIST *table, TABLE_LIST *table_list);
+TABLE_LIST *unique_table(THD *thd, TABLE_LIST *table, TABLE_LIST *table_list,
+ bool check_alias);
TABLE **find_temporary_table(THD *thd, const char *db, const char *table_name);
bool close_temporary_table(THD *thd, const char *db, const char *table_name);
void close_temporary(TABLE *table, bool delete_table);
--- 1.367/sql/sql_base.cc 2007-02-26 15:57:41 +03:00
+++ 1.368/sql/sql_base.cc 2007-02-28 23:43:00 +03:00
@@ -796,6 +796,7 @@
thd thread handle
table table which should be checked
table_list list of tables
+ check_alias whether to check tables' aliases
NOTE: to exclude derived tables from check we use following mechanism:
a) during derived table processing set THD::derived_tables_processing
@@ -823,10 +824,11 @@
0 if table is unique
*/
-TABLE_LIST* unique_table(THD *thd, TABLE_LIST *table, TABLE_LIST *table_list)
+TABLE_LIST* unique_table(THD *thd, TABLE_LIST *table, TABLE_LIST *table_list,
+ bool check_alias)
{
TABLE_LIST *res;
- const char *d_name, *t_name;
+ const char *d_name, *t_name, *t_alias;
DBUG_ENTER("unique_table");
DBUG_PRINT("enter", ("table alias: %s", table->alias));
@@ -854,6 +856,7 @@
}
d_name= table->db;
t_name= table->table_name;
+ t_alias= table->alias;
DBUG_PRINT("info", ("real table: %s.%s", d_name, t_name));
for (;;)
@@ -861,6 +864,7 @@
if (((! (res= find_table_in_global_list(table_list, d_name, t_name))) &&
(! (res= mysql_lock_have_duplicate(thd, table, table_list)))) ||
((!res->table || res->table != table->table) &&
+ (!check_alias || !strcmp(t_alias, res->alias)) &&
res->select_lex && !res->select_lex->exclude_from_table_unique_test &&
!res->prelocking_placeholder))
break;
--- 1.192/sql/sql_delete.cc 2007-02-21 22:59:49 +03:00
+++ 1.193/sql/sql_delete.cc 2007-02-28 23:43:00 +03:00
@@ -371,7 +371,7 @@
}
{
TABLE_LIST *duplicate;
- if ((duplicate= unique_table(thd, table_list, table_list->next_global)))
+ if ((duplicate= unique_table(thd, table_list, table_list->next_global, 0)))
{
update_non_unique_table_error(table_list, "DELETE", duplicate);
DBUG_RETURN(TRUE);
@@ -468,7 +468,7 @@
{
TABLE_LIST *duplicate;
if ((duplicate= unique_table(thd, target_tbl->correspondent_table,
- lex->query_tables)))
+ lex->query_tables, 0)))
{
update_non_unique_table_error(target_tbl->correspondent_table,
"DELETE", duplicate);
--- 1.217/sql/sql_insert.cc 2007-02-26 15:57:41 +03:00
+++ 1.218/sql/sql_insert.cc 2007-02-28 23:43:00 +03:00
@@ -1043,7 +1043,7 @@
{
Item *fake_conds= 0;
TABLE_LIST *duplicate;
- if ((duplicate= unique_table(thd, table_list, table_list->next_global)))
+ if ((duplicate= unique_table(thd, table_list, table_list->next_global, 1)))
{
update_non_unique_table_error(table_list, "INSERT", duplicate);
DBUG_RETURN(TRUE);
@@ -2423,7 +2423,7 @@
query
*/
if (!(lex->current_select->options & OPTION_BUFFER_RESULT) &&
- unique_table(thd, table_list, table_list->next_global))
+ unique_table(thd, table_list, table_list->next_global, 0))
{
/* Using same table for INSERT and SELECT */
lex->current_select->options|= OPTION_BUFFER_RESULT;
--- 1.105/sql/sql_load.cc 2007-01-22 15:10:41 +03:00
+++ 1.106/sql/sql_load.cc 2007-02-28 23:43:00 +03:00
@@ -176,7 +176,7 @@
table is marked to be 'used for insert' in which case we should never
mark this table as as 'const table' (ie, one that has only one row).
*/
- if (unique_table(thd, table_list, table_list->next_global))
+ if (unique_table(thd, table_list, table_list->next_global, 0))
{
my_error(ER_UPDATE_TABLE_USED, MYF(0), table_list->table_name);
DBUG_RETURN(TRUE);
--- 1.604/sql/sql_parse.cc 2007-02-21 14:05:02 +03:00
+++ 1.605/sql/sql_parse.cc 2007-02-28 23:43:00 +03:00
@@ -2988,7 +2988,7 @@
if (!(create_info.options & HA_LEX_CREATE_TMP_TABLE))
{
TABLE_LIST *duplicate;
- if ((duplicate= unique_table(thd, create_table, select_tables)))
+ if ((duplicate= unique_table(thd, create_table, select_tables, 0)))
{
update_non_unique_table_error(create_table, "CREATE", duplicate);
res= 1;
@@ -3004,7 +3004,7 @@
tab= tab->next_local)
{
TABLE_LIST *duplicate;
- if ((duplicate= unique_table(thd, tab, select_tables)))
+ if ((duplicate= unique_table(thd, tab, select_tables, 0)))
{
update_non_unique_table_error(tab, "CREATE", duplicate);
res= 1;
--- 1.210/sql/sql_update.cc 2007-02-26 15:57:42 +03:00
+++ 1.211/sql/sql_update.cc 2007-02-28 23:43:00 +03:00
@@ -640,7 +640,7 @@
/* Check that we are not using table that we are updating in a sub select */
{
TABLE_LIST *duplicate;
- if ((duplicate= unique_table(thd, table_list, table_list->next_global)))
+ if ((duplicate= unique_table(thd, table_list, table_list->next_global, 0)))
{
update_non_unique_table_error(table_list, "UPDATE", duplicate);
my_error(ER_UPDATE_TABLE_USED, MYF(0), table_list->table_name);
@@ -867,7 +867,7 @@
tl->lock_type != TL_READ_NO_INSERT)
{
TABLE_LIST *duplicate;
- if ((duplicate= unique_table(thd, tl, table_list)))
+ if ((duplicate= unique_table(thd, tl, table_list, 0)))
{
update_non_unique_table_error(table_list, "UPDATE", duplicate);
DBUG_RETURN(TRUE);
@@ -1086,7 +1086,7 @@
List<Item> *fields)
{
TABLE *table= join_tab->table;
- if (unique_table(thd, table_ref, all_tables))
+ if (unique_table(thd, table_ref, all_tables, 0))
return 0;
switch (join_tab->type) {
case JT_SYSTEM:
| Thread |
|---|
| • bk commit into 5.0 tree (evgen:1.2425) | eugene | 28 Feb |