summaryrefslogtreecommitdiff
path: root/mysql-test/t/ndb_condition_pushdown.test
diff options
context:
space:
mode:
authorunknown <mskold@mysql.com>2004-12-17 21:13:22 +0100
committerunknown <mskold@mysql.com>2004-12-17 21:13:22 +0100
commitbda84af2a65db4b782da782424157943477dc6e4 (patch)
tree9f51d9cac4b45ffad89462fcc79b3f15eda3b19b /mysql-test/t/ndb_condition_pushdown.test
parent66f7bd24414724af26b2bf690e03ff3fe7ccbb4a (diff)
downloadmariadb-git-bda84af2a65db4b782da782424157943477dc6e4.tar.gz
Condition pushdown to storage engine
Diffstat (limited to 'mysql-test/t/ndb_condition_pushdown.test')
-rw-r--r--mysql-test/t/ndb_condition_pushdown.test26
1 files changed, 26 insertions, 0 deletions
diff --git a/mysql-test/t/ndb_condition_pushdown.test b/mysql-test/t/ndb_condition_pushdown.test
new file mode 100644
index 00000000000..16e366b8dfb
--- /dev/null
+++ b/mysql-test/t/ndb_condition_pushdown.test
@@ -0,0 +1,26 @@
+-- source include/have_ndb.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2;
+--enable_warnings
+
+#
+# Test of condition pushdown to storage engine
+#
+CREATE TABLE t1 (pk1 int unsigned NOT NULL PRIMARY KEY, attr1 int unsigned NOT NULL, attr2 int unsigned, attr3 VARCHAR(10) ) ENGINE=ndbcluster;
+
+insert into t1 values (0,0,0, "a"),(1,1,1,"b"),(2,2,NULL,NULL),(3,3,3,"d"),(4,4,4,"e"),(5,5,5,"f");
+
+CREATE TABLE t2 (pk1 int unsigned NOT NULL PRIMARY KEY, attr1 int unsigned NOT NULL, attr2 int unsigned, attr3 VARCHAR(10) ) ENGINE=ndbcluster;
+
+insert into t2 values (0,0,0, "a"),(1,1,1,"b"),(2,2,2,"c"),(3,3,3,"d"),(4,4,4,"e"),(5,5,5,"f");
+
+set @old_ndbcpd = @@session.ndb_condition_pushdown;
+set ndb_condition_pushdown = off;
+select * from t1 where attr3 is null or attr1 > 2 and pk1= 3 order by pk1;
+select * from t1,t2 where t1.attr1 > 1 and t1.attr2 = t2.attr2 and t2.attr1 < 5 order by t1.pk1;
+set ndb_condition_pushdown = on;
+select * from t1 where attr3 is null or attr1 > 2 and pk1= 3 order by pk1;
+select * from t1,t2 where t1.attr1 > 1 and t1.attr2 = t2.attr2 and t2.attr1 < 5 order by t1.pk1;
+set ndb_condition_pushdown = @old_ndbcpd;
+DROP TABLE t1,t2;