summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authormskold@mysql.com <>2006-03-28 13:28:36 +0200
committermskold@mysql.com <>2006-03-28 13:28:36 +0200
commitc85cc93f480b2b8c5e1ec2025b01a908738afb7e (patch)
treeab9b4b70a04b3f921c606b24c0ffaf859f40a33c /mysql-test
parentebff86613724289aed32b6f2aa8201b53100715a (diff)
parentcd557bf49515531c77d4f15fd989e293c82a9603 (diff)
downloadmariadb-git-c85cc93f480b2b8c5e1ec2025b01a908738afb7e.tar.gz
Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into mysql.com:/usr/local/home/marty/MySQL/mysql-5.1-new
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/ndb_condition_pushdown.result18
-rw-r--r--mysql-test/r/ndb_insert.result16
-rw-r--r--mysql-test/t/ndb_condition_pushdown.test12
-rw-r--r--mysql-test/t/ndb_insert.test8
4 files changed, 52 insertions, 2 deletions
diff --git a/mysql-test/r/ndb_condition_pushdown.result b/mysql-test/r/ndb_condition_pushdown.result
index bdeff437f6f..3fbc9a38f60 100644
--- a/mysql-test/r/ndb_condition_pushdown.result
+++ b/mysql-test/r/ndb_condition_pushdown.result
@@ -1766,5 +1766,21 @@ select * from t3 left join t4 on t4.attr2 = t3.attr2 where t4.attr1 > 1 and t4.a
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort
1 SIMPLE t4 ALL NULL NULL NULL NULL 6 Using where
+create table t5 (a int primary key auto_increment, b tinytext not null)
+engine = ndb;
+insert into t5 (b) values ('jonas'), ('jensing'), ('johan');
+set engine_condition_pushdown = off;
+select * from t5 where b like '%jo%' order by a;
+a b
+1 jonas
+3 johan
+set engine_condition_pushdown = on;
+explain select * from t5 where b like '%jo%';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t5 ALL NULL NULL NULL NULL 3 Using where
+select * from t5 where b like '%jo%' order by a;
+a b
+1 jonas
+3 johan
set engine_condition_pushdown = @old_ecpd;
-DROP TABLE t1,t2,t3,t4;
+DROP TABLE t1,t2,t3,t4,t5;
diff --git a/mysql-test/r/ndb_insert.result b/mysql-test/r/ndb_insert.result
index 1da958ef0f7..3f9a5d7c6c5 100644
--- a/mysql-test/r/ndb_insert.result
+++ b/mysql-test/r/ndb_insert.result
@@ -629,7 +629,23 @@ DELETE FROM t1;
CREATE UNIQUE INDEX ai ON t1(a);
INSERT IGNORE INTO t1 VALUES (1);
INSERT IGNORE INTO t1 VALUES (1);
+INSERT IGNORE INTO t1 VALUES (NULL),(2);
SELECT * FROM t1 ORDER BY a;
a
+NULL
1
+2
+DROP TABLE t1;
+CREATE TABLE t1(pk INT NOT NULL PRIMARY KEY, a INT, UNIQUE (a)) ENGINE=ndb;
+INSERT IGNORE INTO t1 VALUES (1,1),(2,2),(3,3);
+INSERT IGNORE INTO t1 VALUES (4,NULL),(5,NULL),(6,NULL),(7,4);
+SELECT * FROM t1 ORDER BY pk;
+pk a
+1 1
+2 2
+3 3
+4 NULL
+5 NULL
+6 NULL
+7 4
DROP TABLE t1;
diff --git a/mysql-test/t/ndb_condition_pushdown.test b/mysql-test/t/ndb_condition_pushdown.test
index 9f512430085..1e6e105bc61 100644
--- a/mysql-test/t/ndb_condition_pushdown.test
+++ b/mysql-test/t/ndb_condition_pushdown.test
@@ -1639,5 +1639,15 @@ select * from t2 where (attr1 < 2) = (attr2 < 2) order by pk1;
explain
select * from t3 left join t4 on t4.attr2 = t3.attr2 where t4.attr1 > 1 and t4.attr3 < 5 or t4.attr1 is null order by t4.pk1;
+# bug#15722
+create table t5 (a int primary key auto_increment, b tinytext not null)
+engine = ndb;
+insert into t5 (b) values ('jonas'), ('jensing'), ('johan');
+set engine_condition_pushdown = off;
+select * from t5 where b like '%jo%' order by a;
+set engine_condition_pushdown = on;
+explain select * from t5 where b like '%jo%';
+select * from t5 where b like '%jo%' order by a;
+
set engine_condition_pushdown = @old_ecpd;
-DROP TABLE t1,t2,t3,t4;
+DROP TABLE t1,t2,t3,t4,t5;
diff --git a/mysql-test/t/ndb_insert.test b/mysql-test/t/ndb_insert.test
index 4fe847058c4..bf25ca9a133 100644
--- a/mysql-test/t/ndb_insert.test
+++ b/mysql-test/t/ndb_insert.test
@@ -619,7 +619,15 @@ DELETE FROM t1;
CREATE UNIQUE INDEX ai ON t1(a);
INSERT IGNORE INTO t1 VALUES (1);
INSERT IGNORE INTO t1 VALUES (1);
+INSERT IGNORE INTO t1 VALUES (NULL),(2);
SELECT * FROM t1 ORDER BY a;
DROP TABLE t1;
+# Ignore and NULL values
+CREATE TABLE t1(pk INT NOT NULL PRIMARY KEY, a INT, UNIQUE (a)) ENGINE=ndb;
+INSERT IGNORE INTO t1 VALUES (1,1),(2,2),(3,3);
+INSERT IGNORE INTO t1 VALUES (4,NULL),(5,NULL),(6,NULL),(7,4);
+SELECT * FROM t1 ORDER BY pk;
+DROP TABLE t1;
+
# End of 4.1 tests