diff options
Diffstat (limited to 'mysql-test/r/ndb_basic.result')
-rw-r--r-- | mysql-test/r/ndb_basic.result | 195 |
1 files changed, 123 insertions, 72 deletions
diff --git a/mysql-test/r/ndb_basic.result b/mysql-test/r/ndb_basic.result index 0e7b039a5f9..80e1aa7939a 100644 --- a/mysql-test/r/ndb_basic.result +++ b/mysql-test/r/ndb_basic.result @@ -1,98 +1,106 @@ DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; +drop database if exists mysqltest; CREATE TABLE t1 ( pk1 INT NOT NULL PRIMARY KEY, -attr1 INT NOT NULL +attr1 INT NOT NULL, +attr2 INT, +attr3 VARCHAR(10) ) ENGINE=ndbcluster; -INSERT INTO t1 VALUES (9410,9412); -SELECT pk1 FROM t1; +INSERT INTO t1 VALUES (9410,9412, NULL, '9412'), (9411,9413, 17, '9413'); +SELECT pk1 FROM t1 ORDER BY pk1; pk1 9410 -SELECT * FROM t1; -pk1 attr1 -9410 9412 -SELECT t1.* FROM t1; -pk1 attr1 -9410 9412 +9411 +SELECT * FROM t1 ORDER BY pk1; +pk1 attr1 attr2 attr3 +9410 9412 NULL 9412 +9411 9413 17 9413 +SELECT t1.* FROM t1 ORDER BY pk1; +pk1 attr1 attr2 attr3 +9410 9412 NULL 9412 +9411 9413 17 9413 UPDATE t1 SET attr1=1 WHERE pk1=9410; -SELECT * FROM t1; -pk1 attr1 -9410 1 +SELECT * FROM t1 ORDER BY pk1; +pk1 attr1 attr2 attr3 +9410 1 NULL 9412 +9411 9413 17 9413 UPDATE t1 SET pk1=2 WHERE attr1=1; -ERROR 42000: Table 't1' uses an extension that doesn't exist in this MySQL version -SELECT * FROM t1; -pk1 attr1 -9410 1 +SELECT * FROM t1 ORDER BY pk1; +pk1 attr1 attr2 attr3 +2 1 NULL 9412 +9411 9413 17 9413 +UPDATE t1 SET pk1=pk1 + 1; +SELECT * FROM t1 ORDER BY pk1; +pk1 attr1 attr2 attr3 +3 1 NULL 9412 +9412 9413 17 9413 DELETE FROM t1; SELECT * FROM t1; -pk1 attr1 -INSERT INTO t1 VALUES (9410,9412), (9411, 9413), (9408, 8765), -(7,8), (8,9), (9,10), (10,11), (11,12), (12,13), (13,14); +pk1 attr1 attr2 attr3 +INSERT INTO t1 VALUES (9410,9412, NULL, '9412'), (9408, 8765, NULL, '8765'), +(7,8, NULL, NULL), (8,9, NULL, NULL), (9,10, NULL, NULL), (10,11, NULL, NULL), (11,12, NULL, NULL), (12,13, NULL, NULL), (13,14, NULL, NULL); UPDATE t1 SET attr1 = 9999; SELECT * FROM t1 ORDER BY pk1; -pk1 attr1 -7 9999 -8 9999 -9 9999 -10 9999 -11 9999 -12 9999 -13 9999 -9408 9999 -9410 9999 -9411 9999 +pk1 attr1 attr2 attr3 +7 9999 NULL NULL +8 9999 NULL NULL +9 9999 NULL NULL +10 9999 NULL NULL +11 9999 NULL NULL +12 9999 NULL NULL +13 9999 NULL NULL +9408 9999 NULL 8765 +9410 9999 NULL 9412 UPDATE t1 SET attr1 = 9998 WHERE pk1 < 1000; SELECT * FROM t1 ORDER BY pk1; -pk1 attr1 -7 9998 -8 9998 -9 9998 -10 9998 -11 9998 -12 9998 -13 9998 -9408 9999 -9410 9999 -9411 9999 +pk1 attr1 attr2 attr3 +7 9998 NULL NULL +8 9998 NULL NULL +9 9998 NULL NULL +10 9998 NULL NULL +11 9998 NULL NULL +12 9998 NULL NULL +13 9998 NULL NULL +9408 9999 NULL 8765 +9410 9999 NULL 9412 UPDATE t1 SET attr1 = 9997 WHERE attr1 = 9999; SELECT * FROM t1 ORDER BY pk1; -pk1 attr1 -7 9998 -8 9998 -9 9998 -10 9998 -11 9998 -12 9998 -13 9998 -9408 9997 -9410 9997 -9411 9997 +pk1 attr1 attr2 attr3 +7 9998 NULL NULL +8 9998 NULL NULL +9 9998 NULL NULL +10 9998 NULL NULL +11 9998 NULL NULL +12 9998 NULL NULL +13 9998 NULL NULL +9408 9997 NULL 8765 +9410 9997 NULL 9412 DELETE FROM t1 WHERE pk1 = 9410; SELECT * FROM t1 ORDER BY pk1; -pk1 attr1 -7 9998 -8 9998 -9 9998 -10 9998 -11 9998 -12 9998 -13 9998 -9408 9997 -9411 9997 +pk1 attr1 attr2 attr3 +7 9998 NULL NULL +8 9998 NULL NULL +9 9998 NULL NULL +10 9998 NULL NULL +11 9998 NULL NULL +12 9998 NULL NULL +13 9998 NULL NULL +9408 9997 NULL 8765 DELETE FROM t1; SELECT * FROM t1; -pk1 attr1 -INSERT INTO t1 values (1, 4), (2, 4), (3, 5), (4, 4), (5, 5); +pk1 attr1 attr2 attr3 +INSERT INTO t1 values (1, 4, NULL, NULL), (2, 4, NULL, NULL), (3, 5, NULL, NULL), (4, 4, NULL, NULL), (5, 5, NULL, NULL); DELETE FROM t1 WHERE attr1=4; SELECT * FROM t1 order by pk1; -pk1 attr1 -3 5 -5 5 +pk1 attr1 attr2 attr3 +3 5 NULL NULL +5 5 NULL NULL DELETE FROM t1; -INSERT INTO t1 VALUES (9410,9412), (9411, 9413); +INSERT INTO t1 VALUES (9410,9412, NULL, NULL), (9411, 9413, NULL, NULL); DELETE FROM t1 WHERE pk1 = 9410; SELECT * FROM t1; -pk1 attr1 -9411 9413 +pk1 attr1 attr2 attr3 +9411 9413 NULL NULL DROP TABLE t1; CREATE TABLE t1 (id INT, id2 int) engine=ndbcluster; INSERT INTO t1 values(3456, 7890); @@ -108,13 +116,17 @@ SELECT * FROM t1; id id2 1234 7890 DELETE FROM t1; -INSERT INTO t1 values(3456, 7890), (3456, 7890), (3456, 7890); -SELECT * FROM t1; +INSERT INTO t1 values(3456, 7890), (3456, 7890), (3456, 7890), (3454, 7890); +SELECT * FROM t1 ORDER BY id; id id2 +3454 7890 3456 7890 3456 7890 3456 7890 DELETE FROM t1 WHERE id = 3456; +SELECT * FROM t1 ORDER BY id; +id id2 +3454 7890 DROP TABLE t1; CREATE TABLE t1 ( pk1 INT NOT NULL PRIMARY KEY, @@ -222,6 +234,18 @@ select * from t4 where a = 7 and b = 17 order by a; a b c d select * from t4 where a = 7 and b != 16 order by b; a b c d +delete from t2 where a > 5; +select x1.a, x1.b from t2 x1, t2 x2 where x1.b = x2.b order by x1.a; +a b +1 10 +3 12 +5 14 +select a, b FROM t2 outer_table where +a = (select a from t2 where b = outer_table.b ) order by a; +a b +1 10 +3 12 +5 14 delete from t2; delete from t3; delete from t4; @@ -338,3 +362,30 @@ select * from t7; adress a b c No adress 8 NULL 12 drop table t7; +CREATE TABLE t1 ( +pk1 INT NOT NULL PRIMARY KEY, +attr1 INT NOT NULL, +attr2 INT, +attr3 VARCHAR(10) +) ENGINE=ndbcluster; +INSERT INTO t1 VALUES (9410,9412, NULL, '9412'), (9411,9413, 17, '9413'); +create database mysqltest; +use mysqltest; +CREATE TABLE t2 ( +a bigint unsigned NOT NULL PRIMARY KEY, +b int unsigned not null, +c int unsigned +) engine=ndbcluster; +insert into t2 select pk1,attr1,attr2 from test.t1; +select * from t2 order by a; +a b c +9410 9412 NULL +9411 9413 17 +select b from test.t1, t2 where c = test.t1.attr2; +b +9413 +select b,test.t1.attr1 from test.t1, t2 where test.t1.pk1 < a; +b attr1 +9413 9412 +drop table test.t1, t2; +drop database mysqltest; |