summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorndbdev@dl145b.mysql.com <>2005-06-16 14:27:13 +0200
committerndbdev@dl145b.mysql.com <>2005-06-16 14:27:13 +0200
commit5eab6ddcd6d88c97dbe7d9b4123551e3cd8e74b4 (patch)
treeb3f421a6b69713033398ab71c36d8fd9cf9b0bf2 /mysql-test
parent329140329cb7f6ea2fa25548a8db893c9d062cd9 (diff)
parentb6eebbecc28a86b2f05c021ff16c914531ecadff (diff)
downloadmariadb-git-5eab6ddcd6d88c97dbe7d9b4123551e3cd8e74b4.tar.gz
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1
into dl145b.mysql.com:/home/ndbdev/tomas/mysql-5.1
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/include/ps_query.inc2
-rw-r--r--mysql-test/r/cast.result11
-rw-r--r--mysql-test/r/func_math.result6
-rw-r--r--mysql-test/r/information_schema.result12
-rw-r--r--mysql-test/r/join_nested.result22
-rw-r--r--mysql-test/r/join_outer.result8
-rw-r--r--mysql-test/r/ps_2myisam.result2
-rw-r--r--mysql-test/r/ps_3innodb.result2
-rw-r--r--mysql-test/r/ps_4heap.result2
-rw-r--r--mysql-test/r/ps_5merge.result4
-rw-r--r--mysql-test/r/ps_6bdb.result2
-rw-r--r--mysql-test/r/ps_7ndb.result4
-rw-r--r--mysql-test/r/select.result3
-rw-r--r--mysql-test/t/cast.test17
-rw-r--r--mysql-test/t/func_math.test7
-rw-r--r--mysql-test/t/information_schema.test15
-rw-r--r--mysql-test/t/join_nested.test18
-rw-r--r--mysql-test/t/join_outer.test12
-rw-r--r--mysql-test/t/select.test5
19 files changed, 145 insertions, 9 deletions
diff --git a/mysql-test/include/ps_query.inc b/mysql-test/include/ps_query.inc
index 63504a0fa2b..27a86f88231 100644
--- a/mysql-test/include/ps_query.inc
+++ b/mysql-test/include/ps_query.inc
@@ -300,7 +300,7 @@ set @arg00=1;
prepare stmt1 from ' select a,b from t1 order by a
limit 1 ';
execute stmt1 ;
-prepare stmt1 from ' select a,b from t1 limit ? ';
+prepare stmt1 from ' select a,b from t1 order by a limit ? ';
execute stmt1 using @arg00;
##### parameter used in many places
diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result
index 6dc608a9289..1b5bdf98afd 100644
--- a/mysql-test/r/cast.result
+++ b/mysql-test/r/cast.result
@@ -344,3 +344,14 @@ select cast(s1 as decimal(7,2)) from t1;
cast(s1 as decimal(7,2))
111111.00
drop table t1;
+CREATE TABLE t1 (v varchar(10), tt tinytext, t text,
+mt mediumtext, lt longtext);
+INSERT INTO t1 VALUES ('1.01', '2.02', '3.03', '4.04', '5.05');
+SELECT CAST(v AS DECIMAL), CAST(tt AS DECIMAL), CAST(t AS DECIMAL),
+CAST(mt AS DECIMAL), CAST(lt AS DECIMAL) from t1;
+CAST(v AS DECIMAL) CAST(tt AS DECIMAL) CAST(t AS DECIMAL) CAST(mt AS DECIMAL) CAST(lt AS DECIMAL)
+1.01 2.02 3.03 4.04 5.05
+DROP TABLE t1;
+select cast(NULL as decimal(6)) as t1;
+t1
+NULL
diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result
index c7674c57c8d..b7188092b41 100644
--- a/mysql-test/r/func_math.result
+++ b/mysql-test/r/func_math.result
@@ -146,3 +146,9 @@ drop table t1;
select round(150, 2);
round(150, 2)
150.00
+select ceil(0.09);
+ceil(0.09)
+1
+select ceil(0.000000000000000009);
+ceil(0.000000000000000009)
+1
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index 38eb1d6a3ae..c6090bc663d 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -823,3 +823,15 @@ GRANT SELECT ON *.* TO 'user4'@'localhost'
drop user user1@localhost, user2@localhost, user3@localhost, user4@localhost;
use test;
drop database mysqltest;
+create procedure p1 () modifies sql data set @a = 5;
+create procedure p2 () set @a = 5;
+select sql_data_access from information_schema.routines
+where specific_name like 'p%';
+sql_data_access
+MODIFIES SQL DATA
+CONTAINS SQL
+drop procedure p1;
+drop procedure p2;
+show create database information_schema;
+Database Create Database
+information_schema CREATE DATABASE `information_schema` /*!40100 DEFAULT CHARACTER SET utf8 */
diff --git a/mysql-test/r/join_nested.result b/mysql-test/r/join_nested.result
index bce086b00d2..27edac1b30b 100644
--- a/mysql-test/r/join_nested.result
+++ b/mysql-test/r/join_nested.result
@@ -1321,3 +1321,25 @@ NULL NULL NULL
18 NULL NULL
19 NULL NULL
DROP TABLE t1,t2,t3;
+CREATE TABLE t1 (c11 int);
+CREATE TABLE t2 (c21 int);
+CREATE TABLE t3 (c31 int);
+INSERT INTO t1 VALUES (4), (5);
+SELECT * FROM t1 LEFT JOIN t2 ON c11=c21;
+c11 c21
+4 NULL
+5 NULL
+EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON c11=c21;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 system NULL NULL NULL NULL 0 const row not found
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2
+SELECT * FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON c21=c31) ON c11=c21;
+c11 c21 c31
+4 NULL NULL
+5 NULL NULL
+EXPLAIN SELECT * FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON c21=c31) ON c11=c21;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2
+1 SIMPLE t2 ALL NULL NULL NULL NULL 0
+1 SIMPLE t3 ALL NULL NULL NULL NULL 0
+DROP TABLE t1,t2,t3;
diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result
index e69e7603e21..b75eadd5291 100644
--- a/mysql-test/r/join_outer.result
+++ b/mysql-test/r/join_outer.result
@@ -975,3 +975,11 @@ EMPNUM NAME GRP
0 KERI 10
9 BARRY NULL
DROP TABLE t1,t2;
+CREATE TABLE t1 (c11 int);
+CREATE TABLE t2 (c21 int);
+INSERT INTO t1 VALUES (30), (40), (50);
+INSERT INTO t2 VALUES (300), (400), (500);
+SELECT * FROM t1 LEFT JOIN t2 ON (c11=c21 AND c21=30) WHERE c11=40;
+c11 c21
+40 NULL
+DROP TABLE t1, t2;
diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result
index 3df9b6dcb6e..5e839bf4a02 100644
--- a/mysql-test/r/ps_2myisam.result
+++ b/mysql-test/r/ps_2myisam.result
@@ -444,7 +444,7 @@ limit 1 ';
execute stmt1 ;
a b
1 one
-prepare stmt1 from ' select a,b from t1 limit ? ';
+prepare stmt1 from ' select a,b from t1 order by a limit ? ';
execute stmt1 using @arg00;
a b
1 one
diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result
index 851178e2aee..c5d5895adca 100644
--- a/mysql-test/r/ps_3innodb.result
+++ b/mysql-test/r/ps_3innodb.result
@@ -444,7 +444,7 @@ limit 1 ';
execute stmt1 ;
a b
1 one
-prepare stmt1 from ' select a,b from t1 limit ? ';
+prepare stmt1 from ' select a,b from t1 order by a limit ? ';
execute stmt1 using @arg00;
a b
1 one
diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result
index 60675a72bdc..8d703ec1ea5 100644
--- a/mysql-test/r/ps_4heap.result
+++ b/mysql-test/r/ps_4heap.result
@@ -445,7 +445,7 @@ limit 1 ';
execute stmt1 ;
a b
1 one
-prepare stmt1 from ' select a,b from t1 limit ? ';
+prepare stmt1 from ' select a,b from t1 order by a limit ? ';
execute stmt1 using @arg00;
a b
1 one
diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result
index a177290daa4..72b0fac4201 100644
--- a/mysql-test/r/ps_5merge.result
+++ b/mysql-test/r/ps_5merge.result
@@ -487,7 +487,7 @@ limit 1 ';
execute stmt1 ;
a b
1 one
-prepare stmt1 from ' select a,b from t1 limit ? ';
+prepare stmt1 from ' select a,b from t1 order by a limit ? ';
execute stmt1 using @arg00;
a b
1 one
@@ -3499,7 +3499,7 @@ limit 1 ';
execute stmt1 ;
a b
1 one
-prepare stmt1 from ' select a,b from t1 limit ? ';
+prepare stmt1 from ' select a,b from t1 order by a limit ? ';
execute stmt1 using @arg00;
a b
1 one
diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result
index 92399c3b3b9..87b1b110f42 100644
--- a/mysql-test/r/ps_6bdb.result
+++ b/mysql-test/r/ps_6bdb.result
@@ -444,7 +444,7 @@ limit 1 ';
execute stmt1 ;
a b
1 one
-prepare stmt1 from ' select a,b from t1 limit ? ';
+prepare stmt1 from ' select a,b from t1 order by a limit ? ';
execute stmt1 using @arg00;
a b
1 one
diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result
index c7dabc2016d..c158156d11d 100644
--- a/mysql-test/r/ps_7ndb.result
+++ b/mysql-test/r/ps_7ndb.result
@@ -444,10 +444,10 @@ limit 1 ';
execute stmt1 ;
a b
1 one
-prepare stmt1 from ' select a,b from t1 limit ? ';
+prepare stmt1 from ' select a,b from t1 order by a limit ? ';
execute stmt1 using @arg00;
a b
-3 three
+1 one
set @arg00='b' ;
set @arg01=0 ;
set @arg02=2 ;
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index 1c0321ac658..bd2825822a1 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -2699,3 +2699,6 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 3
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where
DROP TABLE t1,t2;
+select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0;
+x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0
+16 16 2 2
diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test
index cafecd6000d..356b69daf38 100644
--- a/mysql-test/t/cast.test
+++ b/mysql-test/t/cast.test
@@ -168,3 +168,20 @@ create table t1(s1 time);
insert into t1 values ('11:11:11');
select cast(s1 as decimal(7,2)) from t1;
drop table t1;
+
+#
+# Test for bug #11283: field conversion from varchar, and text types to decimal
+#
+
+CREATE TABLE t1 (v varchar(10), tt tinytext, t text,
+ mt mediumtext, lt longtext);
+INSERT INTO t1 VALUES ('1.01', '2.02', '3.03', '4.04', '5.05');
+
+SELECT CAST(v AS DECIMAL), CAST(tt AS DECIMAL), CAST(t AS DECIMAL),
+ CAST(mt AS DECIMAL), CAST(lt AS DECIMAL) from t1;
+
+DROP TABLE t1;
+# Bug @10237 (CAST(NULL DECIMAL) crashes server)
+#
+select cast(NULL as decimal(6)) as t1;
+
diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test
index 03057af6911..da4b8335e07 100644
--- a/mysql-test/t/func_math.test
+++ b/mysql-test/t/func_math.test
@@ -84,3 +84,10 @@ drop table t1;
# Bug #10083 (round doesn't increase decimals)
#
select round(150, 2);
+
+#
+# Bug @10632 (Ceiling function returns wrong answer)
+#
+select ceil(0.09);
+select ceil(0.000000000000000009);
+
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
index 7302b3e5e58..e03bea5899a 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -542,3 +542,18 @@ connection default;
drop user user1@localhost, user2@localhost, user3@localhost, user4@localhost;
use test;
drop database mysqltest;
+
+#
+# Bug #11055 information_schema: routines.sql_data_access has wrong value
+#
+create procedure p1 () modifies sql data set @a = 5;
+create procedure p2 () set @a = 5;
+select sql_data_access from information_schema.routines
+where specific_name like 'p%';
+drop procedure p1;
+drop procedure p2;
+
+#
+# Bug #9434 SHOW CREATE DATABASE information_schema;
+#
+show create database information_schema;
diff --git a/mysql-test/t/join_nested.test b/mysql-test/t/join_nested.test
index 9591f1fa7ed..992217d0391 100644
--- a/mysql-test/t/join_nested.test
+++ b/mysql-test/t/join_nested.test
@@ -752,3 +752,21 @@ EXPLAIN SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c;
SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c;
DROP TABLE t1,t2,t3;
+
+#
+# Test for bug #11284: empty table in a nested left join
+#
+
+CREATE TABLE t1 (c11 int);
+CREATE TABLE t2 (c21 int);
+CREATE TABLE t3 (c31 int);
+
+INSERT INTO t1 VALUES (4), (5);
+
+SELECT * FROM t1 LEFT JOIN t2 ON c11=c21;
+EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON c11=c21;
+
+SELECT * FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON c21=c31) ON c11=c21;
+EXPLAIN SELECT * FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON c21=c31) ON c11=c21;
+
+DROP TABLE t1,t2,t3;
diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test
index 670e7433926..7dd35f164d5 100644
--- a/mysql-test/t/join_outer.test
+++ b/mysql-test/t/join_outer.test
@@ -698,4 +698,16 @@ SELECT * FROM v1 WHERE EMPNUM < 10;
DROP TABLE t1,t2;
+#
+# Test for bug #11285: false Item_equal on expression in outer join
+#
+
+CREATE TABLE t1 (c11 int);
+CREATE TABLE t2 (c21 int);
+INSERT INTO t1 VALUES (30), (40), (50);
+INSERT INTO t2 VALUES (300), (400), (500);
+
+SELECT * FROM t1 LEFT JOIN t2 ON (c11=c21 AND c21=30) WHERE c11=40;
+
+DROP TABLE t1, t2;
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index 372325c4cbd..2558a3aeaeb 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -2271,3 +2271,8 @@ EXPLAIN SELECT t1.a FROM t1 INNER JOIN t2 ON t1.a=t2.a;
DROP TABLE t1,t2;
+#
+# Bug #10650
+#
+
+select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0;