mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge sinisa@bk-internal.mysql.com:/home/bk/mysql-4.1
into sinisa.nasamreza.org:/mnt/work/mysql-4.1
This commit is contained in:
@ -333,4 +333,5 @@ check table t1,t2;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
test.t2 check status OK
|
||||
select max(a) +1, max(a) +2 into @xx,@yy from t1;
|
||||
drop table t1,t2;
|
||||
|
@ -241,5 +241,6 @@ select @@key_buffer_size;
|
||||
select * from t1 where a=2;
|
||||
select * from t2 where a=3;
|
||||
check table t1,t2;
|
||||
select max(a) +1, max(a) +2 into @xx,@yy from t1;
|
||||
drop table t1,t2;
|
||||
|
||||
|
11
sql/item.cc
11
sql/item.cc
@ -1241,7 +1241,16 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference)
|
||||
}
|
||||
}
|
||||
|
||||
if (((*ref)->with_sum_func &&
|
||||
/*
|
||||
* The following conditional is changed as to correctly identify
|
||||
* incorrect references in group functions or forward references
|
||||
* with sub-select's / derived tables, while it prevents this
|
||||
* check when Item_ref is created in an expression involving
|
||||
* summing function, which is to be placed in the user variable.
|
||||
*
|
||||
*/
|
||||
|
||||
if (((*ref)->with_sum_func && name &&
|
||||
(depended_from ||
|
||||
!(thd->lex.current_select->linkage != GLOBAL_OPTIONS_TYPE &&
|
||||
thd->lex.current_select->select_lex()->having_fix_field))) ||
|
||||
|
Reference in New Issue
Block a user