1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

fixed bug with thd->allow_sum_func value in subselect

This commit is contained in:
bell@sanja.is.com.ua
2002-11-23 21:55:39 +02:00
parent 1b62dc0223
commit f6f937085f
3 changed files with 9 additions and 2 deletions

View File

@@ -12,6 +12,9 @@ SELECT (SELECT 1 FROM (SELECT 1) HAVING a=1) as a;
Reference 'a' not supported (forward reference in item list)
SELECT (SELECT 1 FROM (SELECT 1) HAVING b=1) as a,(SELECT 1 FROM (SELECT 1) HAVING a=1) as b;
Reference 'b' not supported (forward reference in item list)
SELECT (SELECT 1),MAX(1) FROM (SELECT 1);
(SELECT 1) MAX(1)
1 1
drop table if exists t1,t2,t3,t4,t5,attend,clinic,inscrit;
create table t1 (a int);
create table t2 (a int, b int);

View File

@@ -5,6 +5,7 @@ SELECT (SELECT (SELECT 0 UNION SELECT 0));
SELECT (SELECT 1 FROM (SELECT 1) HAVING a=1) as a;
-- error 1245
SELECT (SELECT 1 FROM (SELECT 1) HAVING b=1) as a,(SELECT 1 FROM (SELECT 1) HAVING a=1) as b;
SELECT (SELECT 1),MAX(1) FROM (SELECT 1);
drop table if exists t1,t2,t3,t4,t5,attend,clinic,inscrit;
create table t1 (a int);
create table t2 (a int, b int);

View File

@@ -2225,8 +2225,10 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
{
DBUG_ENTER("setup_conds");
thd->set_query_id=1;
thd->cond_count=0;
thd->allow_sum_func=0;
thd->cond_count= 0;
bool save_allow_sum_func= thd->allow_sum_func;
thd->allow_sum_func= 0;
if (*conds)
{
thd->where="where clause";
@@ -2299,6 +2301,7 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
table->on_expr=and_conds(table->on_expr,cond_and);
}
}
thd->allow_sum_func= save_allow_sum_func;
DBUG_RETURN(test(thd->fatal_error));
}