mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
merge
sql/field.cc: Auto merged sql/item.cc: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_func.h: Auto merged sql/sql_base.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_update.cc: Auto merged sql/sql_yacc.yy: Auto merged
This commit is contained in:
@ -2154,7 +2154,7 @@ int setup_fields(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables,
|
||||
Item **ref= ref_pointer_array;
|
||||
while ((item= it++))
|
||||
{
|
||||
if (item->fix_fields(thd, tables, it.ref()) ||
|
||||
if (!item->fixed && item->fix_fields(thd, tables, it.ref()) ||
|
||||
(item= *(it.ref()))->check_cols(1))
|
||||
DBUG_RETURN(-1); /* purecov: inspected */
|
||||
if (ref)
|
||||
@ -2293,7 +2293,7 @@ insert_fields(THD *thd,TABLE_LIST *tables, const char *db_name,
|
||||
thd->used_tables|=table->map;
|
||||
while ((field = *ptr++))
|
||||
{
|
||||
Item_field *item= new Item_field(field);
|
||||
Item_field *item= new Item_field(field, 0);
|
||||
if (!found++)
|
||||
(void) it->replace(item); // Replace '*'
|
||||
else
|
||||
@ -2336,7 +2336,8 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
|
||||
if (*conds)
|
||||
{
|
||||
thd->where="where clause";
|
||||
if ((*conds)->fix_fields(thd, tables, conds) || (*conds)->check_cols(1))
|
||||
if (!(*conds)->fixed && (*conds)->fix_fields(thd, tables, conds) ||
|
||||
(*conds)->check_cols(1))
|
||||
DBUG_RETURN(1);
|
||||
not_null_tables= (*conds)->not_null_tables();
|
||||
}
|
||||
@ -2348,7 +2349,9 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
|
||||
{
|
||||
/* Make a join an a expression */
|
||||
thd->where="on clause";
|
||||
if (table->on_expr->fix_fields(thd, tables, &table->on_expr) ||
|
||||
|
||||
if (!table->on_expr->fixed &&
|
||||
table->on_expr->fix_fields(thd, tables, &table->on_expr) ||
|
||||
table->on_expr->check_cols(1))
|
||||
DBUG_RETURN(1);
|
||||
thd->lex->current_select->cond_count++;
|
||||
@ -2387,12 +2390,12 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
|
||||
t1->field[i]->field_name,
|
||||
t2->field[j]->field_name))
|
||||
{
|
||||
Item_func_eq *tmp=new Item_func_eq(new Item_field(t1->field[i]),
|
||||
new Item_field(t2->field[j]));
|
||||
// fix_fields() call will be made for tmp by cond_and->fix_fields
|
||||
Item_func_eq *tmp=new Item_func_eq(new Item_field(t1->field[i], 1),
|
||||
new Item_field(t2->field[j],
|
||||
1));
|
||||
if (!tmp)
|
||||
DBUG_RETURN(1);
|
||||
tmp->fix_length_and_dec(); // Update cmp_type
|
||||
tmp->const_item_cache=0;
|
||||
/* Mark field used for table cache */
|
||||
t1->field[i]->query_id=t2->field[j]->query_id=thd->query_id;
|
||||
cond_and->list.push_back(tmp);
|
||||
@ -2402,8 +2405,11 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
|
||||
}
|
||||
}
|
||||
}
|
||||
cond_and->used_tables_cache= t1->map | t2->map;
|
||||
//cond_and->used_tables_cache= t1->map | t2->map;
|
||||
thd->lex->current_select->cond_count+= cond_and->list.elements;
|
||||
if (cond_and->fix_fields(thd, tables, (Item**)&cond_and) ||
|
||||
cond_and->check_cols(1))
|
||||
DBUG_RETURN(1);
|
||||
if (!table->outer_join) // Not left join
|
||||
{
|
||||
if (!(*conds=and_conds(*conds, cond_and)))
|
||||
|
Reference in New Issue
Block a user