summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2006-07-18 23:30:09 +0400
committerunknown <evgen@moonbone.local>2006-07-18 23:30:09 +0400
commit6abe1c7158884acb0cc754337be2857a7d5f82f1 (patch)
treea2c1397e353ee062b060f2de7d0ebb0e8efce9c9 /mysql-test/r
parentd39e85320f953919dfb6f2c67e57cde2d1d40890 (diff)
parent5a77e566abb4c486a296c1ad762ddfe740db695e (diff)
downloadmariadb-git-6abe1c7158884acb0cc754337be2857a7d5f82f1.tar.gz
Merge moonbone.local:/home/evgen/bk-trees/mysql-4.1
into moonbone.local:/work/tmp_merge-4.1-opt-mysql mysql-test/r/date_formats.result: Auto merged mysql-test/t/date_formats.test: Auto merged sql/item_strfunc.cc: Auto merged sql/sql_class.cc: Auto merged
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/func_str.result15
-rw-r--r--mysql-test/r/innodb_mysql.result29
-rw-r--r--mysql-test/r/odbc.result11
-rw-r--r--mysql-test/r/rpl_insert_id.result14
-rw-r--r--mysql-test/r/subselect.result33
5 files changed, 102 insertions, 0 deletions
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index 24e6bb6f38a..61a77c211d7 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -1021,4 +1021,19 @@ select * from t1 where f1='test' and (f2= sha("TEST") or f2= sha("test"));
f1 f2
test a94a8fe5ccb19ba61c4c0873d391e987982fbbd3
drop table t1;
+CREATE TABLE t1 (a varchar(10));
+INSERT INTO t1 VALUES ('abc'), ('xyz');
+SELECT a, CONCAT(a,' ',a) AS c FROM t1
+HAVING LEFT(c,LENGTH(c)-INSTR(REVERSE(c)," ")) = a;
+a c
+abc abc abc
+xyz xyz xyz
+SELECT a, CONCAT(a,' ',a) AS c FROM t1
+HAVING LEFT(CONCAT(a,' ',a),
+LENGTH(CONCAT(a,' ',a))-
+INSTR(REVERSE(CONCAT(a,' ',a))," ")) = a;
+a c
+abc abc abc
+xyz xyz xyz
+DROP TABLE t1;
End of 4.1 tests
diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result
index 2a4e3555e3b..920d7aa42ce 100644
--- a/mysql-test/r/innodb_mysql.result
+++ b/mysql-test/r/innodb_mysql.result
@@ -54,3 +54,32 @@ c.c_id = 218 and expiredate is null;
slai_id
12
drop table t1, t2;
+CREATE TABLE t1 (a int, b int, KEY b (b)) Engine=InnoDB;
+CREATE TABLE t2 (a int, b int, PRIMARY KEY (a,b)) Engine=InnoDB;
+CREATE TABLE t3 (a int, b int, c int, PRIMARY KEY (a),
+UNIQUE KEY b (b,c), KEY a (a,b,c)) Engine=InnoDB;
+INSERT INTO t1 VALUES (1, 1);
+INSERT INTO t1 SELECT a + 1, b + 1 FROM t1;
+INSERT INTO t1 SELECT a + 2, b + 2 FROM t1;
+INSERT INTO t2 VALUES (1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8);
+INSERT INTO t2 SELECT a + 1, b FROM t2;
+DELETE FROM t2 WHERE a = 1 AND b < 2;
+INSERT INTO t3 VALUES (1,1,1),(2,1,2);
+INSERT INTO t3 SELECT a + 2, a + 2, 3 FROM t3;
+INSERT INTO t3 SELECT a + 4, a + 4, 3 FROM t3;
+SELECT STRAIGHT_JOIN SQL_NO_CACHE t1.b, t1.a FROM t1, t3, t2 WHERE
+t3.a = t2.a AND t2.b = t1.a AND t3.b = 1 AND t3.c IN (1, 2)
+ORDER BY t1.b LIMIT 2;
+b a
+1 1
+2 2
+SELECT STRAIGHT_JOIN SQL_NO_CACHE t1.b, t1.a FROM t1, t3, t2 WHERE
+t3.a = t2.a AND t2.b = t1.a AND t3.b = 1 AND t3.c IN (1, 2)
+ORDER BY t1.b LIMIT 5;
+b a
+1 1
+2 2
+2 2
+3 3
+3 3
+DROP TABLE t1, t2, t3;
diff --git a/mysql-test/r/odbc.result b/mysql-test/r/odbc.result
index c0b2ada0053..30d839077f3 100644
--- a/mysql-test/r/odbc.result
+++ b/mysql-test/r/odbc.result
@@ -14,3 +14,14 @@ explain select * from t1 where b is null;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
drop table t1;
+CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY);
+INSERT INTO t1 VALUES (NULL);
+SELECT sql_no_cache a, last_insert_id() FROM t1 WHERE a IS NULL;
+a last_insert_id()
+1 1
+SELECT sql_no_cache a, last_insert_id() FROM t1 WHERE a IS NULL;
+a last_insert_id()
+SELECT sql_no_cache a, last_insert_id() FROM t1;
+a last_insert_id()
+1 1
+DROP TABLE t1;
diff --git a/mysql-test/r/rpl_insert_id.result b/mysql-test/r/rpl_insert_id.result
index 8482f631553..e683ea2fb39 100644
--- a/mysql-test/r/rpl_insert_id.result
+++ b/mysql-test/r/rpl_insert_id.result
@@ -73,3 +73,17 @@ CREATE TABLE t1 ( a INT UNIQUE );
SET FOREIGN_KEY_CHECKS=0;
INSERT INTO t1 VALUES (1),(1);
ERROR 23000: Duplicate entry '1' for key 1
+drop table t1;
+create table t1(a int auto_increment, key(a));
+create table t2(a int);
+insert into t1 (a) values (null);
+insert into t2 (a) select a from t1 where a is null;
+insert into t2 (a) select a from t1 where a is null;
+select * from t2;
+a
+1
+select * from t2;
+a
+1
+drop table t1;
+drop table t2;
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 7925715a8b7..c78f0951469 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -2835,3 +2835,36 @@ a
4
DROP TABLE t1,t2,t3;
purge master logs before (select adddate(current_timestamp(), interval -4 day));
+CREATE TABLE t1 (f1 INT);
+CREATE TABLE t2 (f2 INT);
+INSERT INTO t1 VALUES (1);
+SELECT * FROM t1 WHERE f1 > ALL (SELECT f2 FROM t2);
+f1
+1
+SELECT * FROM t1 WHERE f1 > ALL (SELECT f2 FROM t2 WHERE 1=0);
+f1
+1
+INSERT INTO t2 VALUES (1);
+INSERT INTO t2 VALUES (2);
+SELECT * FROM t1 WHERE f1 > ALL (SELECT f2 FROM t2 WHERE f2=0);
+f1
+1
+DROP TABLE t1, t2;
+select 1 from dual where 1 < any (select 2);
+1
+1
+select 1 from dual where 1 < all (select 2);
+1
+1
+select 1 from dual where 2 > any (select 1);
+1
+1
+select 1 from dual where 2 > all (select 1);
+1
+1
+select 1 from dual where 1 < any (select 2 from dual);
+1
+1
+select 1 from dual where 1 < all (select 2 from dual where 1!=1);
+1
+1