summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-04-03 11:13:51 +0300
committerunknown <bell@sanja.is.com.ua>2004-04-03 11:13:51 +0300
commit8c8dffb60d23bf3a5666dcc251d2f15cb913d541 (patch)
treec9f3e9d74cc127bb1de122f2c0d31fab4719caac /sql/sql_base.cc
parenta62a5fc9c0cef8d9f1ae685b43b6dc539d6fcfc8 (diff)
downloadmariadb-git-8c8dffb60d23bf3a5666dcc251d2f15cb913d541.tar.gz
fixed brocken of client_test
fixed aggregate functions in PS (BUG#3360) mysql-test/r/union.result: 4.1 more correct error sql/item_cmpfunc.h: and_conds do not make fix fields sql/item_sum.cc: storing/restoring argument of aggregate function for prepared statements restoring order list of group_concat for safety sql/item_sum.h: storing/restoring argument of aggregate function for prepared statements layout fix sql/mysql_priv.h: just declaration sql/sql_base.cc: fix_fields() have to be called with temporary memory pool active sql/sql_parse.cc: removed hack with item pointer storing sql/sql_prepare.cc: debug output added removed hack with item pointer storing sql/sql_select.cc: fix_fields now should be called separately sql/sql_union.cc: removed wrong merged check from 4.0 (4.1 have its own protection) sql/table.h: removed hack with item pointer storing tests/client_test.c: new test fo PS
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc44
1 files changed, 27 insertions, 17 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 7fc97a14ffd..38e01546a4a 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -2403,15 +2403,13 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
{
if (table->on_expr)
{
- if (stmt)
- thd->set_n_backup_item_arena(stmt, &backup);
/* Make a join an a expression */
thd->where="on clause";
if (!table->on_expr->fixed &&
table->on_expr->fix_fields(thd, tables, &table->on_expr) ||
table->on_expr->check_cols(1))
- goto err;
+ DBUG_RETURN(1);
thd->lex->current_select->cond_count++;
/*
@@ -2423,12 +2421,16 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
!(specialflag & SPECIAL_NO_NEW_FUNC)))
{
table->outer_join= 0;
- if (!(*conds= and_conds(thd, *conds, table->on_expr, tables)))
- goto err;
+ if (stmt)
+ thd->set_n_backup_item_arena(stmt, &backup);
+ *conds= and_conds(*conds, table->on_expr);
table->on_expr=0;
+ if (stmt)
+ thd->restore_backup_item_arena(stmt, &backup);
+ if ((*conds) && !(*conds)->fixed &&
+ (*conds)->fix_fields(thd, tables, conds))
+ DBUG_RETURN(1);
}
- if (stmt)
- thd->restore_backup_item_arena(stmt, &backup);
}
if (table->natural_join)
{
@@ -2467,20 +2469,28 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
if (!table->outer_join) // Not left join
{
- if (!(*conds= and_conds(thd, *conds, cond_and, tables)) ||
- (*conds && !(*conds)->fixed &&
- (*conds)->fix_fields(thd, tables, conds)))
- goto err;
+ *conds= and_conds(*conds, cond_and);
+ // fix_fields() should be made with temporary memory pool
+ if (stmt)
+ thd->restore_backup_item_arena(stmt, &backup);
+ if (*conds && !(*conds)->fixed)
+ {
+ if ((*conds)->fix_fields(thd, tables, conds))
+ DBUG_RETURN(1);
+ }
}
else
{
- table->on_expr= and_conds(thd, table->on_expr, cond_and, tables);
- if (table->on_expr && !table->on_expr->fixed &&
- table->on_expr->fix_fields(thd, tables, &table->on_expr))
- goto err;
+ table->on_expr= and_conds(table->on_expr, cond_and);
+ // fix_fields() should be made with temporary memory pool
+ if (stmt)
+ thd->restore_backup_item_arena(stmt, &backup);
+ if (table->on_expr && !table->on_expr->fixed)
+ {
+ if (table->on_expr->fix_fields(thd, tables, &table->on_expr))
+ DBUG_RETURN(1);
+ }
}
- if (stmt)
- thd->restore_backup_item_arena(stmt, &backup);
}
}