mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Merge with 4.1
Makefile.am: Auto merged myisam/mi_create.c: Auto merged myisam/mi_open.c: Auto merged mysql-test/r/ctype_utf8.result: Auto merged mysys/thr_alarm.c: Auto merged VC++Files/sql/mysqld.dsp: Keep old client/mysqldump.c: Manual merge client/mysqltest.c: Automatic merge configure.in: Manual merge mysql-test/r/ctype_ucs.result: Auto merge mysql-test/r/func_str.result: Auto merge mysql-test/r/group_by.result: Auto merge mysql-test/r/insert_select.result: Auto merge mysql-test/r/insert_update.result: Auto merge mysql-test/r/lowercase_table2.result: Auto merge mysql-test/r/select.result: Manual merge mysql-test/r/variables.result: Auto merge mysql-test/t/ctype_ucs.test: Auto merge mysql-test/t/func_str.test: Auto merge mysql-test/t/group_by.test: Auto merge mysql-test/t/insert_select.test: Auto merge mysql-test/t/insert_update.test: Auto merge mysql-test/t/ndb_alter_table.test: Auto merge mysql-test/t/select.test: Auto merge mysql-test/t/variables.test: Auto merge mysys/my_access.c: Auto merge scripts/make_win_src_distribution.sh: Auto merge sql/field.cc: Manual merge sql/ha_ndbcluster.cc: Auto merge sql/handler.cc: Auto merge sql/item.cc: Auto merge sql/item.h: Manual merge sql/item_cmpfunc.h: Auto merge sql/item_strfunc.cc: Auto merge sql/item_strfunc.h: Auto merge sql/mysql_priv.h: manual merge sql/mysqld.cc: manual merge sql/opt_range.cc: manual merge sql/set_var.cc: Auto merge sql/sql_base.cc: manual merge Restore processing of ON DUPLICATE KEY UPDATE sql/sql_insert.cc: manual merge Restore processing of ON DUPLICATE KEY UPDATE Simplify mysql_prepare_insert by using local variable for select_lex and save old values just before they are changed sql/sql_parse.cc: Restore processing of ON DUPLICATE KEY UPDATE sql/sql_prepare.cc: New ON DUPLICATE KEY UPDATE handling sql/sql_select.cc: manual merge sql/sql_table.cc: auto merge sql/sql_yacc.yy: auto merge strings/ctype-ucs2.c: auto merge strings/ctype-utf8.c: auto merge
This commit is contained in:
@@ -2619,7 +2619,7 @@ find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables,
|
||||
const char *name=item->field_name;
|
||||
uint length=(uint) strlen(name);
|
||||
char name_buff[NAME_LEN+1];
|
||||
|
||||
bool allow_rowid;
|
||||
if (item->cached_table)
|
||||
{
|
||||
/*
|
||||
@@ -2686,13 +2686,10 @@ find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables,
|
||||
db= name_buff;
|
||||
}
|
||||
|
||||
bool search_global= item->item_flags & MY_ITEM_PREFER_1ST_TABLE;
|
||||
if (table_name && table_name[0])
|
||||
{ /* Qualified field */
|
||||
bool found_table=0;
|
||||
uint table_idx= 0;
|
||||
for (; tables; tables= search_global?tables->next_global:tables->next_local,
|
||||
table_idx++)
|
||||
bool found_table= 0;
|
||||
for (; tables; tables= tables->next_local),
|
||||
{
|
||||
/* TODO; Ensure that db and tables->db always points to something ! */
|
||||
if (!my_strcasecmp(table_alias_charset, tables->alias, table_name) &&
|
||||
@@ -2728,8 +2725,6 @@ find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables,
|
||||
return (Field*) 0;
|
||||
}
|
||||
found=find;
|
||||
if (table_idx == 0 && item->item_flags & MY_ITEM_PREFER_1ST_TABLE)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2754,11 +2749,10 @@ find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables,
|
||||
return (Field*) not_found_field;
|
||||
return (Field*) 0;
|
||||
}
|
||||
bool allow_rowid= tables && !tables->next_local; // Only one table
|
||||
uint table_idx= 0;
|
||||
for (; tables ; tables= search_global?tables->next_global:tables->next_local,
|
||||
table_idx++)
|
||||
allow_rowid= tables && !tables->next_local; // Only one table
|
||||
for (; tables ; tables= tables->next_local)
|
||||
{
|
||||
Field *field;
|
||||
if (!tables->table && !tables->ancestor)
|
||||
{
|
||||
if (report_error == REPORT_ALL_ERRORS ||
|
||||
@@ -2767,17 +2761,17 @@ find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables,
|
||||
return (Field*) not_found_field;
|
||||
}
|
||||
|
||||
Field *field= find_field_in_table(thd, tables, name, item->name,
|
||||
length, ref,
|
||||
(tables->table &&
|
||||
test(tables->table->grant.
|
||||
want_privilege) &&
|
||||
check_privileges),
|
||||
(test(tables->grant.want_privilege) &&
|
||||
check_privileges),
|
||||
allow_rowid,
|
||||
&(item->cached_field_index),
|
||||
register_tree_change);
|
||||
field= find_field_in_table(thd, tables, name, item->name,
|
||||
length, ref,
|
||||
(tables->table &&
|
||||
test(tables->table->grant.
|
||||
want_privilege) &&
|
||||
check_privileges),
|
||||
(test(tables->grant.want_privilege) &&
|
||||
check_privileges),
|
||||
allow_rowid,
|
||||
&(item->cached_field_index),
|
||||
register_tree_change);
|
||||
if (field)
|
||||
{
|
||||
if (field == WRONG_GRANT)
|
||||
@@ -2793,8 +2787,6 @@ find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables,
|
||||
return (Field*) 0;
|
||||
}
|
||||
found= field;
|
||||
if (table_idx == 0 && item->item_flags & MY_ITEM_PREFER_1ST_TABLE)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
|
||||
Reference in New Issue
Block a user