summaryrefslogtreecommitdiff
path: root/mysql-test/r/select_jcl6.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/r/select_jcl6.result')
-rw-r--r--mysql-test/r/select_jcl6.result95
1 files changed, 88 insertions, 7 deletions
diff --git a/mysql-test/r/select_jcl6.result b/mysql-test/r/select_jcl6.result
index 359e7c8e2e7..db7f2c473a8 100644
--- a/mysql-test/r/select_jcl6.result
+++ b/mysql-test/r/select_jcl6.result
@@ -524,7 +524,7 @@ insert into tmp select * from t3;
insert into t3 select * from tmp;
alter table t3 add t2nr int not null auto_increment primary key first;
drop table tmp;
-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;
namn
Abraham Abraham
@@ -537,7 +537,7 @@ ammonium ammonium
analyzable analyzable
animals animals
animized animized
-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;
concat(fld3," ",fld3)
Abraham Abraham
@@ -574,7 +574,7 @@ attendants 1
bedlam 1
bedpost 1
boasted 1
-SET SQL_BIG_TABLES=1;
+SET BIG_TABLES=1;
select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10;
fld3 count(*)
affixed 1
@@ -587,7 +587,7 @@ attendants 1
bedlam 1
bedpost 1
boasted 1
-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;
fld3 repeat("a",length(fld3)) count(*)
circus aaaaaa 1
@@ -4186,18 +4186,24 @@ str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00'
set SQL_MODE=TRADITIONAL;
select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34';
str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'
-1
+NULL
+Warnings:
+Warning 1411 Incorrect datetime value: '2007-10-00 12:34' for function str_to_date
select str_to_date('2007-10-01 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34';
str_to_date('2007-10-01 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'
0
select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34';
str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34'
-0
+NULL
+Warnings:
+Warning 1411 Incorrect datetime value: '2007-10-00 12:34' for function str_to_date
select str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01'
and '2007/10/20';
str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01'
and '2007/10/20'
-1
+NULL
+Warnings:
+Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date
set SQL_MODE=DEFAULT;
select str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20';
str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20'
@@ -4356,6 +4362,7 @@ Handler_read_key 2
Handler_read_last 0
Handler_read_next 10
Handler_read_prev 0
+Handler_read_retry 0
Handler_read_rnd 10
Handler_read_rnd_deleted 1
Handler_read_rnd_next 6
@@ -5196,6 +5203,37 @@ WHERE t2.pk <> 2;
pk i pk i pk i
DROP TABLE t1,t2,t_empty;
End of 5.1 tests
+#
+# Bug#45227: Lost HAVING clause led to a wrong result.
+#
+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 ;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE CC range int_key int_key 4 NULL 10 Using index condition; Using where; Rowid-ordered scan; Using filesort
+SELECT `varchar_nokey` G1 FROM CC WHERE `int_nokey` AND `int_key` <= 4
+HAVING G1 ORDER BY `varchar_key` LIMIT 6 ;
+G1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'j'
+Warning 1292 Truncated incorrect DOUBLE value: 'z'
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect DOUBLE value: 'q'
+Warning 1292 Truncated incorrect DOUBLE value: 'm'
+DROP TABLE CC;
+# End of test#45227
#
# BUG#776274: substitution of a single row table
#
@@ -5302,6 +5340,14 @@ f1
DROP TABLE t1;
DROP VIEW view_t1;
# End of test BUG#63020
+#
+# Bug #13571700 TINYBLOB NOT NULL, CRASH IN PROTOCOL::NET_STORE_DATA
+#
+CREATE TABLE t1 (a TINYBLOB NOT NULL);
+SELECT a, COUNT(*) FROM t1 WHERE 0;
+a COUNT(*)
+NULL 0
+DROP TABLE t1;
SET optimizer_switch=@save_optimizer_switch;
#
# LP bug#994275 Assertion `real->type() == Item::FIELD_ITEM' failed
@@ -5481,6 +5527,41 @@ pk1 a1 b1 pk2 a2
3 1 6 1 1
DROP TABLE t1,t2;
End of 5.3 tests
+#
+# mysql BUG#1271 Undefined variable in PASSWORD()
+# function is not handled correctly
+#
+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;
+name pw
+tom *F305E8EC27734F687F2EB6EC03CF0F7AF27C18E1
+select length(PASSWORD(@pass));
+length(PASSWORD(@pass))
+41
+SELECT name FROM t1 WHERE name='tom' AND pw=PASSWORD(@pass);
+name
+tom
+SELECT name FROM t1 WHERE name='tom' AND pw=PASSWORD(@wrong);
+name
+SELECT name FROM t1 WHERE name='tom' AND pw=PASSWORD(@undefined);
+name
+select (SELECT name FROM t1 WHERE name='tom' AND pw=PASSWORD(@pass));
+(SELECT name FROM t1 WHERE name='tom' AND pw=PASSWORD(@pass))
+tom
+select (SELECT name FROM t1 WHERE name='tom' AND pw=PASSWORD(@wrong));
+(SELECT name FROM t1 WHERE name='tom' AND pw=PASSWORD(@wrong))
+NULL
+select (SELECT name FROM t1 WHERE name='tom' AND pw=PASSWORD(@undefined));
+(SELECT name FROM t1 WHERE name='tom' AND pw=PASSWORD(@undefined))
+NULL
+drop table t1;
+End of 10.0 tests
set join_cache_level=default;
show variables like 'join_cache_level';
Variable_name Value