summaryrefslogtreecommitdiff
path: root/mysql-test/suite/ndb/t/ndb_row_format.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/ndb/t/ndb_row_format.test')
-rw-r--r--mysql-test/suite/ndb/t/ndb_row_format.test86
1 files changed, 86 insertions, 0 deletions
diff --git a/mysql-test/suite/ndb/t/ndb_row_format.test b/mysql-test/suite/ndb/t/ndb_row_format.test
new file mode 100644
index 00000000000..b1582cbe339
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_row_format.test
@@ -0,0 +1,86 @@
+-- source include/have_ndb.inc
+-- source include/not_embedded.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7;
+drop database if exists mysqltest;
+--enable_warnings
+
+#
+# some negative tests
+#
+
+# cannot have ROW_FORMAT=FIXED and var attrs mixed
+--error 1005
+CREATE TABLE t1
+ ( a INT KEY,
+ b VARCHAR(10) )
+ ROW_FORMAT=FIXED
+ ENGINE=NDB;
+
+# warnings give more detail on the error
+SHOW WARNINGS;
+
+
+#
+# Check force var part for different ROW_FORMAT
+#
+
+# default => ForceVarPart: 1
+CREATE TABLE t1
+ ( a INT KEY,
+ b INT )
+ ENGINE=NDB;
+--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep ForceVarPart
+DROP TABLE t1;
+
+# explicit DEFAULT => ForceVarPart: 1
+CREATE TABLE t1
+ ( a INT KEY,
+ b INT )
+ ROW_FORMAT=DEFAULT
+ ENGINE=NDB;
+--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep ForceVarPart
+DROP TABLE t1;
+
+# FIXED => ForceVarPart: 0
+CREATE TABLE t1
+ ( a INT KEY,
+ b INT )
+ ROW_FORMAT=FIXED
+ ENGINE=NDB;
+--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep ForceVarPart
+DROP TABLE t1;
+
+# DYNAMIC => ForceVarPart: 1
+CREATE TABLE t1
+ ( a INT KEY,
+ b INT )
+ ROW_FORMAT=DYNAMIC
+ ENGINE=NDB;
+--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep ForceVarPart
+DROP TABLE t1;
+
+# test of bug
+create table t1 (a int auto_increment primary key, b varchar(1000)) engine = ndb;
+insert into t1(b) values ('0123456789');
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+select count(*) from t1;
+begin;
+update t1 set b = concat(b,b);
+update t1 set b = concat(b,b);
+update t1 set b = concat(b,b);
+update t1 set b = concat(b,b);
+update t1 set b = concat(b,b);
+rollback;
+select count(*),b from t1 group by b;
+drop table t1;