summaryrefslogtreecommitdiff
path: root/mysql-test/t/select.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/select.test')
-rw-r--r--mysql-test/t/select.test71
1 files changed, 67 insertions, 4 deletions
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index 3c56ef2837b..2d75dc48f73 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -1424,9 +1424,9 @@ drop table tmp;
# big table done
-SET SQL_BIG_TABLES=1;
+SET BIG_TABLES=1;
select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10;
-SET SQL_BIG_TABLES=0;
+SET BIG_TABLES=0;
select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10;
select distinct fld5 from t2 limit 10;
@@ -1435,9 +1435,9 @@ select distinct fld5 from t2 limit 10;
#
select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10;
-SET SQL_BIG_TABLES=1; # Force use of MyISAM
+SET BIG_TABLES=1; # Force use of MyISAM
select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10;
-SET SQL_BIG_TABLES=0;
+SET BIG_TABLES=0;
select distinct fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr,fld3 limit 100,10;
#
@@ -4363,6 +4363,30 @@ DROP TABLE t1,t2,t_empty;
--echo End of 5.1 tests
+--echo #
+--echo # Bug#45227: Lost HAVING clause led to a wrong result.
+--echo #
+CREATE TABLE `CC` (
+ `int_nokey` int(11) NOT NULL,
+ `int_key` int(11) NOT NULL,
+ `varchar_key` varchar(1) NOT NULL,
+ `varchar_nokey` varchar(1) NOT NULL,
+ KEY `int_key` (`int_key`),
+ KEY `varchar_key` (`varchar_key`)
+);
+INSERT INTO `CC` VALUES
+(0,8,'q','q'),(5,8,'m','m'),(7,3,'j','j'),(1,2,'z','z'),(8,2,'a','a'),(2,6,'',''),(1,8,'e'
+,'e'),(8,9,'t','t'),(5,2,'q','q'),(4,6,'b','b'),(5,5,'w','w'),(3,2,'m','m'),(0,4,'x','x'),
+(8,9,'',''),(0,6,'w','w'),(4,5,'x','x'),(0,0,'e','e'),(0,0,'e','e'),(2,8,'p','p'),(0,0,'x'
+,'x');
+EXPLAIN SELECT `varchar_nokey` G1 FROM CC WHERE `int_nokey` AND `int_key` <= 4
+ HAVING G1 ORDER BY `varchar_key` LIMIT 6 ;
+
+SELECT `varchar_nokey` G1 FROM CC WHERE `int_nokey` AND `int_key` <= 4
+ HAVING G1 ORDER BY `varchar_key` LIMIT 6 ;
+
+DROP TABLE CC;
+--echo # End of test#45227
--echo #
--echo # BUG#776274: substitution of a single row table
--echo #
@@ -4446,6 +4470,14 @@ DROP TABLE t1;
DROP VIEW view_t1;
--echo # End of test BUG#63020
+--echo #
+--echo # Bug #13571700 TINYBLOB NOT NULL, CRASH IN PROTOCOL::NET_STORE_DATA
+--echo #
+
+CREATE TABLE t1 (a TINYBLOB NOT NULL);
+SELECT a, COUNT(*) FROM t1 WHERE 0;
+DROP TABLE t1;
+
SET optimizer_switch=@save_optimizer_switch;
--echo #
@@ -4607,3 +4639,34 @@ DROP TABLE t1,t2;
--echo End of 5.3 tests
+--echo #
+--echo # mysql BUG#1271 Undefined variable in PASSWORD()
+--echo # function is not handled correctly
+--echo #
+
+create table t1 (
+name VARCHAR(50) NOT NULL PRIMARY KEY,
+pw VARCHAR(41) NOT NULL);
+
+INSERT INTO t1 (name, pw)
+VALUES ('tom', PASSWORD('my_pw'));
+
+SET @pass='my_pw';
+SET @wrong='incorrect';
+
+select * from t1;
+select length(PASSWORD(@pass));
+
+
+SELECT name FROM t1 WHERE name='tom' AND pw=PASSWORD(@pass);
+SELECT name FROM t1 WHERE name='tom' AND pw=PASSWORD(@wrong);
+SELECT name FROM t1 WHERE name='tom' AND pw=PASSWORD(@undefined);
+
+
+select (SELECT name FROM t1 WHERE name='tom' AND pw=PASSWORD(@pass));
+select (SELECT name FROM t1 WHERE name='tom' AND pw=PASSWORD(@wrong));
+select (SELECT name FROM t1 WHERE name='tom' AND pw=PASSWORD(@undefined));
+
+drop table t1;
+
+--echo End of 10.0 tests