diff options
author | unknown <vva@eagle.mysql.r18.ru> | 2004-08-12 20:37:31 +0500 |
---|---|---|
committer | unknown <vva@eagle.mysql.r18.ru> | 2004-08-12 20:37:31 +0500 |
commit | 7e5247aadeeaddc08f0d2c4405095e3c19e3a0a4 (patch) | |
tree | b6ef68101ea51f8f69e3826a5d1e60f3e143d35d /mysql-test/r/having.result | |
parent | cf8a6e52b749a1a1311c31f4aad615593ba25b9e (diff) | |
download | mariadb-git-7e5247aadeeaddc08f0d2c4405095e3c19e3a0a4.tar.gz |
fixed Bug #4358 Problem with HAVING clause that uses alias
from the select list and TEXT field
make setup_copy_fields to insert Item_copy_string for blobs in
the beginning of the copy_funcs (push_back instead of push_front)
the thing is that Item_copy_string::copy for function can call
Item_copy_string::val_int for blob via Item_ref.
But if Item_copy_string::copy for blob isn't called before,
it's value will be wrong.
So all the Item_copy_string::copy for blobs should be called before
Item_copy_string::copy for functions.
mysql-test/r/having.result:
added test case for
Bug #4358 Problem with HAVING clause that uses
alias from the select list and TEXT field
mysql-test/t/having.test:
added test case for
Bug #4358 Problem with HAVING clause that uses
alias from the select list and TEXT field
sql/sql_select.cc:
make setup_copy_fields to insert Item_copy_string for blobs in
the beginning of the copy_funcs (push_back instead of push_front)
the thing is that Item_copy_string::copy for function can call
Item_copy_string::val_int for blob via Item_ref.
But if Item_copy_string::copy for blob isn't called before,
it's value will be wrong.
So all the Item_copy_string::copy for blobs should be called before
Item_copy_string::copy for functions.
fixed
Bug #4358 Problem with HAVING clause that
uses alias from the select list and TEXT field
Diffstat (limited to 'mysql-test/r/having.result')
-rw-r--r-- | mysql-test/r/having.result | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result index d643070f7f9..f0e9172991c 100644 --- a/mysql-test/r/having.result +++ b/mysql-test/r/having.result @@ -78,3 +78,43 @@ sqty 5 9 drop table t1; +CREATE TABLE t1 ( +`id` bigint(20) NOT NULL default '0', +`description` text +) TYPE=MyISAM; +CREATE TABLE t2 ( +`id` bigint(20) NOT NULL default '0', +`description` varchar(20) +) TYPE=MyISAM; +INSERT INTO t1 VALUES (1, 'test'); +INSERT INTO t2 VALUES (1, 'test'); +CREATE TABLE t3 ( +`id` bigint(20) NOT NULL default '0', +`order_id` bigint(20) NOT NULL default '0' +) TYPE=MyISAM; +select +a.id, a.description, +count(b.id) as c +from t1 a left join t3 b on a.id=b.order_id +group by a.id, a.description +having (a.description is not null) and (c=0); +id description c +1 test 0 +select +a.*, +count(b.id) as c +from t2 a left join t3 b on a.id=b.order_id +group by a.id, a.description +having (a.description is not null) and (c=0); +id description c +1 test 0 +INSERT INTO t1 VALUES (2, 'test2'); +select +a.id, a.description, +count(b.id) as c +from t1 a left join t3 b on a.id=b.order_id +group by a.id, a.description +having (a.description is not null) and (c=0); +id description c +1 test 0 +2 test2 0 |