summaryrefslogtreecommitdiff
path: root/mysql-test/suite/storage_engine/type_bit.inc
diff options
context:
space:
mode:
authorElena Stepanova <elenst@ubuntu11.home>2012-07-16 06:17:56 +0400
committerElena Stepanova <elenst@ubuntu11.home>2012-07-16 06:17:56 +0400
commit72a5542f0ef1fbc36aabc511f18855f302906501 (patch)
treefe4cabf5a4e59323b941fb1fa5a300548c841ea2 /mysql-test/suite/storage_engine/type_bit.inc
parent403cac0fe710bbd65a65f5b409cff6194ce6bace (diff)
downloadmariadb-git-72a5542f0ef1fbc36aabc511f18855f302906501.tar.gz
MDEV-11: Generic storage engine test suite
Diffstat (limited to 'mysql-test/suite/storage_engine/type_bit.inc')
-rw-r--r--mysql-test/suite/storage_engine/type_bit.inc76
1 files changed, 76 insertions, 0 deletions
diff --git a/mysql-test/suite/storage_engine/type_bit.inc b/mysql-test/suite/storage_engine/type_bit.inc
new file mode 100644
index 00000000000..1a232305e1c
--- /dev/null
+++ b/mysql-test/suite/storage_engine/type_bit.inc
@@ -0,0 +1,76 @@
+#
+# BIT column type
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# Valid values
+
+let $create_definition =
+ a BIT $col_opts,
+ b BIT(20) $col_opts,
+ c BIT(64) $col_opts,
+ d BIT(1) $col_opts
+;
+--source create_table.inc
+if ($mysql_errname)
+{
+ --let $my_last_stmt = $create_statement
+ --let $functionality = BIT types
+ --source unexpected_result.inc
+}
+if (!$mysql_errname)
+{
+ --replace_column 3 # 4 # 5 #
+ SHOW COLUMNS IN t1;
+
+ --let $alter_definition = DROP COLUMN d
+ --source alter_table.inc
+ if ($mysql_errname)
+ {
+ --let $my_last_stmt = $alter_statement
+ --let $functionality = ALTER TABLE
+ --source unexpected_result.inc
+ }
+ if (!$mysql_errname)
+ {
+ --let $alter_definition = ADD COLUMN d BIT(0) $col_opts
+ --source alter_table.inc
+
+ --replace_column 3 # 4 # 5 #
+ SHOW COLUMNS IN t1;
+ }
+
+ INSERT INTO t1 VALUES (0,POW(2,20)-1,b'1111111111111111111111111111111111111111111111111111111111111111',1);
+ --sorted_result
+ SELECT BIN(a), HEX(b), c+0 FROM t1 WHERE d>0;
+
+ INSERT INTO t1 VALUES (1,0,-1,0);
+ --sorted_result
+ SELECT a+0, b+0, c+0 FROM t1 WHERE d<100;
+
+ INSERT INTO t1 VALUES (b'1', 'f', 0xFF, 0x0);
+ --sorted_result
+ SELECT a+0, b+0, c+0 FROM t1 WHERE d IN (0, 2);
+
+ # Out of range values
+ # (should produce warnings)
+
+ INSERT INTO t1 VALUES (0x10,0,0,1);
+ --sorted_result
+ SELECT * FROM t1;
+
+ INSERT INTO t1 VALUES (0x01,0,0x10000000000000000,0);
+ --sorted_result
+ SELECT * FROM t1;
+
+ DROP TABLE t1;
+
+ --let $error_codes = ER_TOO_BIG_DISPLAYWIDTH
+ --let $create_definition = a BIT(65) $col_opts
+ --source create_table.inc
+}
+
+