[Commits] 577694a: Add passing tests in mysql-test/suite/rocksdb (based on mysql-test/suite/leveldb)

Sergei Petrunia psergey at askmonty.org
Wed Jul 16 12:53:05 EEST 2014


revision-id: 577694adcf94b5474c8c289540b6cb2ab276eb2e
parent(s): bbcaf676457cedc715ee5564db8a0075eba8a3ac
committer: Sergei Petrunia
branch nick: webscalesql-5.6
timestamp: 2014-07-16 13:53:05 +0400
message:

Add passing tests in mysql-test/suite/rocksdb (based on mysql-test/suite/leveldb)

-----------------------

 mysql-test/suite/rocksdb/1st.result                |   22 +
 mysql-test/suite/rocksdb/1st.test                  |   34 +
 mysql-test/suite/rocksdb/alter_table.result        |  181 ++
 mysql-test/suite/rocksdb/alter_table.test          |   92 +
 mysql-test/suite/rocksdb/analyze_table.result      |   29 +
 mysql-test/suite/rocksdb/analyze_table.test        |   29 +
 mysql-test/suite/rocksdb/check_table.inc           |   54 +
 mysql-test/suite/rocksdb/check_table.result        |   68 +
 mysql-test/suite/rocksdb/check_table.test          |   10 +
 mysql-test/suite/rocksdb/checksum_table.result     |   20 +
 mysql-test/suite/rocksdb/checksum_table.test       |   22 +
 .../suite/rocksdb/checksum_table_live.result       |   20 +
 mysql-test/suite/rocksdb/checksum_table_live.test  |   22 +
 mysql-test/suite/rocksdb/col_not_null.inc          |   55 +
 .../suite/rocksdb/col_not_null_timestamp.inc       |   61 +
 mysql-test/suite/rocksdb/col_null.inc              |   33 +
 mysql-test/suite/rocksdb/col_opt_default.result    |   20 +
 mysql-test/suite/rocksdb/col_opt_default.test      |   25 +
 mysql-test/suite/rocksdb/col_opt_not_null.result   | 2612 ++++++++++++++++++++
 mysql-test/suite/rocksdb/col_opt_not_null.test     |  222 ++
 mysql-test/suite/rocksdb/col_opt_null.result       | 2115 ++++++++++++++++
 mysql-test/suite/rocksdb/col_opt_null.test         |  214 ++
 mysql-test/suite/rocksdb/col_opt_unsigned.result   |  741 ++++++
 mysql-test/suite/rocksdb/col_opt_unsigned.test     |   72 +
 mysql-test/suite/rocksdb/col_opt_zerofill.result   |  723 ++++++
 mysql-test/suite/rocksdb/col_opt_zerofill.test     |   65 +
 .../rocksdb/cons_snapshot_repeatable_read.result   |   18 +
 .../rocksdb/cons_snapshot_repeatable_read.test     |    4 +
 .../rocksdb/cons_snapshot_serializable.result      |   24 +
 .../suite/rocksdb/cons_snapshot_serializable.test  |    4 +
 mysql-test/suite/rocksdb/consistent_snapshot.inc   |   42 +
 mysql-test/suite/rocksdb/create_table.result       |   44 +
 mysql-test/suite/rocksdb/create_table.test         |   67 +
 mysql-test/suite/rocksdb/delete.result             |  123 +
 mysql-test/suite/rocksdb/delete.test               |  100 +
 mysql-test/suite/rocksdb/delete_ignore.result      |   59 +
 mysql-test/suite/rocksdb/delete_ignore.test        |   35 +
 mysql-test/suite/rocksdb/delete_quick.result       |   24 +
 mysql-test/suite/rocksdb/delete_quick.test         |   30 +
 mysql-test/suite/rocksdb/delete_with_keys.result   |   38 +
 mysql-test/suite/rocksdb/delete_with_keys.test     |   37 +
 mysql-test/suite/rocksdb/describe.result           |   19 +
 mysql-test/suite/rocksdb/describe.test             |   22 +
 mysql-test/suite/rocksdb/disabled.def              |   11 +
 mysql-test/suite/rocksdb/index.inc                 |  113 +
 mysql-test/suite/rocksdb/index.result              |   42 +
 mysql-test/suite/rocksdb/index.test                |   21 +
 .../suite/rocksdb/index_key_block_size.result      |   51 +
 mysql-test/suite/rocksdb/index_key_block_size.test |   65 +
 mysql-test/suite/rocksdb/index_primary.result      |   52 +
 mysql-test/suite/rocksdb/index_primary.test        |   61 +
 mysql-test/suite/rocksdb/index_type_btree.result   |   42 +
 mysql-test/suite/rocksdb/index_type_btree.test     |   10 +
 mysql-test/suite/rocksdb/index_type_hash.result    |   42 +
 mysql-test/suite/rocksdb/index_type_hash.test      |   10 +
 mysql-test/suite/rocksdb/insert.result             |  209 ++
 mysql-test/suite/rocksdb/insert.test               |   99 +
 mysql-test/suite/rocksdb/insert_with_keys.result   |   63 +
 mysql-test/suite/rocksdb/insert_with_keys.test     |   91 +
 .../suite/rocksdb/level_read_committed.result      |   91 +
 mysql-test/suite/rocksdb/level_read_committed.test |    5 +
 .../suite/rocksdb/level_read_uncommitted.result    |  116 +
 .../suite/rocksdb/level_read_uncommitted.test      |    4 +
 .../suite/rocksdb/level_repeatable_read.result     |   69 +
 .../suite/rocksdb/level_repeatable_read.test       |    3 +
 mysql-test/suite/rocksdb/level_serializable.result |   56 +
 mysql-test/suite/rocksdb/level_serializable.test   |    3 +
 mysql-test/suite/rocksdb/loaddata.result           |   93 +
 mysql-test/suite/rocksdb/loaddata.test             |   91 +
 mysql-test/suite/rocksdb/lock.result               |  108 +
 mysql-test/suite/rocksdb/lock.test                 |  200 ++
 mysql-test/suite/rocksdb/misc.result               |   89 +
 mysql-test/suite/rocksdb/misc.test                 |   43 +
 mysql-test/suite/rocksdb/my.cnf                    |    7 +
 mysql-test/suite/rocksdb/optimize_table.inc        |   30 +
 mysql-test/suite/rocksdb/optimize_table.result     |   29 +
 mysql-test/suite/rocksdb/optimize_table.test       |    6 +
 mysql-test/suite/rocksdb/repair_table.inc          |   38 +
 mysql-test/suite/rocksdb/repair_table.result       |   37 +
 mysql-test/suite/rocksdb/repair_table.test         |    6 +
 mysql-test/suite/rocksdb/replace.result            |   32 +
 mysql-test/suite/rocksdb/replace.test              |   52 +
 mysql-test/suite/rocksdb/se-innodb.out             |    1 +
 mysql-test/suite/rocksdb/select.result             |  373 +++
 mysql-test/suite/rocksdb/select.test               |  200 ++
 mysql-test/suite/rocksdb/select_for_update.result  |   35 +
 mysql-test/suite/rocksdb/select_for_update.test    |   53 +
 .../suite/rocksdb/select_lock_in_share_mode.result |   37 +
 .../suite/rocksdb/select_lock_in_share_mode.test   |   52 +
 mysql-test/suite/rocksdb/show_engine.result        |    5 +
 mysql-test/suite/rocksdb/show_engine.test          |   13 +
 mysql-test/suite/rocksdb/show_table_status.result  |   62 +
 mysql-test/suite/rocksdb/show_table_status.test    |   26 +
 .../suite/rocksdb/tbl_opt_avg_row_length.result    |   18 +
 .../suite/rocksdb/tbl_opt_avg_row_length.test      |   21 +
 mysql-test/suite/rocksdb/tbl_opt_checksum.result   |   18 +
 mysql-test/suite/rocksdb/tbl_opt_checksum.test     |   17 +
 mysql-test/suite/rocksdb/tbl_opt_connection.result |   26 +
 mysql-test/suite/rocksdb/tbl_opt_connection.test   |   30 +
 .../suite/rocksdb/tbl_opt_data_index_dir.result    |   20 +
 .../suite/rocksdb/tbl_opt_data_index_dir.test      |   35 +
 .../suite/rocksdb/tbl_opt_delay_key_write.result   |   18 +
 .../suite/rocksdb/tbl_opt_delay_key_write.test     |   21 +
 .../suite/rocksdb/tbl_opt_insert_method.result     |   18 +
 .../suite/rocksdb/tbl_opt_insert_method.test       |   21 +
 .../suite/rocksdb/tbl_opt_key_block_size.result    |   18 +
 .../suite/rocksdb/tbl_opt_key_block_size.test      |   21 +
 mysql-test/suite/rocksdb/tbl_opt_max_rows.result   |   18 +
 mysql-test/suite/rocksdb/tbl_opt_max_rows.test     |   21 +
 mysql-test/suite/rocksdb/tbl_opt_min_rows.result   |   18 +
 mysql-test/suite/rocksdb/tbl_opt_min_rows.test     |   21 +
 mysql-test/suite/rocksdb/tbl_opt_pack_keys.result  |   18 +
 mysql-test/suite/rocksdb/tbl_opt_pack_keys.test    |   21 +
 mysql-test/suite/rocksdb/tbl_opt_password.result   |   18 +
 mysql-test/suite/rocksdb/tbl_opt_password.test     |   25 +
 mysql-test/suite/rocksdb/tbl_opt_row_format.result |   18 +
 mysql-test/suite/rocksdb/tbl_opt_row_format.test   |   21 +
 mysql-test/suite/rocksdb/tbl_opt_union.result      |   16 +
 mysql-test/suite/rocksdb/tbl_opt_union.test        |   26 +
 mysql-test/suite/rocksdb/tbl_standard_opts.result  |   46 +
 mysql-test/suite/rocksdb/tbl_standard_opts.test    |   40 +
 mysql-test/suite/rocksdb/transaction_isolation.inc |   92 +
 mysql-test/suite/rocksdb/truncate_table.result     |   33 +
 mysql-test/suite/rocksdb/truncate_table.test       |   68 +
 mysql-test/suite/rocksdb/type_binary.inc           |   45 +
 mysql-test/suite/rocksdb/type_binary.result        |   48 +
 mysql-test/suite/rocksdb/type_binary.test          |    6 +
 mysql-test/suite/rocksdb/type_bit.inc              |   53 +
 mysql-test/suite/rocksdb/type_bit.result           |   53 +
 mysql-test/suite/rocksdb/type_bit.test             |    6 +
 mysql-test/suite/rocksdb/type_blob.inc             |   49 +
 mysql-test/suite/rocksdb/type_blob.result          |   57 +
 mysql-test/suite/rocksdb/type_blob.test            |    6 +
 mysql-test/suite/rocksdb/type_blob_indexes.result  |  152 ++
 mysql-test/suite/rocksdb/type_blob_indexes.test    |  109 +
 mysql-test/suite/rocksdb/type_bool.inc             |   64 +
 mysql-test/suite/rocksdb/type_bool.result          |   73 +
 mysql-test/suite/rocksdb/type_bool.test            |    6 +
 mysql-test/suite/rocksdb/type_char.inc             |   45 +
 mysql-test/suite/rocksdb/type_char.result          |   58 +
 mysql-test/suite/rocksdb/type_char.test            |    6 +
 mysql-test/suite/rocksdb/type_date_time.inc        |   45 +
 mysql-test/suite/rocksdb/type_date_time.result     |   53 +
 mysql-test/suite/rocksdb/type_date_time.test       |    7 +
 mysql-test/suite/rocksdb/type_enum.inc             |   50 +
 mysql-test/suite/rocksdb/type_enum.result          |   47 +
 mysql-test/suite/rocksdb/type_enum.test            |    6 +
 mysql-test/suite/rocksdb/type_fixed.inc            |   85 +
 mysql-test/suite/rocksdb/type_fixed.result         |  131 +
 mysql-test/suite/rocksdb/type_fixed.test           |    6 +
 mysql-test/suite/rocksdb/type_float.inc            |  108 +
 mysql-test/suite/rocksdb/type_float.result         |  306 +++
 mysql-test/suite/rocksdb/type_float.test           |    6 +
 mysql-test/suite/rocksdb/type_int.inc              |   68 +
 mysql-test/suite/rocksdb/type_int.result           |  212 ++
 mysql-test/suite/rocksdb/type_int.test             |    6 +
 mysql-test/suite/rocksdb/type_set.inc              |   49 +
 mysql-test/suite/rocksdb/type_set.result           |   49 +
 mysql-test/suite/rocksdb/type_set.test             |    6 +
 mysql-test/suite/rocksdb/type_text.inc             |   49 +
 mysql-test/suite/rocksdb/type_text.result          |   57 +
 mysql-test/suite/rocksdb/type_text.test            |    6 +
 mysql-test/suite/rocksdb/type_text_indexes.result  |  137 +
 mysql-test/suite/rocksdb/type_text_indexes.test    |  102 +
 mysql-test/suite/rocksdb/type_varbinary.inc        |   75 +
 mysql-test/suite/rocksdb/type_varbinary.result     |   93 +
 mysql-test/suite/rocksdb/type_varbinary.test       |    6 +
 mysql-test/suite/rocksdb/type_varchar.inc          |   77 +
 mysql-test/suite/rocksdb/type_varchar.result       |  128 +
 mysql-test/suite/rocksdb/type_varchar.test         |    6 +
 mysql-test/suite/rocksdb/update.result             |  113 +
 mysql-test/suite/rocksdb/update.test               |   70 +
 mysql-test/suite/rocksdb/update_multi.result       |   65 +
 mysql-test/suite/rocksdb/update_multi.test         |   30 +
 174 files changed, 15210 insertions(+)

diff --git a/mysql-test/suite/rocksdb/1st.result b/mysql-test/suite/rocksdb/1st.result
new file mode 100644
index 0000000..7d1e860
--- /dev/null
+++ b/mysql-test/suite/rocksdb/1st.result
@@ -0,0 +1,22 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (pk INT PRIMARY KEY DEFAULT '0', a INT(11), b CHAR(8)) ENGINE=rocksdb;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `pk` int(11) NOT NULL DEFAULT '0',
+  `a` int(11) DEFAULT NULL,
+  `b` char(8) DEFAULT NULL,
+  PRIMARY KEY (`pk`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	0	
+a	int(11)	YES		NULL	
+b	char(8)	YES		NULL	
+INSERT INTO t1 VALUES (1, 1,'a');
+INSERT INTO t1 (a,b) VALUES (2,'b');
+SELECT a,b FROM t1;
+a	b
+1	a
+2	b
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/1st.test b/mysql-test/suite/rocksdb/1st.test
new file mode 100644
index 0000000..b427f5a
--- /dev/null
+++ b/mysql-test/suite/rocksdb/1st.test
@@ -0,0 +1,34 @@
+# 
+# This test checks some very basic capabilities
+# which will be used in almost every other test,
+# and will not be checked through support* variables.
+# If this test does not pass, there is no point
+# at executing other ones.
+#
+# Minimal requirements:
+# - supported column types: INT, CHAR (default CHAR(8), INT(11));
+# - column attributes as declared in define_engine.inc ($default_col_opts)
+#     (by default empty, which means no additional attributes apart from the type);
+# - table attributes as declared in define_engine.inc ($default_tbl_opts)
+#     (by default empty, which means no additional attributes apart from ENGINE);
+# - CREATE TABLE .. (column1 <column options>, column2 <column options>) ENGINE=<storage_engine>;
+# - INSERT INTO TABLE .. VALUES (val1,val2);
+# - DROP TABLE ..
+# - SELECT a,b FROM ..
+# - SHOW CREATE TABLE ..
+# - SHOW COLUMNS IN ...
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (pk INT PRIMARY KEY DEFAULT '0', a INT(11), b CHAR(8)) ENGINE=rocksdb;
+SHOW CREATE TABLE t1;
+SHOW COLUMNS IN t1;
+INSERT INTO t1 VALUES (1, 1,'a');
+INSERT INTO t1 (a,b) VALUES (2,'b');
+--sorted_result
+SELECT a,b FROM t1;
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/alter_table.result b/mysql-test/suite/rocksdb/alter_table.result
new file mode 100644
index 0000000..191a7a3
--- /dev/null
+++ b/mysql-test/suite/rocksdb/alter_table.result
@@ -0,0 +1,181 @@
+DROP TABLE IF EXISTS t1, t2;
+CREATE TABLE t1 (pk INT PRIMARY KEY, a INT, c CHAR(8)) ENGINE=rocksdb;
+INSERT INTO t1 VALUES (1,1,'a'),(2,5,'z');
+ALTER TABLE t1 ADD COLUMN b INT;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `pk` int(11) NOT NULL,
+  `a` int(11) DEFAULT NULL,
+  `c` char(8) DEFAULT NULL,
+  `b` int(11) DEFAULT NULL,
+  PRIMARY KEY (`pk`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
+ALTER TABLE t1 ALTER COLUMN a SET DEFAULT '0';
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `pk` int(11) NOT NULL,
+  `a` int(11) DEFAULT '0',
+  `c` char(8) DEFAULT NULL,
+  `b` int(11) DEFAULT NULL,
+  PRIMARY KEY (`pk`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
+ALTER TABLE t1 ALTER a DROP DEFAULT;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `pk` int(11) NOT NULL,
+  `a` int(11),
+  `c` char(8) DEFAULT NULL,
+  `b` int(11) DEFAULT NULL,
+  PRIMARY KEY (`pk`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
+ALTER TABLE t1 CHANGE COLUMN b b1 CHAR(8) FIRST;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `b1` char(8) DEFAULT NULL,
+  `pk` int(11) NOT NULL,
+  `a` int(11),
+  `c` char(8) DEFAULT NULL,
+  PRIMARY KEY (`pk`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
+ALTER TABLE t1 CHANGE b1 b INT AFTER c;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `pk` int(11) NOT NULL,
+  `a` int(11),
+  `c` char(8) DEFAULT NULL,
+  `b` int(11) DEFAULT NULL,
+  PRIMARY KEY (`pk`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
+ALTER TABLE t1 CHANGE b b CHAR(8);
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `pk` int(11) NOT NULL,
+  `a` int(11),
+  `c` char(8) DEFAULT NULL,
+  `b` char(8) DEFAULT NULL,
+  PRIMARY KEY (`pk`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
+ALTER TABLE t1 MODIFY COLUMN b INT;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `pk` int(11) NOT NULL,
+  `a` int(11),
+  `c` char(8) DEFAULT NULL,
+  `b` int(11) DEFAULT NULL,
+  PRIMARY KEY (`pk`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
+ALTER TABLE t1 MODIFY COLUMN b CHAR(8) FIRST;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `b` char(8) DEFAULT NULL,
+  `pk` int(11) NOT NULL,
+  `a` int(11),
+  `c` char(8) DEFAULT NULL,
+  PRIMARY KEY (`pk`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
+ALTER TABLE t1 MODIFY COLUMN b INT AFTER a;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `pk` int(11) NOT NULL,
+  `a` int(11),
+  `b` int(11) DEFAULT NULL,
+  `c` char(8) DEFAULT NULL,
+  PRIMARY KEY (`pk`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
+ALTER TABLE t1 DROP COLUMN b;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `pk` int(11) NOT NULL,
+  `a` int(11),
+  `c` char(8) DEFAULT NULL,
+  PRIMARY KEY (`pk`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
+ALTER TABLE t1 RENAME TO t2;
+SHOW CREATE TABLE t1;
+ERROR 42S02: Table 'test.t1' doesn't exist
+SHOW CREATE TABLE t2;
+Table	Create Table
+t2	CREATE TABLE `t2` (
+  `pk` int(11) NOT NULL,
+  `a` int(11),
+  `c` char(8) DEFAULT NULL,
+  PRIMARY KEY (`pk`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t1 (pk INT PRIMARY KEY, a INT, b INT) ENGINE=rocksdb;
+INSERT INTO t1 VALUES (1,1,5),(2,2,2),(3,4,3);
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `pk` int(11) NOT NULL,
+  `a` int(11) DEFAULT NULL,
+  `b` int(11) DEFAULT NULL,
+  PRIMARY KEY (`pk`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
+ALTER TABLE t1 ORDER BY b ASC, a DESC, pk DESC;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `pk` int(11) NOT NULL,
+  `a` int(11) DEFAULT NULL,
+  `b` int(11) DEFAULT NULL,
+  PRIMARY KEY (`pk`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
+SELECT * FROM t1;
+pk	a	b
+1	1	5
+2	2	2
+3	4	3
+DROP TABLE t1;
+CREATE TABLE t1 (pk INT PRIMARY KEY, a INT, b CHAR(8), c CHAR(8)) ENGINE=rocksdb CHARACTER SET latin1 COLLATE latin1_general_cs;
+INSERT INTO t1 VALUES (1,5,'z','t');
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `pk` int(11) NOT NULL,
+  `a` int(11) DEFAULT NULL,
+  `b` char(8) COLLATE latin1_general_cs DEFAULT NULL,
+  `c` char(8) COLLATE latin1_general_cs DEFAULT NULL,
+  PRIMARY KEY (`pk`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs
+ALTER TABLE t1 CONVERT TO CHARACTER SET utf8;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `pk` int(11) NOT NULL,
+  `a` int(11) DEFAULT NULL,
+  `b` char(8) DEFAULT NULL,
+  `c` char(8) DEFAULT NULL,
+  PRIMARY KEY (`pk`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=utf8
+ALTER TABLE t1 DEFAULT CHARACTER SET = latin1 COLLATE latin1_general_ci;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `pk` int(11) NOT NULL,
+  `a` int(11) DEFAULT NULL,
+  `b` char(8) CHARACTER SET utf8 DEFAULT NULL,
+  `c` char(8) CHARACTER SET utf8 DEFAULT NULL,
+  PRIMARY KEY (`pk`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci
+ALTER TABLE t1 FORCE;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `pk` int(11) NOT NULL,
+  `a` int(11) DEFAULT NULL,
+  `b` char(8) CHARACTER SET utf8 DEFAULT NULL,
+  `c` char(8) CHARACTER SET utf8 DEFAULT NULL,
+  PRIMARY KEY (`pk`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/alter_table.test b/mysql-test/suite/rocksdb/alter_table.test
new file mode 100644
index 0000000..6d12fde
--- /dev/null
+++ b/mysql-test/suite/rocksdb/alter_table.test
@@ -0,0 +1,92 @@
+# 
+# Basic ALTER TABLE statements.
+#
+# USAGE of table options in ALTER statements
+#   is covered in tbl_standard_opts and tbl_opt*.tests.
+#
+# Index operations are covered in index* tests.
+#
+# ALTER OFFLINE is not covered as it is not supported, as of 5.5.23
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
+
+CREATE TABLE t1 (pk INT PRIMARY KEY, a INT, c CHAR(8)) ENGINE=rocksdb;
+INSERT INTO t1 VALUES (1,1,'a'),(2,5,'z');
+
+# Column operations
+
+ALTER TABLE t1 ADD COLUMN b INT;
+SHOW CREATE TABLE t1;
+
+ALTER TABLE t1 ALTER COLUMN a SET DEFAULT '0';
+SHOW CREATE TABLE t1;
+
+ALTER TABLE t1 ALTER a DROP DEFAULT;
+SHOW CREATE TABLE t1;
+
+ALTER TABLE t1 CHANGE COLUMN b b1 CHAR(8) FIRST;
+SHOW CREATE TABLE t1;
+
+ALTER TABLE t1 CHANGE b1 b INT AFTER c;
+SHOW CREATE TABLE t1;
+
+ALTER TABLE t1 CHANGE b b CHAR(8);
+SHOW CREATE TABLE t1;
+
+ALTER TABLE t1 MODIFY COLUMN b INT;
+SHOW CREATE TABLE t1;
+
+ALTER TABLE t1 MODIFY COLUMN b CHAR(8) FIRST;
+SHOW CREATE TABLE t1;
+
+ALTER TABLE t1 MODIFY COLUMN b INT AFTER a;
+SHOW CREATE TABLE t1;
+
+ALTER TABLE t1 DROP COLUMN b;
+SHOW CREATE TABLE t1;
+
+
+# Rename table
+
+ALTER TABLE t1 RENAME TO t2;
+--error ER_NO_SUCH_TABLE
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+
+# ORDER BY
+CREATE TABLE t1 (pk INT PRIMARY KEY, a INT, b INT) ENGINE=rocksdb;
+INSERT INTO t1 VALUES (1,1,5),(2,2,2),(3,4,3);
+SHOW CREATE TABLE t1;
+
+ALTER TABLE t1 ORDER BY b ASC, a DESC, pk DESC;
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+
+# Character set, collate
+
+CREATE TABLE t1 (pk INT PRIMARY KEY, a INT, b CHAR(8), c CHAR(8)) ENGINE=rocksdb CHARACTER SET latin1 COLLATE latin1_general_cs;
+INSERT INTO t1 VALUES (1,5,'z','t');
+SHOW CREATE TABLE t1;
+
+ALTER TABLE t1 CONVERT TO CHARACTER SET utf8;
+SHOW CREATE TABLE t1;
+
+ALTER TABLE t1 DEFAULT CHARACTER SET = latin1 COLLATE latin1_general_ci;
+SHOW CREATE TABLE t1;
+
+
+# A 'null' ALTER operation
+
+ALTER TABLE t1 FORCE;
+SHOW CREATE TABLE t1;
+
+DROP TABLE t1;
+
+
diff --git a/mysql-test/suite/rocksdb/analyze_table.result b/mysql-test/suite/rocksdb/analyze_table.result
new file mode 100644
index 0000000..13822eb
--- /dev/null
+++ b/mysql-test/suite/rocksdb/analyze_table.result
@@ -0,0 +1,29 @@
+DROP TABLE IF EXISTS t1,t2;
+CREATE TABLE t1 (pk INT PRIMARY KEY, a INT(11), b CHAR(8)) ENGINE=rocksdb;
+INSERT INTO t1 VALUES (1,1,'a'),(2,2,'b');
+CREATE TABLE t2 (pk INT PRIMARY KEY, a INT(11), b CHAR(8)) ENGINE=rocksdb;
+INSERT INTO t1 VALUES (3,3,'c');
+ANALYZE TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	analyze	note	The storage engine for the table doesn't support analyze
+INSERT INTO t2 VALUES (1,4,'d');
+ANALYZE NO_WRITE_TO_BINLOG TABLE t2;
+Table	Op	Msg_type	Msg_text
+test.t2	analyze	note	The storage engine for the table doesn't support analyze
+INSERT INTO t1 VALUES (4,5,'e');
+INSERT INTO t2 VALUES (2,6,'f');
+ANALYZE LOCAL TABLE t1, t2;
+Table	Op	Msg_type	Msg_text
+test.t1	analyze	note	The storage engine for the table doesn't support analyze
+test.t2	analyze	note	The storage engine for the table doesn't support analyze
+DROP TABLE t1, t2;
+CREATE TABLE t1 (pk INT PRIMARY KEY, a INT(11), KEY(a)) ENGINE=rocksdb;
+INSERT INTO t1 VALUES (1,1),(2,2),(3,4),(4,7);
+ANALYZE TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	analyze	note	The storage engine for the table doesn't support analyze
+INSERT INTO t1 VALUES (5,8),(6,10),(7,11),(8,12);
+ANALYZE TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	analyze	note	The storage engine for the table doesn't support analyze
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/analyze_table.test b/mysql-test/suite/rocksdb/analyze_table.test
new file mode 100644
index 0000000..02254cb
--- /dev/null
+++ b/mysql-test/suite/rocksdb/analyze_table.test
@@ -0,0 +1,29 @@
+# 
+# ANALYZE TABLE statements
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2;
+--enable_warnings
+
+CREATE TABLE t1 (pk INT PRIMARY KEY, a INT(11), b CHAR(8)) ENGINE=rocksdb;
+INSERT INTO t1 VALUES (1,1,'a'),(2,2,'b');
+CREATE TABLE t2 (pk INT PRIMARY KEY, a INT(11), b CHAR(8)) ENGINE=rocksdb;
+INSERT INTO t1 VALUES (3,3,'c');
+ANALYZE TABLE t1;
+INSERT INTO t2 VALUES (1,4,'d');
+ANALYZE NO_WRITE_TO_BINLOG TABLE t2;
+INSERT INTO t1 VALUES (4,5,'e');
+INSERT INTO t2 VALUES (2,6,'f');
+ANALYZE LOCAL TABLE t1, t2;
+
+DROP TABLE t1, t2;
+
+  --let $create_definition = a $int_indexed_col, $default_index(a)
+CREATE TABLE t1 (pk INT PRIMARY KEY, a INT(11), KEY(a)) ENGINE=rocksdb;
+INSERT INTO t1 VALUES (1,1),(2,2),(3,4),(4,7);
+ANALYZE TABLE t1;
+INSERT INTO t1 VALUES (5,8),(6,10),(7,11),(8,12);
+ANALYZE TABLE t1;
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/check_table.inc b/mysql-test/suite/rocksdb/check_table.inc
new file mode 100644
index 0000000..c108a97
--- /dev/null
+++ b/mysql-test/suite/rocksdb/check_table.inc
@@ -0,0 +1,54 @@
+# 
+# CHECK TABLE statements
+#
+# Note: the output is likely to be different for the engine under test,
+# in which case rdiff will be needed. Or, the output might say that
+# the storage engine does not support CHECK.
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2;
+--enable_warnings
+
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b');
+
+CREATE TABLE t2 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+
+CHECK TABLE t1;
+INSERT INTO t1 (a,b) VALUES (3,'c');
+INSERT INTO t2 (a,b) VALUES (4,'d');
+CHECK TABLE t1, t2 FOR UPGRADE;
+INSERT INTO t2 (a,b) VALUES (5,'e');
+CHECK TABLE t2 QUICK;
+INSERT INTO t1 (a,b) VALUES (6,'f');
+CHECK TABLE t1 FAST;
+INSERT INTO t1 (a,b) VALUES (7,'g');
+INSERT INTO t2 (a,b) VALUES (8,'h');
+CHECK TABLE t2, t1 MEDIUM;
+INSERT INTO t1 (a,b) VALUES (9,'i');
+INSERT INTO t2 (a,b) VALUES (10,'j');
+CHECK TABLE t1, t2 EXTENDED;
+INSERT INTO t1 (a,b) VALUES (11,'k');
+CHECK TABLE t1 CHANGED;
+
+DROP TABLE t1, t2;
+
+
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY, KEY(a)) ENGINE=rocksdb;
+INSERT INTO t1 (a) VALUES (1),(2),(5);
+CHECK TABLE t1;
+INSERT INTO t1 (a) VALUES (6),(8),(12);
+CHECK TABLE t1 FOR UPGRADE;
+INSERT INTO t1 (a) VALUES (13),(15),(16);
+CHECK TABLE t1 QUICK;
+INSERT INTO t1 (a) VALUES (17),(120),(132);
+CHECK TABLE t1 FAST;
+INSERT INTO t1 (a) VALUES (801),(900),(7714);
+CHECK TABLE t1 MEDIUM;
+INSERT INTO t1 (a) VALUES (8760),(10023),(12000);
+CHECK TABLE t1 EXTENDED;
+INSERT INTO t1 (a) VALUES (13345),(24456),(78302),(143028);
+CHECK TABLE t1 CHANGED;
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/check_table.result b/mysql-test/suite/rocksdb/check_table.result
new file mode 100644
index 0000000..6688d6a
--- /dev/null
+++ b/mysql-test/suite/rocksdb/check_table.result
@@ -0,0 +1,68 @@
+DROP TABLE IF EXISTS t1,t2;
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b');
+CREATE TABLE t2 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+CHECK TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	check	note	The storage engine for the table doesn't support check
+INSERT INTO t1 (a,b) VALUES (3,'c');
+INSERT INTO t2 (a,b) VALUES (4,'d');
+CHECK TABLE t1, t2 FOR UPGRADE;
+Table	Op	Msg_type	Msg_text
+test.t1	check	status	OK
+test.t2	check	status	OK
+INSERT INTO t2 (a,b) VALUES (5,'e');
+CHECK TABLE t2 QUICK;
+Table	Op	Msg_type	Msg_text
+test.t2	check	note	The storage engine for the table doesn't support check
+INSERT INTO t1 (a,b) VALUES (6,'f');
+CHECK TABLE t1 FAST;
+Table	Op	Msg_type	Msg_text
+test.t1	check	note	The storage engine for the table doesn't support check
+INSERT INTO t1 (a,b) VALUES (7,'g');
+INSERT INTO t2 (a,b) VALUES (8,'h');
+CHECK TABLE t2, t1 MEDIUM;
+Table	Op	Msg_type	Msg_text
+test.t2	check	note	The storage engine for the table doesn't support check
+test.t1	check	note	The storage engine for the table doesn't support check
+INSERT INTO t1 (a,b) VALUES (9,'i');
+INSERT INTO t2 (a,b) VALUES (10,'j');
+CHECK TABLE t1, t2 EXTENDED;
+Table	Op	Msg_type	Msg_text
+test.t1	check	note	The storage engine for the table doesn't support check
+test.t2	check	note	The storage engine for the table doesn't support check
+INSERT INTO t1 (a,b) VALUES (11,'k');
+CHECK TABLE t1 CHANGED;
+Table	Op	Msg_type	Msg_text
+test.t1	check	note	The storage engine for the table doesn't support check
+DROP TABLE t1, t2;
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY, KEY(a)) ENGINE=rocksdb;
+INSERT INTO t1 (a) VALUES (1),(2),(5);
+CHECK TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	check	note	The storage engine for the table doesn't support check
+INSERT INTO t1 (a) VALUES (6),(8),(12);
+CHECK TABLE t1 FOR UPGRADE;
+Table	Op	Msg_type	Msg_text
+test.t1	check	status	OK
+INSERT INTO t1 (a) VALUES (13),(15),(16);
+CHECK TABLE t1 QUICK;
+Table	Op	Msg_type	Msg_text
+test.t1	check	note	The storage engine for the table doesn't support check
+INSERT INTO t1 (a) VALUES (17),(120),(132);
+CHECK TABLE t1 FAST;
+Table	Op	Msg_type	Msg_text
+test.t1	check	note	The storage engine for the table doesn't support check
+INSERT INTO t1 (a) VALUES (801),(900),(7714);
+CHECK TABLE t1 MEDIUM;
+Table	Op	Msg_type	Msg_text
+test.t1	check	note	The storage engine for the table doesn't support check
+INSERT INTO t1 (a) VALUES (8760),(10023),(12000);
+CHECK TABLE t1 EXTENDED;
+Table	Op	Msg_type	Msg_text
+test.t1	check	note	The storage engine for the table doesn't support check
+INSERT INTO t1 (a) VALUES (13345),(24456),(78302),(143028);
+CHECK TABLE t1 CHANGED;
+Table	Op	Msg_type	Msg_text
+test.t1	check	note	The storage engine for the table doesn't support check
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/check_table.test b/mysql-test/suite/rocksdb/check_table.test
new file mode 100644
index 0000000..8065e4e
--- /dev/null
+++ b/mysql-test/suite/rocksdb/check_table.test
@@ -0,0 +1,10 @@
+# 
+# CHECK TABLE statements
+#
+# Note: the output is likely to be different for the engine under test,
+# in which case rdiff will be needed. Or, the output might say that
+# the storage engine does not support CHECK.
+#
+
+--source check_table.inc
+
diff --git a/mysql-test/suite/rocksdb/checksum_table.result b/mysql-test/suite/rocksdb/checksum_table.result
new file mode 100644
index 0000000..b5b2f59
--- /dev/null
+++ b/mysql-test/suite/rocksdb/checksum_table.result
@@ -0,0 +1,20 @@
+DROP TABLE IF EXISTS t1,t2;
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb CHECKSUM=0;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b');
+CREATE TABLE t2 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb CHECKSUM=0;
+CHECKSUM TABLE t1;
+Table	Checksum
+test.t1	4259194219
+CHECKSUM TABLE t2, t1;
+Table	Checksum
+test.t2	0
+test.t1	4259194219
+CHECKSUM TABLE t1, t2 QUICK;
+Table	Checksum
+test.t1	NULL
+test.t2	NULL
+CHECKSUM TABLE t1, t2 EXTENDED;
+Table	Checksum
+test.t1	4259194219
+test.t2	0
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/rocksdb/checksum_table.test b/mysql-test/suite/rocksdb/checksum_table.test
new file mode 100644
index 0000000..fd3fa18
--- /dev/null
+++ b/mysql-test/suite/rocksdb/checksum_table.test
@@ -0,0 +1,22 @@
+# 
+# CHECKSUM TABLE statements for standard CHECKSUM properties.
+# Live checksums are covered in checksum_table_live.test
+# 
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2;
+--enable_warnings
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb CHECKSUM=0;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b');
+
+CREATE TABLE t2 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb CHECKSUM=0;
+
+CHECKSUM TABLE t1; 
+CHECKSUM TABLE t2, t1;
+CHECKSUM TABLE t1, t2 QUICK;
+CHECKSUM TABLE t1, t2 EXTENDED;
+
+DROP TABLE t1, t2;
+
+
diff --git a/mysql-test/suite/rocksdb/checksum_table_live.result b/mysql-test/suite/rocksdb/checksum_table_live.result
new file mode 100644
index 0000000..fb86c0a
--- /dev/null
+++ b/mysql-test/suite/rocksdb/checksum_table_live.result
@@ -0,0 +1,20 @@
+DROP TABLE IF EXISTS t1,t2;
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb CHECKSUM=1;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b');
+CREATE TABLE t2 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb CHECKSUM=1;
+CHECKSUM TABLE t1;
+Table	Checksum
+test.t1	4259194219
+CHECKSUM TABLE t2, t1;
+Table	Checksum
+test.t2	0
+test.t1	4259194219
+CHECKSUM TABLE t1, t2 QUICK;
+Table	Checksum
+test.t1	NULL
+test.t2	NULL
+CHECKSUM TABLE t1, t2 EXTENDED;
+Table	Checksum
+test.t1	4259194219
+test.t2	0
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/rocksdb/checksum_table_live.test b/mysql-test/suite/rocksdb/checksum_table_live.test
new file mode 100644
index 0000000..bd69415
--- /dev/null
+++ b/mysql-test/suite/rocksdb/checksum_table_live.test
@@ -0,0 +1,22 @@
+# 
+# CHECKSUM TABLE statements for live CHECKSUM.
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2;
+--enable_warnings
+
+# For most engines CHECKSUM=1 option will be ignored,
+# and the results will be different
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb CHECKSUM=1;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b');
+CREATE TABLE t2 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb CHECKSUM=1;
+
+CHECKSUM TABLE t1; 
+CHECKSUM TABLE t2, t1;
+CHECKSUM TABLE t1, t2 QUICK;
+CHECKSUM TABLE t1, t2 EXTENDED;
+
+DROP TABLE t1, t2;
+
diff --git a/mysql-test/suite/rocksdb/col_not_null.inc b/mysql-test/suite/rocksdb/col_not_null.inc
new file mode 100644
index 0000000..2d3c929
--- /dev/null
+++ b/mysql-test/suite/rocksdb/col_not_null.inc
@@ -0,0 +1,55 @@
+#
+# NOT NULL attribute in columns
+#
+# Usage:
+# let $col_type = <column type>;
+# let $col_default = <default value for a column>;
+# --source col_not_null.inc
+#
+# We will add NOT NULL to the column options;
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+--echo #----------------------------------
+--echo # $col_type NOT NULL columns without a default
+--echo #----------------------------------
+
+eval CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c $col_type NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+
+--error ER_BAD_NULL_ERROR
+INSERT INTO t1 (c) VALUES (NULL);
+eval INSERT INTO t1 (c) VALUES ($col_default);
+SELECT HEX(c) FROM t1;
+
+DROP TABLE t1;
+
+--echo #----------------------------------
+--echo # $col_type NOT NULL columns with a default
+--echo #----------------------------------
+
+eval CREATE TABLE t1 (
+  pk INT AUTO_INCREMENT PRIMARY KEY,
+  c $col_type NOT NULL DEFAULT $col_default
+) ENGINE=rocksdb;
+
+SHOW COLUMNS IN t1;
+
+--error ER_INVALID_DEFAULT
+eval ALTER TABLE t1 ADD COLUMN err $col_type NOT NULL DEFAULT NULL;
+
+--error ER_BAD_NULL_ERROR
+INSERT INTO t1 (c) VALUES (NULL);
+
+eval INSERT INTO t1 (c) VALUES ($col_default);
+eval INSERT INTO t1 () VALUES ();
+
+# HEX should be universal for all column types
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+
+DROP TABLE t1;
+
+
diff --git a/mysql-test/suite/rocksdb/col_not_null_timestamp.inc b/mysql-test/suite/rocksdb/col_not_null_timestamp.inc
new file mode 100644
index 0000000..4c5b89c
--- /dev/null
+++ b/mysql-test/suite/rocksdb/col_not_null_timestamp.inc
@@ -0,0 +1,61 @@
+#
+# NOT NULL attribute in TIMESTAMP columns
+#
+# This is a copy of col_not_null.inc, except that 
+# instead of getting an error on inserting NULL into a non-NULL column,
+# we are getting the current timestamp (see MySQL:68472).
+# If the bug is ever fixed, this include file won't be needed anymore.
+
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+--echo #----------------------------------
+--echo # $col_type NOT NULL column without a default
+--echo #----------------------------------
+
+eval CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c $col_type NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+
+# Here where the non-standard behavior strikes: 
+# instead of an error we are getting the current timestamp
+
+# As of mysql-5.6.11, this no longer works, and we get an error:
+--error ER_BAD_NULL_ERROR
+INSERT INTO t1 (c) VALUES (NULL);
+eval INSERT INTO t1 (c) VALUES ($col_default);
+SELECT HEX(c) FROM t1;
+
+DROP TABLE t1;
+
+--echo #----------------------------------
+--echo # $col_type NOT NULL columns with a default
+--echo #----------------------------------
+
+eval CREATE TABLE t1 (
+  pk INT AUTO_INCREMENT PRIMARY KEY,
+  c $col_type NOT NULL DEFAULT $col_default
+) ENGINE=rocksdb;
+
+SHOW COLUMNS IN t1;
+
+--error ER_INVALID_DEFAULT
+eval ALTER TABLE t1 ADD COLUMN err $col_type NOT NULL DEFAULT NULL;
+
+# Here where the non-standard behavior strikes: 
+# instead of an error we are getting the current timestamp
+
+# As of mysql-5.6.11, this no longer works, and we get an error:
+--error ER_BAD_NULL_ERROR
+INSERT INTO t1 (c) VALUES (NULL);
+
+eval INSERT INTO t1 (c) VALUES ($col_default);
+eval INSERT INTO t1 () VALUES ();
+
+# HEX should be universal for all column types
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+
+DROP TABLE t1;
+
+
diff --git a/mysql-test/suite/rocksdb/col_null.inc b/mysql-test/suite/rocksdb/col_null.inc
new file mode 100644
index 0000000..39a239b
--- /dev/null
+++ b/mysql-test/suite/rocksdb/col_null.inc
@@ -0,0 +1,33 @@
+#
+# NULL attribute and DEFAULT NULL in columns
+#
+# Usage:
+# let $col_type = <column type>;
+# let $col_default = <default non-null value for a column>;
+# --source col_null.inc
+#
+# We will add NULL attribute to the column options.
+#
+
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+eval CREATE TABLE t1 (
+  c $col_type NULL,
+  c1 $col_type NULL DEFAULT NULL,
+  c2 $col_type NULL DEFAULT $col_default,
+  pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+
+SHOW COLUMNS IN t1;
+
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+eval INSERT INTO t1 (c,c1,c2) VALUES ($col_default,$col_default,$col_default);
+INSERT INTO t1 () VALUES ();
+
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/col_opt_default.result b/mysql-test/suite/rocksdb/col_opt_default.result
new file mode 100644
index 0000000..af53f06
--- /dev/null
+++ b/mysql-test/suite/rocksdb/col_opt_default.result
@@ -0,0 +1,20 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT PRIMARY KEY DEFAULT '0') ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+a	int(11)	NO	PRI	0	
+INSERT INTO t1 (a) VALUES (1);
+SELECT a FROM t1;
+a
+1
+ALTER TABLE t1 ADD COLUMN b CHAR(8) DEFAULT '';
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+a	int(11)	NO	PRI	0	
+b	char(8)	YES			
+INSERT INTO t1 (b) VALUES ('a');
+SELECT a,b FROM t1 ORDER BY a,b;
+a	b
+0	a
+1	
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/col_opt_default.test b/mysql-test/suite/rocksdb/col_opt_default.test
new file mode 100644
index 0000000..a026d04
--- /dev/null
+++ b/mysql-test/suite/rocksdb/col_opt_default.test
@@ -0,0 +1,25 @@
+# 
+# Check whether DEFAULT column attribute 
+# is supported in CREATE and ALTER TABLE.
+# If the attribute is supported at all, it will be covered
+# in more details in col_option_null and col_option_not_null tests.
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT PRIMARY KEY DEFAULT '0') ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+
+INSERT INTO t1 (a) VALUES (1);
+SELECT a FROM t1;
+
+ALTER TABLE t1 ADD COLUMN b CHAR(8) DEFAULT '';
+SHOW COLUMNS IN t1;
+
+INSERT INTO t1 (b) VALUES ('a');
+SELECT a,b FROM t1 ORDER BY a,b;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/col_opt_not_null.result b/mysql-test/suite/rocksdb/col_opt_not_null.result
new file mode 100644
index 0000000..005aa1e
--- /dev/null
+++ b/mysql-test/suite/rocksdb/col_opt_not_null.result
@@ -0,0 +1,2612 @@
+########################
+# BINARY columns
+########################
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+b BINARY NOT NULL,
+b0 BINARY(0) NOT NULL,
+b1 BINARY(1) NOT NULL,
+b20 BINARY(20) NOT NULL,
+b255 BINARY(255) NOT NULL,
+pk BINARY PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+b	binary(1)	NO		NULL	
+b0	binary(0)	NO		NULL	
+b1	binary(1)	NO		NULL	
+b20	binary(20)	NO		NULL	
+b255	binary(255)	NO		NULL	
+pk	binary(1)	NO	PRI	NULL	
+INSERT INTO t1 VALUES ('','','','','','');
+INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.','a');
+SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255), HEX(pk) FROM t1 ORDER BY pk;
+HEX(b)	HEX(b0)	HEX(b1)	HEX(b20)	HEX(b255)	HEX(pk)
+00		00	0000000000000000000000000000000000000000	000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000	00
+61		62	616263646566676869206B6C6D6E6F7071727374	4372656174696E6720616E2061727469636C6520666F7220746865204B6E6F776C65646765626173652069732073696D696C617220746F2061736B696E67207175657374696F6E732E2046697273742C206E6176696761746520746F207468652063617465676F727920776865726520796F75206665656C207468652061727469636C652073686F756C642062652E204F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C726561647920657869737420776869636820776F756C6420776F726B2E00000000000000000000000000000000000000000000000000000000000000	61
+INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256),'b');
+Warnings:
+Warning	1265	Data truncated for column 'b' at row 1
+Warning	1265	Data truncated for column 'b0' at row 1
+Warning	1265	Data truncated for column 'b1' at row 1
+Warning	1265	Data truncated for column 'b20' at row 1
+Warning	1265	Data truncated for column 'b255' at row 1
+INSERT INTO t1 SELECT b255, b255, b255, b255, CONCAT('a',b255,b255), 'c' FROM t1;
+ERROR 23000: Duplicate entry 'c' for key 'PRIMARY'
+SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255), HEX(pk) FROM t1 ORDER BY pk;
+HEX(b)	HEX(b0)	HEX(b1)	HEX(b20)	HEX(b255)	HEX(pk)
+00		00	0000000000000000000000000000000000000000	000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000	00
+61		61	6161616161616161616161616161616161616161	787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878	62
+61		62	616263646566676869206B6C6D6E6F7071727374	4372656174696E6720616E2061727469636C6520666F7220746865204B6E6F776C65646765626173652069732073696D696C617220746F2061736B696E67207175657374696F6E732E2046697273742C206E6176696761746520746F207468652063617465676F727920776865726520796F75206665656C207468652061727469636C652073686F756C642062652E204F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C726561647920657869737420776869636820776F756C6420776F726B2E00000000000000000000000000000000000000000000000000000000000000	61
+ALTER TABLE t1 ADD COLUMN b257 BINARY(257) NOT NULL;
+ERROR 42000: Column length too big for column 'b257' (max = 255); use BLOB or TEXT instead
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+b	binary(1)	NO		NULL	
+b0	binary(0)	NO		NULL	
+b1	binary(1)	NO		NULL	
+b20	binary(20)	NO		NULL	
+b255	binary(255)	NO		NULL	
+pk	binary(1)	NO	PRI	NULL	
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# BINARY NOT NULL columns without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c BINARY NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	binary(1)	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES (0);
+SELECT HEX(c) FROM t1;
+HEX(c)
+30
+DROP TABLE t1;
+#----------------------------------
+# BINARY NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c BINARY NOT NULL DEFAULT 0
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	binary(1)	NO		0	
+ALTER TABLE t1 ADD COLUMN err BINARY NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES (0);
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	30
+2	30
+DROP TABLE t1;
+########################
+# VARBINARY columns
+########################
+DROP TABLE IF EXISTS t1, t2;
+CREATE TABLE t1 (
+v0 VARBINARY(0) NOT NULL,
+v1 VARBINARY(1) NOT NULL,
+v64 VARBINARY(64) NOT NULL,
+v65000 VARBINARY(65000) NOT NULL,
+PRIMARY KEY (v64)
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+v0	varbinary(0)	NO		NULL	
+v1	varbinary(1)	NO		NULL	
+v64	varbinary(64)	NO	PRI	NULL	
+v65000	varbinary(65000)	NO		NULL	
+CREATE TABLE t2 (v VARBINARY(65532) NOT NULL, PRIMARY KEY(v(255))) ENGINE=rocksdb;
+SHOW COLUMNS IN t2;
+Field	Type	Null	Key	Default	Extra
+v	varbinary(65532)	NO	PRI	NULL	
+INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','','','');
+INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','y','Once there, double check that an article doesn\'t already exist','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off.
+
+  If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment.
+  For developers who want to code on MariaDB or MySQL
+
+      * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB.
+            o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB!
+            o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. 
+      * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings
+            o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! 
+
+  For MariaDB / MySQL end users
+
+      * MariaDB Crash Course by Ben Forta
+            o First MariaDB book!
+            o For people who want to learn SQL and the basics of MariaDB.
+            o Now shipping. Purchase at Amazon.com or your favorite bookseller. 
+
+      * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer.
+            o Everything you wanted to know about the SQL 99 standard. Excellent reference book!
+            o Free to read in the Knowledgebase! 
+
+      * MySQL (4th Edition) by Paul DuBois
+            o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. 
+
+      * MySQL Cookbook by Paul DuBois
+            o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. 
+
+      * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al.
+            o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) 
+
+      * MySQL Admin Cookbook
+            o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration 
+
+      * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen
+            o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. ');
+SELECT HEX(v0), HEX(v1), HEX(v64), HEX(v65000) FROM t1;
+HEX(v0)	HEX(v1)	HEX(v64)	HEX(v65000)
+			
+	79	4F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C7265616479206578697374	486572652069732061206C697374206F66207265636F6D6D656E64656420626F6F6B73206F6E204D61726961444220616E64204D7953514C2E2057652776652070726F7669646564206C696E6B7320746F20416D617A6F6E2E636F6D206865726520666F7220636F6E76656E69656E63652C2062757420746865792063616E20626520666F756E64206174206D616E79206F7468657220626F6F6B73746F7265732C20626F7468206F6E6C696E6520616E64206F66662E0A0A2020496620796F752077616E7420746F206861766520796F7572206661766F72697465204D7953514C202F204D61726961444220626F6F6B206C697374656420686572652C20706C65617365206C65617665206120636F6D6D656E742E0A2020466F7220646576656C6F706572732077686F2077616E7420746F20636F6465206F6E204D617269614442206F72204D7953514C0A0A2020202020202A20556E6465727374616E64696E67204D7953514C20496E7465726E616C73206279205361736861205061636865762C20666F726D6572204D7953514C20646576656C6F706572206174204D7953514C2041422E0A2020202020
 20202020
 2020206F205468697320697320746865206F6E6C7920626F6F6B207765206B6E6F772061626F75742074686174206465736372696265732074686520696E7465726E616C73206F66204D617269614442202F204D7953514C2E2041206D757374206861766520666F7220616E796F6E652077686F2077616E747320746F20756E6465727374616E6420616E6420646576656C6F70206F6E204D617269614442210A2020202020202020202020206F204E6F7420616C6C20746F706963732061726520636F766572656420616E6420736F6D652070617274732061726520736C696768746C79206F757464617465642C20627574207374696C6C20746865206265737420626F6F6B206F6E207468697320746F7069632E200A2020202020202A204D7953514C20352E3120506C7567696E20446576656C6F706D656E742062792053657267656920476F6C75626368696B20616E6420416E64726577204875746368696E67730A2020202020202020202020206F2041206D757374207265616420666F7220616E796F6E652077616E74696E6720746F207772697465206120706C7567696E20666F72204D6172696144422C207772697474656E20627920746865205365726765692077686F2064657369676E65642074686520706C7567696E20696E7465726661636520666F72204
 D7953514
 C20616E64204D61726961444221200A0A2020466F72204D617269614442202F204D7953514C20656E642075736572730A0A2020202020202A204D61726961444220437261736820436F757273652062792042656E20466F7274610A2020202020202020202020206F204669727374204D61726961444220626F6F6B210A2020202020202020202020206F20466F722070656F706C652077686F2077616E7420746F206C6561726E2053514C20616E642074686520626173696373206F66204D6172696144422E0A2020202020202020202020206F204E6F77207368697070696E672E20507572636861736520617420416D617A6F6E2E636F6D206F7220796F7572206661766F7269746520626F6F6B73656C6C65722E200A0A2020202020202A2053514C2D393920436F6D706C6574652C205265616C6C792062792050657465722047756C75747A616E20262054727564792050656C7A65722E0A2020202020202020202020206F2045766572797468696E6720796F752077616E74656420746F206B6E6F772061626F7574207468652053514C203939207374616E646172642E20457863656C6C656E74207265666572656E636520626F6F6B210A2020202020202020202020206F204672656520746F207265616420696E20746865204B6E6F776C656467656261736521200A
 0A202020
 2020202A204D7953514C20283474682045646974696F6E29206279205061756C204475426F69730A2020202020202020202020206F20546865202764656661756C742720626F6F6B20746F207265616420696620796F7520776F6E7420746F206C6561726E20746F20757365204D7953514C202F204D6172696144422E200A0A2020202020202A204D7953514C20436F6F6B626F6F6B206279205061756C204475426F69730A2020202020202020202020206F2041206C6F74206F66206578616D706C6573206F6620686F7720746F20757365204D7953514C2E204173207769746820616C6C206F66205061756C277320626F6F6B732C206974277320776F727468206974732077656967687420696E20676F6C6420616E64206576656E20656E6A6F7961626C652072656164696E6720666F7220737563682061202764727927207375626A6563742E200A0A2020202020202A204869676820506572666F726D616E6365204D7953514C2C205365636F6E642045646974696F6E2C204279204261726F6E20536368776172747A2C205065746572205A6169747365762C20566164696D20546B616368656E6B6F2C204A6572656D7920442E205A61776F646E792C2041726A656E204C656E747A2C20446572656B204A2E2042616C6C696E672C20657420616C2E0A20202020202
 02020202
 020206F20224869676820506572666F726D616E6365204D7953514C2069732074686520646566696E697469766520677569646520746F206275696C64696E6720666173742C2072656C6961626C652073797374656D732077697468204D7953514C2E205772697474656E206279206E6F74656420657870657274732077697468207965617273206F66207265616C2D776F726C6420657870657269656E6365206275696C64696E672076657279206C617267652073797374656D732C207468697320626F6F6B20636F7665727320657665727920617370656374206F66204D7953514C20706572666F726D616E636520696E2064657461696C2C20616E6420666F6375736573206F6E20726F627573746E6573732C2073656375726974792C20616E64206461746120696E746567726974792E204C6561726E20616476616E63656420746563686E697175657320696E20646570746820736F20796F752063616E206272696E67206F7574204D7953514C27732066756C6C20706F7765722E22202846726F6D2074686520626F6F6B206465736372697074696F6E206174204F275265696C6C7929200A0A2020202020202A204D7953514C2041646D696E20436F6F6B626F6F6B0A2020202020202020202020206F204120717569636B20737465702D62792D7374657020677569
 64652066
 6F72204D7953514C20757365727320616E642064617461626173652061646D696E6973747261746F727320746F207461636B6C65207265616C2D776F726C64206368616C6C656E6765732077697468204D7953514C20636F6E66696775726174696F6E20616E642061646D696E697374726174696F6E200A0A2020202020202A204D7953514C20352E302043657274696669636174696F6E2053747564792047756964652C204279205061756C204475426F69732C2053746566616E2048696E7A2C204361727374656E20506564657273656E0A2020202020202020202020206F205468697320697320746865206F6666696369616C20677569646520746F20636F766572207468652070617373696E67206F66207468652074776F204D7953514C2043657274696669636174696F6E206578616D696E6174696F6E732E2049742069732076616C69642074696C6C2076657273696F6E20352E30206F6620746865207365727665722C20736F207768696C65206974206D697373657320616C6C2074686520666561747572657320617661696C61626C6520696E204D7953514C20352E3120616E6420677265617465722028696E636C7564696E67204D61726961444220352E3120616E642067726561746572292C2069742070726F7669646573206120676F6F6420626173696
 320756E6
 465727374616E64696E67206F66204D7953514C20666F722074686520656E642D757365722E20
+INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('y', 'yy', REPEAT('c',65), REPEAT('abcdefghi ',6501));
+Warnings:
+Warning	1265	Data truncated for column 'v0' at row 1
+Warning	1265	Data truncated for column 'v1' at row 1
+Warning	1265	Data truncated for column 'v64' at row 1
+Warning	1265	Data truncated for column 'v65000' at row 1
+INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, CONCAT('a',v65000), CONCAT(v65000,v1) FROM t1;
+Warnings:
+Warning	1265	Data truncated for column 'v0' at row 5
+Warning	1265	Data truncated for column 'v1' at row 5
+Warning	1265	Data truncated for column 'v64' at row 5
+Warning	1265	Data truncated for column 'v0' at row 6
+Warning	1265	Data truncated for column 'v1' at row 6
+Warning	1265	Data truncated for column 'v64' at row 6
+Warning	1265	Data truncated for column 'v65000' at row 6
+SELECT HEX(v0), HEX(v1), HEX(v64), LENGTH(HEX(v65000)) FROM t1;
+HEX(v0)	HEX(v1)	HEX(v64)	LENGTH(HEX(v65000))
+			0
+		61	0
+	48	61486572652069732061206C697374206F66207265636F6D6D656E64656420626F6F6B73206F6E204D61726961444220616E64204D7953514C2E205765277665	5932
+	61	61616263646566676869206162636465666768692061626364656667686920616263646566676869206162636465666768692061626364656667686920616263	130000
+	79	4F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C7265616479206578697374	5930
+	79	63636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363	130000
+ALTER TABLE t1 ADD COLUMN v65536 VARBINARY(65536) NOT NULL;
+Warnings:
+Note	1246	Converting column 'v65536' from VARBINARY to BLOB
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+v0	varbinary(0)	NO		NULL	
+v1	varbinary(1)	NO		NULL	
+v64	varbinary(64)	NO	PRI	NULL	
+v65000	varbinary(65000)	NO		NULL	
+v65536	mediumblob	NO		NULL	
+DROP TABLE t1, t2;
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# VARBINARY(64) NOT NULL columns without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c VARBINARY(64) NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	varbinary(64)	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('test');
+SELECT HEX(c) FROM t1;
+HEX(c)
+74657374
+DROP TABLE t1;
+#----------------------------------
+# VARBINARY(64) NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c VARBINARY(64) NOT NULL DEFAULT 'test'
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	varbinary(64)	NO		test	
+ALTER TABLE t1 ADD COLUMN err VARBINARY(64) NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('test');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	74657374
+2	74657374
+DROP TABLE t1;
+########################
+# BIT columns
+########################
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+a BIT NOT NULL,
+b BIT(20) NOT NULL,
+c BIT(64) NOT NULL,
+d BIT(1) NOT NULL,
+PRIMARY KEY (c)
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+a	bit(1)	NO		NULL	
+b	bit(20)	NO		NULL	
+c	bit(64)	NO	PRI	NULL	
+d	bit(1)	NO		NULL	
+ALTER TABLE t1 DROP COLUMN d;
+ALTER TABLE t1 ADD COLUMN d BIT(0) NOT NULL;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+a	bit(1)	NO		NULL	
+b	bit(20)	NO		NULL	
+c	bit(64)	NO	PRI	NULL	
+d	bit(1)	NO		NULL	
+INSERT INTO t1 (a,b,c,d) VALUES (0,POW(2,20)-1,b'1111111111111111111111111111111111111111111111111111111111111111',1);
+SELECT BIN(a), HEX(b), c+0 FROM t1 WHERE d>0;
+BIN(a)	HEX(b)	c+0
+0	FFFFF	18446744073709551615
+INSERT INTO t1 (a,b,c,d) VALUES (1,0,-2,0);
+SELECT a+0, b+0, c+0 FROM t1 WHERE d<100;
+a+0	b+0	c+0
+0	1048575	18446744073709551615
+1	0	18446744073709551614
+INSERT INTO t1 (a,b,c,d) VALUES (b'1', 'f', 0xFF, 0x0);
+SELECT a+0, b+0, c+0 FROM t1 WHERE d IN (0, 2);
+a+0	b+0	c+0
+1	0	18446744073709551614
+1	102	255
+DELETE FROM t1;
+INSERT INTO t1 (a,b,c,d) VALUES (0x10,0,0,1);
+Warnings:
+Warning	1264	Out of range value for column 'a' at row 1
+SELECT a+0,b+0,c+0,d+0 FROM t1;
+a+0	b+0	c+0	d+0
+1	0	0	1
+INSERT INTO t1 (a,b,c,d) VALUES (0x01,0,0x10000000000000000,0);
+Warnings:
+Warning	1264	Out of range value for column 'c' at row 1
+SELECT a+0,b+0,c+0,d+0 FROM t1;
+a+0	b+0	c+0	d+0
+1	0	0	1
+1	0	18446744073709551615	0
+DROP TABLE t1;
+CREATE TABLE t1 (pk INT PRIMARY KEY, a BIT(65) NOT NULL) ENGINE=rocksdb;
+ERROR 42000: Display width out of range for column 'a' (max = 64)
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# BIT NOT NULL columns without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c BIT NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	bit(1)	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES (1);
+SELECT HEX(c) FROM t1;
+HEX(c)
+1
+DROP TABLE t1;
+#----------------------------------
+# BIT NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c BIT NOT NULL DEFAULT 1
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	bit(1)	NO		b'1'	
+ALTER TABLE t1 ADD COLUMN err BIT NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES (1);
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	1
+2	1
+DROP TABLE t1;
+########################
+# BLOB columns
+########################
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+b BLOB NOT NULL,
+b0 BLOB(0) NOT NULL,
+b1 BLOB(1) NOT NULL,
+b300 BLOB(300) NOT NULL,
+bm BLOB(65535) NOT NULL,
+b70k BLOB(70000) NOT NULL,
+b17m BLOB(17000000) NOT NULL,
+t TINYBLOB NOT NULL,
+m MEDIUMBLOB NOT NULL,
+l LONGBLOB NOT NULL
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+b	blob	NO		NULL	
+b0	blob	NO		NULL	
+b1	tinyblob	NO		NULL	
+b300	blob	NO		NULL	
+bm	blob	NO		NULL	
+b70k	mediumblob	NO		NULL	
+b17m	longblob	NO		NULL	
+t	tinyblob	NO		NULL	
+m	mediumblob	NO		NULL	
+l	longblob	NO		NULL	
+INSERT INTO t1 (b,b0,b1,b300,bm,b70k,b17m,t,m,l) VALUES
+('','','','','','','','','',''),
+('a','b','c','d','e','f','g','h','i','j'),
+('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'),
+( REPEAT('a',65535), REPEAT('b',65535), REPEAT('c',255), REPEAT('d',65535), REPEAT('e',65535), REPEAT('f',1048576), HEX(REPEAT('g',1048576)), REPEAT('h',255), REPEAT('i',1048576), HEX(REPEAT('j',1048576)) );
+SELECT LENGTH(b), LENGTH(b0), LENGTH(b1), LENGTH(b300), LENGTH(bm), LENGTH(b70k), LENGTH(b17m), LENGTH(t), LENGTH(m), LENGTH(l) FROM t1;
+LENGTH(b)	LENGTH(b0)	LENGTH(b1)	LENGTH(b300)	LENGTH(bm)	LENGTH(b70k)	LENGTH(b17m)	LENGTH(t)	LENGTH(m)	LENGTH(l)
+0	0	0	0	0	0	0	0	0	0
+1	1	1	1	1	1	1	1	1	1
+5	5	5	5	5	5	5	5	5	6
+65535	65535	255	65535	65535	1048576	2097152	255	1048576	2097152
+INSERT INTO t1 (b,b0,b1,b300,bm,b70k,b17m,t,m,l) VALUES
+( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) );
+Warnings:
+Warning	1265	Data truncated for column 'b' at row 1
+Warning	1265	Data truncated for column 'b0' at row 1
+Warning	1265	Data truncated for column 'b1' at row 1
+Warning	1265	Data truncated for column 'b300' at row 1
+Warning	1265	Data truncated for column 'bm' at row 1
+Warning	1265	Data truncated for column 't' at row 1
+SELECT LENGTH(b), LENGTH(b0), LENGTH(b1), LENGTH(b300), LENGTH(bm), LENGTH(b70k), LENGTH(b17m), LENGTH(t), LENGTH(m), LENGTH(l) FROM t1;
+LENGTH(b)	LENGTH(b0)	LENGTH(b1)	LENGTH(b300)	LENGTH(bm)	LENGTH(b70k)	LENGTH(b17m)	LENGTH(t)	LENGTH(m)	LENGTH(l)
+0	0	0	0	0	0	0	0	0	0
+1	1	1	1	1	1	1	1	1	1
+5	5	5	5	5	5	5	5	5	6
+65535	65535	255	65535	65535	1048576	1048576	255	1048576	1048576
+65535	65535	255	65535	65535	1048576	2097152	255	1048576	2097152
+ALTER TABLE t1 ADD COLUMN bbb BLOB(4294967296);
+ERROR 42000: Display width out of range for column 'bbb' (max = 4294967295)
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# BLOB NOT NULL columns without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c BLOB NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	blob	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('');
+SELECT HEX(c) FROM t1;
+HEX(c)
+
+DROP TABLE t1;
+#----------------------------------
+# BLOB NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c BLOB NOT NULL DEFAULT ''
+) ENGINE=rocksdb;
+Warnings:
+Warning	1101	BLOB/TEXT column 'c' can't have a default value
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	blob	NO		NULL	
+ALTER TABLE t1 ADD COLUMN err BLOB NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	
+2	
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# TINYBLOB NOT NULL columns without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c TINYBLOB NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	tinyblob	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('');
+SELECT HEX(c) FROM t1;
+HEX(c)
+
+DROP TABLE t1;
+#----------------------------------
+# TINYBLOB NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c TINYBLOB NOT NULL DEFAULT ''
+) ENGINE=rocksdb;
+Warnings:
+Warning	1101	BLOB/TEXT column 'c' can't have a default value
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	tinyblob	NO		NULL	
+ALTER TABLE t1 ADD COLUMN err TINYBLOB NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	
+2	
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# MEDIUMBLOB NOT NULL columns without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c MEDIUMBLOB NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	mediumblob	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('');
+SELECT HEX(c) FROM t1;
+HEX(c)
+
+DROP TABLE t1;
+#----------------------------------
+# MEDIUMBLOB NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c MEDIUMBLOB NOT NULL DEFAULT ''
+) ENGINE=rocksdb;
+Warnings:
+Warning	1101	BLOB/TEXT column 'c' can't have a default value
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	mediumblob	NO		NULL	
+ALTER TABLE t1 ADD COLUMN err MEDIUMBLOB NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	
+2	
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# LONGBLOB NOT NULL columns without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c LONGBLOB NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	longblob	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('');
+SELECT HEX(c) FROM t1;
+HEX(c)
+
+DROP TABLE t1;
+#----------------------------------
+# LONGBLOB NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c LONGBLOB NOT NULL DEFAULT ''
+) ENGINE=rocksdb;
+Warnings:
+Warning	1101	BLOB/TEXT column 'c' can't have a default value
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	longblob	NO		NULL	
+ALTER TABLE t1 ADD COLUMN err LONGBLOB NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	
+2	
+DROP TABLE t1;
+########################
+# BOOL columns
+########################
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+b1 BOOL NOT NULL,
+b2 BOOLEAN NOT NULL
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+b1	tinyint(1)	NO		NULL	
+b2	tinyint(1)	NO		NULL	
+INSERT INTO t1 (b1,b2) VALUES (1,TRUE);
+SELECT b1,b2 FROM t1;
+b1	b2
+1	1
+INSERT INTO t1 (b1,b2) VALUES (FALSE,0);
+SELECT b1,b2 FROM t1;
+b1	b2
+0	0
+1	1
+INSERT INTO t1 (b1,b2) VALUES (2,3);
+SELECT b1,b2 FROM t1;
+b1	b2
+0	0
+1	1
+2	3
+INSERT INTO t1 (b1,b2) VALUES (-1,-2);
+SELECT b1,b2 FROM t1;
+b1	b2
+-1	-2
+0	0
+1	1
+2	3
+SELECT IF(b1,'true','false') AS a, IF(b2,'true','false') AS b FROM t1;
+a	b
+false	false
+true	true
+true	true
+true	true
+SELECT b1,b2 FROM t1 WHERE b1 = TRUE;
+b1	b2
+1	1
+SELECT b1,b2 FROM t1 WHERE b2 = FALSE;
+b1	b2
+0	0
+INSERT INTO t1 (b1,b2) VALUES ('a','b');
+Warnings:
+Warning	1366	Incorrect integer value: 'a' for column 'b1' at row 1
+Warning	1366	Incorrect integer value: 'b' for column 'b2' at row 1
+SELECT b1,b2 FROM t1;
+b1	b2
+-1	-2
+0	0
+0	0
+1	1
+2	3
+INSERT INTO t1 (b1,b2) VALUES (128,-129);
+Warnings:
+Warning	1264	Out of range value for column 'b1' at row 1
+Warning	1264	Out of range value for column 'b2' at row 1
+SELECT b1,b2 FROM t1;
+b1	b2
+-1	-2
+0	0
+0	0
+1	1
+127	-128
+2	3
+ALTER TABLE t1 ADD COLUMN b3 BOOLEAN UNSIGNED NOT NULL;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNSIGNED NOT NULL' at line 1
+ALTER TABLE ADD COLUMN b3 BOOL ZEROFILL NOT NULL;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ADD COLUMN b3 BOOL ZEROFILL NOT NULL' at line 1
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# BOOL NOT NULL columns without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c BOOL NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	tinyint(1)	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('0');
+SELECT HEX(c) FROM t1;
+HEX(c)
+0
+DROP TABLE t1;
+#----------------------------------
+# BOOL NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c BOOL NOT NULL DEFAULT '0'
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	tinyint(1)	NO		0	
+ALTER TABLE t1 ADD COLUMN err BOOL NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('0');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	0
+2	0
+DROP TABLE t1;
+########################
+# CHAR columns
+########################
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c CHAR NOT NULL,
+c0 CHAR(0) NOT NULL,
+c1 CHAR(1) NOT NULL,
+c20 CHAR(20) NOT NULL,
+c255 CHAR(255) NOT NULL,
+PRIMARY KEY (c255)
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	char(1)	NO		NULL	
+c0	char(0)	NO		NULL	
+c1	char(1)	NO		NULL	
+c20	char(20)	NO		NULL	
+c255	char(255)	NO	PRI	NULL	
+INSERT INTO t1 (c,c0,c1,c20,c255) VALUES ('','','','','');
+INSERT INTO t1 (c,c0,c1,c20,c255) VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.');
+SELECT c,c0,c1,c20,c255 FROM t1;
+c	c0	c1	c20	c255
+				
+a		b	abcdefghi klmnopqrst	Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work.
+INSERT INTO t1 (c,c0,c1,c20,c255) VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256));
+Warnings:
+Warning	1265	Data truncated for column 'c' at row 1
+Warning	1265	Data truncated for column 'c0' at row 1
+Warning	1265	Data truncated for column 'c1' at row 1
+Warning	1265	Data truncated for column 'c20' at row 1
+Warning	1265	Data truncated for column 'c255' at row 1
+INSERT INTO t1 (c,c0,c1,c20,c255) SELECT c255, c255, c255, c255, CONCAT('a',c255,c1) FROM t1;
+Warnings:
+Warning	1265	Data truncated for column 'c' at row 5
+Warning	1265	Data truncated for column 'c0' at row 5
+Warning	1265	Data truncated for column 'c1' at row 5
+Warning	1265	Data truncated for column 'c20' at row 5
+Warning	1265	Data truncated for column 'c' at row 6
+Warning	1265	Data truncated for column 'c0' at row 6
+Warning	1265	Data truncated for column 'c1' at row 6
+Warning	1265	Data truncated for column 'c20' at row 6
+Warning	1265	Data truncated for column 'c255' at row 6
+SELECT c,c0,c1,c20,c255 FROM t1;
+c	c0	c1	c20	c255
+				
+				a
+C		C	Creating an article	aCreating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work.b
+a		a	aaaaaaaaaaaaaaaaaaaa	xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+a		b	abcdefghi klmnopqrst	Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work.
+x		x	xxxxxxxxxxxxxxxxxxxx	axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+SELECT DISTINCT c20, REPEAT('a',LENGTH(c20)), COUNT(*) FROM t1 GROUP BY c1, c20;
+c20	REPEAT('a',LENGTH(c20))	COUNT(*)
+		2
+Creating an article	aaaaaaaaaaaaaaaaaaa	1
+aaaaaaaaaaaaaaaaaaaa	aaaaaaaaaaaaaaaaaaaa	1
+abcdefghi klmnopqrst	aaaaaaaaaaaaaaaaaaaa	1
+xxxxxxxxxxxxxxxxxxxx	aaaaaaaaaaaaaaaaaaaa	1
+ALTER TABLE t1 ADD COLUMN c257 CHAR(257) NOT NULL;
+ERROR 42000: Column length too big for column 'c257' (max = 255); use BLOB or TEXT instead
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# CHAR NOT NULL columns without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c CHAR NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	char(1)	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('_');
+SELECT HEX(c) FROM t1;
+HEX(c)
+5F
+DROP TABLE t1;
+#----------------------------------
+# CHAR NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c CHAR NOT NULL DEFAULT '_'
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	char(1)	NO		_	
+ALTER TABLE t1 ADD COLUMN err CHAR NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('_');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	5F
+2	5F
+DROP TABLE t1;
+########################
+# VARCHAR columns
+########################
+DROP TABLE IF EXISTS t1, t2;
+CREATE TABLE t1 (
+v0 VARCHAR(0) NOT NULL,
+v1 VARCHAR(1) NOT NULL,
+v64 VARCHAR(64) NOT NULL,
+v65000 VARCHAR(65000) NOT NULL,
+PRIMARY KEY (v64)
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+v0	varchar(0)	NO		NULL	
+v1	varchar(1)	NO		NULL	
+v64	varchar(64)	NO	PRI	NULL	
+v65000	varchar(65000)	NO		NULL	
+CREATE TABLE t2 (v VARCHAR(65532), PRIMARY KEY (v(255))) ENGINE=rocksdb;
+SHOW COLUMNS IN t2;
+Field	Type	Null	Key	Default	Extra
+v	varchar(65532)	NO	PRI		
+INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','','','');
+INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','y','Once there, double check that an article doesn\'t already exist','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off.
+
+  If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment.
+  For developers who want to code on MariaDB or MySQL
+
+      * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB.
+            o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB!
+            o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. 
+      * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings
+            o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! 
+
+  For MariaDB / MySQL end users
+
+      * MariaDB Crash Course by Ben Forta
+            o First MariaDB book!
+            o For people who want to learn SQL and the basics of MariaDB.
+            o Now shipping. Purchase at Amazon.com or your favorite bookseller. 
+
+      * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer.
+            o Everything you wanted to know about the SQL 99 standard. Excellent reference book!
+            o Free to read in the Knowledgebase! 
+
+      * MySQL (4th Edition) by Paul DuBois
+            o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. 
+
+      * MySQL Cookbook by Paul DuBois
+            o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. 
+
+      * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al.
+            o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) 
+
+      * MySQL Admin Cookbook
+            o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration 
+
+      * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen
+            o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. ');
+SELECT v0,v1,v64,v65000 FROM t1;
+v0	v1	v64	v65000
+
+
+
+
+
+
+
+
+
+
+			
+	y	Once there, double check that an article doesn't already exist	Here is a list of recommended books on MariaDB and MySQL. We've provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off.
+            o "High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL's full power." (From the book description at O'Reilly) 
+            o A lot of examples of how to use MySQL. As with all of Paul's books, it's worth its weight in gold and even enjoyable reading for such a 'dry' subject. 
+            o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! 
+            o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration 
+            o Everything you wanted to know about the SQL 99 standard. Excellent reference book!
+            o First MariaDB book!
+            o For people who want to learn SQL and the basics of MariaDB.
+            o Free to read in the Knowledgebase! 
+            o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. 
+            o Now shipping. Purchase at Amazon.com or your favorite bookseller. 
+            o The 'default' book to read if you wont to learn to use MySQL / MariaDB. 
+            o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. 
+            o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB!
+      * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al.
+      * MariaDB Crash Course by Ben Forta
+      * MySQL (4th Edition) by Paul DuBois
+      * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen
+      * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings
+      * MySQL Admin Cookbook
+      * MySQL Cookbook by Paul DuBois
+      * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer.
+      * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB.
+  For MariaDB / MySQL end users
+  For developers who want to code on MariaDB or MySQL
+  If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment.
+INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('y', 'yy', REPEAT('c',65), REPEAT('abcdefghi ',6501));
+Warnings:
+Warning	1265	Data truncated for column 'v0' at row 1
+Warning	1265	Data truncated for column 'v1' at row 1
+Warning	1265	Data truncated for column 'v64' at row 1
+Warning	1265	Data truncated for column 'v65000' at row 1
+INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, CONCAT('a',v65000), CONCAT(v65000,v1) FROM t1;
+Warnings:
+Warning	1265	Data truncated for column 'v0' at row 5
+Warning	1265	Data truncated for column 'v1' at row 5
+Warning	1265	Data truncated for column 'v64' at row 5
+Warning	1265	Data truncated for column 'v65000' at row 5
+Warning	1265	Data truncated for column 'v0' at row 6
+Warning	1265	Data truncated for column 'v1' at row 6
+Warning	1265	Data truncated for column 'v64' at row 6
+SELECT v0, v1, v64, LENGTH(v65000) FROM t1;
+v0	v1	v64	LENGTH(v65000)
+			0
+		a	0
+	H	aHere is a list of recommended books on MariaDB and MySQL. We've	2966
+	a	aabcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abc	65000
+	y	Once there, double check that an article doesn't already exist	2965
+	y	cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc	65000
+ALTER TABLE t1 ADD COLUMN v65536 VARCHAR(65536) NOT NULL;
+Warnings:
+Note	1246	Converting column 'v65536' from VARCHAR to TEXT
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+v0	varchar(0)	NO		NULL	
+v1	varchar(1)	NO		NULL	
+v64	varchar(64)	NO	PRI	NULL	
+v65000	varchar(65000)	NO		NULL	
+v65536	mediumtext	NO		NULL	
+DROP TABLE t1, t2;
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# VARCHAR(64) NOT NULL columns without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c VARCHAR(64) NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	varchar(64)	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('test default');
+SELECT HEX(c) FROM t1;
+HEX(c)
+746573742064656661756C74
+DROP TABLE t1;
+#----------------------------------
+# VARCHAR(64) NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c VARCHAR(64) NOT NULL DEFAULT 'test default'
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	varchar(64)	NO		test default	
+ALTER TABLE t1 ADD COLUMN err VARCHAR(64) NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('test default');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	746573742064656661756C74
+2	746573742064656661756C74
+DROP TABLE t1;
+########################
+# date and time columns
+########################
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+d DATE NOT NULL,
+dt DATETIME NOT NULL,
+ts TIMESTAMP NOT NULL,
+t TIME NOT NULL,
+y YEAR NOT NULL,
+y4 YEAR(4) NOT NULL,
+y2 YEAR(2) NOT NULL,
+pk DATETIME PRIMARY KEY
+) ENGINE=rocksdb;
+Warnings:
+Warning	1818	YEAR(2) column type is deprecated. Creating YEAR(4) column instead.
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+d	date	NO		NULL	
+dt	datetime	NO		NULL	
+ts	timestamp	NO		NULL	
+t	time	NO		NULL	
+y	year(4)	NO		NULL	
+y4	year(4)	NO		NULL	
+y2	year(4)	NO		NULL	
+pk	datetime	NO	PRI	NULL	
+SET @tm = '2012-04-09 05:27:00';
+INSERT INTO t1 (d,dt,ts,t,y,y4,y2,pk) VALUES
+('1000-01-01', '1000-01-01 00:00:00', FROM_UNIXTIME(1), '-838:59:59', '1901', '1901', '00','2012-12-12 12:12:12'),
+('9999-12-31', '9999-12-31 23:59:59', FROM_UNIXTIME(2147483647), '838:59:59', '2155', '2155', '99','2012-12-12 12:12:13'),
+('0000-00-00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:00:00', '0', '0', '0','2012-12-12 12:12:14'),
+(DATE(@tm), at tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm),YEAR(@tm),YEAR(@tm),'2012-12-12 12:12:15');
+SELECT d,dt,ts,t,y,y4,y2 FROM t1;
+d	dt	ts	t	y	y4	y2
+0000-00-00	0000-00-00 00:00:00	0000-00-00 00:00:00	00:00:00	2000	2000	2000
+1000-01-01	1000-01-01 00:00:00	1970-01-01 03:00:01	-838:59:59	1901	1901	2000
+2012-04-09	2012-04-09 05:27:00	2012-04-09 05:27:00	05:27:00	2012	2012	2012
+9999-12-31	9999-12-31 23:59:59	2038-01-19 06:14:07	838:59:59	2155	2155	1999
+INSERT INTO t1 (d,dt,ts,t,y,y4,y2,pk) VALUES
+('999-13-32', '999-11-31 00:00:00', '0', '-839:00:00', '1900', '1900', '-1','2012-12-12 12:12:16');
+Warnings:
+Warning	1265	Data truncated for column 'd' at row 1
+Warning	1264	Out of range value for column 'dt' at row 1
+Warning	1264	Out of range value for column 'ts' at row 1
+Warning	1264	Out of range value for column 't' at row 1
+Warning	1264	Out of range value for column 'y' at row 1
+Warning	1264	Out of range value for column 'y4' at row 1
+Warning	1264	Out of range value for column 'y2' at row 1
+SELECT d,dt,ts,t,y,y4,y2 FROM t1;
+d	dt	ts	t	y	y4	y2
+1000-01-01	1000-01-01 00:00:00	1970-01-01 03:00:01	-838:59:59	1901	1901	2000
+9999-12-31	9999-12-31 23:59:59	2038-01-19 06:14:07	838:59:59	2155	2155	1999
+0000-00-00	0000-00-00 00:00:00	0000-00-00 00:00:00	00:00:00	2000	2000	2000
+2012-04-09	2012-04-09 05:27:00	2012-04-09 05:27:00	05:27:00	2012	2012	2012
+0000-00-00	0000-00-00 00:00:00	0000-00-00 00:00:00	-838:59:59	0000	0000	0000
+DROP TABLE t1;
+SET TIMESTAMP=UNIX_TIMESTAMP('2013-12-12 12:12:12');
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# DATE NOT NULL columns without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c DATE NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	date	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('2012-12-21');
+SELECT HEX(c) FROM t1;
+HEX(c)
+323031322D31322D3231
+DROP TABLE t1;
+#----------------------------------
+# DATE NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c DATE NOT NULL DEFAULT '2012-12-21'
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	date	NO		2012-12-21	
+ALTER TABLE t1 ADD COLUMN err DATE NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('2012-12-21');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	323031322D31322D3231
+2	323031322D31322D3231
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# DATETIME NOT NULL columns without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c DATETIME NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	datetime	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('2012-12-21 12:21:12');
+SELECT HEX(c) FROM t1;
+HEX(c)
+323031322D31322D32312031323A32313A3132
+DROP TABLE t1;
+#----------------------------------
+# DATETIME NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c DATETIME NOT NULL DEFAULT '2012-12-21 12:21:12'
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	datetime	NO		2012-12-21 12:21:12	
+ALTER TABLE t1 ADD COLUMN err DATETIME NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('2012-12-21 12:21:12');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	323031322D31322D32312031323A32313A3132
+2	323031322D31322D32312031323A32313A3132
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# TIMESTAMP NOT NULL column without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c TIMESTAMP NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	timestamp	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('2012-12-21 12:21:12');
+SELECT HEX(c) FROM t1;
+HEX(c)
+323031322D31322D32312031323A32313A3132
+DROP TABLE t1;
+#----------------------------------
+# TIMESTAMP NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c TIMESTAMP NOT NULL DEFAULT '2012-12-21 12:21:12'
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	timestamp	NO		2012-12-21 12:21:12	
+ALTER TABLE t1 ADD COLUMN err TIMESTAMP NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('2012-12-21 12:21:12');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	323031322D31322D32312031323A32313A3132
+2	323031322D31322D32312031323A32313A3132
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# TIME NOT NULL columns without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c TIME NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	time	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('12:21:12');
+SELECT HEX(c) FROM t1;
+HEX(c)
+31323A32313A3132
+DROP TABLE t1;
+#----------------------------------
+# TIME NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c TIME NOT NULL DEFAULT '12:21:12'
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	time	NO		12:21:12	
+ALTER TABLE t1 ADD COLUMN err TIME NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('12:21:12');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	31323A32313A3132
+2	31323A32313A3132
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# YEAR NOT NULL columns without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c YEAR NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	year(4)	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('2012');
+SELECT HEX(c) FROM t1;
+HEX(c)
+7DC
+DROP TABLE t1;
+#----------------------------------
+# YEAR NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c YEAR NOT NULL DEFAULT '2012'
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	year(4)	NO		2012	
+ALTER TABLE t1 ADD COLUMN err YEAR NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('2012');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	7DC
+2	7DC
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# YEAR(2) NOT NULL columns without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c YEAR(2) NOT NULL) ENGINE=rocksdb;
+Warnings:
+Warning	1818	YEAR(2) column type is deprecated. Creating YEAR(4) column instead.
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	year(4)	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('12');
+SELECT HEX(c) FROM t1;
+HEX(c)
+7DC
+DROP TABLE t1;
+#----------------------------------
+# YEAR(2) NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c YEAR(2) NOT NULL DEFAULT '12'
+) ENGINE=rocksdb;
+Warnings:
+Warning	1818	YEAR(2) column type is deprecated. Creating YEAR(4) column instead.
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	year(4)	NO		2012	
+ALTER TABLE t1 ADD COLUMN err YEAR(2) NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('12');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	7DC
+2	7DC
+DROP TABLE t1;
+########################
+# ENUM columns
+########################
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+a ENUM('') NOT NULL,
+b ENUM('test1','test2','test3','test4','test5') NOT NULL,
+c ENUM('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',' ','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o
 ','5p','
 5q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75') NOT NULL,
+PRIMARY KEY (b)
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+a	enum('')	NO		NULL	
+b	enum('test1','test2','test3','test4','test5')	NO	PRI	NULL	
+c	enum('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o'
 ,'5p','5
 q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75')	NO		NULL	
+INSERT INTO t1 (a,b,c) VALUES ('','test2','4'),('',5,2);
+SELECT a,b,c FROM t1;
+a	b	c
+	test2	4
+	test5	2
+INSERT INTO t1 (a,b,c) VALUES (0,'test6',-1);
+Warnings:
+Warning	1265	Data truncated for column 'a' at row 1
+Warning	1265	Data truncated for column 'b' at row 1
+Warning	1265	Data truncated for column 'c' at row 1
+SELECT a,b,c FROM t1;
+a	b	c
+		
+	test2	4
+	test5	2
+ALTER TABLE t1 ADD COLUMN e ENUM('a','A') NOT NULL;
+Warnings:
+Note	1291	Column 'e' has duplicated value 'a' in ENUM
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+a	enum('')	NO		NULL	
+b	enum('test1','test2','test3','test4','test5')	NO	PRI	NULL	
+c	enum('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o'
 ,'5p','5
 q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75')	NO		NULL	
+e	enum('a','A')	NO		NULL	
+INSERT INTO t1 (a,b,c,e) VALUES ('','test3','75','A');
+SELECT a,b,c,e FROM t1;
+a	b	c	e
+			a
+	test2	4	a
+	test3	75	a
+	test5	2	a
+SELECT a,b,c,e FROM t1 WHERE b='test2' OR a != '';
+a	b	c	e
+	test2	4	a
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# ENUM('test1','test2','test3') NOT NULL columns without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c ENUM('test1','test2','test3') NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	enum('test1','test2','test3')	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('test2');
+SELECT HEX(c) FROM t1;
+HEX(c)
+7465737432
+DROP TABLE t1;
+#----------------------------------
+# ENUM('test1','test2','test3') NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c ENUM('test1','test2','test3') NOT NULL DEFAULT 'test2'
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	enum('test1','test2','test3')	NO		test2	
+ALTER TABLE t1 ADD COLUMN err ENUM('test1','test2','test3') NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('test2');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	7465737432
+2	7465737432
+DROP TABLE t1;
+########################
+# Fixed point columns (NUMERIC, DECIMAL)
+########################
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+d DECIMAL NOT NULL,
+d0 DECIMAL(0) NOT NULL,
+d1_1 DECIMAL(1,1) NOT NULL,
+d10_2 DECIMAL(10,2) NOT NULL,
+d60_10 DECIMAL(60,10) NOT NULL,
+n NUMERIC NOT NULL,
+n0_0 NUMERIC(0,0) NOT NULL,
+n1 NUMERIC(1) NOT NULL,
+n20_4 NUMERIC(20,4) NOT NULL,
+n65_4 NUMERIC(65,4) NOT NULL,
+pk NUMERIC NOT NULL PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+d	decimal(10,0)	NO		NULL	
+d0	decimal(10,0)	NO		NULL	
+d1_1	decimal(1,1)	NO		NULL	
+d10_2	decimal(10,2)	NO		NULL	
+d60_10	decimal(60,10)	NO		NULL	
+n	decimal(10,0)	NO		NULL	
+n0_0	decimal(10,0)	NO		NULL	
+n1	decimal(1,0)	NO		NULL	
+n20_4	decimal(20,4)	NO		NULL	
+n65_4	decimal(65,4)	NO		NULL	
+pk	decimal(10,0)	NO	PRI	NULL	
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807,1);
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (0,0,0,0,0,0,0,0,0,0,2);
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999,3);
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
+d	d0	d1_1	d10_2	d60_10	n	n0_0	n1	n20_4	n65_4
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+100	123456	0.3	40000.25	123456789123456789.1000100000	1024	7000	8	999999.9000	9223372036854775807.0000
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807,4);
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999,5);
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
+d	d0	d1_1	d10_2	d60_10	n	n0_0	n1	n20_4	n65_4
+-100	-123456	-0.3	-40000.25	-123456789123456789.1000100000	-1024	-7000	-8	-999999.9000	-9223372036854775807.0000
+-9999999999	-9999999999	-0.9	-99999999.99	-99999999999999999999999999999999999999999999999999.9999999999	-9999999999	-9999999999	-9	-9999999999999999.9999	-9999999999999999999999999999999999999999999999999999999999999.9999
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+100	123456	0.3	40000.25	123456789123456789.1000100000	1024	7000	8	999999.9000	9223372036854775807.0000
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100;
+d	d0	d1_1	d10_2	d60_10	n	n0_0	n1	n20_4	n65_4
+-100	-123456	-0.3	-40000.25	-123456789123456789.1000100000	-1024	-7000	-8	-999999.9000	-9223372036854775807.0000
+-9999999999	-9999999999	-0.9	-99999999.99	-99999999999999999999999999999999999999999999999999.9999999999	-9999999999	-9999999999	-9	-9999999999999999.9999	-9999999999999999999999999999999999999999999999999999999999999.9999
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+6
+);
+Warnings:
+Warning	1264	Out of range value for column 'd' at row 1
+Warning	1264	Out of range value for column 'd0' at row 1
+Warning	1264	Out of range value for column 'd1_1' at row 1
+Warning	1264	Out of range value for column 'd10_2' at row 1
+Warning	1264	Out of range value for column 'd60_10' at row 1
+Warning	1264	Out of range value for column 'n' at row 1
+Warning	1264	Out of range value for column 'n0_0' at row 1
+Warning	1264	Out of range value for column 'n1' at row 1
+Warning	1264	Out of range value for column 'n20_4' at row 1
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
+d	d0	d1_1	d10_2	d60_10	n	n0_0	n1	n20_4	n65_4
+-100	-123456	-0.3	-40000.25	-123456789123456789.1000100000	-1024	-7000	-8	-999999.9000	-9223372036854775807.0000
+-9999999999	-9999999999	-0.9	-99999999.99	-99999999999999999999999999999999999999999999999999.9999999999	-9999999999	-9999999999	-9	-9999999999999999.9999	-9999999999999999999999999999999999999999999999999999999999999.9999
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+100	123456	0.3	40000.25	123456789123456789.1000100000	1024	7000	8	999999.9000	9223372036854775807.0000
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999,7);
+Warnings:
+Warning	1264	Out of range value for column 'd' at row 1
+Warning	1264	Out of range value for column 'd0' at row 1
+Warning	1264	Out of range value for column 'd1_1' at row 1
+Warning	1264	Out of range value for column 'd10_2' at row 1
+Warning	1264	Out of range value for column 'd60_10' at row 1
+Warning	1264	Out of range value for column 'n' at row 1
+Warning	1264	Out of range value for column 'n0_0' at row 1
+Warning	1264	Out of range value for column 'n1' at row 1
+Warning	1264	Out of range value for column 'n20_4' at row 1
+Warning	1264	Out of range value for column 'n65_4' at row 1
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
+d	d0	d1_1	d10_2	d60_10	n	n0_0	n1	n20_4	n65_4
+-100	-123456	-0.3	-40000.25	-123456789123456789.1000100000	-1024	-7000	-8	-999999.9000	-9223372036854775807.0000
+-9999999999	-9999999999	-0.9	-99999999.99	-99999999999999999999999999999999999999999999999999.9999999999	-9999999999	-9999999999	-9	-9999999999999999.9999	-9999999999999999999999999999999999999999999999999999999999999.9999
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+100	123456	0.3	40000.25	123456789123456789.1000100000	1024	7000	8	999999.9000	9223372036854775807.0000
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111,8);
+Warnings:
+Note	1265	Data truncated for column 'd' at row 1
+Note	1265	Data truncated for column 'd0' at row 1
+Warning	1264	Out of range value for column 'd1_1' at row 1
+Note	1265	Data truncated for column 'd10_2' at row 1
+Note	1265	Data truncated for column 'd60_10' at row 1
+Note	1265	Data truncated for column 'n' at row 1
+Note	1265	Data truncated for column 'n0_0' at row 1
+Note	1265	Data truncated for column 'n1' at row 1
+Note	1265	Data truncated for column 'n20_4' at row 1
+Note	1265	Data truncated for column 'n65_4' at row 1
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
+d	d0	d1_1	d10_2	d60_10	n	n0_0	n1	n20_4	n65_4
+-100	-123456	-0.3	-40000.25	-123456789123456789.1000100000	-1024	-7000	-8	-999999.9000	-9223372036854775807.0000
+-9999999999	-9999999999	-0.9	-99999999.99	-99999999999999999999999999999999999999999999999999.9999999999	-9999999999	-9999999999	-9	-9999999999999999.9999	-9999999999999999999999999999999999999999999999999999999999999.9999
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+100	123456	0.3	40000.25	123456789123456789.1000100000	1024	7000	8	999999.9000	9223372036854775807.0000
+9999999999	9999999999	0.9	99999999.00	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.0000	9999999999999999999999999999999999999999999999999999999999999.1111
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+ALTER TABLE t1 ADD COLUMN n66 NUMERIC(66) NOT NULL;
+ERROR 42000: Too big precision 66 specified for column 'n66'. Maximum is 65.
+ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(66,6) NOT NULL;
+ERROR 42000: Too big precision 66 specified for column 'n66_6'. Maximum is 65.
+ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(66,66) NOT NULL;
+ERROR 42000: Too big scale 66 specified for column 'n66_66'. Maximum is 30.
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# DECIMAL NOT NULL columns without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c DECIMAL NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	decimal(10,0)	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES (1.1);
+Warnings:
+Note	1265	Data truncated for column 'c' at row 1
+SELECT HEX(c) FROM t1;
+HEX(c)
+1
+DROP TABLE t1;
+#----------------------------------
+# DECIMAL NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c DECIMAL NOT NULL DEFAULT 1.1
+) ENGINE=rocksdb;
+Warnings:
+Note	1265	Data truncated for column 'c' at row 1
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	decimal(10,0)	NO		1	
+ALTER TABLE t1 ADD COLUMN err DECIMAL NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES (1.1);
+Warnings:
+Note	1265	Data truncated for column 'c' at row 1
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	1
+2	1
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# NUMERIC NOT NULL columns without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c NUMERIC NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	decimal(10,0)	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES (0);
+SELECT HEX(c) FROM t1;
+HEX(c)
+0
+DROP TABLE t1;
+#----------------------------------
+# NUMERIC NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c NUMERIC NOT NULL DEFAULT 0
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	decimal(10,0)	NO		0	
+ALTER TABLE t1 ADD COLUMN err NUMERIC NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES (0);
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	0
+2	0
+DROP TABLE t1;
+########################
+# Floating point columns (FLOAT, DOUBLE)
+########################
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+f FLOAT NOT NULL,
+f0 FLOAT(0) NOT NULL,
+r1_1 REAL(1,1) NOT NULL,
+f23_0 FLOAT(23) NOT NULL,
+f20_3 FLOAT(20,3) NOT NULL,
+d DOUBLE NOT NULL,
+d1_0 DOUBLE(1,0) NOT NULL,
+d10_10 DOUBLE PRECISION (10,10) NOT NULL,
+d53 DOUBLE(53,0) NOT NULL,
+d53_10 DOUBLE(53,10) NOT NULL,
+pk DOUBLE NOT NULL PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+f	float	NO		NULL	
+f0	float	NO		NULL	
+r1_1	double(1,1)	NO		NULL	
+f23_0	float	NO		NULL	
+f20_3	float(20,3)	NO		NULL	
+d	double	NO		NULL	
+d1_0	double(1,0)	NO		NULL	
+d10_10	double(10,10)	NO		NULL	
+d53	double(53,0)	NO		NULL	
+d53_10	double(53,10)	NO		NULL	
+pk	double	NO	PRI	NULL	
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999,1);
+SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1;
+f	12345.1
+d	11111111.111
+d10_10	0.0123456789
+d1_0	8
+d53	1234566789123456800
+d53_10	100000000000000000.0000000000
+f0	12345.1
+f20_3	56789.988
+f23_0	123457000
+r1_1	0.9
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (0,0,0,0,0,0,0,0,0,0,2);
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (
+99999999999999999999999999999999999999,
+99999999999999999999999999999999999999.9999999999999999,
+0.9,
+99999999999999999999999999999999999999.9,
+99999999999999999.999,
+999999999999999999999999999999999999999999999999999999999999999999999999999999999,
+9,
+0.9999999999, 
+1999999999999999999999999999999999999999999999999999999,
+19999999999999999999999999999999999999999999.9999999999,
+3
+);
+Warnings:
+Warning	1264	Out of range value for column 'd53' at row 1
+Warning	1264	Out of range value for column 'd53_10' at row 1
+SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1;
+f	12345.1
+d	0
+d	11111111.111
+d	1e81
+d10_10	0.0000000000
+d10_10	0.0123456789
+d10_10	0.9999999999
+d1_0	0
+d1_0	8
+d1_0	9
+d53	0
+d53	100000000000000000000000000000000000000000000000000000
+d53	1234566789123456800
+d53_10	0.0000000000
+d53_10	100000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+f	0
+f	1e38
+f0	0
+f0	12345.1
+f0	1e38
+f20_3	0.000
+f20_3	56789.988
+f20_3	99999998430674940.000
+f23_0	0
+f23_0	123457000
+f23_0	1e38
+r1_1	0.0
+r1_1	0.9
+r1_1	0.9
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999,4);
+SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1;
+f	12345.1
+d	-1e60
+d	0
+d	11111111.111
+d	1e81
+d10_10	-0.9999999999
+d10_10	0.0000000000
+d10_10	0.0123456789
+d10_10	0.9999999999
+d1_0	-9
+d1_0	0
+d1_0	8
+d1_0	9
+d53	-1000000000000000000000000000000
+d53	0
+d53	100000000000000000000000000000000000000000000000000000
+d53	1234566789123456800
+d53_10	-10000000000000000000000000000000000000000000.0000000000
+d53_10	0.0000000000
+d53_10	100000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+f	-1e24
+f	0
+f	1e38
+f0	-100000000000
+f0	0
+f0	12345.1
+f0	1e38
+f20_3	-99999998430674940.000
+f20_3	0.000
+f20_3	56789.988
+f20_3	99999998430674940.000
+f23_0	-1000
+f23_0	0
+f23_0	123457000
+f23_0	1e38
+r1_1	-0.9
+r1_1	0.0
+r1_1	0.9
+r1_1	0.9
+SELECT MAX(f), MAX(f0), MAX(r1_1), MAX(f23_0), MAX(f20_3), MAX(d), MAX(d1_0), MAX(d10_10), MAX(d53), MAX(d53_10) FROM t1;
+MAX(f)	9.999999680285692e37
+MAX(d)	1e81
+MAX(d10_10)	0.9999999999
+MAX(d1_0)	9
+MAX(d53)	100000000000000000000000000000000000000000000000000000
+MAX(d53_10)	10000000000000000000000000000000000000000000.0000000000
+MAX(f0)	9.999999680285692e37
+MAX(f20_3)	99999998430674940.000
+MAX(f23_0)	9.999999680285692e37
+MAX(r1_1)	0.9
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+5
+);
+Warnings:
+Warning	1264	Out of range value for column 'f' at row 1
+Warning	1264	Out of range value for column 'f0' at row 1
+Warning	1264	Out of range value for column 'r1_1' at row 1
+Warning	1264	Out of range value for column 'f23_0' at row 1
+Warning	1264	Out of range value for column 'f20_3' at row 1
+Warning	1264	Out of range value for column 'd1_0' at row 1
+Warning	1264	Out of range value for column 'd10_10' at row 1
+Warning	1264	Out of range value for column 'd53' at row 1
+Warning	1264	Out of range value for column 'd53_10' at row 1
+SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1;
+f	12345.1
+d	-1e60
+d	0
+d	11111111.111
+d	1e61
+d	1e81
+d10_10	-0.9999999999
+d10_10	0.0000000000
+d10_10	0.0123456789
+d10_10	0.9999999999
+d10_10	0.9999999999
+d1_0	-9
+d1_0	0
+d1_0	8
+d1_0	9
+d1_0	9
+d53	-1000000000000000000000000000000
+d53	0
+d53	100000000000000000000000000000000000000000000000000000
+d53	100000000000000000000000000000000000000000000000000000
+d53	1234566789123456800
+d53_10	-10000000000000000000000000000000000000000000.0000000000
+d53_10	0.0000000000
+d53_10	100000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+f	-1e24
+f	0
+f	1e38
+f	3.40282e38
+f0	-100000000000
+f0	0
+f0	12345.1
+f0	1e38
+f0	3.40282e38
+f20_3	-99999998430674940.000
+f20_3	0.000
+f20_3	56789.988
+f20_3	99999998430674940.000
+f20_3	99999998430674940.000
+f23_0	-1000
+f23_0	0
+f23_0	123457000
+f23_0	1e38
+f23_0	3.40282e38
+r1_1	-0.9
+r1_1	0.0
+r1_1	0.9
+r1_1	0.9
+r1_1	0.9
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (
+999999999999999999999999999999999999999,
+999999999999999999999999999999999999999.9999999999999999,
+1.9,
+999999999999999999999999999999999999999.9,
+999999999999999999.999,
+9999999999999999999999999999999999999999999999999999999999999999999999999999999999,
+99,
+1.9999999999,
+1999999999999999999999999999999999999999999999999999999,
+19999999999999999999999999999999999999999999.9999999999,
+6
+);
+Warnings:
+Warning	1292	Truncated incorrect DECIMAL value: ''
+Warning	1264	Out of range value for column 'f' at row 1
+Warning	1264	Out of range value for column 'f0' at row 1
+Warning	1264	Out of range value for column 'r1_1' at row 1
+Warning	1264	Out of range value for column 'f23_0' at row 1
+Warning	1264	Out of range value for column 'f20_3' at row 1
+Warning	1264	Out of range value for column 'd1_0' at row 1
+Warning	1264	Out of range value for column 'd10_10' at row 1
+Warning	1264	Out of range value for column 'd53' at row 1
+Warning	1264	Out of range value for column 'd53_10' at row 1
+SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1;
+f	12345.1
+d	-1e60
+d	0
+d	11111111.111
+d	1e61
+d	1e65
+d	1e81
+d10_10	-0.9999999999
+d10_10	0.0000000000
+d10_10	0.0123456789
+d10_10	0.9999999999
+d10_10	0.9999999999
+d10_10	0.9999999999
+d1_0	-9
+d1_0	0
+d1_0	8
+d1_0	9
+d1_0	9
+d1_0	9
+d53	-1000000000000000000000000000000
+d53	0
+d53	100000000000000000000000000000000000000000000000000000
+d53	100000000000000000000000000000000000000000000000000000
+d53	100000000000000000000000000000000000000000000000000000
+d53	1234566789123456800
+d53_10	-10000000000000000000000000000000000000000000.0000000000
+d53_10	0.0000000000
+d53_10	100000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+f	-1e24
+f	0
+f	1e38
+f	3.40282e38
+f	3.40282e38
+f0	-100000000000
+f0	0
+f0	12345.1
+f0	1e38
+f0	3.40282e38
+f0	3.40282e38
+f20_3	-99999998430674940.000
+f20_3	0.000
+f20_3	56789.988
+f20_3	99999998430674940.000
+f20_3	99999998430674940.000
+f20_3	99999998430674940.000
+f23_0	-1000
+f23_0	0
+f23_0	123457000
+f23_0	1e38
+f23_0	3.40282e38
+f23_0	3.40282e38
+r1_1	-0.9
+r1_1	0.0
+r1_1	0.9
+r1_1	0.9
+r1_1	0.9
+r1_1	0.9
+ALTER TABLE t1 ADD COLUMN d0_0 DOUBLE(0,0) NOT NULL;
+ERROR 42000: Display width out of range for column 'd0_0' (max = 255)
+ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(256,1) NOT NULL;
+ERROR 42000: Too big precision 256 specified for column 'n66_6'. Maximum is 65.
+ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(40,35) NOT NULL;
+ERROR 42000: Too big scale 35 specified for column 'n66_66'. Maximum is 30.
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# FLOAT NOT NULL columns without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c FLOAT NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	float	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES (1.1);
+SELECT HEX(c) FROM t1;
+HEX(c)
+1
+DROP TABLE t1;
+#----------------------------------
+# FLOAT NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c FLOAT NOT NULL DEFAULT 1.1
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	float	NO		1.1	
+ALTER TABLE t1 ADD COLUMN err FLOAT NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES (1.1);
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	1
+2	1
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# DOUBLE NOT NULL columns without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c DOUBLE NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	double	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES (0);
+SELECT HEX(c) FROM t1;
+HEX(c)
+0
+DROP TABLE t1;
+#----------------------------------
+# DOUBLE NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c DOUBLE NOT NULL DEFAULT 0
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	double	NO		0	
+ALTER TABLE t1 ADD COLUMN err DOUBLE NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES (0);
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	0
+2	0
+DROP TABLE t1;
+########################
+# INT columns
+########################
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+i INT NOT NULL,
+i0 INT(0) NOT NULL,
+i1 INT(1) NOT NULL,
+i20 INT(20) NOT NULL,
+t TINYINT NOT NULL,
+t0 TINYINT(0) NOT NULL,
+t1 TINYINT(1) NOT NULL,
+t20 TINYINT(20) NOT NULL,
+s SMALLINT NOT NULL,
+s0 SMALLINT(0) NOT NULL,
+s1 SMALLINT(1) NOT NULL,
+s20 SMALLINT(20) NOT NULL,
+m MEDIUMINT NOT NULL,
+m0 MEDIUMINT(0) NOT NULL,
+m1 MEDIUMINT(1) NOT NULL,
+m20 MEDIUMINT(20) NOT NULL,
+b BIGINT NOT NULL,
+b0 BIGINT(0) NOT NULL,
+b1 BIGINT(1) NOT NULL,
+b20 BIGINT(20) NOT NULL,
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+i	int(11)	NO		NULL	
+i0	int(11)	NO		NULL	
+i1	int(1)	NO		NULL	
+i20	int(20)	NO		NULL	
+t	tinyint(4)	NO		NULL	
+t0	tinyint(4)	NO		NULL	
+t1	tinyint(1)	NO		NULL	
+t20	tinyint(20)	NO		NULL	
+s	smallint(6)	NO		NULL	
+s0	smallint(6)	NO		NULL	
+s1	smallint(1)	NO		NULL	
+s20	smallint(20)	NO		NULL	
+m	mediumint(9)	NO		NULL	
+m0	mediumint(9)	NO		NULL	
+m1	mediumint(1)	NO		NULL	
+m20	mediumint(20)	NO		NULL	
+b	bigint(20)	NO		NULL	
+b0	bigint(20)	NO		NULL	
+b1	bigint(1)	NO		NULL	
+b20	bigint(20)	NO		NULL	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20);
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807);
+SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1;
+i	i0	i1	i20	t	t0	t1	t20	s	s0	s1	s20	m	m0	m1	m20	b	b0	b1	b20
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
+1	2	3	4	5	6	7	8	9	10	11	12	13	14	15	16	17	18	19	20
+2147483647	2147483647	2147483647	2147483647	127	127	127	127	32767	32767	32767	32767	8388607	8388607	8388607	8388607	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808);
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615);
+Warnings:
+Warning	1264	Out of range value for column 'i' at row 1
+Warning	1264	Out of range value for column 'i0' at row 1
+Warning	1264	Out of range value for column 'i1' at row 1
+Warning	1264	Out of range value for column 'i20' at row 1
+Warning	1264	Out of range value for column 't' at row 1
+Warning	1264	Out of range value for column 't0' at row 1
+Warning	1264	Out of range value for column 't1' at row 1
+Warning	1264	Out of range value for column 't20' at row 1
+Warning	1264	Out of range value for column 's' at row 1
+Warning	1264	Out of range value for column 's0' at row 1
+Warning	1264	Out of range value for column 's1' at row 1
+Warning	1264	Out of range value for column 's20' at row 1
+Warning	1264	Out of range value for column 'm' at row 1
+Warning	1264	Out of range value for column 'm0' at row 1
+Warning	1264	Out of range value for column 'm1' at row 1
+Warning	1264	Out of range value for column 'm20' at row 1
+Warning	1264	Out of range value for column 'b' at row 1
+Warning	1264	Out of range value for column 'b0' at row 1
+Warning	1264	Out of range value for column 'b1' at row 1
+Warning	1264	Out of range value for column 'b20' at row 1
+SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1;
+i	i0	i1	i20	t	t0	t1	t20	s	s0	s1	s20	m	m0	m1	m20	b	b0	b1	b20
+-2147483648	-2147483648	-2147483648	-2147483648	-128	-128	-128	-128	-32768	-32768	-32768	-32768	-8388608	-8388608	-8388608	-8388608	-9223372036854775808	-9223372036854775808	-9223372036854775808	-9223372036854775808
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
+1	2	3	4	5	6	7	8	9	10	11	12	13	14	15	16	17	18	19	20
+2147483647	2147483647	2147483647	2147483647	127	127	127	127	32767	32767	32767	32767	8388607	8388607	8388607	8388607	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+2147483647	2147483647	2147483647	2147483647	127	127	127	127	32767	32767	32767	32767	8388607	8388607	8388607	8388607	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809);
+Warnings:
+Warning	1264	Out of range value for column 'i' at row 1
+Warning	1264	Out of range value for column 'i0' at row 1
+Warning	1264	Out of range value for column 'i1' at row 1
+Warning	1264	Out of range value for column 'i20' at row 1
+Warning	1264	Out of range value for column 't' at row 1
+Warning	1264	Out of range value for column 't0' at row 1
+Warning	1264	Out of range value for column 't1' at row 1
+Warning	1264	Out of range value for column 't20' at row 1
+Warning	1264	Out of range value for column 's' at row 1
+Warning	1264	Out of range value for column 's0' at row 1
+Warning	1264	Out of range value for column 's1' at row 1
+Warning	1264	Out of range value for column 's20' at row 1
+Warning	1264	Out of range value for column 'm' at row 1
+Warning	1264	Out of range value for column 'm0' at row 1
+Warning	1264	Out of range value for column 'm1' at row 1
+Warning	1264	Out of range value for column 'm20' at row 1
+Warning	1264	Out of range value for column 'b' at row 1
+Warning	1264	Out of range value for column 'b0' at row 1
+Warning	1264	Out of range value for column 'b1' at row 1
+Warning	1264	Out of range value for column 'b20' at row 1
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616);
+Warnings:
+Warning	1264	Out of range value for column 'i' at row 1
+Warning	1264	Out of range value for column 'i0' at row 1
+Warning	1264	Out of range value for column 'i1' at row 1
+Warning	1264	Out of range value for column 'i20' at row 1
+Warning	1264	Out of range value for column 't' at row 1
+Warning	1264	Out of range value for column 't0' at row 1
+Warning	1264	Out of range value for column 't1' at row 1
+Warning	1264	Out of range value for column 't20' at row 1
+Warning	1264	Out of range value for column 's' at row 1
+Warning	1264	Out of range value for column 's0' at row 1
+Warning	1264	Out of range value for column 's1' at row 1
+Warning	1264	Out of range value for column 's20' at row 1
+Warning	1264	Out of range value for column 'm' at row 1
+Warning	1264	Out of range value for column 'm0' at row 1
+Warning	1264	Out of range value for column 'm1' at row 1
+Warning	1264	Out of range value for column 'm20' at row 1
+Warning	1264	Out of range value for column 'b' at row 1
+Warning	1264	Out of range value for column 'b0' at row 1
+Warning	1264	Out of range value for column 'b1' at row 1
+Warning	1264	Out of range value for column 'b20' at row 1
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615);
+Warnings:
+Warning	1264	Out of range value for column 'i' at row 8
+Warning	1264	Out of range value for column 'i0' at row 8
+Warning	1264	Out of range value for column 'i1' at row 8
+Warning	1264	Out of range value for column 'i20' at row 8
+Warning	1264	Out of range value for column 't' at row 8
+Warning	1264	Out of range value for column 't0' at row 8
+Warning	1264	Out of range value for column 't1' at row 8
+Warning	1264	Out of range value for column 't20' at row 8
+Warning	1264	Out of range value for column 's' at row 8
+Warning	1264	Out of range value for column 's0' at row 8
+Warning	1264	Out of range value for column 's1' at row 8
+Warning	1264	Out of range value for column 's20' at row 8
+Warning	1264	Out of range value for column 'm' at row 8
+Warning	1264	Out of range value for column 'm0' at row 8
+Warning	1264	Out of range value for column 'm1' at row 8
+Warning	1264	Out of range value for column 'm20' at row 8
+Warning	1264	Out of range value for column 'i' at row 9
+Warning	1264	Out of range value for column 'i0' at row 9
+Warning	1264	Out of range value for column 'i1' at row 9
+Warning	1264	Out of range value for column 'i20' at row 9
+Warning	1264	Out of range value for column 't' at row 9
+Warning	1264	Out of range value for column 't0' at row 9
+Warning	1264	Out of range value for column 't1' at row 9
+Warning	1264	Out of range value for column 't20' at row 9
+Warning	1264	Out of range value for column 's' at row 9
+Warning	1264	Out of range value for column 's0' at row 9
+Warning	1264	Out of range value for column 's1' at row 9
+Warning	1264	Out of range value for column 's20' at row 9
+Warning	1264	Out of range value for column 'm' at row 9
+Warning	1264	Out of range value for column 'm0' at row 9
+Warning	1264	Out of range value for column 'm1' at row 9
+Warning	1264	Out of range value for column 'm20' at row 9
+Warning	1264	Out of range value for column 'i' at row 10
+Warning	1264	Out of range value for column 'i0' at row 10
+Warning	1264	Out of range value for column 'i1' at row 10
+Warning	1264	Out of range value for column 'i20' at row 10
+Warning	1264	Out of range value for column 't' at row 10
+Warning	1264	Out of range value for column 't0' at row 10
+Warning	1264	Out of range value for column 't1' at row 10
+Warning	1264	Out of range value for column 't20' at row 10
+Warning	1264	Out of range value for column 's' at row 10
+Warning	1264	Out of range value for column 's0' at row 10
+Warning	1264	Out of range value for column 's1' at row 10
+Warning	1264	Out of range value for column 's20' at row 10
+Warning	1264	Out of range value for column 'm' at row 10
+Warning	1264	Out of range value for column 'm0' at row 10
+Warning	1264	Out of range value for column 'm1' at row 10
+Warning	1264	Out of range value for column 'm20' at row 10
+Warning	1264	Out of range value for column 'i' at row 11
+Warning	1264	Out of range value for column 'i0' at row 11
+Warning	1264	Out of range value for column 'i1' at row 11
+Warning	1264	Out of range value for column 'i20' at row 11
+Warning	1264	Out of range value for column 't' at row 11
+Warning	1264	Out of range value for column 't0' at row 11
+Warning	1264	Out of range value for column 't1' at row 11
+Warning	1264	Out of range value for column 't20' at row 11
+Warning	1264	Out of range value for column 's' at row 11
+Warning	1264	Out of range value for column 's0' at row 11
+Warning	1264	Out of range value for column 's1' at row 11
+Warning	1264	Out of range value for column 's20' at row 11
+Warning	1264	Out of range value for column 'm' at row 11
+Warning	1264	Out of range value for column 'm0' at row 11
+Warning	1264	Out of range value for column 'm1' at row 11
+Warning	1264	Out of range value for column 'm20' at row 11
+SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1;
+i	i0	i1	i20	t	t0	t1	t20	s	s0	s1	s20	m	m0	m1	m20	b	b0	b1	b20
+-2147483648	-2147483648	-2147483648	-2147483648	-128	-128	-128	-128	-32768	-32768	-32768	-32768	-8388608	-8388608	-8388608	-8388608	-9223372036854775808	-9223372036854775808	-9223372036854775808	-9223372036854775808
+-2147483648	-2147483648	-2147483648	-2147483648	-128	-128	-128	-128	-32768	-32768	-32768	-32768	-8388608	-8388608	-8388608	-8388608	-9223372036854775808	-9223372036854775808	-9223372036854775808	-9223372036854775808
+-2147483648	-2147483648	-2147483648	-2147483648	-128	-128	-128	-128	-32768	-32768	-32768	-32768	-8388608	-8388608	-8388608	-8388608	-9223372036854775808	-9223372036854775808	-9223372036854775808	-9223372036854775808
+-2147483648	-2147483648	-2147483648	-2147483648	-128	-128	-128	-128	-32768	-32768	-32768	-32768	-8388608	-8388608	-8388608	-8388608	-9223372036854775808	-9223372036854775808	-9223372036854775808	-9223372036854775808
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
+1	2	3	4	5	6	7	8	9	10	11	12	13	14	15	16	17	18	19	20
+2147483647	2147483647	2147483647	2147483647	127	127	127	127	32767	32767	32767	32767	8388607	8388607	8388607	8388607	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+2147483647	2147483647	2147483647	2147483647	127	127	127	127	32767	32767	32767	32767	8388607	8388607	8388607	8388607	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+2147483647	2147483647	2147483647	2147483647	127	127	127	127	32767	32767	32767	32767	8388607	8388607	8388607	8388607	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+2147483647	2147483647	2147483647	2147483647	127	127	127	127	32767	32767	32767	32767	8388607	8388607	8388607	8388607	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+2147483647	2147483647	2147483647	2147483647	127	127	127	127	32767	32767	32767	32767	8388607	8388607	8388607	8388607	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+2147483647	2147483647	2147483647	2147483647	127	127	127	127	32767	32767	32767	32767	8388607	8388607	8388607	8388607	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+ALTER TABLE t1 ADD COLUMN i257 INT(257) NOT NULL;
+ERROR 42000: Display width out of range for column 'i257' (max = 255)
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# INT NOT NULL columns without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c INT NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	int(11)	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES (2147483647);
+SELECT HEX(c) FROM t1;
+HEX(c)
+7FFFFFFF
+DROP TABLE t1;
+#----------------------------------
+# INT NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c INT NOT NULL DEFAULT 2147483647
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	int(11)	NO		2147483647	
+ALTER TABLE t1 ADD COLUMN err INT NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES (2147483647);
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	7FFFFFFF
+2	7FFFFFFF
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# TINYINT NOT NULL columns without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c TINYINT NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	tinyint(4)	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES (127);
+SELECT HEX(c) FROM t1;
+HEX(c)
+7F
+DROP TABLE t1;
+#----------------------------------
+# TINYINT NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c TINYINT NOT NULL DEFAULT 127
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	tinyint(4)	NO		127	
+ALTER TABLE t1 ADD COLUMN err TINYINT NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES (127);
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	7F
+2	7F
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# SMALLINT NOT NULL columns without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c SMALLINT NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	smallint(6)	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES (0);
+SELECT HEX(c) FROM t1;
+HEX(c)
+0
+DROP TABLE t1;
+#----------------------------------
+# SMALLINT NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c SMALLINT NOT NULL DEFAULT 0
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	smallint(6)	NO		0	
+ALTER TABLE t1 ADD COLUMN err SMALLINT NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES (0);
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	0
+2	0
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# MEDIUMINT NOT NULL columns without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c MEDIUMINT NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	mediumint(9)	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES (1);
+SELECT HEX(c) FROM t1;
+HEX(c)
+1
+DROP TABLE t1;
+#----------------------------------
+# MEDIUMINT NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c MEDIUMINT NOT NULL DEFAULT 1
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	mediumint(9)	NO		1	
+ALTER TABLE t1 ADD COLUMN err MEDIUMINT NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES (1);
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	1
+2	1
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# BIGINT NOT NULL columns without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c BIGINT NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	bigint(20)	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES (9223372036854775807);
+SELECT HEX(c) FROM t1;
+HEX(c)
+7FFFFFFFFFFFFFFF
+DROP TABLE t1;
+#----------------------------------
+# BIGINT NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c BIGINT NOT NULL DEFAULT 9223372036854775807
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	bigint(20)	NO		9223372036854775807	
+ALTER TABLE t1 ADD COLUMN err BIGINT NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES (9223372036854775807);
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	7FFFFFFFFFFFFFFF
+2	7FFFFFFFFFFFFFFF
+DROP TABLE t1;
+########################
+# SET columns
+########################
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+a SET('') NOT NULL,
+b SET('test1','test2','test3','test4','test5') NOT NULL,
+c SET('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64') NOT NULL,
+PRIMARY KEY (c)
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+a	set('')	NO		NULL	
+b	set('test1','test2','test3','test4','test5')	NO		NULL	
+c	set('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64')	NO	PRI	NULL	
+INSERT INTO t1 (a,b,c) VALUES 
+('','test2,test3','01,34,44,,23'),
+('',5,2),
+(',','test4,test2','');
+Warnings:
+Warning	1265	Data truncated for column 'c' at row 1
+SELECT a,b,c FROM t1;
+a	b	c
+	test1,test3	02
+	test2,test3	01,23,34,44
+	test2,test4	
+INSERT INTO t1 (a,b,c) VALUES (0,'test6',-1);
+Warnings:
+Warning	1265	Data truncated for column 'b' at row 1
+Warning	1265	Data truncated for column 'c' at row 1
+SELECT a,b,c FROM t1;
+a	b	c
+		01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50'51,52,53,54,55,56,57,58,59,60,61,62,63,64
+	test1,test3	02
+	test2,test3	01,23,34,44
+	test2,test4	
+ALTER TABLE t1 ADD COLUMN e SET('a','A') NOT NULL;
+Warnings:
+Note	1291	Column 'e' has duplicated value 'a' in SET
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+a	set('')	NO		NULL	
+b	set('test1','test2','test3','test4','test5')	NO		NULL	
+c	set('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64')	NO	PRI	NULL	
+e	set('a','A')	NO		NULL	
+ALTER TABLE t1 ADD COLUMN f SET('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',' ','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i') NOT NULL;
+ERROR HY000: Too many strings for column f and SET
+SELECT a,b,c,e FROM t1 WHERE FIND_IN_SET('test2',b)>0 OR a != '';
+a	b	c	e
+	test2,test3	01,23,34,44	
+	test2,test4		
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# SET('test1','test2','test3') NOT NULL columns without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c SET('test1','test2','test3') NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	set('test1','test2','test3')	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('test2,test3');
+SELECT HEX(c) FROM t1;
+HEX(c)
+74657374322C7465737433
+DROP TABLE t1;
+#----------------------------------
+# SET('test1','test2','test3') NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c SET('test1','test2','test3') NOT NULL DEFAULT 'test2,test3'
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	set('test1','test2','test3')	NO		test2,test3	
+ALTER TABLE t1 ADD COLUMN err SET('test1','test2','test3') NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('test2,test3');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	74657374322C7465737433
+2	74657374322C7465737433
+DROP TABLE t1;
+########################
+# TEXT columns
+########################
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+t TEXT NOT NULL,
+t0 TEXT(0) NOT NULL,
+t1 TEXT(1) NOT NULL,
+t300 TEXT(300) NOT NULL,
+tm TEXT(65535) NOT NULL,
+t70k TEXT(70000) NOT NULL,
+t17m TEXT(17000000) NOT NULL,
+tt TINYTEXT NOT NULL,
+m MEDIUMTEXT NOT NULL,
+l LONGTEXT NOT NULL
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+t	text	NO		NULL	
+t0	text	NO		NULL	
+t1	tinytext	NO		NULL	
+t300	text	NO		NULL	
+tm	text	NO		NULL	
+t70k	mediumtext	NO		NULL	
+t17m	longtext	NO		NULL	
+tt	tinytext	NO		NULL	
+m	mediumtext	NO		NULL	
+l	longtext	NO		NULL	
+INSERT INTO t1 (t,t0,t1,t300,tm,t70k,t17m,tt,m,l) VALUES
+('','','','','','','','','',''),
+('a','b','c','d','e','f','g','h','i','j'),
+('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'),
+( REPEAT('a',65535), REPEAT('b',65535), REPEAT('c',255), REPEAT('d',65535), REPEAT('e',65535), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',255), REPEAT('i',1048576), REPEAT('j',1048576) );
+SELECT LENGTH(t), LENGTH(t0), LENGTH(t1), LENGTH(t300), LENGTH(tm), LENGTH(t70k), LENGTH(t17m), LENGTH(tt), LENGTH(m), LENGTH(l) FROM t1;
+LENGTH(t)	LENGTH(t0)	LENGTH(t1)	LENGTH(t300)	LENGTH(tm)	LENGTH(t70k)	LENGTH(t17m)	LENGTH(tt)	LENGTH(m)	LENGTH(l)
+0	0	0	0	0	0	0	0	0	0
+1	1	1	1	1	1	1	1	1	1
+5	5	5	5	5	5	5	5	5	6
+65535	65535	255	65535	65535	1048576	1048576	255	1048576	1048576
+INSERT INTO t1 (t,t0,t1,t300,tm,t70k,t17m,tt,m,l) VALUES
+( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) );
+Warnings:
+Warning	1265	Data truncated for column 't' at row 1
+Warning	1265	Data truncated for column 't0' at row 1
+Warning	1265	Data truncated for column 't1' at row 1
+Warning	1265	Data truncated for column 't300' at row 1
+Warning	1265	Data truncated for column 'tm' at row 1
+Warning	1265	Data truncated for column 'tt' at row 1
+SELECT LENGTH(t), LENGTH(t0), LENGTH(t1), LENGTH(t300), LENGTH(tm), LENGTH(t70k), LENGTH(t17m), LENGTH(tt), LENGTH(m), LENGTH(l) FROM t1;
+LENGTH(t)	LENGTH(t0)	LENGTH(t1)	LENGTH(t300)	LENGTH(tm)	LENGTH(t70k)	LENGTH(t17m)	LENGTH(tt)	LENGTH(m)	LENGTH(l)
+0	0	0	0	0	0	0	0	0	0
+1	1	1	1	1	1	1	1	1	1
+5	5	5	5	5	5	5	5	5	6
+65535	65535	255	65535	65535	1048576	1048576	255	1048576	1048576
+65535	65535	255	65535	65535	1048576	1048576	255	1048576	1048576
+ALTER TABLE t1 ADD COLUMN ttt TEXT(4294967296) NOT NULL;
+ERROR 42000: Display width out of range for column 'ttt' (max = 4294967295)
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# TEXT NOT NULL columns without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c TEXT NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	text	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('');
+SELECT HEX(c) FROM t1;
+HEX(c)
+
+DROP TABLE t1;
+#----------------------------------
+# TEXT NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c TEXT NOT NULL DEFAULT ''
+) ENGINE=rocksdb;
+Warnings:
+Warning	1101	BLOB/TEXT column 'c' can't have a default value
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	text	NO		NULL	
+ALTER TABLE t1 ADD COLUMN err TEXT NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	
+2	
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# TINYTEXT NOT NULL columns without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c TINYTEXT NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	tinytext	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('');
+SELECT HEX(c) FROM t1;
+HEX(c)
+
+DROP TABLE t1;
+#----------------------------------
+# TINYTEXT NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c TINYTEXT NOT NULL DEFAULT ''
+) ENGINE=rocksdb;
+Warnings:
+Warning	1101	BLOB/TEXT column 'c' can't have a default value
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	tinytext	NO		NULL	
+ALTER TABLE t1 ADD COLUMN err TINYTEXT NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	
+2	
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# MEDIUMTEXT NOT NULL columns without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c MEDIUMTEXT NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	mediumtext	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('');
+SELECT HEX(c) FROM t1;
+HEX(c)
+
+DROP TABLE t1;
+#----------------------------------
+# MEDIUMTEXT NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c MEDIUMTEXT NOT NULL DEFAULT ''
+) ENGINE=rocksdb;
+Warnings:
+Warning	1101	BLOB/TEXT column 'c' can't have a default value
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	mediumtext	NO		NULL	
+ALTER TABLE t1 ADD COLUMN err MEDIUMTEXT NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	
+2	
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+#----------------------------------
+# LONGTEXT NOT NULL columns without a default
+#----------------------------------
+CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c LONGTEXT NOT NULL) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	longtext	NO		NULL	
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('');
+SELECT HEX(c) FROM t1;
+HEX(c)
+
+DROP TABLE t1;
+#----------------------------------
+# LONGTEXT NOT NULL columns with a default
+#----------------------------------
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+c LONGTEXT NOT NULL DEFAULT ''
+) ENGINE=rocksdb;
+Warnings:
+Warning	1101	BLOB/TEXT column 'c' can't have a default value
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+c	longtext	NO		NULL	
+ALTER TABLE t1 ADD COLUMN err LONGTEXT NOT NULL DEFAULT NULL;
+ERROR 42000: Invalid default value for 'err'
+INSERT INTO t1 (c) VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+INSERT INTO t1 (c) VALUES ('');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c) FROM t1 ORDER BY pk;
+pk	HEX(c)
+1	
+2	
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/col_opt_not_null.test b/mysql-test/suite/rocksdb/col_opt_not_null.test
new file mode 100644
index 0000000..6aeff1a
--- /dev/null
+++ b/mysql-test/suite/rocksdb/col_opt_not_null.test
@@ -0,0 +1,222 @@
+# 
+# NOT NULL column attribute
+#
+
+#########################################
+# TODO:
+# Currently the test produces incorrect (?) result
+# due to bug MySQL:68472. If the bug is ever fixed,
+# the test and result files will need to be updated.
+#########################################
+
+
+let $extra_col_opts = NOT NULL;
+
+--echo ########################
+--echo # BINARY columns
+--echo ########################
+
+--source type_binary.inc
+--let $col_type = BINARY
+--let $col_default = 0
+--source col_not_null.inc
+
+--echo ########################
+--echo # VARBINARY columns
+--echo ########################
+
+--source type_varbinary.inc
+--let $col_type = VARBINARY(64)
+--let $col_default = 'test'
+--source col_not_null.inc
+
+--echo ########################
+--echo # BIT columns
+--echo ########################
+
+--source type_bit.inc
+--let $col_type = BIT
+--let $col_default = 1
+--source col_not_null.inc
+
+--echo ########################
+--echo # BLOB columns
+--echo ########################
+
+--source type_blob.inc
+
+--let $col_default = ''
+
+--let $col_type = BLOB
+--source col_not_null.inc
+
+--let $col_type = TINYBLOB
+--source col_not_null.inc
+
+--let $col_type = MEDIUMBLOB
+--source col_not_null.inc
+
+--let $col_type = LONGBLOB
+--source col_not_null.inc
+
+--echo ########################
+--echo # BOOL columns
+--echo ########################
+
+--source type_bool.inc
+--let $col_type = BOOL
+--let $col_default = '0'
+--source col_not_null.inc
+
+--echo ########################
+--echo # CHAR columns
+--echo ########################
+
+--source type_char.inc
+--let $col_type = CHAR
+--let $col_default = '_'
+--source col_not_null.inc
+
+--echo ########################
+--echo # VARCHAR columns
+--echo ########################
+
+--source type_varchar.inc
+--let $col_type = VARCHAR(64)
+--let $col_default = 'test default'
+--source col_not_null.inc
+
+--echo ########################
+--echo # date and time columns
+--echo ########################
+
+--source type_date_time.inc
+
+SET TIMESTAMP=UNIX_TIMESTAMP('2013-12-12 12:12:12');
+
+--let $col_type = DATE
+--let $col_default = '2012-12-21'
+--source col_not_null.inc
+
+--let $col_type = DATETIME
+--let $col_default = '2012-12-21 12:21:12'
+--source col_not_null.inc
+
+# Even with explicit-defaults-for-timestamps, we still can't use
+# the standard include file, due to bug MySQL:68472
+
+--let $col_type = TIMESTAMP
+--let $col_default = '2012-12-21 12:21:12'
+--source col_not_null_timestamp.inc
+
+--let $col_type = TIME
+--let $col_default = '12:21:12'
+--source col_not_null.inc
+
+--let $col_type = YEAR
+--let $col_default = '2012'
+--source col_not_null.inc
+
+--let $col_type = YEAR(2)
+--let $col_default = '12'
+--source col_not_null.inc
+
+--echo ########################
+--echo # ENUM columns
+--echo ########################
+
+--source type_enum.inc
+
+--let $col_type = ENUM('test1','test2','test3')
+--let $col_default = 'test2'
+--source col_not_null.inc
+
+--echo ########################
+--echo # Fixed point columns (NUMERIC, DECIMAL)
+--echo ########################
+
+--source type_fixed.inc
+
+--let $col_type = DECIMAL
+--let $col_default = 1.1
+--source col_not_null.inc
+
+--let $col_type = NUMERIC
+--let $col_default = 0
+--source col_not_null.inc
+
+--echo ########################
+--echo # Floating point columns (FLOAT, DOUBLE)
+--echo ########################
+
+--source type_float.inc
+  
+--let $col_type = FLOAT
+--let $col_default = 1.1
+--source col_not_null.inc
+
+--let $col_type = DOUBLE
+--let $col_default = 0
+--source col_not_null.inc
+
+--echo ########################
+--echo # INT columns
+--echo ########################
+
+--source type_int.inc
+  
+--let $col_type = INT
+--let $col_default = 2147483647
+--source col_not_null.inc
+
+--let $col_type = TINYINT
+--let $col_default = 127
+--source col_not_null.inc
+
+--let $col_type = SMALLINT
+--let $col_default = 0
+--source col_not_null.inc
+
+--let $col_type = MEDIUMINT
+--let $col_default = 1
+--source col_not_null.inc
+
+--let $col_type = BIGINT
+--let $col_default = 9223372036854775807
+--source col_not_null.inc
+
+--echo ########################
+--echo # SET columns
+--echo ########################
+
+--source type_set.inc
+--let $col_type = SET('test1','test2','test3')
+--let $col_default = 'test2,test3'
+--source col_not_null.inc
+
+--echo ########################
+--echo # TEXT columns
+--echo ########################
+
+--source type_text.inc
+
+--let $col_default = ''
+  
+--let $col_type = TEXT
+--source col_not_null.inc
+
+--let $col_type = TINYTEXT
+--source col_not_null.inc
+
+--let $col_type = MEDIUMTEXT
+--source col_not_null.inc
+
+--let $col_type = LONGTEXT
+--source col_not_null.inc
+
+
+--let $col_type =
+--let $col_default =
+--let $extra_col_opts =
+
+
diff --git a/mysql-test/suite/rocksdb/col_opt_null.result b/mysql-test/suite/rocksdb/col_opt_null.result
new file mode 100644
index 0000000..46c83e6
--- /dev/null
+++ b/mysql-test/suite/rocksdb/col_opt_null.result
@@ -0,0 +1,2115 @@
+########################
+# BINARY columns
+########################
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+b BINARY NULL,
+b0 BINARY(0) NULL,
+b1 BINARY(1) NULL,
+b20 BINARY(20) NULL,
+b255 BINARY(255) NULL,
+pk BINARY PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+b	binary(1)	YES		NULL	
+b0	binary(0)	YES		NULL	
+b1	binary(1)	YES		NULL	
+b20	binary(20)	YES		NULL	
+b255	binary(255)	YES		NULL	
+pk	binary(1)	NO	PRI	NULL	
+INSERT INTO t1 VALUES ('','','','','','');
+INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.','a');
+SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255), HEX(pk) FROM t1 ORDER BY pk;
+HEX(b)	HEX(b0)	HEX(b1)	HEX(b20)	HEX(b255)	HEX(pk)
+00		00	0000000000000000000000000000000000000000	000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000	00
+61		62	616263646566676869206B6C6D6E6F7071727374	4372656174696E6720616E2061727469636C6520666F7220746865204B6E6F776C65646765626173652069732073696D696C617220746F2061736B696E67207175657374696F6E732E2046697273742C206E6176696761746520746F207468652063617465676F727920776865726520796F75206665656C207468652061727469636C652073686F756C642062652E204F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C726561647920657869737420776869636820776F756C6420776F726B2E00000000000000000000000000000000000000000000000000000000000000	61
+INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256),'b');
+Warnings:
+Warning	1265	Data truncated for column 'b' at row 1
+Warning	1265	Data truncated for column 'b0' at row 1
+Warning	1265	Data truncated for column 'b1' at row 1
+Warning	1265	Data truncated for column 'b20' at row 1
+Warning	1265	Data truncated for column 'b255' at row 1
+INSERT INTO t1 SELECT b255, b255, b255, b255, CONCAT('a',b255,b255), 'c' FROM t1;
+ERROR 23000: Duplicate entry 'c' for key 'PRIMARY'
+SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255), HEX(pk) FROM t1 ORDER BY pk;
+HEX(b)	HEX(b0)	HEX(b1)	HEX(b20)	HEX(b255)	HEX(pk)
+00		00	0000000000000000000000000000000000000000	000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000	00
+61		61	6161616161616161616161616161616161616161	787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878	62
+61		62	616263646566676869206B6C6D6E6F7071727374	4372656174696E6720616E2061727469636C6520666F7220746865204B6E6F776C65646765626173652069732073696D696C617220746F2061736B696E67207175657374696F6E732E2046697273742C206E6176696761746520746F207468652063617465676F727920776865726520796F75206665656C207468652061727469636C652073686F756C642062652E204F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C726561647920657869737420776869636820776F756C6420776F726B2E00000000000000000000000000000000000000000000000000000000000000	61
+ALTER TABLE t1 ADD COLUMN b257 BINARY(257) NULL;
+ERROR 42000: Column length too big for column 'b257' (max = 255); use BLOB or TEXT instead
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+b	binary(1)	YES		NULL	
+b0	binary(0)	YES		NULL	
+b1	binary(1)	YES		NULL	
+b20	binary(20)	YES		NULL	
+b255	binary(255)	YES		NULL	
+pk	binary(1)	NO	PRI	NULL	
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c BINARY NULL,
+c1 BINARY NULL DEFAULT NULL,
+c2 BINARY NULL DEFAULT 0,
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	binary(1)	YES		NULL	
+c1	binary(1)	YES		NULL	
+c2	binary(1)	YES		0	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES (0,0,0);
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2	30	30	30
+3	NULL	NULL	30
+DROP TABLE t1;
+########################
+# VARBINARY columns
+########################
+DROP TABLE IF EXISTS t1, t2;
+CREATE TABLE t1 (
+v0 VARBINARY(0) NULL,
+v1 VARBINARY(1) NULL,
+v64 VARBINARY(64) NULL,
+v65000 VARBINARY(65000) NULL,
+PRIMARY KEY (v64)
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+v0	varbinary(0)	YES		NULL	
+v1	varbinary(1)	YES		NULL	
+v64	varbinary(64)	NO	PRI		
+v65000	varbinary(65000)	YES		NULL	
+CREATE TABLE t2 (v VARBINARY(65532) NULL, PRIMARY KEY(v(255))) ENGINE=rocksdb;
+SHOW COLUMNS IN t2;
+Field	Type	Null	Key	Default	Extra
+v	varbinary(65532)	NO	PRI		
+INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','','','');
+INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','y','Once there, double check that an article doesn\'t already exist','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off.
+
+  If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment.
+  For developers who want to code on MariaDB or MySQL
+
+      * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB.
+            o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB!
+            o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. 
+      * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings
+            o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! 
+
+  For MariaDB / MySQL end users
+
+      * MariaDB Crash Course by Ben Forta
+            o First MariaDB book!
+            o For people who want to learn SQL and the basics of MariaDB.
+            o Now shipping. Purchase at Amazon.com or your favorite bookseller. 
+
+      * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer.
+            o Everything you wanted to know about the SQL 99 standard. Excellent reference book!
+            o Free to read in the Knowledgebase! 
+
+      * MySQL (4th Edition) by Paul DuBois
+            o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. 
+
+      * MySQL Cookbook by Paul DuBois
+            o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. 
+
+      * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al.
+            o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) 
+
+      * MySQL Admin Cookbook
+            o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration 
+
+      * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen
+            o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. ');
+SELECT HEX(v0), HEX(v1), HEX(v64), HEX(v65000) FROM t1;
+HEX(v0)	HEX(v1)	HEX(v64)	HEX(v65000)
+			
+	79	4F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C7265616479206578697374	486572652069732061206C697374206F66207265636F6D6D656E64656420626F6F6B73206F6E204D61726961444220616E64204D7953514C2E2057652776652070726F7669646564206C696E6B7320746F20416D617A6F6E2E636F6D206865726520666F7220636F6E76656E69656E63652C2062757420746865792063616E20626520666F756E64206174206D616E79206F7468657220626F6F6B73746F7265732C20626F7468206F6E6C696E6520616E64206F66662E0A0A2020496620796F752077616E7420746F206861766520796F7572206661766F72697465204D7953514C202F204D61726961444220626F6F6B206C697374656420686572652C20706C65617365206C65617665206120636F6D6D656E742E0A2020466F7220646576656C6F706572732077686F2077616E7420746F20636F6465206F6E204D617269614442206F72204D7953514C0A0A2020202020202A20556E6465727374616E64696E67204D7953514C20496E7465726E616C73206279205361736861205061636865762C20666F726D6572204D7953514C20646576656C6F706572206174204D7953514C2041422E0A2020202020
 20202020
 2020206F205468697320697320746865206F6E6C7920626F6F6B207765206B6E6F772061626F75742074686174206465736372696265732074686520696E7465726E616C73206F66204D617269614442202F204D7953514C2E2041206D757374206861766520666F7220616E796F6E652077686F2077616E747320746F20756E6465727374616E6420616E6420646576656C6F70206F6E204D617269614442210A2020202020202020202020206F204E6F7420616C6C20746F706963732061726520636F766572656420616E6420736F6D652070617274732061726520736C696768746C79206F757464617465642C20627574207374696C6C20746865206265737420626F6F6B206F6E207468697320746F7069632E200A2020202020202A204D7953514C20352E3120506C7567696E20446576656C6F706D656E742062792053657267656920476F6C75626368696B20616E6420416E64726577204875746368696E67730A2020202020202020202020206F2041206D757374207265616420666F7220616E796F6E652077616E74696E6720746F207772697465206120706C7567696E20666F72204D6172696144422C207772697474656E20627920746865205365726765692077686F2064657369676E65642074686520706C7567696E20696E7465726661636520666F72204
 D7953514
 C20616E64204D61726961444221200A0A2020466F72204D617269614442202F204D7953514C20656E642075736572730A0A2020202020202A204D61726961444220437261736820436F757273652062792042656E20466F7274610A2020202020202020202020206F204669727374204D61726961444220626F6F6B210A2020202020202020202020206F20466F722070656F706C652077686F2077616E7420746F206C6561726E2053514C20616E642074686520626173696373206F66204D6172696144422E0A2020202020202020202020206F204E6F77207368697070696E672E20507572636861736520617420416D617A6F6E2E636F6D206F7220796F7572206661766F7269746520626F6F6B73656C6C65722E200A0A2020202020202A2053514C2D393920436F6D706C6574652C205265616C6C792062792050657465722047756C75747A616E20262054727564792050656C7A65722E0A2020202020202020202020206F2045766572797468696E6720796F752077616E74656420746F206B6E6F772061626F7574207468652053514C203939207374616E646172642E20457863656C6C656E74207265666572656E636520626F6F6B210A2020202020202020202020206F204672656520746F207265616420696E20746865204B6E6F776C656467656261736521200A
 0A202020
 2020202A204D7953514C20283474682045646974696F6E29206279205061756C204475426F69730A2020202020202020202020206F20546865202764656661756C742720626F6F6B20746F207265616420696620796F7520776F6E7420746F206C6561726E20746F20757365204D7953514C202F204D6172696144422E200A0A2020202020202A204D7953514C20436F6F6B626F6F6B206279205061756C204475426F69730A2020202020202020202020206F2041206C6F74206F66206578616D706C6573206F6620686F7720746F20757365204D7953514C2E204173207769746820616C6C206F66205061756C277320626F6F6B732C206974277320776F727468206974732077656967687420696E20676F6C6420616E64206576656E20656E6A6F7961626C652072656164696E6720666F7220737563682061202764727927207375626A6563742E200A0A2020202020202A204869676820506572666F726D616E6365204D7953514C2C205365636F6E642045646974696F6E2C204279204261726F6E20536368776172747A2C205065746572205A6169747365762C20566164696D20546B616368656E6B6F2C204A6572656D7920442E205A61776F646E792C2041726A656E204C656E747A2C20446572656B204A2E2042616C6C696E672C20657420616C2E0A20202020202
 02020202
 020206F20224869676820506572666F726D616E6365204D7953514C2069732074686520646566696E697469766520677569646520746F206275696C64696E6720666173742C2072656C6961626C652073797374656D732077697468204D7953514C2E205772697474656E206279206E6F74656420657870657274732077697468207965617273206F66207265616C2D776F726C6420657870657269656E6365206275696C64696E672076657279206C617267652073797374656D732C207468697320626F6F6B20636F7665727320657665727920617370656374206F66204D7953514C20706572666F726D616E636520696E2064657461696C2C20616E6420666F6375736573206F6E20726F627573746E6573732C2073656375726974792C20616E64206461746120696E746567726974792E204C6561726E20616476616E63656420746563686E697175657320696E20646570746820736F20796F752063616E206272696E67206F7574204D7953514C27732066756C6C20706F7765722E22202846726F6D2074686520626F6F6B206465736372697074696F6E206174204F275265696C6C7929200A0A2020202020202A204D7953514C2041646D696E20436F6F6B626F6F6B0A2020202020202020202020206F204120717569636B20737465702D62792D7374657020677569
 64652066
 6F72204D7953514C20757365727320616E642064617461626173652061646D696E6973747261746F727320746F207461636B6C65207265616C2D776F726C64206368616C6C656E6765732077697468204D7953514C20636F6E66696775726174696F6E20616E642061646D696E697374726174696F6E200A0A2020202020202A204D7953514C20352E302043657274696669636174696F6E2053747564792047756964652C204279205061756C204475426F69732C2053746566616E2048696E7A2C204361727374656E20506564657273656E0A2020202020202020202020206F205468697320697320746865206F6666696369616C20677569646520746F20636F766572207468652070617373696E67206F66207468652074776F204D7953514C2043657274696669636174696F6E206578616D696E6174696F6E732E2049742069732076616C69642074696C6C2076657273696F6E20352E30206F6620746865207365727665722C20736F207768696C65206974206D697373657320616C6C2074686520666561747572657320617661696C61626C6520696E204D7953514C20352E3120616E6420677265617465722028696E636C7564696E67204D61726961444220352E3120616E642067726561746572292C2069742070726F7669646573206120676F6F6420626173696
 320756E6
 465727374616E64696E67206F66204D7953514C20666F722074686520656E642D757365722E20
+INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('y', 'yy', REPEAT('c',65), REPEAT('abcdefghi ',6501));
+Warnings:
+Warning	1265	Data truncated for column 'v0' at row 1
+Warning	1265	Data truncated for column 'v1' at row 1
+Warning	1265	Data truncated for column 'v64' at row 1
+Warning	1265	Data truncated for column 'v65000' at row 1
+INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, CONCAT('a',v65000), CONCAT(v65000,v1) FROM t1;
+Warnings:
+Warning	1265	Data truncated for column 'v0' at row 5
+Warning	1265	Data truncated for column 'v1' at row 5
+Warning	1265	Data truncated for column 'v64' at row 5
+Warning	1265	Data truncated for column 'v0' at row 6
+Warning	1265	Data truncated for column 'v1' at row 6
+Warning	1265	Data truncated for column 'v64' at row 6
+Warning	1265	Data truncated for column 'v65000' at row 6
+SELECT HEX(v0), HEX(v1), HEX(v64), LENGTH(HEX(v65000)) FROM t1;
+HEX(v0)	HEX(v1)	HEX(v64)	LENGTH(HEX(v65000))
+			0
+		61	0
+	48	61486572652069732061206C697374206F66207265636F6D6D656E64656420626F6F6B73206F6E204D61726961444220616E64204D7953514C2E205765277665	5932
+	61	61616263646566676869206162636465666768692061626364656667686920616263646566676869206162636465666768692061626364656667686920616263	130000
+	79	4F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C7265616479206578697374	5930
+	79	63636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363	130000
+ALTER TABLE t1 ADD COLUMN v65536 VARBINARY(65536) NULL;
+Warnings:
+Note	1246	Converting column 'v65536' from VARBINARY to BLOB
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+v0	varbinary(0)	YES		NULL	
+v1	varbinary(1)	YES		NULL	
+v64	varbinary(64)	NO	PRI		
+v65000	varbinary(65000)	YES		NULL	
+v65536	mediumblob	YES		NULL	
+DROP TABLE t1, t2;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c VARBINARY(64) NULL,
+c1 VARBINARY(64) NULL DEFAULT NULL,
+c2 VARBINARY(64) NULL DEFAULT 'test',
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	varbinary(64)	YES		NULL	
+c1	varbinary(64)	YES		NULL	
+c2	varbinary(64)	YES		test	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES ('test','test','test');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2	74657374	74657374	74657374
+3	NULL	NULL	74657374
+DROP TABLE t1;
+########################
+# BIT columns
+########################
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+a BIT NULL,
+b BIT(20) NULL,
+c BIT(64) NULL,
+d BIT(1) NULL,
+PRIMARY KEY (c)
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+a	bit(1)	YES		NULL	
+b	bit(20)	YES		NULL	
+c	bit(64)	NO	PRI	b'0'	
+d	bit(1)	YES		NULL	
+ALTER TABLE t1 DROP COLUMN d;
+ALTER TABLE t1 ADD COLUMN d BIT(0) NULL;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+a	bit(1)	YES		NULL	
+b	bit(20)	YES		NULL	
+c	bit(64)	NO	PRI	b'0'	
+d	bit(1)	YES		NULL	
+INSERT INTO t1 (a,b,c,d) VALUES (0,POW(2,20)-1,b'1111111111111111111111111111111111111111111111111111111111111111',1);
+SELECT BIN(a), HEX(b), c+0 FROM t1 WHERE d>0;
+BIN(a)	HEX(b)	c+0
+0	FFFFF	18446744073709551615
+INSERT INTO t1 (a,b,c,d) VALUES (1,0,-2,0);
+SELECT a+0, b+0, c+0 FROM t1 WHERE d<100;
+a+0	b+0	c+0
+0	1048575	18446744073709551615
+1	0	18446744073709551614
+INSERT INTO t1 (a,b,c,d) VALUES (b'1', 'f', 0xFF, 0x0);
+SELECT a+0, b+0, c+0 FROM t1 WHERE d IN (0, 2);
+a+0	b+0	c+0
+1	0	18446744073709551614
+1	102	255
+DELETE FROM t1;
+INSERT INTO t1 (a,b,c,d) VALUES (0x10,0,0,1);
+Warnings:
+Warning	1264	Out of range value for column 'a' at row 1
+SELECT a+0,b+0,c+0,d+0 FROM t1;
+a+0	b+0	c+0	d+0
+1	0	0	1
+INSERT INTO t1 (a,b,c,d) VALUES (0x01,0,0x10000000000000000,0);
+Warnings:
+Warning	1264	Out of range value for column 'c' at row 1
+SELECT a+0,b+0,c+0,d+0 FROM t1;
+a+0	b+0	c+0	d+0
+1	0	0	1
+1	0	18446744073709551615	0
+DROP TABLE t1;
+CREATE TABLE t1 (pk INT PRIMARY KEY, a BIT(65) NULL) ENGINE=rocksdb;
+ERROR 42000: Display width out of range for column 'a' (max = 64)
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c BIT NULL,
+c1 BIT NULL DEFAULT NULL,
+c2 BIT NULL DEFAULT 1,
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	bit(1)	YES		NULL	
+c1	bit(1)	YES		NULL	
+c2	bit(1)	YES		b'1'	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES (1,1,1);
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2	1	1	1
+3	NULL	NULL	1
+DROP TABLE t1;
+########################
+# BLOB columns
+########################
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+b BLOB NULL,
+b0 BLOB(0) NULL,
+b1 BLOB(1) NULL,
+b300 BLOB(300) NULL,
+bm BLOB(65535) NULL,
+b70k BLOB(70000) NULL,
+b17m BLOB(17000000) NULL,
+t TINYBLOB NULL,
+m MEDIUMBLOB NULL,
+l LONGBLOB NULL
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+b	blob	YES		NULL	
+b0	blob	YES		NULL	
+b1	tinyblob	YES		NULL	
+b300	blob	YES		NULL	
+bm	blob	YES		NULL	
+b70k	mediumblob	YES		NULL	
+b17m	longblob	YES		NULL	
+t	tinyblob	YES		NULL	
+m	mediumblob	YES		NULL	
+l	longblob	YES		NULL	
+INSERT INTO t1 (b,b0,b1,b300,bm,b70k,b17m,t,m,l) VALUES
+('','','','','','','','','',''),
+('a','b','c','d','e','f','g','h','i','j'),
+('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'),
+( REPEAT('a',65535), REPEAT('b',65535), REPEAT('c',255), REPEAT('d',65535), REPEAT('e',65535), REPEAT('f',1048576), HEX(REPEAT('g',1048576)), REPEAT('h',255), REPEAT('i',1048576), HEX(REPEAT('j',1048576)) );
+SELECT LENGTH(b), LENGTH(b0), LENGTH(b1), LENGTH(b300), LENGTH(bm), LENGTH(b70k), LENGTH(b17m), LENGTH(t), LENGTH(m), LENGTH(l) FROM t1;
+LENGTH(b)	LENGTH(b0)	LENGTH(b1)	LENGTH(b300)	LENGTH(bm)	LENGTH(b70k)	LENGTH(b17m)	LENGTH(t)	LENGTH(m)	LENGTH(l)
+0	0	0	0	0	0	0	0	0	0
+1	1	1	1	1	1	1	1	1	1
+5	5	5	5	5	5	5	5	5	6
+65535	65535	255	65535	65535	1048576	2097152	255	1048576	2097152
+INSERT INTO t1 (b,b0,b1,b300,bm,b70k,b17m,t,m,l) VALUES
+( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) );
+Warnings:
+Warning	1265	Data truncated for column 'b' at row 1
+Warning	1265	Data truncated for column 'b0' at row 1
+Warning	1265	Data truncated for column 'b1' at row 1
+Warning	1265	Data truncated for column 'b300' at row 1
+Warning	1265	Data truncated for column 'bm' at row 1
+Warning	1265	Data truncated for column 't' at row 1
+SELECT LENGTH(b), LENGTH(b0), LENGTH(b1), LENGTH(b300), LENGTH(bm), LENGTH(b70k), LENGTH(b17m), LENGTH(t), LENGTH(m), LENGTH(l) FROM t1;
+LENGTH(b)	LENGTH(b0)	LENGTH(b1)	LENGTH(b300)	LENGTH(bm)	LENGTH(b70k)	LENGTH(b17m)	LENGTH(t)	LENGTH(m)	LENGTH(l)
+0	0	0	0	0	0	0	0	0	0
+1	1	1	1	1	1	1	1	1	1
+5	5	5	5	5	5	5	5	5	6
+65535	65535	255	65535	65535	1048576	1048576	255	1048576	1048576
+65535	65535	255	65535	65535	1048576	2097152	255	1048576	2097152
+ALTER TABLE t1 ADD COLUMN bbb BLOB(4294967296);
+ERROR 42000: Display width out of range for column 'bbb' (max = 4294967295)
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c BLOB NULL,
+c1 BLOB NULL DEFAULT NULL,
+c2 BLOB NULL DEFAULT '',
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+Warnings:
+Warning	1101	BLOB/TEXT column 'c2' can't have a default value
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	blob	YES		NULL	
+c1	blob	YES		NULL	
+c2	blob	YES		NULL	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES ('','','');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2			
+3	NULL	NULL	NULL
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c TINYBLOB NULL,
+c1 TINYBLOB NULL DEFAULT NULL,
+c2 TINYBLOB NULL DEFAULT '',
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+Warnings:
+Warning	1101	BLOB/TEXT column 'c2' can't have a default value
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	tinyblob	YES		NULL	
+c1	tinyblob	YES		NULL	
+c2	tinyblob	YES		NULL	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES ('','','');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2			
+3	NULL	NULL	NULL
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c MEDIUMBLOB NULL,
+c1 MEDIUMBLOB NULL DEFAULT NULL,
+c2 MEDIUMBLOB NULL DEFAULT '',
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+Warnings:
+Warning	1101	BLOB/TEXT column 'c2' can't have a default value
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	mediumblob	YES		NULL	
+c1	mediumblob	YES		NULL	
+c2	mediumblob	YES		NULL	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES ('','','');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2			
+3	NULL	NULL	NULL
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c LONGBLOB NULL,
+c1 LONGBLOB NULL DEFAULT NULL,
+c2 LONGBLOB NULL DEFAULT '',
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+Warnings:
+Warning	1101	BLOB/TEXT column 'c2' can't have a default value
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	longblob	YES		NULL	
+c1	longblob	YES		NULL	
+c2	longblob	YES		NULL	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES ('','','');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2			
+3	NULL	NULL	NULL
+DROP TABLE t1;
+########################
+# BOOL columns
+########################
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+b1 BOOL NULL,
+b2 BOOLEAN NULL
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+b1	tinyint(1)	YES		NULL	
+b2	tinyint(1)	YES		NULL	
+INSERT INTO t1 (b1,b2) VALUES (1,TRUE);
+SELECT b1,b2 FROM t1;
+b1	b2
+1	1
+INSERT INTO t1 (b1,b2) VALUES (FALSE,0);
+SELECT b1,b2 FROM t1;
+b1	b2
+0	0
+1	1
+INSERT INTO t1 (b1,b2) VALUES (2,3);
+SELECT b1,b2 FROM t1;
+b1	b2
+0	0
+1	1
+2	3
+INSERT INTO t1 (b1,b2) VALUES (-1,-2);
+SELECT b1,b2 FROM t1;
+b1	b2
+-1	-2
+0	0
+1	1
+2	3
+SELECT IF(b1,'true','false') AS a, IF(b2,'true','false') AS b FROM t1;
+a	b
+false	false
+true	true
+true	true
+true	true
+SELECT b1,b2 FROM t1 WHERE b1 = TRUE;
+b1	b2
+1	1
+SELECT b1,b2 FROM t1 WHERE b2 = FALSE;
+b1	b2
+0	0
+INSERT INTO t1 (b1,b2) VALUES ('a','b');
+Warnings:
+Warning	1366	Incorrect integer value: 'a' for column 'b1' at row 1
+Warning	1366	Incorrect integer value: 'b' for column 'b2' at row 1
+SELECT b1,b2 FROM t1;
+b1	b2
+-1	-2
+0	0
+0	0
+1	1
+2	3
+INSERT INTO t1 (b1,b2) VALUES (128,-129);
+Warnings:
+Warning	1264	Out of range value for column 'b1' at row 1
+Warning	1264	Out of range value for column 'b2' at row 1
+SELECT b1,b2 FROM t1;
+b1	b2
+-1	-2
+0	0
+0	0
+1	1
+127	-128
+2	3
+ALTER TABLE t1 ADD COLUMN b3 BOOLEAN UNSIGNED NULL;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNSIGNED NULL' at line 1
+ALTER TABLE ADD COLUMN b3 BOOL ZEROFILL NULL;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ADD COLUMN b3 BOOL ZEROFILL NULL' at line 1
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c BOOL NULL,
+c1 BOOL NULL DEFAULT NULL,
+c2 BOOL NULL DEFAULT '0',
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	tinyint(1)	YES		NULL	
+c1	tinyint(1)	YES		NULL	
+c2	tinyint(1)	YES		0	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES ('0','0','0');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2	0	0	0
+3	NULL	NULL	0
+DROP TABLE t1;
+########################
+# CHAR columns
+########################
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c CHAR NULL,
+c0 CHAR(0) NULL,
+c1 CHAR(1) NULL,
+c20 CHAR(20) NULL,
+c255 CHAR(255) NULL,
+PRIMARY KEY (c255)
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	char(1)	YES		NULL	
+c0	char(0)	YES		NULL	
+c1	char(1)	YES		NULL	
+c20	char(20)	YES		NULL	
+c255	char(255)	NO	PRI		
+INSERT INTO t1 (c,c0,c1,c20,c255) VALUES ('','','','','');
+INSERT INTO t1 (c,c0,c1,c20,c255) VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.');
+SELECT c,c0,c1,c20,c255 FROM t1;
+c	c0	c1	c20	c255
+				
+a		b	abcdefghi klmnopqrst	Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work.
+INSERT INTO t1 (c,c0,c1,c20,c255) VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256));
+Warnings:
+Warning	1265	Data truncated for column 'c' at row 1
+Warning	1265	Data truncated for column 'c0' at row 1
+Warning	1265	Data truncated for column 'c1' at row 1
+Warning	1265	Data truncated for column 'c20' at row 1
+Warning	1265	Data truncated for column 'c255' at row 1
+INSERT INTO t1 (c,c0,c1,c20,c255) SELECT c255, c255, c255, c255, CONCAT('a',c255,c1) FROM t1;
+Warnings:
+Warning	1265	Data truncated for column 'c' at row 5
+Warning	1265	Data truncated for column 'c0' at row 5
+Warning	1265	Data truncated for column 'c1' at row 5
+Warning	1265	Data truncated for column 'c20' at row 5
+Warning	1265	Data truncated for column 'c' at row 6
+Warning	1265	Data truncated for column 'c0' at row 6
+Warning	1265	Data truncated for column 'c1' at row 6
+Warning	1265	Data truncated for column 'c20' at row 6
+Warning	1265	Data truncated for column 'c255' at row 6
+SELECT c,c0,c1,c20,c255 FROM t1;
+c	c0	c1	c20	c255
+				
+				a
+C		C	Creating an article	aCreating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work.b
+a		a	aaaaaaaaaaaaaaaaaaaa	xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+a		b	abcdefghi klmnopqrst	Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work.
+x		x	xxxxxxxxxxxxxxxxxxxx	axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+SELECT DISTINCT c20, REPEAT('a',LENGTH(c20)), COUNT(*) FROM t1 GROUP BY c1, c20;
+c20	REPEAT('a',LENGTH(c20))	COUNT(*)
+		2
+Creating an article	aaaaaaaaaaaaaaaaaaa	1
+aaaaaaaaaaaaaaaaaaaa	aaaaaaaaaaaaaaaaaaaa	1
+abcdefghi klmnopqrst	aaaaaaaaaaaaaaaaaaaa	1
+xxxxxxxxxxxxxxxxxxxx	aaaaaaaaaaaaaaaaaaaa	1
+ALTER TABLE t1 ADD COLUMN c257 CHAR(257) NULL;
+ERROR 42000: Column length too big for column 'c257' (max = 255); use BLOB or TEXT instead
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c CHAR NULL,
+c1 CHAR NULL DEFAULT NULL,
+c2 CHAR NULL DEFAULT '_',
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	char(1)	YES		NULL	
+c1	char(1)	YES		NULL	
+c2	char(1)	YES		_	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES ('_','_','_');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2	5F	5F	5F
+3	NULL	NULL	5F
+DROP TABLE t1;
+########################
+# VARCHAR columns
+########################
+DROP TABLE IF EXISTS t1, t2;
+CREATE TABLE t1 (
+v0 VARCHAR(0) NULL,
+v1 VARCHAR(1) NULL,
+v64 VARCHAR(64) NULL,
+v65000 VARCHAR(65000) NULL,
+PRIMARY KEY (v64)
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+v0	varchar(0)	YES		NULL	
+v1	varchar(1)	YES		NULL	
+v64	varchar(64)	NO	PRI		
+v65000	varchar(65000)	YES		NULL	
+CREATE TABLE t2 (v VARCHAR(65532), PRIMARY KEY (v(255))) ENGINE=rocksdb;
+SHOW COLUMNS IN t2;
+Field	Type	Null	Key	Default	Extra
+v	varchar(65532)	NO	PRI		
+INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','','','');
+INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','y','Once there, double check that an article doesn\'t already exist','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off.
+
+  If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment.
+  For developers who want to code on MariaDB or MySQL
+
+      * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB.
+            o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB!
+            o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. 
+      * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings
+            o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! 
+
+  For MariaDB / MySQL end users
+
+      * MariaDB Crash Course by Ben Forta
+            o First MariaDB book!
+            o For people who want to learn SQL and the basics of MariaDB.
+            o Now shipping. Purchase at Amazon.com or your favorite bookseller. 
+
+      * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer.
+            o Everything you wanted to know about the SQL 99 standard. Excellent reference book!
+            o Free to read in the Knowledgebase! 
+
+      * MySQL (4th Edition) by Paul DuBois
+            o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. 
+
+      * MySQL Cookbook by Paul DuBois
+            o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. 
+
+      * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al.
+            o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) 
+
+      * MySQL Admin Cookbook
+            o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration 
+
+      * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen
+            o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. ');
+SELECT v0,v1,v64,v65000 FROM t1;
+v0	v1	v64	v65000
+
+
+
+
+
+
+
+
+
+
+			
+	y	Once there, double check that an article doesn't already exist	Here is a list of recommended books on MariaDB and MySQL. We've provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off.
+            o "High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL's full power." (From the book description at O'Reilly) 
+            o A lot of examples of how to use MySQL. As with all of Paul's books, it's worth its weight in gold and even enjoyable reading for such a 'dry' subject. 
+            o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! 
+            o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration 
+            o Everything you wanted to know about the SQL 99 standard. Excellent reference book!
+            o First MariaDB book!
+            o For people who want to learn SQL and the basics of MariaDB.
+            o Free to read in the Knowledgebase! 
+            o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. 
+            o Now shipping. Purchase at Amazon.com or your favorite bookseller. 
+            o The 'default' book to read if you wont to learn to use MySQL / MariaDB. 
+            o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. 
+            o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB!
+      * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al.
+      * MariaDB Crash Course by Ben Forta
+      * MySQL (4th Edition) by Paul DuBois
+      * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen
+      * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings
+      * MySQL Admin Cookbook
+      * MySQL Cookbook by Paul DuBois
+      * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer.
+      * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB.
+  For MariaDB / MySQL end users
+  For developers who want to code on MariaDB or MySQL
+  If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment.
+INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('y', 'yy', REPEAT('c',65), REPEAT('abcdefghi ',6501));
+Warnings:
+Warning	1265	Data truncated for column 'v0' at row 1
+Warning	1265	Data truncated for column 'v1' at row 1
+Warning	1265	Data truncated for column 'v64' at row 1
+Warning	1265	Data truncated for column 'v65000' at row 1
+INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, CONCAT('a',v65000), CONCAT(v65000,v1) FROM t1;
+Warnings:
+Warning	1265	Data truncated for column 'v0' at row 5
+Warning	1265	Data truncated for column 'v1' at row 5
+Warning	1265	Data truncated for column 'v64' at row 5
+Warning	1265	Data truncated for column 'v65000' at row 5
+Warning	1265	Data truncated for column 'v0' at row 6
+Warning	1265	Data truncated for column 'v1' at row 6
+Warning	1265	Data truncated for column 'v64' at row 6
+SELECT v0, v1, v64, LENGTH(v65000) FROM t1;
+v0	v1	v64	LENGTH(v65000)
+			0
+		a	0
+	H	aHere is a list of recommended books on MariaDB and MySQL. We've	2966
+	a	aabcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abc	65000
+	y	Once there, double check that an article doesn't already exist	2965
+	y	cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc	65000
+ALTER TABLE t1 ADD COLUMN v65536 VARCHAR(65536) NULL;
+Warnings:
+Note	1246	Converting column 'v65536' from VARCHAR to TEXT
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+v0	varchar(0)	YES		NULL	
+v1	varchar(1)	YES		NULL	
+v64	varchar(64)	NO	PRI		
+v65000	varchar(65000)	YES		NULL	
+v65536	mediumtext	YES		NULL	
+DROP TABLE t1, t2;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c VARCHAR(64) NULL,
+c1 VARCHAR(64) NULL DEFAULT NULL,
+c2 VARCHAR(64) NULL DEFAULT 'test default',
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	varchar(64)	YES		NULL	
+c1	varchar(64)	YES		NULL	
+c2	varchar(64)	YES		test default	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES ('test default','test default','test default');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2	746573742064656661756C74	746573742064656661756C74	746573742064656661756C74
+3	NULL	NULL	746573742064656661756C74
+DROP TABLE t1;
+########################
+# date and time columns
+########################
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+d DATE NULL,
+dt DATETIME NULL,
+ts TIMESTAMP NULL,
+t TIME NULL,
+y YEAR NULL,
+y4 YEAR(4) NULL,
+y2 YEAR(2) NULL,
+pk DATETIME PRIMARY KEY
+) ENGINE=rocksdb;
+Warnings:
+Warning	1818	YEAR(2) column type is deprecated. Creating YEAR(4) column instead.
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+d	date	YES		NULL	
+dt	datetime	YES		NULL	
+ts	timestamp	YES		NULL	
+t	time	YES		NULL	
+y	year(4)	YES		NULL	
+y4	year(4)	YES		NULL	
+y2	year(4)	YES		NULL	
+pk	datetime	NO	PRI	NULL	
+SET @tm = '2012-04-09 05:27:00';
+INSERT INTO t1 (d,dt,ts,t,y,y4,y2,pk) VALUES
+('1000-01-01', '1000-01-01 00:00:00', FROM_UNIXTIME(1), '-838:59:59', '1901', '1901', '00','2012-12-12 12:12:12'),
+('9999-12-31', '9999-12-31 23:59:59', FROM_UNIXTIME(2147483647), '838:59:59', '2155', '2155', '99','2012-12-12 12:12:13'),
+('0000-00-00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:00:00', '0', '0', '0','2012-12-12 12:12:14'),
+(DATE(@tm), at tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm),YEAR(@tm),YEAR(@tm),'2012-12-12 12:12:15');
+SELECT d,dt,ts,t,y,y4,y2 FROM t1;
+d	dt	ts	t	y	y4	y2
+0000-00-00	0000-00-00 00:00:00	0000-00-00 00:00:00	00:00:00	2000	2000	2000
+1000-01-01	1000-01-01 00:00:00	1970-01-01 03:00:01	-838:59:59	1901	1901	2000
+2012-04-09	2012-04-09 05:27:00	2012-04-09 05:27:00	05:27:00	2012	2012	2012
+9999-12-31	9999-12-31 23:59:59	2038-01-19 06:14:07	838:59:59	2155	2155	1999
+INSERT INTO t1 (d,dt,ts,t,y,y4,y2,pk) VALUES
+('999-13-32', '999-11-31 00:00:00', '0', '-839:00:00', '1900', '1900', '-1','2012-12-12 12:12:16');
+Warnings:
+Warning	1265	Data truncated for column 'd' at row 1
+Warning	1264	Out of range value for column 'dt' at row 1
+Warning	1264	Out of range value for column 'ts' at row 1
+Warning	1264	Out of range value for column 't' at row 1
+Warning	1264	Out of range value for column 'y' at row 1
+Warning	1264	Out of range value for column 'y4' at row 1
+Warning	1264	Out of range value for column 'y2' at row 1
+SELECT d,dt,ts,t,y,y4,y2 FROM t1;
+d	dt	ts	t	y	y4	y2
+1000-01-01	1000-01-01 00:00:00	1970-01-01 03:00:01	-838:59:59	1901	1901	2000
+9999-12-31	9999-12-31 23:59:59	2038-01-19 06:14:07	838:59:59	2155	2155	1999
+0000-00-00	0000-00-00 00:00:00	0000-00-00 00:00:00	00:00:00	2000	2000	2000
+2012-04-09	2012-04-09 05:27:00	2012-04-09 05:27:00	05:27:00	2012	2012	2012
+0000-00-00	0000-00-00 00:00:00	0000-00-00 00:00:00	-838:59:59	0000	0000	0000
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c DATE NULL,
+c1 DATE NULL DEFAULT NULL,
+c2 DATE NULL DEFAULT '2012-12-21',
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	date	YES		NULL	
+c1	date	YES		NULL	
+c2	date	YES		2012-12-21	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES ('2012-12-21','2012-12-21','2012-12-21');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2	323031322D31322D3231	323031322D31322D3231	323031322D31322D3231
+3	NULL	NULL	323031322D31322D3231
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c DATETIME NULL,
+c1 DATETIME NULL DEFAULT NULL,
+c2 DATETIME NULL DEFAULT '2012-12-21 12:21:12',
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	datetime	YES		NULL	
+c1	datetime	YES		NULL	
+c2	datetime	YES		2012-12-21 12:21:12	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES ('2012-12-21 12:21:12','2012-12-21 12:21:12','2012-12-21 12:21:12');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2	323031322D31322D32312031323A32313A3132	323031322D31322D32312031323A32313A3132	323031322D31322D32312031323A32313A3132
+3	NULL	NULL	323031322D31322D32312031323A32313A3132
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c TIMESTAMP NULL,
+c1 TIMESTAMP NULL DEFAULT NULL,
+c2 TIMESTAMP NULL DEFAULT '2012-12-21 12:21:12',
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	timestamp	YES		NULL	
+c1	timestamp	YES		NULL	
+c2	timestamp	YES		2012-12-21 12:21:12	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES ('2012-12-21 12:21:12','2012-12-21 12:21:12','2012-12-21 12:21:12');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2	323031322D31322D32312031323A32313A3132	323031322D31322D32312031323A32313A3132	323031322D31322D32312031323A32313A3132
+3	NULL	NULL	323031322D31322D32312031323A32313A3132
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c TIME NULL,
+c1 TIME NULL DEFAULT NULL,
+c2 TIME NULL DEFAULT '12:21:12',
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	time	YES		NULL	
+c1	time	YES		NULL	
+c2	time	YES		12:21:12	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES ('12:21:12','12:21:12','12:21:12');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2	31323A32313A3132	31323A32313A3132	31323A32313A3132
+3	NULL	NULL	31323A32313A3132
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c YEAR NULL,
+c1 YEAR NULL DEFAULT NULL,
+c2 YEAR NULL DEFAULT '2012',
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	year(4)	YES		NULL	
+c1	year(4)	YES		NULL	
+c2	year(4)	YES		2012	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES ('2012','2012','2012');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2	7DC	7DC	7DC
+3	NULL	NULL	7DC
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c YEAR(2) NULL,
+c1 YEAR(2) NULL DEFAULT NULL,
+c2 YEAR(2) NULL DEFAULT '12',
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+Warnings:
+Warning	1818	YEAR(2) column type is deprecated. Creating YEAR(4) column instead.
+Warning	1818	YEAR(2) column type is deprecated. Creating YEAR(4) column instead.
+Warning	1818	YEAR(2) column type is deprecated. Creating YEAR(4) column instead.
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	year(4)	YES		NULL	
+c1	year(4)	YES		NULL	
+c2	year(4)	YES		2012	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES ('12','12','12');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2	7DC	7DC	7DC
+3	NULL	NULL	7DC
+DROP TABLE t1;
+########################
+# ENUM columns
+########################
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+a ENUM('') NULL,
+b ENUM('test1','test2','test3','test4','test5') NULL,
+c ENUM('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',' ','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o
 ','5p','
 5q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75') NULL,
+PRIMARY KEY (b)
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+a	enum('')	YES		NULL	
+b	enum('test1','test2','test3','test4','test5')	NO	PRI	test1	
+c	enum('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o'
 ,'5p','5
 q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75')	YES		NULL	
+INSERT INTO t1 (a,b,c) VALUES ('','test2','4'),('',5,2);
+SELECT a,b,c FROM t1;
+a	b	c
+	test2	4
+	test5	2
+INSERT INTO t1 (a,b,c) VALUES (0,'test6',-1);
+Warnings:
+Warning	1265	Data truncated for column 'a' at row 1
+Warning	1265	Data truncated for column 'b' at row 1
+Warning	1265	Data truncated for column 'c' at row 1
+SELECT a,b,c FROM t1;
+a	b	c
+		
+	test2	4
+	test5	2
+ALTER TABLE t1 ADD COLUMN e ENUM('a','A') NULL;
+Warnings:
+Note	1291	Column 'e' has duplicated value 'a' in ENUM
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+a	enum('')	YES		NULL	
+b	enum('test1','test2','test3','test4','test5')	NO	PRI	test1	
+c	enum('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o'
 ,'5p','5
 q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75')	YES		NULL	
+e	enum('a','A')	YES		NULL	
+INSERT INTO t1 (a,b,c,e) VALUES ('','test3','75','A');
+SELECT a,b,c,e FROM t1;
+a	b	c	e
+			NULL
+	test2	4	NULL
+	test3	75	a
+	test5	2	NULL
+SELECT a,b,c,e FROM t1 WHERE b='test2' OR a != '';
+a	b	c	e
+	test2	4	NULL
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c ENUM('test1','test2','test3') NULL,
+c1 ENUM('test1','test2','test3') NULL DEFAULT NULL,
+c2 ENUM('test1','test2','test3') NULL DEFAULT 'test2',
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	enum('test1','test2','test3')	YES		NULL	
+c1	enum('test1','test2','test3')	YES		NULL	
+c2	enum('test1','test2','test3')	YES		test2	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES ('test2','test2','test2');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2	7465737432	7465737432	7465737432
+3	NULL	NULL	7465737432
+DROP TABLE t1;
+########################
+# Fixed point columns (NUMERIC, DECIMAL)
+########################
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+d DECIMAL NULL,
+d0 DECIMAL(0) NULL,
+d1_1 DECIMAL(1,1) NULL,
+d10_2 DECIMAL(10,2) NULL,
+d60_10 DECIMAL(60,10) NULL,
+n NUMERIC NULL,
+n0_0 NUMERIC(0,0) NULL,
+n1 NUMERIC(1) NULL,
+n20_4 NUMERIC(20,4) NULL,
+n65_4 NUMERIC(65,4) NULL,
+pk NUMERIC NULL PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+d	decimal(10,0)	YES		NULL	
+d0	decimal(10,0)	YES		NULL	
+d1_1	decimal(1,1)	YES		NULL	
+d10_2	decimal(10,2)	YES		NULL	
+d60_10	decimal(60,10)	YES		NULL	
+n	decimal(10,0)	YES		NULL	
+n0_0	decimal(10,0)	YES		NULL	
+n1	decimal(1,0)	YES		NULL	
+n20_4	decimal(20,4)	YES		NULL	
+n65_4	decimal(65,4)	YES		NULL	
+pk	decimal(10,0)	NO	PRI	NULL	
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807,1);
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (0,0,0,0,0,0,0,0,0,0,2);
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999,3);
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
+d	d0	d1_1	d10_2	d60_10	n	n0_0	n1	n20_4	n65_4
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+100	123456	0.3	40000.25	123456789123456789.1000100000	1024	7000	8	999999.9000	9223372036854775807.0000
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807,4);
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999,5);
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
+d	d0	d1_1	d10_2	d60_10	n	n0_0	n1	n20_4	n65_4
+-100	-123456	-0.3	-40000.25	-123456789123456789.1000100000	-1024	-7000	-8	-999999.9000	-9223372036854775807.0000
+-9999999999	-9999999999	-0.9	-99999999.99	-99999999999999999999999999999999999999999999999999.9999999999	-9999999999	-9999999999	-9	-9999999999999999.9999	-9999999999999999999999999999999999999999999999999999999999999.9999
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+100	123456	0.3	40000.25	123456789123456789.1000100000	1024	7000	8	999999.9000	9223372036854775807.0000
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100;
+d	d0	d1_1	d10_2	d60_10	n	n0_0	n1	n20_4	n65_4
+-100	-123456	-0.3	-40000.25	-123456789123456789.1000100000	-1024	-7000	-8	-999999.9000	-9223372036854775807.0000
+-9999999999	-9999999999	-0.9	-99999999.99	-99999999999999999999999999999999999999999999999999.9999999999	-9999999999	-9999999999	-9	-9999999999999999.9999	-9999999999999999999999999999999999999999999999999999999999999.9999
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+6
+);
+Warnings:
+Warning	1264	Out of range value for column 'd' at row 1
+Warning	1264	Out of range value for column 'd0' at row 1
+Warning	1264	Out of range value for column 'd1_1' at row 1
+Warning	1264	Out of range value for column 'd10_2' at row 1
+Warning	1264	Out of range value for column 'd60_10' at row 1
+Warning	1264	Out of range value for column 'n' at row 1
+Warning	1264	Out of range value for column 'n0_0' at row 1
+Warning	1264	Out of range value for column 'n1' at row 1
+Warning	1264	Out of range value for column 'n20_4' at row 1
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
+d	d0	d1_1	d10_2	d60_10	n	n0_0	n1	n20_4	n65_4
+-100	-123456	-0.3	-40000.25	-123456789123456789.1000100000	-1024	-7000	-8	-999999.9000	-9223372036854775807.0000
+-9999999999	-9999999999	-0.9	-99999999.99	-99999999999999999999999999999999999999999999999999.9999999999	-9999999999	-9999999999	-9	-9999999999999999.9999	-9999999999999999999999999999999999999999999999999999999999999.9999
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+100	123456	0.3	40000.25	123456789123456789.1000100000	1024	7000	8	999999.9000	9223372036854775807.0000
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999,7);
+Warnings:
+Warning	1264	Out of range value for column 'd' at row 1
+Warning	1264	Out of range value for column 'd0' at row 1
+Warning	1264	Out of range value for column 'd1_1' at row 1
+Warning	1264	Out of range value for column 'd10_2' at row 1
+Warning	1264	Out of range value for column 'd60_10' at row 1
+Warning	1264	Out of range value for column 'n' at row 1
+Warning	1264	Out of range value for column 'n0_0' at row 1
+Warning	1264	Out of range value for column 'n1' at row 1
+Warning	1264	Out of range value for column 'n20_4' at row 1
+Warning	1264	Out of range value for column 'n65_4' at row 1
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
+d	d0	d1_1	d10_2	d60_10	n	n0_0	n1	n20_4	n65_4
+-100	-123456	-0.3	-40000.25	-123456789123456789.1000100000	-1024	-7000	-8	-999999.9000	-9223372036854775807.0000
+-9999999999	-9999999999	-0.9	-99999999.99	-99999999999999999999999999999999999999999999999999.9999999999	-9999999999	-9999999999	-9	-9999999999999999.9999	-9999999999999999999999999999999999999999999999999999999999999.9999
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+100	123456	0.3	40000.25	123456789123456789.1000100000	1024	7000	8	999999.9000	9223372036854775807.0000
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111,8);
+Warnings:
+Note	1265	Data truncated for column 'd' at row 1
+Note	1265	Data truncated for column 'd0' at row 1
+Warning	1264	Out of range value for column 'd1_1' at row 1
+Note	1265	Data truncated for column 'd10_2' at row 1
+Note	1265	Data truncated for column 'd60_10' at row 1
+Note	1265	Data truncated for column 'n' at row 1
+Note	1265	Data truncated for column 'n0_0' at row 1
+Note	1265	Data truncated for column 'n1' at row 1
+Note	1265	Data truncated for column 'n20_4' at row 1
+Note	1265	Data truncated for column 'n65_4' at row 1
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
+d	d0	d1_1	d10_2	d60_10	n	n0_0	n1	n20_4	n65_4
+-100	-123456	-0.3	-40000.25	-123456789123456789.1000100000	-1024	-7000	-8	-999999.9000	-9223372036854775807.0000
+-9999999999	-9999999999	-0.9	-99999999.99	-99999999999999999999999999999999999999999999999999.9999999999	-9999999999	-9999999999	-9	-9999999999999999.9999	-9999999999999999999999999999999999999999999999999999999999999.9999
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+100	123456	0.3	40000.25	123456789123456789.1000100000	1024	7000	8	999999.9000	9223372036854775807.0000
+9999999999	9999999999	0.9	99999999.00	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.0000	9999999999999999999999999999999999999999999999999999999999999.1111
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+ALTER TABLE t1 ADD COLUMN n66 NUMERIC(66) NULL;
+ERROR 42000: Too big precision 66 specified for column 'n66'. Maximum is 65.
+ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(66,6) NULL;
+ERROR 42000: Too big precision 66 specified for column 'n66_6'. Maximum is 65.
+ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(66,66) NULL;
+ERROR 42000: Too big scale 66 specified for column 'n66_66'. Maximum is 30.
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c DECIMAL NULL,
+c1 DECIMAL NULL DEFAULT NULL,
+c2 DECIMAL NULL DEFAULT 1.1,
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+Warnings:
+Note	1265	Data truncated for column 'c2' at row 1
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	decimal(10,0)	YES		NULL	
+c1	decimal(10,0)	YES		NULL	
+c2	decimal(10,0)	YES		1	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES (1.1,1.1,1.1);
+Warnings:
+Note	1265	Data truncated for column 'c' at row 1
+Note	1265	Data truncated for column 'c1' at row 1
+Note	1265	Data truncated for column 'c2' at row 1
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2	1	1	1
+3	NULL	NULL	1
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c NUMERIC NULL,
+c1 NUMERIC NULL DEFAULT NULL,
+c2 NUMERIC NULL DEFAULT 0 ,
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	decimal(10,0)	YES		NULL	
+c1	decimal(10,0)	YES		NULL	
+c2	decimal(10,0)	YES		0	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES (0 ,0 ,0 );
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2	0	0	0
+3	NULL	NULL	0
+DROP TABLE t1;
+########################
+# Floating point columns (FLOAT, DOUBLE)
+########################
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+f FLOAT NULL,
+f0 FLOAT(0) NULL,
+r1_1 REAL(1,1) NULL,
+f23_0 FLOAT(23) NULL,
+f20_3 FLOAT(20,3) NULL,
+d DOUBLE NULL,
+d1_0 DOUBLE(1,0) NULL,
+d10_10 DOUBLE PRECISION (10,10) NULL,
+d53 DOUBLE(53,0) NULL,
+d53_10 DOUBLE(53,10) NULL,
+pk DOUBLE NULL PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+f	float	YES		NULL	
+f0	float	YES		NULL	
+r1_1	double(1,1)	YES		NULL	
+f23_0	float	YES		NULL	
+f20_3	float(20,3)	YES		NULL	
+d	double	YES		NULL	
+d1_0	double(1,0)	YES		NULL	
+d10_10	double(10,10)	YES		NULL	
+d53	double(53,0)	YES		NULL	
+d53_10	double(53,10)	YES		NULL	
+pk	double	NO	PRI	NULL	
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999,1);
+SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1;
+f	12345.1
+d	11111111.111
+d10_10	0.0123456789
+d1_0	8
+d53	1234566789123456800
+d53_10	100000000000000000.0000000000
+f0	12345.1
+f20_3	56789.988
+f23_0	123457000
+r1_1	0.9
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (0,0,0,0,0,0,0,0,0,0,2);
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (
+99999999999999999999999999999999999999,
+99999999999999999999999999999999999999.9999999999999999,
+0.9,
+99999999999999999999999999999999999999.9,
+99999999999999999.999,
+999999999999999999999999999999999999999999999999999999999999999999999999999999999,
+9,
+0.9999999999, 
+1999999999999999999999999999999999999999999999999999999,
+19999999999999999999999999999999999999999999.9999999999,
+3
+);
+Warnings:
+Warning	1264	Out of range value for column 'd53' at row 1
+Warning	1264	Out of range value for column 'd53_10' at row 1
+SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1;
+f	12345.1
+d	0
+d	11111111.111
+d	1e81
+d10_10	0.0000000000
+d10_10	0.0123456789
+d10_10	0.9999999999
+d1_0	0
+d1_0	8
+d1_0	9
+d53	0
+d53	100000000000000000000000000000000000000000000000000000
+d53	1234566789123456800
+d53_10	0.0000000000
+d53_10	100000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+f	0
+f	1e38
+f0	0
+f0	12345.1
+f0	1e38
+f20_3	0.000
+f20_3	56789.988
+f20_3	99999998430674940.000
+f23_0	0
+f23_0	123457000
+f23_0	1e38
+r1_1	0.0
+r1_1	0.9
+r1_1	0.9
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999,4);
+SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1;
+f	12345.1
+d	-1e60
+d	0
+d	11111111.111
+d	1e81
+d10_10	-0.9999999999
+d10_10	0.0000000000
+d10_10	0.0123456789
+d10_10	0.9999999999
+d1_0	-9
+d1_0	0
+d1_0	8
+d1_0	9
+d53	-1000000000000000000000000000000
+d53	0
+d53	100000000000000000000000000000000000000000000000000000
+d53	1234566789123456800
+d53_10	-10000000000000000000000000000000000000000000.0000000000
+d53_10	0.0000000000
+d53_10	100000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+f	-1e24
+f	0
+f	1e38
+f0	-100000000000
+f0	0
+f0	12345.1
+f0	1e38
+f20_3	-99999998430674940.000
+f20_3	0.000
+f20_3	56789.988
+f20_3	99999998430674940.000
+f23_0	-1000
+f23_0	0
+f23_0	123457000
+f23_0	1e38
+r1_1	-0.9
+r1_1	0.0
+r1_1	0.9
+r1_1	0.9
+SELECT MAX(f), MAX(f0), MAX(r1_1), MAX(f23_0), MAX(f20_3), MAX(d), MAX(d1_0), MAX(d10_10), MAX(d53), MAX(d53_10) FROM t1;
+MAX(f)	9.999999680285692e37
+MAX(d)	1e81
+MAX(d10_10)	0.9999999999
+MAX(d1_0)	9
+MAX(d53)	100000000000000000000000000000000000000000000000000000
+MAX(d53_10)	10000000000000000000000000000000000000000000.0000000000
+MAX(f0)	9.999999680285692e37
+MAX(f20_3)	99999998430674940.000
+MAX(f23_0)	9.999999680285692e37
+MAX(r1_1)	0.9
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+5
+);
+Warnings:
+Warning	1264	Out of range value for column 'f' at row 1
+Warning	1264	Out of range value for column 'f0' at row 1
+Warning	1264	Out of range value for column 'r1_1' at row 1
+Warning	1264	Out of range value for column 'f23_0' at row 1
+Warning	1264	Out of range value for column 'f20_3' at row 1
+Warning	1264	Out of range value for column 'd1_0' at row 1
+Warning	1264	Out of range value for column 'd10_10' at row 1
+Warning	1264	Out of range value for column 'd53' at row 1
+Warning	1264	Out of range value for column 'd53_10' at row 1
+SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1;
+f	12345.1
+d	-1e60
+d	0
+d	11111111.111
+d	1e61
+d	1e81
+d10_10	-0.9999999999
+d10_10	0.0000000000
+d10_10	0.0123456789
+d10_10	0.9999999999
+d10_10	0.9999999999
+d1_0	-9
+d1_0	0
+d1_0	8
+d1_0	9
+d1_0	9
+d53	-1000000000000000000000000000000
+d53	0
+d53	100000000000000000000000000000000000000000000000000000
+d53	100000000000000000000000000000000000000000000000000000
+d53	1234566789123456800
+d53_10	-10000000000000000000000000000000000000000000.0000000000
+d53_10	0.0000000000
+d53_10	100000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+f	-1e24
+f	0
+f	1e38
+f	3.40282e38
+f0	-100000000000
+f0	0
+f0	12345.1
+f0	1e38
+f0	3.40282e38
+f20_3	-99999998430674940.000
+f20_3	0.000
+f20_3	56789.988
+f20_3	99999998430674940.000
+f20_3	99999998430674940.000
+f23_0	-1000
+f23_0	0
+f23_0	123457000
+f23_0	1e38
+f23_0	3.40282e38
+r1_1	-0.9
+r1_1	0.0
+r1_1	0.9
+r1_1	0.9
+r1_1	0.9
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (
+999999999999999999999999999999999999999,
+999999999999999999999999999999999999999.9999999999999999,
+1.9,
+999999999999999999999999999999999999999.9,
+999999999999999999.999,
+9999999999999999999999999999999999999999999999999999999999999999999999999999999999,
+99,
+1.9999999999,
+1999999999999999999999999999999999999999999999999999999,
+19999999999999999999999999999999999999999999.9999999999,
+6
+);
+Warnings:
+Warning	1292	Truncated incorrect DECIMAL value: ''
+Warning	1264	Out of range value for column 'f' at row 1
+Warning	1264	Out of range value for column 'f0' at row 1
+Warning	1264	Out of range value for column 'r1_1' at row 1
+Warning	1264	Out of range value for column 'f23_0' at row 1
+Warning	1264	Out of range value for column 'f20_3' at row 1
+Warning	1264	Out of range value for column 'd1_0' at row 1
+Warning	1264	Out of range value for column 'd10_10' at row 1
+Warning	1264	Out of range value for column 'd53' at row 1
+Warning	1264	Out of range value for column 'd53_10' at row 1
+SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1;
+f	12345.1
+d	-1e60
+d	0
+d	11111111.111
+d	1e61
+d	1e65
+d	1e81
+d10_10	-0.9999999999
+d10_10	0.0000000000
+d10_10	0.0123456789
+d10_10	0.9999999999
+d10_10	0.9999999999
+d10_10	0.9999999999
+d1_0	-9
+d1_0	0
+d1_0	8
+d1_0	9
+d1_0	9
+d1_0	9
+d53	-1000000000000000000000000000000
+d53	0
+d53	100000000000000000000000000000000000000000000000000000
+d53	100000000000000000000000000000000000000000000000000000
+d53	100000000000000000000000000000000000000000000000000000
+d53	1234566789123456800
+d53_10	-10000000000000000000000000000000000000000000.0000000000
+d53_10	0.0000000000
+d53_10	100000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+f	-1e24
+f	0
+f	1e38
+f	3.40282e38
+f	3.40282e38
+f0	-100000000000
+f0	0
+f0	12345.1
+f0	1e38
+f0	3.40282e38
+f0	3.40282e38
+f20_3	-99999998430674940.000
+f20_3	0.000
+f20_3	56789.988
+f20_3	99999998430674940.000
+f20_3	99999998430674940.000
+f20_3	99999998430674940.000
+f23_0	-1000
+f23_0	0
+f23_0	123457000
+f23_0	1e38
+f23_0	3.40282e38
+f23_0	3.40282e38
+r1_1	-0.9
+r1_1	0.0
+r1_1	0.9
+r1_1	0.9
+r1_1	0.9
+r1_1	0.9
+ALTER TABLE t1 ADD COLUMN d0_0 DOUBLE(0,0) NULL;
+ERROR 42000: Display width out of range for column 'd0_0' (max = 255)
+ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(256,1) NULL;
+ERROR 42000: Too big precision 256 specified for column 'n66_6'. Maximum is 65.
+ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(40,35) NULL;
+ERROR 42000: Too big scale 35 specified for column 'n66_66'. Maximum is 30.
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c FLOAT NULL,
+c1 FLOAT NULL DEFAULT NULL,
+c2 FLOAT NULL DEFAULT 1.1 ,
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	float	YES		NULL	
+c1	float	YES		NULL	
+c2	float	YES		1.1	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES (1.1 ,1.1 ,1.1 );
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2	1	1	1
+3	NULL	NULL	1
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c DOUBLE NULL,
+c1 DOUBLE NULL DEFAULT NULL,
+c2 DOUBLE NULL DEFAULT 0  ,
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	double	YES		NULL	
+c1	double	YES		NULL	
+c2	double	YES		0	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES (0  ,0  ,0  );
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2	0	0	0
+3	NULL	NULL	0
+DROP TABLE t1;
+########################
+# INT columns
+########################
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+i INT NULL,
+i0 INT(0) NULL,
+i1 INT(1) NULL,
+i20 INT(20) NULL,
+t TINYINT NULL,
+t0 TINYINT(0) NULL,
+t1 TINYINT(1) NULL,
+t20 TINYINT(20) NULL,
+s SMALLINT NULL,
+s0 SMALLINT(0) NULL,
+s1 SMALLINT(1) NULL,
+s20 SMALLINT(20) NULL,
+m MEDIUMINT NULL,
+m0 MEDIUMINT(0) NULL,
+m1 MEDIUMINT(1) NULL,
+m20 MEDIUMINT(20) NULL,
+b BIGINT NULL,
+b0 BIGINT(0) NULL,
+b1 BIGINT(1) NULL,
+b20 BIGINT(20) NULL,
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+i	int(11)	YES		NULL	
+i0	int(11)	YES		NULL	
+i1	int(1)	YES		NULL	
+i20	int(20)	YES		NULL	
+t	tinyint(4)	YES		NULL	
+t0	tinyint(4)	YES		NULL	
+t1	tinyint(1)	YES		NULL	
+t20	tinyint(20)	YES		NULL	
+s	smallint(6)	YES		NULL	
+s0	smallint(6)	YES		NULL	
+s1	smallint(1)	YES		NULL	
+s20	smallint(20)	YES		NULL	
+m	mediumint(9)	YES		NULL	
+m0	mediumint(9)	YES		NULL	
+m1	mediumint(1)	YES		NULL	
+m20	mediumint(20)	YES		NULL	
+b	bigint(20)	YES		NULL	
+b0	bigint(20)	YES		NULL	
+b1	bigint(1)	YES		NULL	
+b20	bigint(20)	YES		NULL	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20);
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807);
+SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1;
+i	i0	i1	i20	t	t0	t1	t20	s	s0	s1	s20	m	m0	m1	m20	b	b0	b1	b20
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
+1	2	3	4	5	6	7	8	9	10	11	12	13	14	15	16	17	18	19	20
+2147483647	2147483647	2147483647	2147483647	127	127	127	127	32767	32767	32767	32767	8388607	8388607	8388607	8388607	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808);
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615);
+Warnings:
+Warning	1264	Out of range value for column 'i' at row 1
+Warning	1264	Out of range value for column 'i0' at row 1
+Warning	1264	Out of range value for column 'i1' at row 1
+Warning	1264	Out of range value for column 'i20' at row 1
+Warning	1264	Out of range value for column 't' at row 1
+Warning	1264	Out of range value for column 't0' at row 1
+Warning	1264	Out of range value for column 't1' at row 1
+Warning	1264	Out of range value for column 't20' at row 1
+Warning	1264	Out of range value for column 's' at row 1
+Warning	1264	Out of range value for column 's0' at row 1
+Warning	1264	Out of range value for column 's1' at row 1
+Warning	1264	Out of range value for column 's20' at row 1
+Warning	1264	Out of range value for column 'm' at row 1
+Warning	1264	Out of range value for column 'm0' at row 1
+Warning	1264	Out of range value for column 'm1' at row 1
+Warning	1264	Out of range value for column 'm20' at row 1
+Warning	1264	Out of range value for column 'b' at row 1
+Warning	1264	Out of range value for column 'b0' at row 1
+Warning	1264	Out of range value for column 'b1' at row 1
+Warning	1264	Out of range value for column 'b20' at row 1
+SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1;
+i	i0	i1	i20	t	t0	t1	t20	s	s0	s1	s20	m	m0	m1	m20	b	b0	b1	b20
+-2147483648	-2147483648	-2147483648	-2147483648	-128	-128	-128	-128	-32768	-32768	-32768	-32768	-8388608	-8388608	-8388608	-8388608	-9223372036854775808	-9223372036854775808	-9223372036854775808	-9223372036854775808
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
+1	2	3	4	5	6	7	8	9	10	11	12	13	14	15	16	17	18	19	20
+2147483647	2147483647	2147483647	2147483647	127	127	127	127	32767	32767	32767	32767	8388607	8388607	8388607	8388607	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+2147483647	2147483647	2147483647	2147483647	127	127	127	127	32767	32767	32767	32767	8388607	8388607	8388607	8388607	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809);
+Warnings:
+Warning	1264	Out of range value for column 'i' at row 1
+Warning	1264	Out of range value for column 'i0' at row 1
+Warning	1264	Out of range value for column 'i1' at row 1
+Warning	1264	Out of range value for column 'i20' at row 1
+Warning	1264	Out of range value for column 't' at row 1
+Warning	1264	Out of range value for column 't0' at row 1
+Warning	1264	Out of range value for column 't1' at row 1
+Warning	1264	Out of range value for column 't20' at row 1
+Warning	1264	Out of range value for column 's' at row 1
+Warning	1264	Out of range value for column 's0' at row 1
+Warning	1264	Out of range value for column 's1' at row 1
+Warning	1264	Out of range value for column 's20' at row 1
+Warning	1264	Out of range value for column 'm' at row 1
+Warning	1264	Out of range value for column 'm0' at row 1
+Warning	1264	Out of range value for column 'm1' at row 1
+Warning	1264	Out of range value for column 'm20' at row 1
+Warning	1264	Out of range value for column 'b' at row 1
+Warning	1264	Out of range value for column 'b0' at row 1
+Warning	1264	Out of range value for column 'b1' at row 1
+Warning	1264	Out of range value for column 'b20' at row 1
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616);
+Warnings:
+Warning	1264	Out of range value for column 'i' at row 1
+Warning	1264	Out of range value for column 'i0' at row 1
+Warning	1264	Out of range value for column 'i1' at row 1
+Warning	1264	Out of range value for column 'i20' at row 1
+Warning	1264	Out of range value for column 't' at row 1
+Warning	1264	Out of range value for column 't0' at row 1
+Warning	1264	Out of range value for column 't1' at row 1
+Warning	1264	Out of range value for column 't20' at row 1
+Warning	1264	Out of range value for column 's' at row 1
+Warning	1264	Out of range value for column 's0' at row 1
+Warning	1264	Out of range value for column 's1' at row 1
+Warning	1264	Out of range value for column 's20' at row 1
+Warning	1264	Out of range value for column 'm' at row 1
+Warning	1264	Out of range value for column 'm0' at row 1
+Warning	1264	Out of range value for column 'm1' at row 1
+Warning	1264	Out of range value for column 'm20' at row 1
+Warning	1264	Out of range value for column 'b' at row 1
+Warning	1264	Out of range value for column 'b0' at row 1
+Warning	1264	Out of range value for column 'b1' at row 1
+Warning	1264	Out of range value for column 'b20' at row 1
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615);
+Warnings:
+Warning	1264	Out of range value for column 'i' at row 8
+Warning	1264	Out of range value for column 'i0' at row 8
+Warning	1264	Out of range value for column 'i1' at row 8
+Warning	1264	Out of range value for column 'i20' at row 8
+Warning	1264	Out of range value for column 't' at row 8
+Warning	1264	Out of range value for column 't0' at row 8
+Warning	1264	Out of range value for column 't1' at row 8
+Warning	1264	Out of range value for column 't20' at row 8
+Warning	1264	Out of range value for column 's' at row 8
+Warning	1264	Out of range value for column 's0' at row 8
+Warning	1264	Out of range value for column 's1' at row 8
+Warning	1264	Out of range value for column 's20' at row 8
+Warning	1264	Out of range value for column 'm' at row 8
+Warning	1264	Out of range value for column 'm0' at row 8
+Warning	1264	Out of range value for column 'm1' at row 8
+Warning	1264	Out of range value for column 'm20' at row 8
+Warning	1264	Out of range value for column 'i' at row 9
+Warning	1264	Out of range value for column 'i0' at row 9
+Warning	1264	Out of range value for column 'i1' at row 9
+Warning	1264	Out of range value for column 'i20' at row 9
+Warning	1264	Out of range value for column 't' at row 9
+Warning	1264	Out of range value for column 't0' at row 9
+Warning	1264	Out of range value for column 't1' at row 9
+Warning	1264	Out of range value for column 't20' at row 9
+Warning	1264	Out of range value for column 's' at row 9
+Warning	1264	Out of range value for column 's0' at row 9
+Warning	1264	Out of range value for column 's1' at row 9
+Warning	1264	Out of range value for column 's20' at row 9
+Warning	1264	Out of range value for column 'm' at row 9
+Warning	1264	Out of range value for column 'm0' at row 9
+Warning	1264	Out of range value for column 'm1' at row 9
+Warning	1264	Out of range value for column 'm20' at row 9
+Warning	1264	Out of range value for column 'i' at row 10
+Warning	1264	Out of range value for column 'i0' at row 10
+Warning	1264	Out of range value for column 'i1' at row 10
+Warning	1264	Out of range value for column 'i20' at row 10
+Warning	1264	Out of range value for column 't' at row 10
+Warning	1264	Out of range value for column 't0' at row 10
+Warning	1264	Out of range value for column 't1' at row 10
+Warning	1264	Out of range value for column 't20' at row 10
+Warning	1264	Out of range value for column 's' at row 10
+Warning	1264	Out of range value for column 's0' at row 10
+Warning	1264	Out of range value for column 's1' at row 10
+Warning	1264	Out of range value for column 's20' at row 10
+Warning	1264	Out of range value for column 'm' at row 10
+Warning	1264	Out of range value for column 'm0' at row 10
+Warning	1264	Out of range value for column 'm1' at row 10
+Warning	1264	Out of range value for column 'm20' at row 10
+Warning	1264	Out of range value for column 'i' at row 11
+Warning	1264	Out of range value for column 'i0' at row 11
+Warning	1264	Out of range value for column 'i1' at row 11
+Warning	1264	Out of range value for column 'i20' at row 11
+Warning	1264	Out of range value for column 't' at row 11
+Warning	1264	Out of range value for column 't0' at row 11
+Warning	1264	Out of range value for column 't1' at row 11
+Warning	1264	Out of range value for column 't20' at row 11
+Warning	1264	Out of range value for column 's' at row 11
+Warning	1264	Out of range value for column 's0' at row 11
+Warning	1264	Out of range value for column 's1' at row 11
+Warning	1264	Out of range value for column 's20' at row 11
+Warning	1264	Out of range value for column 'm' at row 11
+Warning	1264	Out of range value for column 'm0' at row 11
+Warning	1264	Out of range value for column 'm1' at row 11
+Warning	1264	Out of range value for column 'm20' at row 11
+SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1;
+i	i0	i1	i20	t	t0	t1	t20	s	s0	s1	s20	m	m0	m1	m20	b	b0	b1	b20
+-2147483648	-2147483648	-2147483648	-2147483648	-128	-128	-128	-128	-32768	-32768	-32768	-32768	-8388608	-8388608	-8388608	-8388608	-9223372036854775808	-9223372036854775808	-9223372036854775808	-9223372036854775808
+-2147483648	-2147483648	-2147483648	-2147483648	-128	-128	-128	-128	-32768	-32768	-32768	-32768	-8388608	-8388608	-8388608	-8388608	-9223372036854775808	-9223372036854775808	-9223372036854775808	-9223372036854775808
+-2147483648	-2147483648	-2147483648	-2147483648	-128	-128	-128	-128	-32768	-32768	-32768	-32768	-8388608	-8388608	-8388608	-8388608	-9223372036854775808	-9223372036854775808	-9223372036854775808	-9223372036854775808
+-2147483648	-2147483648	-2147483648	-2147483648	-128	-128	-128	-128	-32768	-32768	-32768	-32768	-8388608	-8388608	-8388608	-8388608	-9223372036854775808	-9223372036854775808	-9223372036854775808	-9223372036854775808
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
+1	2	3	4	5	6	7	8	9	10	11	12	13	14	15	16	17	18	19	20
+2147483647	2147483647	2147483647	2147483647	127	127	127	127	32767	32767	32767	32767	8388607	8388607	8388607	8388607	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+2147483647	2147483647	2147483647	2147483647	127	127	127	127	32767	32767	32767	32767	8388607	8388607	8388607	8388607	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+2147483647	2147483647	2147483647	2147483647	127	127	127	127	32767	32767	32767	32767	8388607	8388607	8388607	8388607	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+2147483647	2147483647	2147483647	2147483647	127	127	127	127	32767	32767	32767	32767	8388607	8388607	8388607	8388607	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+2147483647	2147483647	2147483647	2147483647	127	127	127	127	32767	32767	32767	32767	8388607	8388607	8388607	8388607	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+2147483647	2147483647	2147483647	2147483647	127	127	127	127	32767	32767	32767	32767	8388607	8388607	8388607	8388607	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+ALTER TABLE t1 ADD COLUMN i257 INT(257) NULL;
+ERROR 42000: Display width out of range for column 'i257' (max = 255)
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c INT NULL,
+c1 INT NULL DEFAULT NULL,
+c2 INT NULL DEFAULT 2147483647,
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	int(11)	YES		NULL	
+c1	int(11)	YES		NULL	
+c2	int(11)	YES		2147483647	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES (2147483647,2147483647,2147483647);
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2	7FFFFFFF	7FFFFFFF	7FFFFFFF
+3	NULL	NULL	7FFFFFFF
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c TINYINT NULL,
+c1 TINYINT NULL DEFAULT NULL,
+c2 TINYINT NULL DEFAULT 127  ,
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	tinyint(4)	YES		NULL	
+c1	tinyint(4)	YES		NULL	
+c2	tinyint(4)	YES		127	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES (127  ,127  ,127  );
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2	7F	7F	7F
+3	NULL	NULL	7F
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c SMALLINT NULL,
+c1 SMALLINT NULL DEFAULT NULL,
+c2 SMALLINT NULL DEFAULT 0,
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	smallint(6)	YES		NULL	
+c1	smallint(6)	YES		NULL	
+c2	smallint(6)	YES		0	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES (0,0,0);
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2	0	0	0
+3	NULL	NULL	0
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c MEDIUMINT NULL,
+c1 MEDIUMINT NULL DEFAULT NULL,
+c2 MEDIUMINT NULL DEFAULT 1,
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	mediumint(9)	YES		NULL	
+c1	mediumint(9)	YES		NULL	
+c2	mediumint(9)	YES		1	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES (1,1,1);
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2	1	1	1
+3	NULL	NULL	1
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c BIGINT NULL,
+c1 BIGINT NULL DEFAULT NULL,
+c2 BIGINT NULL DEFAULT 9223372036854775807,
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	bigint(20)	YES		NULL	
+c1	bigint(20)	YES		NULL	
+c2	bigint(20)	YES		9223372036854775807	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES (9223372036854775807,9223372036854775807,9223372036854775807);
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2	7FFFFFFFFFFFFFFF	7FFFFFFFFFFFFFFF	7FFFFFFFFFFFFFFF
+3	NULL	NULL	7FFFFFFFFFFFFFFF
+DROP TABLE t1;
+########################
+# SET columns
+########################
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+a SET('') NULL,
+b SET('test1','test2','test3','test4','test5') NULL,
+c SET('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64') NULL,
+PRIMARY KEY (c)
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+a	set('')	YES		NULL	
+b	set('test1','test2','test3','test4','test5')	YES		NULL	
+c	set('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64')	NO	PRI		
+INSERT INTO t1 (a,b,c) VALUES 
+('','test2,test3','01,34,44,,23'),
+('',5,2),
+(',','test4,test2','');
+Warnings:
+Warning	1265	Data truncated for column 'c' at row 1
+SELECT a,b,c FROM t1;
+a	b	c
+	test1,test3	02
+	test2,test3	01,23,34,44
+	test2,test4	
+INSERT INTO t1 (a,b,c) VALUES (0,'test6',-1);
+Warnings:
+Warning	1265	Data truncated for column 'b' at row 1
+Warning	1265	Data truncated for column 'c' at row 1
+SELECT a,b,c FROM t1;
+a	b	c
+		01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50'51,52,53,54,55,56,57,58,59,60,61,62,63,64
+	test1,test3	02
+	test2,test3	01,23,34,44
+	test2,test4	
+ALTER TABLE t1 ADD COLUMN e SET('a','A') NULL;
+Warnings:
+Note	1291	Column 'e' has duplicated value 'a' in SET
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+a	set('')	YES		NULL	
+b	set('test1','test2','test3','test4','test5')	YES		NULL	
+c	set('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64')	NO	PRI		
+e	set('a','A')	YES		NULL	
+ALTER TABLE t1 ADD COLUMN f SET('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',' ','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i') NULL;
+ERROR HY000: Too many strings for column f and SET
+SELECT a,b,c,e FROM t1 WHERE FIND_IN_SET('test2',b)>0 OR a != '';
+a	b	c	e
+	test2,test3	01,23,34,44	NULL
+	test2,test4		NULL
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c SET('test1','test2','test3') NULL,
+c1 SET('test1','test2','test3') NULL DEFAULT NULL,
+c2 SET('test1','test2','test3') NULL DEFAULT 'test2,test3',
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	set('test1','test2','test3')	YES		NULL	
+c1	set('test1','test2','test3')	YES		NULL	
+c2	set('test1','test2','test3')	YES		test2,test3	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES ('test2,test3','test2,test3','test2,test3');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2	74657374322C7465737433	74657374322C7465737433	74657374322C7465737433
+3	NULL	NULL	74657374322C7465737433
+DROP TABLE t1;
+########################
+# TEXT columns
+########################
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+t TEXT NULL,
+t0 TEXT(0) NULL,
+t1 TEXT(1) NULL,
+t300 TEXT(300) NULL,
+tm TEXT(65535) NULL,
+t70k TEXT(70000) NULL,
+t17m TEXT(17000000) NULL,
+tt TINYTEXT NULL,
+m MEDIUMTEXT NULL,
+l LONGTEXT NULL
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+t	text	YES		NULL	
+t0	text	YES		NULL	
+t1	tinytext	YES		NULL	
+t300	text	YES		NULL	
+tm	text	YES		NULL	
+t70k	mediumtext	YES		NULL	
+t17m	longtext	YES		NULL	
+tt	tinytext	YES		NULL	
+m	mediumtext	YES		NULL	
+l	longtext	YES		NULL	
+INSERT INTO t1 (t,t0,t1,t300,tm,t70k,t17m,tt,m,l) VALUES
+('','','','','','','','','',''),
+('a','b','c','d','e','f','g','h','i','j'),
+('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'),
+( REPEAT('a',65535), REPEAT('b',65535), REPEAT('c',255), REPEAT('d',65535), REPEAT('e',65535), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',255), REPEAT('i',1048576), REPEAT('j',1048576) );
+SELECT LENGTH(t), LENGTH(t0), LENGTH(t1), LENGTH(t300), LENGTH(tm), LENGTH(t70k), LENGTH(t17m), LENGTH(tt), LENGTH(m), LENGTH(l) FROM t1;
+LENGTH(t)	LENGTH(t0)	LENGTH(t1)	LENGTH(t300)	LENGTH(tm)	LENGTH(t70k)	LENGTH(t17m)	LENGTH(tt)	LENGTH(m)	LENGTH(l)
+0	0	0	0	0	0	0	0	0	0
+1	1	1	1	1	1	1	1	1	1
+5	5	5	5	5	5	5	5	5	6
+65535	65535	255	65535	65535	1048576	1048576	255	1048576	1048576
+INSERT INTO t1 (t,t0,t1,t300,tm,t70k,t17m,tt,m,l) VALUES
+( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) );
+Warnings:
+Warning	1265	Data truncated for column 't' at row 1
+Warning	1265	Data truncated for column 't0' at row 1
+Warning	1265	Data truncated for column 't1' at row 1
+Warning	1265	Data truncated for column 't300' at row 1
+Warning	1265	Data truncated for column 'tm' at row 1
+Warning	1265	Data truncated for column 'tt' at row 1
+SELECT LENGTH(t), LENGTH(t0), LENGTH(t1), LENGTH(t300), LENGTH(tm), LENGTH(t70k), LENGTH(t17m), LENGTH(tt), LENGTH(m), LENGTH(l) FROM t1;
+LENGTH(t)	LENGTH(t0)	LENGTH(t1)	LENGTH(t300)	LENGTH(tm)	LENGTH(t70k)	LENGTH(t17m)	LENGTH(tt)	LENGTH(m)	LENGTH(l)
+0	0	0	0	0	0	0	0	0	0
+1	1	1	1	1	1	1	1	1	1
+5	5	5	5	5	5	5	5	5	6
+65535	65535	255	65535	65535	1048576	1048576	255	1048576	1048576
+65535	65535	255	65535	65535	1048576	1048576	255	1048576	1048576
+ALTER TABLE t1 ADD COLUMN ttt TEXT(4294967296) NULL;
+ERROR 42000: Display width out of range for column 'ttt' (max = 4294967295)
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c TEXT NULL,
+c1 TEXT NULL DEFAULT NULL,
+c2 TEXT NULL DEFAULT '',
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+Warnings:
+Warning	1101	BLOB/TEXT column 'c2' can't have a default value
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	text	YES		NULL	
+c1	text	YES		NULL	
+c2	text	YES		NULL	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES ('','','');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2			
+3	NULL	NULL	NULL
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c TINYTEXT NULL,
+c1 TINYTEXT NULL DEFAULT NULL,
+c2 TINYTEXT NULL DEFAULT '',
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+Warnings:
+Warning	1101	BLOB/TEXT column 'c2' can't have a default value
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	tinytext	YES		NULL	
+c1	tinytext	YES		NULL	
+c2	tinytext	YES		NULL	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES ('','','');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2			
+3	NULL	NULL	NULL
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c MEDIUMTEXT NULL,
+c1 MEDIUMTEXT NULL DEFAULT NULL,
+c2 MEDIUMTEXT NULL DEFAULT '',
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+Warnings:
+Warning	1101	BLOB/TEXT column 'c2' can't have a default value
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	mediumtext	YES		NULL	
+c1	mediumtext	YES		NULL	
+c2	mediumtext	YES		NULL	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES ('','','');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2			
+3	NULL	NULL	NULL
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c LONGTEXT NULL,
+c1 LONGTEXT NULL DEFAULT NULL,
+c2 LONGTEXT NULL DEFAULT '',
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+Warnings:
+Warning	1101	BLOB/TEXT column 'c2' can't have a default value
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	longtext	YES		NULL	
+c1	longtext	YES		NULL	
+c2	longtext	YES		NULL	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (c,c1,c2) VALUES (NULL,NULL,NULL);
+INSERT INTO t1 (c,c1,c2) VALUES ('','','');
+INSERT INTO t1 () VALUES ();
+SELECT pk, HEX(c), HEX(c1), HEX(c2) FROM t1 ORDER BY pk;
+pk	HEX(c)	HEX(c1)	HEX(c2)
+1	NULL	NULL	NULL
+2			
+3	NULL	NULL	NULL
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/col_opt_null.test b/mysql-test/suite/rocksdb/col_opt_null.test
new file mode 100644
index 0000000..3af91ff
--- /dev/null
+++ b/mysql-test/suite/rocksdb/col_opt_null.test
@@ -0,0 +1,214 @@
+# 
+# NULL column attribute
+#
+
+let $extra_col_opts = NULL;
+
+
+--echo ########################
+--echo # BINARY columns
+--echo ########################
+
+--source type_binary.inc
+--let $col_type = BINARY
+--let $col_default = 0
+--source col_null.inc
+
+--echo ########################
+--echo # VARBINARY columns
+--echo ########################
+
+--source type_varbinary.inc
+--let $col_type = VARBINARY(64)
+--let $col_default = 'test'
+--source col_null.inc
+
+--echo ########################
+--echo # BIT columns
+--echo ########################
+
+--source type_bit.inc
+--let $col_type = BIT
+--let $col_default = 1
+--source col_null.inc
+
+--echo ########################
+--echo # BLOB columns
+--echo ########################
+
+--source type_blob.inc
+
+--let $col_default = ''
+
+--let $col_type = BLOB
+--source col_null.inc
+
+--let $col_type = TINYBLOB
+--source col_null.inc
+
+--let $col_type = MEDIUMBLOB
+--source col_null.inc
+
+--let $col_type = LONGBLOB
+--source col_null.inc
+
+--echo ########################
+--echo # BOOL columns
+--echo ########################
+
+--source type_bool.inc
+--let $col_type = BOOL
+--let $col_default = '0'
+--source col_null.inc
+
+
+--echo ########################
+--echo # CHAR columns
+--echo ########################
+
+--source type_char.inc
+--let $col_type = CHAR
+--let $col_default = '_'
+--source col_null.inc
+
+--echo ########################
+--echo # VARCHAR columns
+--echo ########################
+
+
+--source type_varchar.inc
+--let $col_type = VARCHAR(64)
+--let $col_default = 'test default'
+--source col_null.inc
+
+
+--echo ########################
+--echo # date and time columns
+--echo ########################
+
+--source type_date_time.inc
+
+--let $col_type = DATE
+--let $col_default = '2012-12-21'
+--source col_null.inc
+
+--let $col_type = DATETIME
+--let $col_default = '2012-12-21 12:21:12'
+--source col_null.inc
+
+--let $col_type = TIMESTAMP
+--let $col_default = '2012-12-21 12:21:12'
+--source col_null.inc
+
+--let $col_type = TIME
+--let $col_default = '12:21:12'
+--source col_null.inc
+
+--let $col_type = YEAR
+--let $col_default = '2012'
+--source col_null.inc
+
+--let $col_type = YEAR(2)
+--let $col_default = '12'
+--source col_null.inc
+
+
+--echo ########################
+--echo # ENUM columns
+--echo ########################
+
+--source type_enum.inc
+--let $col_type = ENUM('test1','test2','test3')
+--let $col_default = 'test2'
+--source col_null.inc
+
+--echo ########################
+--echo # Fixed point columns (NUMERIC, DECIMAL)
+--echo ########################
+
+--source type_fixed.inc
+
+--let $col_type = DECIMAL
+--let $col_default = 1.1
+--source col_null.inc
+
+--let $col_type = NUMERIC
+--let $col_default = 0 
+--source col_null.inc
+
+--echo ########################
+--echo # Floating point columns (FLOAT, DOUBLE)
+--echo ########################
+
+--source type_float.inc
+  
+--let $col_type = FLOAT
+--let $col_default = 1.1 
+--source col_null.inc
+
+--let $col_type = DOUBLE
+--let $col_default = 0  
+--source col_null.inc
+
+--echo ########################
+--echo # INT columns
+--echo ########################
+
+--source type_int.inc
+  
+--let $col_type = INT
+--let $col_default = 2147483647
+--source col_null.inc
+
+--let $col_type = TINYINT
+--let $col_default = 127  
+--source col_null.inc
+
+--let $col_type = SMALLINT
+--let $col_default = 0
+--source col_null.inc
+
+--let $col_type = MEDIUMINT
+--let $col_default = 1
+--source col_null.inc
+
+--let $col_type = BIGINT
+--let $col_default = 9223372036854775807
+--source col_null.inc
+
+--echo ########################
+--echo # SET columns
+--echo ########################
+
+--source type_set.inc
+--let $col_type = SET('test1','test2','test3')
+--let $col_default = 'test2,test3'
+--source col_null.inc
+
+
+--echo ########################
+--echo # TEXT columns
+--echo ########################
+
+--source type_text.inc
+ 
+--let $col_default = ''
+
+--let $col_type = TEXT
+--source col_null.inc
+
+--let $col_type = TINYTEXT
+--source col_null.inc
+
+--let $col_type = MEDIUMTEXT
+--source col_null.inc
+
+--let $col_type = LONGTEXT
+--source col_null.inc
+
+
+--let $col_type =
+--let $col_default =
+--let $extra_col_opts =
+
+
diff --git a/mysql-test/suite/rocksdb/col_opt_unsigned.result b/mysql-test/suite/rocksdb/col_opt_unsigned.result
new file mode 100644
index 0000000..66b6a5f
--- /dev/null
+++ b/mysql-test/suite/rocksdb/col_opt_unsigned.result
@@ -0,0 +1,741 @@
+########################
+# Fixed point columns (NUMERIC, DECIMAL)
+########################
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+d DECIMAL UNSIGNED,
+d0 DECIMAL(0) UNSIGNED,
+d1_1 DECIMAL(1,1) UNSIGNED,
+d10_2 DECIMAL(10,2) UNSIGNED,
+d60_10 DECIMAL(60,10) UNSIGNED,
+n NUMERIC UNSIGNED,
+n0_0 NUMERIC(0,0) UNSIGNED,
+n1 NUMERIC(1) UNSIGNED,
+n20_4 NUMERIC(20,4) UNSIGNED,
+n65_4 NUMERIC(65,4) UNSIGNED,
+pk NUMERIC UNSIGNED PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+d	decimal(10,0) unsigned	YES		NULL	
+d0	decimal(10,0) unsigned	YES		NULL	
+d1_1	decimal(1,1) unsigned	YES		NULL	
+d10_2	decimal(10,2) unsigned	YES		NULL	
+d60_10	decimal(60,10) unsigned	YES		NULL	
+n	decimal(10,0) unsigned	YES		NULL	
+n0_0	decimal(10,0) unsigned	YES		NULL	
+n1	decimal(1,0) unsigned	YES		NULL	
+n20_4	decimal(20,4) unsigned	YES		NULL	
+n65_4	decimal(65,4) unsigned	YES		NULL	
+pk	decimal(10,0) unsigned	NO	PRI	NULL	
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807,1);
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (0,0,0,0,0,0,0,0,0,0,2);
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999,3);
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
+d	d0	d1_1	d10_2	d60_10	n	n0_0	n1	n20_4	n65_4
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+100	123456	0.3	40000.25	123456789123456789.1000100000	1024	7000	8	999999.9000	9223372036854775807.0000
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807,4);
+Warnings:
+Warning	1264	Out of range value for column 'd' at row 1
+Warning	1264	Out of range value for column 'd0' at row 1
+Warning	1264	Out of range value for column 'd1_1' at row 1
+Warning	1264	Out of range value for column 'd10_2' at row 1
+Warning	1264	Out of range value for column 'd60_10' at row 1
+Warning	1264	Out of range value for column 'n' at row 1
+Warning	1264	Out of range value for column 'n0_0' at row 1
+Warning	1264	Out of range value for column 'n1' at row 1
+Warning	1264	Out of range value for column 'n20_4' at row 1
+Warning	1264	Out of range value for column 'n65_4' at row 1
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999,5);
+Warnings:
+Warning	1264	Out of range value for column 'd' at row 1
+Warning	1264	Out of range value for column 'd0' at row 1
+Warning	1264	Out of range value for column 'd1_1' at row 1
+Warning	1264	Out of range value for column 'd10_2' at row 1
+Warning	1264	Out of range value for column 'd60_10' at row 1
+Warning	1264	Out of range value for column 'n' at row 1
+Warning	1264	Out of range value for column 'n0_0' at row 1
+Warning	1264	Out of range value for column 'n1' at row 1
+Warning	1264	Out of range value for column 'n20_4' at row 1
+Warning	1264	Out of range value for column 'n65_4' at row 1
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
+d	d0	d1_1	d10_2	d60_10	n	n0_0	n1	n20_4	n65_4
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+100	123456	0.3	40000.25	123456789123456789.1000100000	1024	7000	8	999999.9000	9223372036854775807.0000
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100;
+d	d0	d1_1	d10_2	d60_10	n	n0_0	n1	n20_4	n65_4
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+6
+);
+Warnings:
+Warning	1264	Out of range value for column 'd' at row 1
+Warning	1264	Out of range value for column 'd0' at row 1
+Warning	1264	Out of range value for column 'd1_1' at row 1
+Warning	1264	Out of range value for column 'd10_2' at row 1
+Warning	1264	Out of range value for column 'd60_10' at row 1
+Warning	1264	Out of range value for column 'n' at row 1
+Warning	1264	Out of range value for column 'n0_0' at row 1
+Warning	1264	Out of range value for column 'n1' at row 1
+Warning	1264	Out of range value for column 'n20_4' at row 1
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
+d	d0	d1_1	d10_2	d60_10	n	n0_0	n1	n20_4	n65_4
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+100	123456	0.3	40000.25	123456789123456789.1000100000	1024	7000	8	999999.9000	9223372036854775807.0000
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999,7);
+Warnings:
+Warning	1264	Out of range value for column 'd' at row 1
+Warning	1264	Out of range value for column 'd0' at row 1
+Warning	1264	Out of range value for column 'd1_1' at row 1
+Warning	1264	Out of range value for column 'd10_2' at row 1
+Warning	1264	Out of range value for column 'd60_10' at row 1
+Warning	1264	Out of range value for column 'n' at row 1
+Warning	1264	Out of range value for column 'n0_0' at row 1
+Warning	1264	Out of range value for column 'n1' at row 1
+Warning	1264	Out of range value for column 'n20_4' at row 1
+Warning	1264	Out of range value for column 'n65_4' at row 1
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
+d	d0	d1_1	d10_2	d60_10	n	n0_0	n1	n20_4	n65_4
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+100	123456	0.3	40000.25	123456789123456789.1000100000	1024	7000	8	999999.9000	9223372036854775807.0000
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111,8);
+Warnings:
+Note	1265	Data truncated for column 'd' at row 1
+Note	1265	Data truncated for column 'd0' at row 1
+Warning	1264	Out of range value for column 'd1_1' at row 1
+Note	1265	Data truncated for column 'd10_2' at row 1
+Note	1265	Data truncated for column 'd60_10' at row 1
+Note	1265	Data truncated for column 'n' at row 1
+Note	1265	Data truncated for column 'n0_0' at row 1
+Note	1265	Data truncated for column 'n1' at row 1
+Note	1265	Data truncated for column 'n20_4' at row 1
+Note	1265	Data truncated for column 'n65_4' at row 1
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
+d	d0	d1_1	d10_2	d60_10	n	n0_0	n1	n20_4	n65_4
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+100	123456	0.3	40000.25	123456789123456789.1000100000	1024	7000	8	999999.9000	9223372036854775807.0000
+9999999999	9999999999	0.9	99999999.00	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.0000	9999999999999999999999999999999999999999999999999999999999999.1111
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+ALTER TABLE t1 ADD COLUMN n66 NUMERIC(66) UNSIGNED;
+ERROR 42000: Too big precision 66 specified for column 'n66'. Maximum is 65.
+ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(66,6) UNSIGNED;
+ERROR 42000: Too big precision 66 specified for column 'n66_6'. Maximum is 65.
+ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(66,66) UNSIGNED;
+ERROR 42000: Too big scale 66 specified for column 'n66_66'. Maximum is 30.
+DROP TABLE t1;
+CREATE TABLE t1 (
+a DECIMAL UNSIGNED,
+b NUMERIC UNSIGNED,
+PRIMARY KEY (a)
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+a	decimal(10,0) unsigned	NO	PRI	0	
+b	decimal(10,0) unsigned	YES		NULL	
+INSERT INTO t1 (a,b) VALUES (1.0,-1.0);
+Warnings:
+Warning	1264	Out of range value for column 'b' at row 1
+INSERT INTO t1 (a,b) VALUES (-100,100);
+Warnings:
+Warning	1264	Out of range value for column 'a' at row 1
+SELECT a,b FROM t1;
+a	b
+0	100
+1	0
+DROP TABLE t1;
+########################
+# Floating point columns (FLOAT, DOUBLE)
+########################
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+f FLOAT UNSIGNED,
+f0 FLOAT(0) UNSIGNED,
+r1_1 REAL(1,1) UNSIGNED,
+f23_0 FLOAT(23) UNSIGNED,
+f20_3 FLOAT(20,3) UNSIGNED,
+d DOUBLE UNSIGNED,
+d1_0 DOUBLE(1,0) UNSIGNED,
+d10_10 DOUBLE PRECISION (10,10) UNSIGNED,
+d53 DOUBLE(53,0) UNSIGNED,
+d53_10 DOUBLE(53,10) UNSIGNED,
+pk DOUBLE UNSIGNED PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+f	float unsigned	YES		NULL	
+f0	float unsigned	YES		NULL	
+r1_1	double(1,1) unsigned	YES		NULL	
+f23_0	float unsigned	YES		NULL	
+f20_3	float(20,3) unsigned	YES		NULL	
+d	double unsigned	YES		NULL	
+d1_0	double(1,0) unsigned	YES		NULL	
+d10_10	double(10,10) unsigned	YES		NULL	
+d53	double(53,0) unsigned	YES		NULL	
+d53_10	double(53,10) unsigned	YES		NULL	
+pk	double unsigned	NO	PRI	NULL	
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999,1);
+SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1;
+f	12345.1
+d	11111111.111
+d10_10	0.0123456789
+d1_0	8
+d53	1234566789123456800
+d53_10	100000000000000000.0000000000
+f0	12345.1
+f20_3	56789.988
+f23_0	123457000
+r1_1	0.9
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (0,0,0,0,0,0,0,0,0,0,2);
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (
+99999999999999999999999999999999999999,
+99999999999999999999999999999999999999.9999999999999999,
+0.9,
+99999999999999999999999999999999999999.9,
+99999999999999999.999,
+999999999999999999999999999999999999999999999999999999999999999999999999999999999,
+9,
+0.9999999999, 
+1999999999999999999999999999999999999999999999999999999,
+19999999999999999999999999999999999999999999.9999999999,
+3
+);
+Warnings:
+Warning	1264	Out of range value for column 'd53' at row 1
+Warning	1264	Out of range value for column 'd53_10' at row 1
+SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1;
+f	12345.1
+d	0
+d	11111111.111
+d	1e81
+d10_10	0.0000000000
+d10_10	0.0123456789
+d10_10	0.9999999999
+d1_0	0
+d1_0	8
+d1_0	9
+d53	0
+d53	100000000000000000000000000000000000000000000000000000
+d53	1234566789123456800
+d53_10	0.0000000000
+d53_10	100000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+f	0
+f	1e38
+f0	0
+f0	12345.1
+f0	1e38
+f20_3	0.000
+f20_3	56789.988
+f20_3	99999998430674940.000
+f23_0	0
+f23_0	123457000
+f23_0	1e38
+r1_1	0.0
+r1_1	0.9
+r1_1	0.9
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999,4);
+Warnings:
+Warning	1264	Out of range value for column 'f' at row 1
+Warning	1264	Out of range value for column 'f0' at row 1
+Warning	1264	Out of range value for column 'r1_1' at row 1
+Warning	1264	Out of range value for column 'f23_0' at row 1
+Warning	1264	Out of range value for column 'f20_3' at row 1
+Warning	1264	Out of range value for column 'd' at row 1
+Warning	1264	Out of range value for column 'd1_0' at row 1
+Warning	1264	Out of range value for column 'd10_10' at row 1
+Warning	1264	Out of range value for column 'd53' at row 1
+Warning	1264	Out of range value for column 'd53_10' at row 1
+SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1;
+f	12345.1
+d	0
+d	0
+d	11111111.111
+d	1e81
+d10_10	0.0000000000
+d10_10	0.0000000000
+d10_10	0.0123456789
+d10_10	0.9999999999
+d1_0	0
+d1_0	0
+d1_0	8
+d1_0	9
+d53	0
+d53	0
+d53	100000000000000000000000000000000000000000000000000000
+d53	1234566789123456800
+d53_10	0.0000000000
+d53_10	0.0000000000
+d53_10	100000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+f	0
+f	0
+f	1e38
+f0	0
+f0	0
+f0	12345.1
+f0	1e38
+f20_3	0.000
+f20_3	0.000
+f20_3	56789.988
+f20_3	99999998430674940.000
+f23_0	0
+f23_0	0
+f23_0	123457000
+f23_0	1e38
+r1_1	0.0
+r1_1	0.0
+r1_1	0.9
+r1_1	0.9
+SELECT MAX(f), MAX(f0), MAX(r1_1), MAX(f23_0), MAX(f20_3), MAX(d), MAX(d1_0), MAX(d10_10), MAX(d53), MAX(d53_10) FROM t1;
+MAX(f)	9.999999680285692e37
+MAX(d)	1e81
+MAX(d10_10)	0.9999999999
+MAX(d1_0)	9
+MAX(d53)	100000000000000000000000000000000000000000000000000000
+MAX(d53_10)	10000000000000000000000000000000000000000000.0000000000
+MAX(f0)	9.999999680285692e37
+MAX(f20_3)	99999998430674940.000
+MAX(f23_0)	9.999999680285692e37
+MAX(r1_1)	0.9
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+5
+);
+Warnings:
+Warning	1264	Out of range value for column 'f' at row 1
+Warning	1264	Out of range value for column 'f0' at row 1
+Warning	1264	Out of range value for column 'r1_1' at row 1
+Warning	1264	Out of range value for column 'f23_0' at row 1
+Warning	1264	Out of range value for column 'f20_3' at row 1
+Warning	1264	Out of range value for column 'd1_0' at row 1
+Warning	1264	Out of range value for column 'd10_10' at row 1
+Warning	1264	Out of range value for column 'd53' at row 1
+Warning	1264	Out of range value for column 'd53_10' at row 1
+SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1;
+f	12345.1
+d	0
+d	0
+d	11111111.111
+d	1e61
+d	1e81
+d10_10	0.0000000000
+d10_10	0.0000000000
+d10_10	0.0123456789
+d10_10	0.9999999999
+d10_10	0.9999999999
+d1_0	0
+d1_0	0
+d1_0	8
+d1_0	9
+d1_0	9
+d53	0
+d53	0
+d53	100000000000000000000000000000000000000000000000000000
+d53	100000000000000000000000000000000000000000000000000000
+d53	1234566789123456800
+d53_10	0.0000000000
+d53_10	0.0000000000
+d53_10	100000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+f	0
+f	0
+f	1e38
+f	3.40282e38
+f0	0
+f0	0
+f0	12345.1
+f0	1e38
+f0	3.40282e38
+f20_3	0.000
+f20_3	0.000
+f20_3	56789.988
+f20_3	99999998430674940.000
+f20_3	99999998430674940.000
+f23_0	0
+f23_0	0
+f23_0	123457000
+f23_0	1e38
+f23_0	3.40282e38
+r1_1	0.0
+r1_1	0.0
+r1_1	0.9
+r1_1	0.9
+r1_1	0.9
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (
+999999999999999999999999999999999999999,
+999999999999999999999999999999999999999.9999999999999999,
+1.9,
+999999999999999999999999999999999999999.9,
+999999999999999999.999,
+9999999999999999999999999999999999999999999999999999999999999999999999999999999999,
+99,
+1.9999999999,
+1999999999999999999999999999999999999999999999999999999,
+19999999999999999999999999999999999999999999.9999999999,
+6
+);
+Warnings:
+Warning	1292	Truncated incorrect DECIMAL value: ''
+Warning	1264	Out of range value for column 'f' at row 1
+Warning	1264	Out of range value for column 'f0' at row 1
+Warning	1264	Out of range value for column 'r1_1' at row 1
+Warning	1264	Out of range value for column 'f23_0' at row 1
+Warning	1264	Out of range value for column 'f20_3' at row 1
+Warning	1264	Out of range value for column 'd1_0' at row 1
+Warning	1264	Out of range value for column 'd10_10' at row 1
+Warning	1264	Out of range value for column 'd53' at row 1
+Warning	1264	Out of range value for column 'd53_10' at row 1
+SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1;
+f	12345.1
+d	0
+d	0
+d	11111111.111
+d	1e61
+d	1e65
+d	1e81
+d10_10	0.0000000000
+d10_10	0.0000000000
+d10_10	0.0123456789
+d10_10	0.9999999999
+d10_10	0.9999999999
+d10_10	0.9999999999
+d1_0	0
+d1_0	0
+d1_0	8
+d1_0	9
+d1_0	9
+d1_0	9
+d53	0
+d53	0
+d53	100000000000000000000000000000000000000000000000000000
+d53	100000000000000000000000000000000000000000000000000000
+d53	100000000000000000000000000000000000000000000000000000
+d53	1234566789123456800
+d53_10	0.0000000000
+d53_10	0.0000000000
+d53_10	100000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+f	0
+f	0
+f	1e38
+f	3.40282e38
+f	3.40282e38
+f0	0
+f0	0
+f0	12345.1
+f0	1e38
+f0	3.40282e38
+f0	3.40282e38
+f20_3	0.000
+f20_3	0.000
+f20_3	56789.988
+f20_3	99999998430674940.000
+f20_3	99999998430674940.000
+f20_3	99999998430674940.000
+f23_0	0
+f23_0	0
+f23_0	123457000
+f23_0	1e38
+f23_0	3.40282e38
+f23_0	3.40282e38
+r1_1	0.0
+r1_1	0.0
+r1_1	0.9
+r1_1	0.9
+r1_1	0.9
+r1_1	0.9
+ALTER TABLE t1 ADD COLUMN d0_0 DOUBLE(0,0) UNSIGNED;
+ERROR 42000: Display width out of range for column 'd0_0' (max = 255)
+ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(256,1) UNSIGNED;
+ERROR 42000: Too big precision 256 specified for column 'n66_6'. Maximum is 65.
+ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(40,35) UNSIGNED;
+ERROR 42000: Too big scale 35 specified for column 'n66_66'. Maximum is 30.
+DROP TABLE t1;
+CREATE TABLE t1 (
+a DOUBLE UNSIGNED,
+b FLOAT UNSIGNED,
+PRIMARY KEY (b) 
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+a	double unsigned	YES		NULL	
+b	float unsigned	NO	PRI	0	
+INSERT INTO t1 (a,b) VALUES (1.0,-1.0);
+Warnings:
+Warning	1264	Out of range value for column 'b' at row 1
+INSERT INTO t1 (a,b) VALUES (-100,100);
+Warnings:
+Warning	1264	Out of range value for column 'a' at row 1
+SELECT a,b FROM t1;
+a	b
+0	100
+1	0
+DROP TABLE t1;
+########################
+# INT columns
+########################
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+i INT UNSIGNED,
+i0 INT(0) UNSIGNED,
+i1 INT(1) UNSIGNED,
+i20 INT(20) UNSIGNED,
+t TINYINT UNSIGNED,
+t0 TINYINT(0) UNSIGNED,
+t1 TINYINT(1) UNSIGNED,
+t20 TINYINT(20) UNSIGNED,
+s SMALLINT UNSIGNED,
+s0 SMALLINT(0) UNSIGNED,
+s1 SMALLINT(1) UNSIGNED,
+s20 SMALLINT(20) UNSIGNED,
+m MEDIUMINT UNSIGNED,
+m0 MEDIUMINT(0) UNSIGNED,
+m1 MEDIUMINT(1) UNSIGNED,
+m20 MEDIUMINT(20) UNSIGNED,
+b BIGINT UNSIGNED,
+b0 BIGINT(0) UNSIGNED,
+b1 BIGINT(1) UNSIGNED,
+b20 BIGINT(20) UNSIGNED,
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+i	int(10) unsigned	YES		NULL	
+i0	int(10) unsigned	YES		NULL	
+i1	int(1) unsigned	YES		NULL	
+i20	int(20) unsigned	YES		NULL	
+t	tinyint(3) unsigned	YES		NULL	
+t0	tinyint(3) unsigned	YES		NULL	
+t1	tinyint(1) unsigned	YES		NULL	
+t20	tinyint(20) unsigned	YES		NULL	
+s	smallint(5) unsigned	YES		NULL	
+s0	smallint(5) unsigned	YES		NULL	
+s1	smallint(1) unsigned	YES		NULL	
+s20	smallint(20) unsigned	YES		NULL	
+m	mediumint(8) unsigned	YES		NULL	
+m0	mediumint(8) unsigned	YES		NULL	
+m1	mediumint(1) unsigned	YES		NULL	
+m20	mediumint(20) unsigned	YES		NULL	
+b	bigint(20) unsigned	YES		NULL	
+b0	bigint(20) unsigned	YES		NULL	
+b1	bigint(1) unsigned	YES		NULL	
+b20	bigint(20) unsigned	YES		NULL	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20);
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807);
+SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1;
+i	i0	i1	i20	t	t0	t1	t20	s	s0	s1	s20	m	m0	m1	m20	b	b0	b1	b20
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
+1	2	3	4	5	6	7	8	9	10	11	12	13	14	15	16	17	18	19	20
+2147483647	2147483647	2147483647	2147483647	127	127	127	127	32767	32767	32767	32767	8388607	8388607	8388607	8388607	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808);
+Warnings:
+Warning	1264	Out of range value for column 'i' at row 1
+Warning	1264	Out of range value for column 'i0' at row 1
+Warning	1264	Out of range value for column 'i1' at row 1
+Warning	1264	Out of range value for column 'i20' at row 1
+Warning	1264	Out of range value for column 't' at row 1
+Warning	1264	Out of range value for column 't0' at row 1
+Warning	1264	Out of range value for column 't1' at row 1
+Warning	1264	Out of range value for column 't20' at row 1
+Warning	1264	Out of range value for column 's' at row 1
+Warning	1264	Out of range value for column 's0' at row 1
+Warning	1264	Out of range value for column 's1' at row 1
+Warning	1264	Out of range value for column 's20' at row 1
+Warning	1264	Out of range value for column 'm' at row 1
+Warning	1264	Out of range value for column 'm0' at row 1
+Warning	1264	Out of range value for column 'm1' at row 1
+Warning	1264	Out of range value for column 'm20' at row 1
+Warning	1264	Out of range value for column 'b' at row 1
+Warning	1264	Out of range value for column 'b0' at row 1
+Warning	1264	Out of range value for column 'b1' at row 1
+Warning	1264	Out of range value for column 'b20' at row 1
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615);
+SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1;
+i	i0	i1	i20	t	t0	t1	t20	s	s0	s1	s20	m	m0	m1	m20	b	b0	b1	b20
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
+1	2	3	4	5	6	7	8	9	10	11	12	13	14	15	16	17	18	19	20
+2147483647	2147483647	2147483647	2147483647	127	127	127	127	32767	32767	32767	32767	8388607	8388607	8388607	8388607	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+4294967295	4294967295	4294967295	4294967295	255	255	255	255	65535	65535	65535	65535	16777215	16777215	16777215	16777215	18446744073709551615	18446744073709551615	18446744073709551615	18446744073709551615
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809);
+Warnings:
+Warning	1264	Out of range value for column 'i' at row 1
+Warning	1264	Out of range value for column 'i0' at row 1
+Warning	1264	Out of range value for column 'i1' at row 1
+Warning	1264	Out of range value for column 'i20' at row 1
+Warning	1264	Out of range value for column 't' at row 1
+Warning	1264	Out of range value for column 't0' at row 1
+Warning	1264	Out of range value for column 't1' at row 1
+Warning	1264	Out of range value for column 't20' at row 1
+Warning	1264	Out of range value for column 's' at row 1
+Warning	1264	Out of range value for column 's0' at row 1
+Warning	1264	Out of range value for column 's1' at row 1
+Warning	1264	Out of range value for column 's20' at row 1
+Warning	1264	Out of range value for column 'm' at row 1
+Warning	1264	Out of range value for column 'm0' at row 1
+Warning	1264	Out of range value for column 'm1' at row 1
+Warning	1264	Out of range value for column 'm20' at row 1
+Warning	1264	Out of range value for column 'b' at row 1
+Warning	1264	Out of range value for column 'b0' at row 1
+Warning	1264	Out of range value for column 'b1' at row 1
+Warning	1264	Out of range value for column 'b20' at row 1
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616);
+Warnings:
+Warning	1264	Out of range value for column 'i' at row 1
+Warning	1264	Out of range value for column 'i0' at row 1
+Warning	1264	Out of range value for column 'i1' at row 1
+Warning	1264	Out of range value for column 'i20' at row 1
+Warning	1264	Out of range value for column 't' at row 1
+Warning	1264	Out of range value for column 't0' at row 1
+Warning	1264	Out of range value for column 't1' at row 1
+Warning	1264	Out of range value for column 't20' at row 1
+Warning	1264	Out of range value for column 's' at row 1
+Warning	1264	Out of range value for column 's0' at row 1
+Warning	1264	Out of range value for column 's1' at row 1
+Warning	1264	Out of range value for column 's20' at row 1
+Warning	1264	Out of range value for column 'm' at row 1
+Warning	1264	Out of range value for column 'm0' at row 1
+Warning	1264	Out of range value for column 'm1' at row 1
+Warning	1264	Out of range value for column 'm20' at row 1
+Warning	1264	Out of range value for column 'b' at row 1
+Warning	1264	Out of range value for column 'b0' at row 1
+Warning	1264	Out of range value for column 'b1' at row 1
+Warning	1264	Out of range value for column 'b20' at row 1
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615);
+Warnings:
+Warning	1264	Out of range value for column 'i' at row 8
+Warning	1264	Out of range value for column 'i0' at row 8
+Warning	1264	Out of range value for column 'i1' at row 8
+Warning	1264	Out of range value for column 'i20' at row 8
+Warning	1264	Out of range value for column 't' at row 8
+Warning	1264	Out of range value for column 't0' at row 8
+Warning	1264	Out of range value for column 't1' at row 8
+Warning	1264	Out of range value for column 't20' at row 8
+Warning	1264	Out of range value for column 's' at row 8
+Warning	1264	Out of range value for column 's0' at row 8
+Warning	1264	Out of range value for column 's1' at row 8
+Warning	1264	Out of range value for column 's20' at row 8
+Warning	1264	Out of range value for column 'm' at row 8
+Warning	1264	Out of range value for column 'm0' at row 8
+Warning	1264	Out of range value for column 'm1' at row 8
+Warning	1264	Out of range value for column 'm20' at row 8
+Warning	1264	Out of range value for column 'i' at row 9
+Warning	1264	Out of range value for column 'i0' at row 9
+Warning	1264	Out of range value for column 'i1' at row 9
+Warning	1264	Out of range value for column 'i20' at row 9
+Warning	1264	Out of range value for column 't' at row 9
+Warning	1264	Out of range value for column 't0' at row 9
+Warning	1264	Out of range value for column 't1' at row 9
+Warning	1264	Out of range value for column 't20' at row 9
+Warning	1264	Out of range value for column 's' at row 9
+Warning	1264	Out of range value for column 's0' at row 9
+Warning	1264	Out of range value for column 's1' at row 9
+Warning	1264	Out of range value for column 's20' at row 9
+Warning	1264	Out of range value for column 'm' at row 9
+Warning	1264	Out of range value for column 'm0' at row 9
+Warning	1264	Out of range value for column 'm1' at row 9
+Warning	1264	Out of range value for column 'm20' at row 9
+Warning	1264	Out of range value for column 'i' at row 10
+Warning	1264	Out of range value for column 'i0' at row 10
+Warning	1264	Out of range value for column 'i1' at row 10
+Warning	1264	Out of range value for column 'i20' at row 10
+Warning	1264	Out of range value for column 't' at row 10
+Warning	1264	Out of range value for column 't0' at row 10
+Warning	1264	Out of range value for column 't1' at row 10
+Warning	1264	Out of range value for column 't20' at row 10
+Warning	1264	Out of range value for column 's' at row 10
+Warning	1264	Out of range value for column 's0' at row 10
+Warning	1264	Out of range value for column 's1' at row 10
+Warning	1264	Out of range value for column 's20' at row 10
+Warning	1264	Out of range value for column 'm' at row 10
+Warning	1264	Out of range value for column 'm0' at row 10
+Warning	1264	Out of range value for column 'm1' at row 10
+Warning	1264	Out of range value for column 'm20' at row 10
+SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1;
+i	i0	i1	i20	t	t0	t1	t20	s	s0	s1	s20	m	m0	m1	m20	b	b0	b1	b20
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
+1	2	3	4	5	6	7	8	9	10	11	12	13	14	15	16	17	18	19	20
+2147483647	2147483647	2147483647	2147483647	127	127	127	127	32767	32767	32767	32767	8388607	8388607	8388607	8388607	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+4294967295	4294967295	4294967295	4294967295	255	255	255	255	65535	65535	65535	65535	16777215	16777215	16777215	16777215	18446744073709551615	18446744073709551615	18446744073709551615	18446744073709551615
+4294967295	4294967295	4294967295	4294967295	255	255	255	255	65535	65535	65535	65535	16777215	16777215	16777215	16777215	18446744073709551615	18446744073709551615	18446744073709551615	18446744073709551615
+4294967295	4294967295	4294967295	4294967295	255	255	255	255	65535	65535	65535	65535	16777215	16777215	16777215	16777215	18446744073709551615	18446744073709551615	18446744073709551615	18446744073709551615
+4294967295	4294967295	4294967295	4294967295	255	255	255	255	65535	65535	65535	65535	16777215	16777215	16777215	16777215	18446744073709551615	18446744073709551615	18446744073709551615	18446744073709551615
+4294967295	4294967295	4294967295	4294967295	255	255	255	255	65535	65535	65535	65535	16777215	16777215	16777215	16777215	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+ALTER TABLE t1 ADD COLUMN i257 INT(257) UNSIGNED;
+ERROR 42000: Display width out of range for column 'i257' (max = 255)
+DROP TABLE t1;
+CREATE TABLE t1 (
+t TINYINT UNSIGNED,
+s SMALLINT UNSIGNED,
+m MEDIUMINT UNSIGNED,
+i INT UNSIGNED,
+b BIGINT UNSIGNED,
+PRIMARY KEY (b)
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+t	tinyint(3) unsigned	YES		NULL	
+s	smallint(5) unsigned	YES		NULL	
+m	mediumint(8) unsigned	YES		NULL	
+i	int(10) unsigned	YES		NULL	
+b	bigint(20) unsigned	NO	PRI	0	
+INSERT INTO t1 (t,s,m,i,b) VALUES (255,65535,16777215,4294967295,18446744073709551615);
+INSERT INTO t1 (t,s,m,i,b) VALUES (-1,-1,-1,-1,-1);
+Warnings:
+Warning	1264	Out of range value for column 't' at row 1
+Warning	1264	Out of range value for column 's' at row 1
+Warning	1264	Out of range value for column 'm' at row 1
+Warning	1264	Out of range value for column 'i' at row 1
+Warning	1264	Out of range value for column 'b' at row 1
+SELECT t,s,m,i,b FROM t1;
+t	s	m	i	b
+0	0	0	0	0
+255	65535	16777215	4294967295	18446744073709551615
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/col_opt_unsigned.test b/mysql-test/suite/rocksdb/col_opt_unsigned.test
new file mode 100644
index 0000000..e7255e1
--- /dev/null
+++ b/mysql-test/suite/rocksdb/col_opt_unsigned.test
@@ -0,0 +1,72 @@
+# 
+# UNSIGNED column attribute 
+#
+
+--let $extra_col_opts = UNSIGNED
+
+--echo ########################
+--echo # Fixed point columns (NUMERIC, DECIMAL)
+--echo ########################
+
+--source type_fixed.inc
+
+CREATE TABLE t1 (
+  a DECIMAL UNSIGNED,
+  b NUMERIC UNSIGNED,
+  PRIMARY KEY (a)
+) ENGINE=rocksdb;
+
+SHOW COLUMNS IN t1;
+
+INSERT INTO t1 (a,b) VALUES (1.0,-1.0);
+INSERT INTO t1 (a,b) VALUES (-100,100);
+--sorted_result
+SELECT a,b FROM t1;
+DROP TABLE t1;
+
+--echo ########################
+--echo # Floating point columns (FLOAT, DOUBLE)
+--echo ########################
+
+--source type_float.inc
+
+CREATE TABLE t1 (
+  a DOUBLE UNSIGNED,
+  b FLOAT UNSIGNED,
+  PRIMARY KEY (b) 
+) ENGINE=rocksdb;
+
+SHOW COLUMNS IN t1;
+
+INSERT INTO t1 (a,b) VALUES (1.0,-1.0);
+INSERT INTO t1 (a,b) VALUES (-100,100);
+--sorted_result
+SELECT a,b FROM t1;
+DROP TABLE t1;
+
+--echo ########################
+--echo # INT columns
+--echo ########################
+
+--source type_int.inc
+
+CREATE TABLE t1 (
+  t TINYINT UNSIGNED,
+  s SMALLINT UNSIGNED,
+  m MEDIUMINT UNSIGNED,
+  i INT UNSIGNED,
+  b BIGINT UNSIGNED,
+  PRIMARY KEY (b)
+) ENGINE=rocksdb;
+
+SHOW COLUMNS IN t1;
+
+INSERT INTO t1 (t,s,m,i,b) VALUES (255,65535,16777215,4294967295,18446744073709551615);
+INSERT INTO t1 (t,s,m,i,b) VALUES (-1,-1,-1,-1,-1);
+--sorted_result
+SELECT t,s,m,i,b FROM t1;
+
+DROP TABLE t1;
+  
+--let $extra_col_opts =
+
diff --git a/mysql-test/suite/rocksdb/col_opt_zerofill.result b/mysql-test/suite/rocksdb/col_opt_zerofill.result
new file mode 100644
index 0000000..823ad2f
--- /dev/null
+++ b/mysql-test/suite/rocksdb/col_opt_zerofill.result
@@ -0,0 +1,723 @@
+########################
+# Fixed point columns (NUMERIC, DECIMAL)
+########################
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+d DECIMAL ZEROFILL,
+d0 DECIMAL(0) ZEROFILL,
+d1_1 DECIMAL(1,1) ZEROFILL,
+d10_2 DECIMAL(10,2) ZEROFILL,
+d60_10 DECIMAL(60,10) ZEROFILL,
+n NUMERIC ZEROFILL,
+n0_0 NUMERIC(0,0) ZEROFILL,
+n1 NUMERIC(1) ZEROFILL,
+n20_4 NUMERIC(20,4) ZEROFILL,
+n65_4 NUMERIC(65,4) ZEROFILL,
+pk NUMERIC ZEROFILL PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+d	decimal(10,0) unsigned zerofill	YES		NULL	
+d0	decimal(10,0) unsigned zerofill	YES		NULL	
+d1_1	decimal(1,1) unsigned zerofill	YES		NULL	
+d10_2	decimal(10,2) unsigned zerofill	YES		NULL	
+d60_10	decimal(60,10) unsigned zerofill	YES		NULL	
+n	decimal(10,0) unsigned zerofill	YES		NULL	
+n0_0	decimal(10,0) unsigned zerofill	YES		NULL	
+n1	decimal(1,0) unsigned zerofill	YES		NULL	
+n20_4	decimal(20,4) unsigned zerofill	YES		NULL	
+n65_4	decimal(65,4) unsigned zerofill	YES		NULL	
+pk	decimal(10,0) unsigned zerofill	NO	PRI	NULL	
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807,1);
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (0,0,0,0,0,0,0,0,0,0,2);
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999,3);
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
+d	d0	d1_1	d10_2	d60_10	n	n0_0	n1	n20_4	n65_4
+0000000000	0000000000	0.0	00000000.00	00000000000000000000000000000000000000000000000000.0000000000	0000000000	0000000000	0	0000000000000000.0000	0000000000000000000000000000000000000000000000000000000000000.0000
+0000000100	0000123456	0.3	00040000.25	00000000000000000000000000000000123456789123456789.1000100000	0000001024	0000007000	8	0000000000999999.9000	0000000000000000000000000000000000000000009223372036854775807.0000
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807,4);
+Warnings:
+Warning	1264	Out of range value for column 'd' at row 1
+Warning	1264	Out of range value for column 'd0' at row 1
+Warning	1264	Out of range value for column 'd1_1' at row 1
+Warning	1264	Out of range value for column 'd10_2' at row 1
+Warning	1264	Out of range value for column 'd60_10' at row 1
+Warning	1264	Out of range value for column 'n' at row 1
+Warning	1264	Out of range value for column 'n0_0' at row 1
+Warning	1264	Out of range value for column 'n1' at row 1
+Warning	1264	Out of range value for column 'n20_4' at row 1
+Warning	1264	Out of range value for column 'n65_4' at row 1
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999,5);
+Warnings:
+Warning	1264	Out of range value for column 'd' at row 1
+Warning	1264	Out of range value for column 'd0' at row 1
+Warning	1264	Out of range value for column 'd1_1' at row 1
+Warning	1264	Out of range value for column 'd10_2' at row 1
+Warning	1264	Out of range value for column 'd60_10' at row 1
+Warning	1264	Out of range value for column 'n' at row 1
+Warning	1264	Out of range value for column 'n0_0' at row 1
+Warning	1264	Out of range value for column 'n1' at row 1
+Warning	1264	Out of range value for column 'n20_4' at row 1
+Warning	1264	Out of range value for column 'n65_4' at row 1
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
+d	d0	d1_1	d10_2	d60_10	n	n0_0	n1	n20_4	n65_4
+0000000000	0000000000	0.0	00000000.00	00000000000000000000000000000000000000000000000000.0000000000	0000000000	0000000000	0	0000000000000000.0000	0000000000000000000000000000000000000000000000000000000000000.0000
+0000000000	0000000000	0.0	00000000.00	00000000000000000000000000000000000000000000000000.0000000000	0000000000	0000000000	0	0000000000000000.0000	0000000000000000000000000000000000000000000000000000000000000.0000
+0000000000	0000000000	0.0	00000000.00	00000000000000000000000000000000000000000000000000.0000000000	0000000000	0000000000	0	0000000000000000.0000	0000000000000000000000000000000000000000000000000000000000000.0000
+0000000100	0000123456	0.3	00040000.25	00000000000000000000000000000000123456789123456789.1000100000	0000001024	0000007000	8	0000000000999999.9000	0000000000000000000000000000000000000000009223372036854775807.0000
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100;
+d	d0	d1_1	d10_2	d60_10	n	n0_0	n1	n20_4	n65_4
+0000000000	0000000000	0.0	00000000.00	00000000000000000000000000000000000000000000000000.0000000000	0000000000	0000000000	0	0000000000000000.0000	0000000000000000000000000000000000000000000000000000000000000.0000
+0000000000	0000000000	0.0	00000000.00	00000000000000000000000000000000000000000000000000.0000000000	0000000000	0000000000	0	0000000000000000.0000	0000000000000000000000000000000000000000000000000000000000000.0000
+0000000000	0000000000	0.0	00000000.00	00000000000000000000000000000000000000000000000000.0000000000	0000000000	0000000000	0	0000000000000000.0000	0000000000000000000000000000000000000000000000000000000000000.0000
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+6
+);
+Warnings:
+Warning	1264	Out of range value for column 'd' at row 1
+Warning	1264	Out of range value for column 'd0' at row 1
+Warning	1264	Out of range value for column 'd1_1' at row 1
+Warning	1264	Out of range value for column 'd10_2' at row 1
+Warning	1264	Out of range value for column 'd60_10' at row 1
+Warning	1264	Out of range value for column 'n' at row 1
+Warning	1264	Out of range value for column 'n0_0' at row 1
+Warning	1264	Out of range value for column 'n1' at row 1
+Warning	1264	Out of range value for column 'n20_4' at row 1
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
+d	d0	d1_1	d10_2	d60_10	n	n0_0	n1	n20_4	n65_4
+0000000000	0000000000	0.0	00000000.00	00000000000000000000000000000000000000000000000000.0000000000	0000000000	0000000000	0	0000000000000000.0000	0000000000000000000000000000000000000000000000000000000000000.0000
+0000000000	0000000000	0.0	00000000.00	00000000000000000000000000000000000000000000000000.0000000000	0000000000	0000000000	0	0000000000000000.0000	0000000000000000000000000000000000000000000000000000000000000.0000
+0000000000	0000000000	0.0	00000000.00	00000000000000000000000000000000000000000000000000.0000000000	0000000000	0000000000	0	0000000000000000.0000	0000000000000000000000000000000000000000000000000000000000000.0000
+0000000100	0000123456	0.3	00040000.25	00000000000000000000000000000000123456789123456789.1000100000	0000001024	0000007000	8	0000000000999999.9000	0000000000000000000000000000000000000000009223372036854775807.0000
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999,7);
+Warnings:
+Warning	1264	Out of range value for column 'd' at row 1
+Warning	1264	Out of range value for column 'd0' at row 1
+Warning	1264	Out of range value for column 'd1_1' at row 1
+Warning	1264	Out of range value for column 'd10_2' at row 1
+Warning	1264	Out of range value for column 'd60_10' at row 1
+Warning	1264	Out of range value for column 'n' at row 1
+Warning	1264	Out of range value for column 'n0_0' at row 1
+Warning	1264	Out of range value for column 'n1' at row 1
+Warning	1264	Out of range value for column 'n20_4' at row 1
+Warning	1264	Out of range value for column 'n65_4' at row 1
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
+d	d0	d1_1	d10_2	d60_10	n	n0_0	n1	n20_4	n65_4
+0000000000	0000000000	0.0	00000000.00	00000000000000000000000000000000000000000000000000.0000000000	0000000000	0000000000	0	0000000000000000.0000	0000000000000000000000000000000000000000000000000000000000000.0000
+0000000000	0000000000	0.0	00000000.00	00000000000000000000000000000000000000000000000000.0000000000	0000000000	0000000000	0	0000000000000000.0000	0000000000000000000000000000000000000000000000000000000000000.0000
+0000000000	0000000000	0.0	00000000.00	00000000000000000000000000000000000000000000000000.0000000000	0000000000	0000000000	0	0000000000000000.0000	0000000000000000000000000000000000000000000000000000000000000.0000
+0000000100	0000123456	0.3	00040000.25	00000000000000000000000000000000123456789123456789.1000100000	0000001024	0000007000	8	0000000000999999.9000	0000000000000000000000000000000000000000009223372036854775807.0000
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111,8);
+Warnings:
+Note	1265	Data truncated for column 'd' at row 1
+Note	1265	Data truncated for column 'd0' at row 1
+Warning	1264	Out of range value for column 'd1_1' at row 1
+Note	1265	Data truncated for column 'd10_2' at row 1
+Note	1265	Data truncated for column 'd60_10' at row 1
+Note	1265	Data truncated for column 'n' at row 1
+Note	1265	Data truncated for column 'n0_0' at row 1
+Note	1265	Data truncated for column 'n1' at row 1
+Note	1265	Data truncated for column 'n20_4' at row 1
+Note	1265	Data truncated for column 'n65_4' at row 1
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
+d	d0	d1_1	d10_2	d60_10	n	n0_0	n1	n20_4	n65_4
+0000000000	0000000000	0.0	00000000.00	00000000000000000000000000000000000000000000000000.0000000000	0000000000	0000000000	0	0000000000000000.0000	0000000000000000000000000000000000000000000000000000000000000.0000
+0000000000	0000000000	0.0	00000000.00	00000000000000000000000000000000000000000000000000.0000000000	0000000000	0000000000	0	0000000000000000.0000	0000000000000000000000000000000000000000000000000000000000000.0000
+0000000000	0000000000	0.0	00000000.00	00000000000000000000000000000000000000000000000000.0000000000	0000000000	0000000000	0	0000000000000000.0000	0000000000000000000000000000000000000000000000000000000000000.0000
+0000000100	0000123456	0.3	00040000.25	00000000000000000000000000000000123456789123456789.1000100000	0000001024	0000007000	8	0000000000999999.9000	0000000000000000000000000000000000000000009223372036854775807.0000
+9999999999	9999999999	0.9	99999999.00	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.0000	9999999999999999999999999999999999999999999999999999999999999.1111
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+ALTER TABLE t1 ADD COLUMN n66 NUMERIC(66) ZEROFILL;
+ERROR 42000: Too big precision 66 specified for column 'n66'. Maximum is 65.
+ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(66,6) ZEROFILL;
+ERROR 42000: Too big precision 66 specified for column 'n66_6'. Maximum is 65.
+ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(66,66) ZEROFILL;
+ERROR 42000: Too big scale 66 specified for column 'n66_66'. Maximum is 30.
+DROP TABLE t1;
+CREATE TABLE t1 (
+a DECIMAL ZEROFILL,
+b NUMERIC ZEROFILL,
+PRIMARY KEY (a)
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+a	decimal(10,0) unsigned zerofill	NO	PRI	0000000000	
+b	decimal(10,0) unsigned zerofill	YES		NULL	
+INSERT INTO t1 (a,b) VALUES (1.1,1234);
+Warnings:
+Note	1265	Data truncated for column 'a' at row 1
+SELECT a,b FROM t1;
+a	b
+0000000001	0000001234
+DROP TABLE t1;
+########################
+# Floating point columns (FLOAT, DOUBLE)
+########################
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+f FLOAT ZEROFILL,
+f0 FLOAT(0) ZEROFILL,
+r1_1 REAL(1,1) ZEROFILL,
+f23_0 FLOAT(23) ZEROFILL,
+f20_3 FLOAT(20,3) ZEROFILL,
+d DOUBLE ZEROFILL,
+d1_0 DOUBLE(1,0) ZEROFILL,
+d10_10 DOUBLE PRECISION (10,10) ZEROFILL,
+d53 DOUBLE(53,0) ZEROFILL,
+d53_10 DOUBLE(53,10) ZEROFILL,
+pk DOUBLE ZEROFILL PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+f	float unsigned zerofill	YES		NULL	
+f0	float unsigned zerofill	YES		NULL	
+r1_1	double(1,1) unsigned zerofill	YES		NULL	
+f23_0	float unsigned zerofill	YES		NULL	
+f20_3	float(20,3) unsigned zerofill	YES		NULL	
+d	double unsigned zerofill	YES		NULL	
+d1_0	double(1,0) unsigned zerofill	YES		NULL	
+d10_10	double(10,10) unsigned zerofill	YES		NULL	
+d53	double(53,0) unsigned zerofill	YES		NULL	
+d53_10	double(53,10) unsigned zerofill	YES		NULL	
+pk	double unsigned zerofill	NO	PRI	NULL	
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999,1);
+SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1;
+f	0000012345.1
+d	000000000011111111.111
+d10_10	0.0123456789
+d1_0	8
+d53	00000000000000000000000000000000001234566789123456800
+d53_10	000000000000000000000000100000000000000000.0000000000
+f0	0000012345.1
+f20_3	0000000000056789.988
+f23_0	000123457000
+r1_1	0.9
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (0,0,0,0,0,0,0,0,0,0,2);
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (
+99999999999999999999999999999999999999,
+99999999999999999999999999999999999999.9999999999999999,
+0.9,
+99999999999999999999999999999999999999.9,
+99999999999999999.999,
+999999999999999999999999999999999999999999999999999999999999999999999999999999999,
+9,
+0.9999999999, 
+1999999999999999999999999999999999999999999999999999999,
+19999999999999999999999999999999999999999999.9999999999,
+3
+);
+Warnings:
+Warning	1264	Out of range value for column 'd53' at row 1
+Warning	1264	Out of range value for column 'd53_10' at row 1
+SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1;
+f	0000012345.1
+d	0000000000000000000000
+d	0000000000000000001e81
+d	000000000011111111.111
+d10_10	0.0000000000
+d10_10	0.0123456789
+d10_10	0.9999999999
+d1_0	0
+d1_0	8
+d1_0	9
+d53	00000000000000000000000000000000000000000000000000000
+d53	00000000000000000000000000000000001234566789123456800
+d53	100000000000000000000000000000000000000000000000000000
+d53_10	000000000000000000000000000000000000000000.0000000000
+d53_10	000000000000000000000000100000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+f	000000000000
+f	000000001e38
+f0	000000000000
+f0	000000001e38
+f0	0000012345.1
+f20_3	0000000000000000.000
+f20_3	0000000000056789.988
+f20_3	99999998430674940.000
+f23_0	000000000000
+f23_0	000000001e38
+f23_0	000123457000
+r1_1	0.0
+r1_1	0.9
+r1_1	0.9
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999,4);
+Warnings:
+Warning	1264	Out of range value for column 'f' at row 1
+Warning	1264	Out of range value for column 'f0' at row 1
+Warning	1264	Out of range value for column 'r1_1' at row 1
+Warning	1264	Out of range value for column 'f23_0' at row 1
+Warning	1264	Out of range value for column 'f20_3' at row 1
+Warning	1264	Out of range value for column 'd' at row 1
+Warning	1264	Out of range value for column 'd1_0' at row 1
+Warning	1264	Out of range value for column 'd10_10' at row 1
+Warning	1264	Out of range value for column 'd53' at row 1
+Warning	1264	Out of range value for column 'd53_10' at row 1
+SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1;
+f	0000012345.1
+d	0000000000000000000000
+d	0000000000000000000000
+d	0000000000000000001e81
+d	000000000011111111.111
+d10_10	0.0000000000
+d10_10	0.0000000000
+d10_10	0.0123456789
+d10_10	0.9999999999
+d1_0	0
+d1_0	0
+d1_0	8
+d1_0	9
+d53	00000000000000000000000000000000000000000000000000000
+d53	00000000000000000000000000000000000000000000000000000
+d53	00000000000000000000000000000000001234566789123456800
+d53	100000000000000000000000000000000000000000000000000000
+d53_10	000000000000000000000000000000000000000000.0000000000
+d53_10	000000000000000000000000000000000000000000.0000000000
+d53_10	000000000000000000000000100000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+f	000000000000
+f	000000000000
+f	000000001e38
+f0	000000000000
+f0	000000000000
+f0	000000001e38
+f0	0000012345.1
+f20_3	0000000000000000.000
+f20_3	0000000000000000.000
+f20_3	0000000000056789.988
+f20_3	99999998430674940.000
+f23_0	000000000000
+f23_0	000000000000
+f23_0	000000001e38
+f23_0	000123457000
+r1_1	0.0
+r1_1	0.0
+r1_1	0.9
+r1_1	0.9
+SELECT MAX(f), MAX(f0), MAX(r1_1), MAX(f23_0), MAX(f20_3), MAX(d), MAX(d1_0), MAX(d10_10), MAX(d53), MAX(d53_10) FROM t1;
+MAX(f)	9.999999680285692e37
+MAX(d)	1e81
+MAX(d10_10)	0.9999999999
+MAX(d1_0)	9
+MAX(d53)	100000000000000000000000000000000000000000000000000000
+MAX(d53_10)	10000000000000000000000000000000000000000000.0000000000
+MAX(f0)	9.999999680285692e37
+MAX(f20_3)	99999998430674940.000
+MAX(f23_0)	9.999999680285692e37
+MAX(r1_1)	0.9
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+5
+);
+Warnings:
+Warning	1264	Out of range value for column 'f' at row 1
+Warning	1264	Out of range value for column 'f0' at row 1
+Warning	1264	Out of range value for column 'r1_1' at row 1
+Warning	1264	Out of range value for column 'f23_0' at row 1
+Warning	1264	Out of range value for column 'f20_3' at row 1
+Warning	1264	Out of range value for column 'd1_0' at row 1
+Warning	1264	Out of range value for column 'd10_10' at row 1
+Warning	1264	Out of range value for column 'd53' at row 1
+Warning	1264	Out of range value for column 'd53_10' at row 1
+SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1;
+f	0000012345.1
+d	0000000000000000000000
+d	0000000000000000000000
+d	0000000000000000001e61
+d	0000000000000000001e81
+d	000000000011111111.111
+d10_10	0.0000000000
+d10_10	0.0000000000
+d10_10	0.0123456789
+d10_10	0.9999999999
+d10_10	0.9999999999
+d1_0	0
+d1_0	0
+d1_0	8
+d1_0	9
+d1_0	9
+d53	00000000000000000000000000000000000000000000000000000
+d53	00000000000000000000000000000000000000000000000000000
+d53	00000000000000000000000000000000001234566789123456800
+d53	100000000000000000000000000000000000000000000000000000
+d53	100000000000000000000000000000000000000000000000000000
+d53_10	000000000000000000000000000000000000000000.0000000000
+d53_10	000000000000000000000000000000000000000000.0000000000
+d53_10	000000000000000000000000100000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+f	000000000000
+f	000000000000
+f	000000001e38
+f	003.40282e38
+f0	000000000000
+f0	000000000000
+f0	000000001e38
+f0	0000012345.1
+f0	003.40282e38
+f20_3	0000000000000000.000
+f20_3	0000000000000000.000
+f20_3	0000000000056789.988
+f20_3	99999998430674940.000
+f20_3	99999998430674940.000
+f23_0	000000000000
+f23_0	000000000000
+f23_0	000000001e38
+f23_0	000123457000
+f23_0	003.40282e38
+r1_1	0.0
+r1_1	0.0
+r1_1	0.9
+r1_1	0.9
+r1_1	0.9
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (
+999999999999999999999999999999999999999,
+999999999999999999999999999999999999999.9999999999999999,
+1.9,
+999999999999999999999999999999999999999.9,
+999999999999999999.999,
+9999999999999999999999999999999999999999999999999999999999999999999999999999999999,
+99,
+1.9999999999,
+1999999999999999999999999999999999999999999999999999999,
+19999999999999999999999999999999999999999999.9999999999,
+6
+);
+Warnings:
+Warning	1292	Truncated incorrect DECIMAL value: ''
+Warning	1264	Out of range value for column 'f' at row 1
+Warning	1264	Out of range value for column 'f0' at row 1
+Warning	1264	Out of range value for column 'r1_1' at row 1
+Warning	1264	Out of range value for column 'f23_0' at row 1
+Warning	1264	Out of range value for column 'f20_3' at row 1
+Warning	1264	Out of range value for column 'd1_0' at row 1
+Warning	1264	Out of range value for column 'd10_10' at row 1
+Warning	1264	Out of range value for column 'd53' at row 1
+Warning	1264	Out of range value for column 'd53_10' at row 1
+SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1;
+f	0000012345.1
+d	0000000000000000000000
+d	0000000000000000000000
+d	0000000000000000001e61
+d	0000000000000000001e65
+d	0000000000000000001e81
+d	000000000011111111.111
+d10_10	0.0000000000
+d10_10	0.0000000000
+d10_10	0.0123456789
+d10_10	0.9999999999
+d10_10	0.9999999999
+d10_10	0.9999999999
+d1_0	0
+d1_0	0
+d1_0	8
+d1_0	9
+d1_0	9
+d1_0	9
+d53	00000000000000000000000000000000000000000000000000000
+d53	00000000000000000000000000000000000000000000000000000
+d53	00000000000000000000000000000000001234566789123456800
+d53	100000000000000000000000000000000000000000000000000000
+d53	100000000000000000000000000000000000000000000000000000
+d53	100000000000000000000000000000000000000000000000000000
+d53_10	000000000000000000000000000000000000000000.0000000000
+d53_10	000000000000000000000000000000000000000000.0000000000
+d53_10	000000000000000000000000100000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+f	000000000000
+f	000000000000
+f	000000001e38
+f	003.40282e38
+f	003.40282e38
+f0	000000000000
+f0	000000000000
+f0	000000001e38
+f0	0000012345.1
+f0	003.40282e38
+f0	003.40282e38
+f20_3	0000000000000000.000
+f20_3	0000000000000000.000
+f20_3	0000000000056789.988
+f20_3	99999998430674940.000
+f20_3	99999998430674940.000
+f20_3	99999998430674940.000
+f23_0	000000000000
+f23_0	000000000000
+f23_0	000000001e38
+f23_0	000123457000
+f23_0	003.40282e38
+f23_0	003.40282e38
+r1_1	0.0
+r1_1	0.0
+r1_1	0.9
+r1_1	0.9
+r1_1	0.9
+r1_1	0.9
+ALTER TABLE t1 ADD COLUMN d0_0 DOUBLE(0,0) ZEROFILL;
+ERROR 42000: Display width out of range for column 'd0_0' (max = 255)
+ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(256,1) ZEROFILL;
+ERROR 42000: Too big precision 256 specified for column 'n66_6'. Maximum is 65.
+ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(40,35) ZEROFILL;
+ERROR 42000: Too big scale 35 specified for column 'n66_66'. Maximum is 30.
+DROP TABLE t1;
+CREATE TABLE t1 (
+a DOUBLE ZEROFILL,
+b FLOAT ZEROFILL,
+PRIMARY KEY (b)
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+a	double unsigned zerofill	YES		NULL	
+b	float unsigned zerofill	NO	PRI	000000000000	
+INSERT INTO t1 (a,b) VALUES (1,1234.5);
+SELECT a,b FROM t1;
+a	b
+0000000000000000000001	0000001234.5
+DROP TABLE t1;
+########################
+# INT columns
+########################
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+i INT ZEROFILL,
+i0 INT(0) ZEROFILL,
+i1 INT(1) ZEROFILL,
+i20 INT(20) ZEROFILL,
+t TINYINT ZEROFILL,
+t0 TINYINT(0) ZEROFILL,
+t1 TINYINT(1) ZEROFILL,
+t20 TINYINT(20) ZEROFILL,
+s SMALLINT ZEROFILL,
+s0 SMALLINT(0) ZEROFILL,
+s1 SMALLINT(1) ZEROFILL,
+s20 SMALLINT(20) ZEROFILL,
+m MEDIUMINT ZEROFILL,
+m0 MEDIUMINT(0) ZEROFILL,
+m1 MEDIUMINT(1) ZEROFILL,
+m20 MEDIUMINT(20) ZEROFILL,
+b BIGINT ZEROFILL,
+b0 BIGINT(0) ZEROFILL,
+b1 BIGINT(1) ZEROFILL,
+b20 BIGINT(20) ZEROFILL,
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+i	int(10) unsigned zerofill	YES		NULL	
+i0	int(10) unsigned zerofill	YES		NULL	
+i1	int(1) unsigned zerofill	YES		NULL	
+i20	int(20) unsigned zerofill	YES		NULL	
+t	tinyint(3) unsigned zerofill	YES		NULL	
+t0	tinyint(3) unsigned zerofill	YES		NULL	
+t1	tinyint(1) unsigned zerofill	YES		NULL	
+t20	tinyint(20) unsigned zerofill	YES		NULL	
+s	smallint(5) unsigned zerofill	YES		NULL	
+s0	smallint(5) unsigned zerofill	YES		NULL	
+s1	smallint(1) unsigned zerofill	YES		NULL	
+s20	smallint(20) unsigned zerofill	YES		NULL	
+m	mediumint(8) unsigned zerofill	YES		NULL	
+m0	mediumint(8) unsigned zerofill	YES		NULL	
+m1	mediumint(1) unsigned zerofill	YES		NULL	
+m20	mediumint(20) unsigned zerofill	YES		NULL	
+b	bigint(20) unsigned zerofill	YES		NULL	
+b0	bigint(20) unsigned zerofill	YES		NULL	
+b1	bigint(1) unsigned zerofill	YES		NULL	
+b20	bigint(20) unsigned zerofill	YES		NULL	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20);
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807);
+SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1;
+i	i0	i1	i20	t	t0	t1	t20	s	s0	s1	s20	m	m0	m1	m20	b	b0	b1	b20
+0000000000	0000000000	0	00000000000000000000	000	000	0	00000000000000000000	00000	00000	0	00000000000000000000	00000000	00000000	0	00000000000000000000	00000000000000000000	00000000000000000000	0	00000000000000000000
+0000000001	0000000002	3	00000000000000000004	005	006	7	00000000000000000008	00009	00010	11	00000000000000000012	00000013	00000014	15	00000000000000000016	00000000000000000017	00000000000000000018	19	00000000000000000020
+2147483647	2147483647	2147483647	00000000002147483647	127	127	127	00000000000000000127	32767	32767	32767	00000000000000032767	08388607	08388607	8388607	00000000000008388607	09223372036854775807	09223372036854775807	9223372036854775807	09223372036854775807
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808);
+Warnings:
+Warning	1264	Out of range value for column 'i' at row 1
+Warning	1264	Out of range value for column 'i0' at row 1
+Warning	1264	Out of range value for column 'i1' at row 1
+Warning	1264	Out of range value for column 'i20' at row 1
+Warning	1264	Out of range value for column 't' at row 1
+Warning	1264	Out of range value for column 't0' at row 1
+Warning	1264	Out of range value for column 't1' at row 1
+Warning	1264	Out of range value for column 't20' at row 1
+Warning	1264	Out of range value for column 's' at row 1
+Warning	1264	Out of range value for column 's0' at row 1
+Warning	1264	Out of range value for column 's1' at row 1
+Warning	1264	Out of range value for column 's20' at row 1
+Warning	1264	Out of range value for column 'm' at row 1
+Warning	1264	Out of range value for column 'm0' at row 1
+Warning	1264	Out of range value for column 'm1' at row 1
+Warning	1264	Out of range value for column 'm20' at row 1
+Warning	1264	Out of range value for column 'b' at row 1
+Warning	1264	Out of range value for column 'b0' at row 1
+Warning	1264	Out of range value for column 'b1' at row 1
+Warning	1264	Out of range value for column 'b20' at row 1
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615);
+SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1;
+i	i0	i1	i20	t	t0	t1	t20	s	s0	s1	s20	m	m0	m1	m20	b	b0	b1	b20
+0000000000	0000000000	0	00000000000000000000	000	000	0	00000000000000000000	00000	00000	0	00000000000000000000	00000000	00000000	0	00000000000000000000	00000000000000000000	00000000000000000000	0	00000000000000000000
+0000000000	0000000000	0	00000000000000000000	000	000	0	00000000000000000000	00000	00000	0	00000000000000000000	00000000	00000000	0	00000000000000000000	00000000000000000000	00000000000000000000	0	00000000000000000000
+0000000001	0000000002	3	00000000000000000004	005	006	7	00000000000000000008	00009	00010	11	00000000000000000012	00000013	00000014	15	00000000000000000016	00000000000000000017	00000000000000000018	19	00000000000000000020
+2147483647	2147483647	2147483647	00000000002147483647	127	127	127	00000000000000000127	32767	32767	32767	00000000000000032767	08388607	08388607	8388607	00000000000008388607	09223372036854775807	09223372036854775807	9223372036854775807	09223372036854775807
+4294967295	4294967295	4294967295	00000000004294967295	255	255	255	00000000000000000255	65535	65535	65535	00000000000000065535	16777215	16777215	16777215	00000000000016777215	18446744073709551615	18446744073709551615	18446744073709551615	18446744073709551615
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809);
+Warnings:
+Warning	1264	Out of range value for column 'i' at row 1
+Warning	1264	Out of range value for column 'i0' at row 1
+Warning	1264	Out of range value for column 'i1' at row 1
+Warning	1264	Out of range value for column 'i20' at row 1
+Warning	1264	Out of range value for column 't' at row 1
+Warning	1264	Out of range value for column 't0' at row 1
+Warning	1264	Out of range value for column 't1' at row 1
+Warning	1264	Out of range value for column 't20' at row 1
+Warning	1264	Out of range value for column 's' at row 1
+Warning	1264	Out of range value for column 's0' at row 1
+Warning	1264	Out of range value for column 's1' at row 1
+Warning	1264	Out of range value for column 's20' at row 1
+Warning	1264	Out of range value for column 'm' at row 1
+Warning	1264	Out of range value for column 'm0' at row 1
+Warning	1264	Out of range value for column 'm1' at row 1
+Warning	1264	Out of range value for column 'm20' at row 1
+Warning	1264	Out of range value for column 'b' at row 1
+Warning	1264	Out of range value for column 'b0' at row 1
+Warning	1264	Out of range value for column 'b1' at row 1
+Warning	1264	Out of range value for column 'b20' at row 1
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616);
+Warnings:
+Warning	1264	Out of range value for column 'i' at row 1
+Warning	1264	Out of range value for column 'i0' at row 1
+Warning	1264	Out of range value for column 'i1' at row 1
+Warning	1264	Out of range value for column 'i20' at row 1
+Warning	1264	Out of range value for column 't' at row 1
+Warning	1264	Out of range value for column 't0' at row 1
+Warning	1264	Out of range value for column 't1' at row 1
+Warning	1264	Out of range value for column 't20' at row 1
+Warning	1264	Out of range value for column 's' at row 1
+Warning	1264	Out of range value for column 's0' at row 1
+Warning	1264	Out of range value for column 's1' at row 1
+Warning	1264	Out of range value for column 's20' at row 1
+Warning	1264	Out of range value for column 'm' at row 1
+Warning	1264	Out of range value for column 'm0' at row 1
+Warning	1264	Out of range value for column 'm1' at row 1
+Warning	1264	Out of range value for column 'm20' at row 1
+Warning	1264	Out of range value for column 'b' at row 1
+Warning	1264	Out of range value for column 'b0' at row 1
+Warning	1264	Out of range value for column 'b1' at row 1
+Warning	1264	Out of range value for column 'b20' at row 1
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615);
+Warnings:
+Warning	1264	Out of range value for column 'i' at row 8
+Warning	1264	Out of range value for column 'i0' at row 8
+Warning	1264	Out of range value for column 'i1' at row 8
+Warning	1264	Out of range value for column 'i20' at row 8
+Warning	1264	Out of range value for column 't' at row 8
+Warning	1264	Out of range value for column 't0' at row 8
+Warning	1264	Out of range value for column 't1' at row 8
+Warning	1264	Out of range value for column 't20' at row 8
+Warning	1264	Out of range value for column 's' at row 8
+Warning	1264	Out of range value for column 's0' at row 8
+Warning	1264	Out of range value for column 's1' at row 8
+Warning	1264	Out of range value for column 's20' at row 8
+Warning	1264	Out of range value for column 'm' at row 8
+Warning	1264	Out of range value for column 'm0' at row 8
+Warning	1264	Out of range value for column 'm1' at row 8
+Warning	1264	Out of range value for column 'm20' at row 8
+Warning	1264	Out of range value for column 'i' at row 9
+Warning	1264	Out of range value for column 'i0' at row 9
+Warning	1264	Out of range value for column 'i1' at row 9
+Warning	1264	Out of range value for column 'i20' at row 9
+Warning	1264	Out of range value for column 't' at row 9
+Warning	1264	Out of range value for column 't0' at row 9
+Warning	1264	Out of range value for column 't1' at row 9
+Warning	1264	Out of range value for column 't20' at row 9
+Warning	1264	Out of range value for column 's' at row 9
+Warning	1264	Out of range value for column 's0' at row 9
+Warning	1264	Out of range value for column 's1' at row 9
+Warning	1264	Out of range value for column 's20' at row 9
+Warning	1264	Out of range value for column 'm' at row 9
+Warning	1264	Out of range value for column 'm0' at row 9
+Warning	1264	Out of range value for column 'm1' at row 9
+Warning	1264	Out of range value for column 'm20' at row 9
+Warning	1264	Out of range value for column 'i' at row 10
+Warning	1264	Out of range value for column 'i0' at row 10
+Warning	1264	Out of range value for column 'i1' at row 10
+Warning	1264	Out of range value for column 'i20' at row 10
+Warning	1264	Out of range value for column 't' at row 10
+Warning	1264	Out of range value for column 't0' at row 10
+Warning	1264	Out of range value for column 't1' at row 10
+Warning	1264	Out of range value for column 't20' at row 10
+Warning	1264	Out of range value for column 's' at row 10
+Warning	1264	Out of range value for column 's0' at row 10
+Warning	1264	Out of range value for column 's1' at row 10
+Warning	1264	Out of range value for column 's20' at row 10
+Warning	1264	Out of range value for column 'm' at row 10
+Warning	1264	Out of range value for column 'm0' at row 10
+Warning	1264	Out of range value for column 'm1' at row 10
+Warning	1264	Out of range value for column 'm20' at row 10
+SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1;
+i	i0	i1	i20	t	t0	t1	t20	s	s0	s1	s20	m	m0	m1	m20	b	b0	b1	b20
+0000000000	0000000000	0	00000000000000000000	000	000	0	00000000000000000000	00000	00000	0	00000000000000000000	00000000	00000000	0	00000000000000000000	00000000000000000000	00000000000000000000	0	00000000000000000000
+0000000000	0000000000	0	00000000000000000000	000	000	0	00000000000000000000	00000	00000	0	00000000000000000000	00000000	00000000	0	00000000000000000000	00000000000000000000	00000000000000000000	0	00000000000000000000
+0000000000	0000000000	0	00000000000000000000	000	000	0	00000000000000000000	00000	00000	0	00000000000000000000	00000000	00000000	0	00000000000000000000	00000000000000000000	00000000000000000000	0	00000000000000000000
+0000000001	0000000002	3	00000000000000000004	005	006	7	00000000000000000008	00009	00010	11	00000000000000000012	00000013	00000014	15	00000000000000000016	00000000000000000017	00000000000000000018	19	00000000000000000020
+2147483647	2147483647	2147483647	00000000002147483647	127	127	127	00000000000000000127	32767	32767	32767	00000000000000032767	08388607	08388607	8388607	00000000000008388607	09223372036854775807	09223372036854775807	9223372036854775807	09223372036854775807
+4294967295	4294967295	4294967295	00000000004294967295	255	255	255	00000000000000000255	65535	65535	65535	00000000000000065535	16777215	16777215	16777215	00000000000016777215	09223372036854775807	09223372036854775807	9223372036854775807	09223372036854775807
+4294967295	4294967295	4294967295	00000000004294967295	255	255	255	00000000000000000255	65535	65535	65535	00000000000000065535	16777215	16777215	16777215	00000000000016777215	18446744073709551615	18446744073709551615	18446744073709551615	18446744073709551615
+4294967295	4294967295	4294967295	00000000004294967295	255	255	255	00000000000000000255	65535	65535	65535	00000000000000065535	16777215	16777215	16777215	00000000000016777215	18446744073709551615	18446744073709551615	18446744073709551615	18446744073709551615
+4294967295	4294967295	4294967295	00000000004294967295	255	255	255	00000000000000000255	65535	65535	65535	00000000000000065535	16777215	16777215	16777215	00000000000016777215	18446744073709551615	18446744073709551615	18446744073709551615	18446744073709551615
+4294967295	4294967295	4294967295	00000000004294967295	255	255	255	00000000000000000255	65535	65535	65535	00000000000000065535	16777215	16777215	16777215	00000000000016777215	18446744073709551615	18446744073709551615	18446744073709551615	18446744073709551615
+ALTER TABLE t1 ADD COLUMN i257 INT(257) ZEROFILL;
+ERROR 42000: Display width out of range for column 'i257' (max = 255)
+DROP TABLE t1;
+CREATE TABLE t1 (
+t TINYINT ZEROFILL,
+s SMALLINT ZEROFILL,
+m MEDIUMINT ZEROFILL,
+i INT ZEROFILL,
+b BIGINT ZEROFILL,
+PRIMARY KEY (b)
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+t	tinyint(3) unsigned zerofill	YES		NULL	
+s	smallint(5) unsigned zerofill	YES		NULL	
+m	mediumint(8) unsigned zerofill	YES		NULL	
+i	int(10) unsigned zerofill	YES		NULL	
+b	bigint(20) unsigned zerofill	NO	PRI	00000000000000000000	
+INSERT INTO t1 (t,s,m,i,b) VALUES (1,10,100,1000,0);
+SELECT t,s,m,i,b FROM t1;
+t	s	m	i	b
+001	00010	00000100	0000001000	00000000000000000000
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/col_opt_zerofill.test b/mysql-test/suite/rocksdb/col_opt_zerofill.test
new file mode 100644
index 0000000..9600567
--- /dev/null
+++ b/mysql-test/suite/rocksdb/col_opt_zerofill.test
@@ -0,0 +1,65 @@
+# 
+# ZEROFILL column attribute 
+#
+
+let $extra_col_opts = ZEROFILL;
+
+--echo ########################
+--echo # Fixed point columns (NUMERIC, DECIMAL)
+--echo ########################
+
+--source type_fixed.inc
+
+CREATE TABLE t1 (
+  a DECIMAL ZEROFILL,
+  b NUMERIC ZEROFILL,
+  PRIMARY KEY (a)
+) ENGINE=rocksdb;
+
+SHOW COLUMNS IN t1;
+
+INSERT INTO t1 (a,b) VALUES (1.1,1234);
+SELECT a,b FROM t1;
+DROP TABLE t1;
+
+--echo ########################
+--echo # Floating point columns (FLOAT, DOUBLE)
+--echo ########################
+
+--source type_float.inc
+
+CREATE TABLE t1 (
+  a DOUBLE ZEROFILL,
+  b FLOAT ZEROFILL,
+  PRIMARY KEY (b)
+) ENGINE=rocksdb;
+
+SHOW COLUMNS IN t1;
+
+INSERT INTO t1 (a,b) VALUES (1,1234.5);
+SELECT a,b FROM t1;
+DROP TABLE t1;
+
+--echo ########################
+--echo # INT columns
+--echo ########################
+
+--source type_int.inc
+
+CREATE TABLE t1 (
+  t TINYINT ZEROFILL,
+  s SMALLINT ZEROFILL,
+  m MEDIUMINT ZEROFILL,
+  i INT ZEROFILL,
+  b BIGINT ZEROFILL,
+  PRIMARY KEY (b)
+) ENGINE=rocksdb; 
+
+SHOW COLUMNS IN t1;
+
+INSERT INTO t1 (t,s,m,i,b) VALUES (1,10,100,1000,0);
+SELECT t,s,m,i,b FROM t1;
+DROP TABLE t1;
+
+--let $extra_col_opts =
+
diff --git a/mysql-test/suite/rocksdb/cons_snapshot_repeatable_read.result b/mysql-test/suite/rocksdb/cons_snapshot_repeatable_read.result
new file mode 100644
index 0000000..9d3440c
--- /dev/null
+++ b/mysql-test/suite/rocksdb/cons_snapshot_repeatable_read.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS t1;
+connect  con1,localhost,root,,;
+connect  con2,localhost,root,,;
+connection con1;
+CREATE TABLE t1 (a INT, pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=ROCKSDB;
+SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+connection con2;
+INSERT INTO t1 (a) VALUES (1);
+connection con1;
+# If consistent read works on this isolation level (REPEATABLE READ), the following SELECT should not return the value we inserted (1)
+SELECT a FROM t1;
+a
+COMMIT;
+connection default;
+disconnect con1;
+disconnect con2;
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/cons_snapshot_repeatable_read.test b/mysql-test/suite/rocksdb/cons_snapshot_repeatable_read.test
new file mode 100644
index 0000000..7b12f73
--- /dev/null
+++ b/mysql-test/suite/rocksdb/cons_snapshot_repeatable_read.test
@@ -0,0 +1,4 @@
+let $trx_isolation = REPEATABLE READ;
+
+--source consistent_snapshot.inc
+
diff --git a/mysql-test/suite/rocksdb/cons_snapshot_serializable.result b/mysql-test/suite/rocksdb/cons_snapshot_serializable.result
new file mode 100644
index 0000000..9c55b0d
--- /dev/null
+++ b/mysql-test/suite/rocksdb/cons_snapshot_serializable.result
@@ -0,0 +1,24 @@
+# -- WARNING ----------------------------------------------------------------
+# According to I_S.ENGINES,  does not support transactions.
+# If it is true, the test will most likely fail; you can 
+# either create an rdiff file, or add the test to disabled.def.
+# If transactions should be supported, check the data in Information Schema.
+# ---------------------------------------------------------------------------
+DROP TABLE IF EXISTS t1;
+connect  con1,localhost,root,,;
+connect  con2,localhost,root,,;
+connection con1;
+CREATE TABLE t1 (a INT, pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=ROCKSDB;
+SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+connection con2;
+INSERT INTO t1 (a) VALUES (1);
+connection con1;
+# If consistent read works on this isolation level (SERIALIZABLE), the following SELECT should not return the value we inserted (1)
+SELECT a FROM t1;
+a
+COMMIT;
+connection default;
+disconnect con1;
+disconnect con2;
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/cons_snapshot_serializable.test b/mysql-test/suite/rocksdb/cons_snapshot_serializable.test
new file mode 100644
index 0000000..4018e2b
--- /dev/null
+++ b/mysql-test/suite/rocksdb/cons_snapshot_serializable.test
@@ -0,0 +1,4 @@
+let $trx_isolation = SERIALIZABLE;
+
+--source consistent_snapshot.inc
+
diff --git a/mysql-test/suite/rocksdb/consistent_snapshot.inc b/mysql-test/suite/rocksdb/consistent_snapshot.inc
new file mode 100644
index 0000000..eb773e5
--- /dev/null
+++ b/mysql-test/suite/rocksdb/consistent_snapshot.inc
@@ -0,0 +1,42 @@
+#
+# TRANSACTION WITH CONSISTENT SNAPSHOT
+#
+
+--enable_connect_log
+
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+connect (con1,localhost,root,,);
+connect (con2,localhost,root,,);
+
+connection con1;
+
+CREATE TABLE t1 (a INT, pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+eval SET SESSION TRANSACTION ISOLATION LEVEL $trx_isolation;
+
+# While a consistent snapshot transaction is executed,
+# no external inserts should be visible to the transaction.
+# But it should only work this way for REPEATABLE-READ and SERIALIZABLE
+
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+
+connection con2;
+INSERT INTO t1 (a) VALUES (1);
+
+connection con1;
+--echo # If consistent read works on this isolation level ($trx_isolation), the following SELECT should not return the value we inserted (1)
+SELECT a FROM t1; 
+COMMIT;
+
+connection default;
+disconnect con1;
+disconnect con2;
+DROP TABLE t1;
+
+--source include/wait_until_count_sessions.inc
+
diff --git a/mysql-test/suite/rocksdb/create_table.result b/mysql-test/suite/rocksdb/create_table.result
new file mode 100644
index 0000000..d0828db
--- /dev/null
+++ b/mysql-test/suite/rocksdb/create_table.result
@@ -0,0 +1,44 @@
+DROP TABLE IF EXISTS t1,t2;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=rocksdb;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
+CREATE TABLE IF NOT EXISTS t1 (a INT PRIMARY KEY) ENGINE=rocksdb;
+Warnings:
+Note	1050	Table 't1' already exists
+CREATE TABLE t2 LIKE t1;
+SHOW CREATE TABLE t2;
+Table	Create Table
+t2	CREATE TABLE `t2` (
+  `a` int(11) NOT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
+CREATE TEMPORARY TABLE t2 (a INT PRIMARY KEY) ENGINE=rocksdb;
+ERROR HY000: Table storage engine 'ROCKSDB' does not support the create option 'TEMPORARY'
+DROP TABLE t2;
+DROP TABLE IF EXISTS t1;
+SET default_storage_engine = rocksdb;
+CREATE TABLE t1 (a INT PRIMARY KEY);
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a INT PRIMARY KEY) AS SELECT 1 AS a UNION SELECT 2 AS a;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
+SELECT * FROM t1;
+a
+1
+2
+FLUSH LOGS;
+DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/suite/rocksdb/create_table.test b/mysql-test/suite/rocksdb/create_table.test
new file mode 100644
index 0000000..d515ced
--- /dev/null
+++ b/mysql-test/suite/rocksdb/create_table.test
@@ -0,0 +1,67 @@
+# 
+# Basic CREATE TABLE statements
+#
+
+#############################################
+# TODO:
+# A part of the test is currently disabled 
+# because temporary tables are not supported
+#############################################
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2;
+--enable_warnings
+
+# Simple create table with minimal table options
+# which are defined in have_engine.inc
+# (default empty) plus ENGINE=
+
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=rocksdb;
+SHOW CREATE TABLE t1;
+
+# IF NOT EXISTS
+CREATE TABLE IF NOT EXISTS t1 (a INT PRIMARY KEY) ENGINE=rocksdb;
+
+# CREATE .. LIKE
+
+CREATE TABLE t2 LIKE t1;
+SHOW CREATE TABLE t2;
+
+--error ER_ILLEGAL_HA_CREATE_OPTION 
+CREATE TEMPORARY TABLE t2 (a INT PRIMARY KEY) ENGINE=rocksdb;
+
+--disable_parsing
+
+DROP TABLE t2;
+
+CREATE TEMPORARY TABLE t2 LIKE t1;
+
+SHOW CREATE TABLE t2;
+DROP TEMPORARY TABLE t2;
+
+--enable_parsing
+
+DROP TABLE t2;
+
+DROP TABLE IF EXISTS t1;
+
+# CREATE .. AS SELECT
+
+# Use the engine as default
+
+SET default_storage_engine = rocksdb;
+
+CREATE TABLE t1 (a INT PRIMARY KEY);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a INT PRIMARY KEY) AS SELECT 1 AS a UNION SELECT 2 AS a;
+SHOW CREATE TABLE t1;
+--sorted_result
+SELECT * FROM t1;
+
+# Just to add FLUSH LOGS into the mix while we are in the most common test
+FLUSH LOGS;
+
+DROP TABLE IF EXISTS t1;
+
diff --git a/mysql-test/suite/rocksdb/delete.result b/mysql-test/suite/rocksdb/delete.result
new file mode 100644
index 0000000..46c496c
--- /dev/null
+++ b/mysql-test/suite/rocksdb/delete.result
@@ -0,0 +1,123 @@
+DROP TABLE IF EXISTS t1,t2;
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (10000,'foobar'),(1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e');
+INSERT INTO t1 (a,b) SELECT a, b FROM t1;
+DELETE FROM t1 WHERE b IN ('c');
+SELECT a,b FROM t1;
+a	b
+1	a
+1	a
+10000	foobar
+10000	foobar
+2	b
+2	b
+4	d
+4	d
+5	e
+5	e
+DELETE FROM t1 WHERE a < 0 OR b = 'a';
+SELECT a,b FROM t1;
+a	b
+10000	foobar
+10000	foobar
+2	b
+2	b
+4	d
+4	d
+5	e
+5	e
+DELETE FROM t1 WHERE a <= 4 ORDER BY b DESC LIMIT 1;
+SELECT a,b FROM t1;
+a	b
+10000	foobar
+10000	foobar
+2	b
+2	b
+4	d
+5	e
+5	e
+CREATE TABLE t2 (c CHAR(8), d INT, pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t2 (c,d) SELECT b, a FROM t1;
+SELECT c,d FROM t2;
+c	d
+b	2
+b	2
+d	4
+e	5
+e	5
+foobar	10000
+foobar	10000
+DELETE t2.* FROM t1, t2 WHERE c < b AND a + d != 1;
+SELECT a,b FROM t1;
+a	b
+10000	foobar
+10000	foobar
+2	b
+2	b
+4	d
+5	e
+5	e
+SELECT c,d FROM t2;
+c	d
+foobar	10000
+foobar	10000
+DELETE FROM t2, t1.* USING t2, t1 WHERE c = 'foobar' and b = c;
+SELECT a,b FROM t1;
+a	b
+2	b
+2	b
+4	d
+5	e
+5	e
+SELECT c,d FROM t2;
+c	d
+DELETE FROM t1;
+SELECT a,b FROM t1;
+a	b
+DROP TABLE t1, t2;
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'f'),(7,'g'),(8,'h'),(10000,'foobar');
+INSERT INTO t1 (a,b) SELECT a, b FROM t1;
+BEGIN;
+DELETE FROM t1 WHERE b IN ('c');
+SELECT a,b FROM t1;
+a	b
+1	a
+1	a
+10000	foobar
+10000	foobar
+2	b
+2	b
+4	d
+4	d
+5	e
+5	e
+6	f
+6	f
+7	g
+7	g
+8	h
+8	h
+DELETE FROM t1 WHERE a < 0 OR b = 'a';
+COMMIT;
+SELECT a,b FROM t1;
+a	b
+10000	foobar
+10000	foobar
+2	b
+2	b
+4	d
+4	d
+5	e
+5	e
+6	f
+6	f
+7	g
+7	g
+8	h
+8	h
+BEGIN;
+DELETE FROM t1 WHERE a <= 4 ORDER BY b DESC LIMIT 1;
+SAVEPOINT spt1;
+ERROR 42000: The storage engine for the table doesn't support SAVEPOINT
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/delete.test b/mysql-test/suite/rocksdb/delete.test
new file mode 100644
index 0000000..5541fc8
--- /dev/null
+++ b/mysql-test/suite/rocksdb/delete.test
@@ -0,0 +1,100 @@
+# 
+# Basic DELETE statements.
+# DELETE LOW_PRIORITY is covered in delete_low_prio test
+# DELETE QUICK is covered in delete_quick test (syntax only)
+# DELETE IGNORE is covered in delete_ignore test
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2;
+--enable_warnings
+
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (10000,'foobar'),(1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e');
+INSERT INTO t1 (a,b) SELECT a, b FROM t1;
+
+# Single-table DELETE
+
+DELETE FROM t1 WHERE b IN ('c');
+--sorted_result
+SELECT a,b FROM t1;
+
+DELETE FROM t1 WHERE a < 0 OR b = 'a';
+--sorted_result
+SELECT a,b FROM t1;
+
+# ORDER BY and LIMIT
+DELETE FROM t1 WHERE a <= 4 ORDER BY b DESC LIMIT 1;
+--sorted_result
+SELECT a,b FROM t1;
+
+# Multi-table DELETE
+
+CREATE TABLE t2 (c CHAR(8), d INT, pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t2 (c,d) SELECT b, a FROM t1;
+--sorted_result
+SELECT c,d FROM t2;
+
+DELETE t2.* FROM t1, t2 WHERE c < b AND a + d != 1;
+--sorted_result
+SELECT a,b FROM t1;
+--sorted_result
+SELECT c,d FROM t2;
+
+DELETE FROM t2, t1.* USING t2, t1 WHERE c = 'foobar' and b = c;
+--sorted_result
+SELECT a,b FROM t1;
+--sorted_result
+SELECT c,d FROM t2;
+
+DELETE FROM t1;
+--sorted_result
+SELECT a,b FROM t1;
+
+DROP TABLE t1, t2;
+
+
+# 
+# Transactional DELETE
+#
+
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'f'),(7,'g'),(8,'h'),(10000,'foobar');
+INSERT INTO t1 (a,b) SELECT a, b FROM t1;
+
+BEGIN;
+DELETE FROM t1 WHERE b IN ('c');
+--sorted_result
+SELECT a,b FROM t1;
+DELETE FROM t1 WHERE a < 0 OR b = 'a';
+COMMIT;
+--sorted_result
+SELECT a,b FROM t1;
+
+# Savepoints
+
+BEGIN;
+DELETE FROM t1 WHERE a <= 4 ORDER BY b DESC LIMIT 1;
+--error ER_CHECK_NOT_IMPLEMENTED
+SAVEPOINT spt1;
+
+--disable_parsing
+
+DELETE FROM t1;
+RELEASE SAVEPOINT spt1;
+ROLLBACK;
+--sorted_result
+SELECT a,b FROM t1;
+
+BEGIN;
+DELETE FROM t1 WHERE a <= 4 ORDER BY b DESC LIMIT 1;
+SAVEPOINT spt1;
+DELETE FROM t1;
+INSERT INTO t1 (a,b) VALUES (1,'a');
+ROLLBACK TO SAVEPOINT spt1;
+COMMIT;
+
+--enable_parsing
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/delete_ignore.result b/mysql-test/suite/rocksdb/delete_ignore.result
new file mode 100644
index 0000000..1f017df
--- /dev/null
+++ b/mysql-test/suite/rocksdb/delete_ignore.result
@@ -0,0 +1,59 @@
+DROP TABLE IF EXISTS t1,t2;
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (10000,'foobar'),(1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e');
+INSERT INTO t1 (a,b) SELECT a, b FROM t1;
+CREATE TABLE t2 (pk INT AUTO_INCREMENT PRIMARY KEY, c CHAR(8), d INT) ENGINE=rocksdb;
+INSERT INTO t2 (c,d) SELECT b, a FROM t1;
+SELECT a,b FROM t1;
+a	b
+1	a
+1	a
+10000	foobar
+10000	foobar
+2	b
+2	b
+3	c
+3	c
+4	d
+4	d
+5	e
+5	e
+SELECT c,d FROM t2;
+c	d
+a	1
+a	1
+b	2
+b	2
+c	3
+c	3
+d	4
+d	4
+e	5
+e	5
+foobar	10000
+foobar	10000
+DELETE IGNORE FROM t1 WHERE b IS NOT NULL ORDER BY a LIMIT 1;
+SELECT a,b FROM t1;
+a	b
+1	a
+10000	foobar
+10000	foobar
+2	b
+2	b
+3	c
+3	c
+4	d
+4	d
+5	e
+5	e
+DELETE IGNORE t1.*, t2.* FROM t1, t2 WHERE c < b OR a != ( SELECT 1 UNION SELECT 2 );
+Warnings:
+Error	1242	Subquery returns more than 1 row
+SELECT a,b FROM t1;
+a	b
+1	a
+SELECT c,d FROM t2;
+c	d
+foobar	10000
+foobar	10000
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/rocksdb/delete_ignore.test b/mysql-test/suite/rocksdb/delete_ignore.test
new file mode 100644
index 0000000..fcd7d20
--- /dev/null
+++ b/mysql-test/suite/rocksdb/delete_ignore.test
@@ -0,0 +1,35 @@
+# 
+# DELETE IGNORE
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2;
+--enable_warnings
+
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+
+INSERT INTO t1 (a,b) VALUES (10000,'foobar'),(1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e');
+INSERT INTO t1 (a,b) SELECT a, b FROM t1;
+
+CREATE TABLE t2 (pk INT AUTO_INCREMENT PRIMARY KEY, c CHAR(8), d INT) ENGINE=rocksdb;
+
+INSERT INTO t2 (c,d) SELECT b, a FROM t1;
+--sorted_result
+SELECT a,b FROM t1;
+--sorted_result
+SELECT c,d FROM t2;
+
+DELETE IGNORE FROM t1 WHERE b IS NOT NULL ORDER BY a LIMIT 1;
+--sorted_result
+SELECT a,b FROM t1;
+
+DELETE IGNORE t1.*, t2.* FROM t1, t2 WHERE c < b OR a != ( SELECT 1 UNION SELECT 2 );
+--sorted_result
+SELECT a,b FROM t1;
+--sorted_result
+SELECT c,d FROM t2;
+
+# Cleanup
+DROP TABLE t1, t2;
+
+
diff --git a/mysql-test/suite/rocksdb/delete_quick.result b/mysql-test/suite/rocksdb/delete_quick.result
new file mode 100644
index 0000000..4173d87
--- /dev/null
+++ b/mysql-test/suite/rocksdb/delete_quick.result
@@ -0,0 +1,24 @@
+DROP TABLE IF EXISTS t1,t2;
+CREATE TABLE t1 (a INT, b CHAR(8), PRIMARY KEY (a)) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e');
+DELETE QUICK FROM t1 WHERE a = 1 OR b > 'foo';
+SELECT a,b FROM t1;
+a	b
+2	b
+3	c
+4	d
+5	e
+CREATE TABLE t2 (c CHAR(8), d INT, PRIMARY KEY (c)) ENGINE=rocksdb;
+INSERT INTO t2 (c,d) SELECT b, a FROM t1;
+SELECT c,d FROM t2;
+c	d
+b	2
+c	3
+d	4
+e	5
+DELETE QUICK FROM t2, t1.* USING t2, t1 WHERE c IS NULL OR a = d;
+SELECT a,b FROM t1;
+a	b
+SELECT c,d FROM t2;
+c	d
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/rocksdb/delete_quick.test b/mysql-test/suite/rocksdb/delete_quick.test
new file mode 100644
index 0000000..2ff1855
--- /dev/null
+++ b/mysql-test/suite/rocksdb/delete_quick.test
@@ -0,0 +1,30 @@
+# 
+# DELETE QUICK syntax.
+# For now we only check that the keyword is accepted,
+# without actually checking whether the feature works.
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2;
+--enable_warnings
+
+CREATE TABLE t1 (a INT, b CHAR(8), PRIMARY KEY (a)) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e');
+
+DELETE QUICK FROM t1 WHERE a = 1 OR b > 'foo';
+--sorted_result
+SELECT a,b FROM t1;
+
+CREATE TABLE t2 (c CHAR(8), d INT, PRIMARY KEY (c)) ENGINE=rocksdb;
+INSERT INTO t2 (c,d) SELECT b, a FROM t1;
+--sorted_result
+SELECT c,d FROM t2;
+
+DELETE QUICK FROM t2, t1.* USING t2, t1 WHERE c IS NULL OR a = d;
+--sorted_result
+SELECT a,b FROM t1;
+--sorted_result
+SELECT c,d FROM t2;
+
+DROP TABLE t1, t2;
+
diff --git a/mysql-test/suite/rocksdb/delete_with_keys.result b/mysql-test/suite/rocksdb/delete_with_keys.result
new file mode 100644
index 0000000..c94708b
--- /dev/null
+++ b/mysql-test/suite/rocksdb/delete_with_keys.result
@@ -0,0 +1,38 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY, KEY(b)) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'x'),(7,'y'),(8,'z');
+DELETE FROM t1 WHERE b > 'y';
+DELETE FROM t1 WHERE a=2;
+SELECT a,b FROM t1;
+a	b
+1	a
+3	c
+4	d
+5	e
+6	x
+7	y
+DELETE FROM t1;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'x'),(7,'y'),(8,'z');
+DELETE FROM t1 WHERE b > 'y';
+DELETE FROM t1 WHERE a=2;
+SELECT a,b FROM t1;
+a	b
+1	a
+3	c
+4	d
+5	e
+6	x
+7	y
+DELETE FROM t1;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, b INT, c INT, pk INT AUTO_INCREMENT PRIMARY KEY, KEY(a), KEY (b)) ENGINE=rocksdb;
+INSERT INTO t1 (a,b,c) VALUES (1,2,3),(4,5,6),(7,8,9);
+DELETE FROM t1 WHERE a = 10 OR b = 20 ORDER BY c LIMIT 1;
+SELECT a,b,c FROM t1;
+a	b	c
+1	2	3
+4	5	6
+7	8	9
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/delete_with_keys.test b/mysql-test/suite/rocksdb/delete_with_keys.test
new file mode 100644
index 0000000..f8af47a
--- /dev/null
+++ b/mysql-test/suite/rocksdb/delete_with_keys.test
@@ -0,0 +1,37 @@
+# 
+# DELETE statements for tables with keys
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY, KEY(b)) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'x'),(7,'y'),(8,'z');
+DELETE FROM t1 WHERE b > 'y';
+DELETE FROM t1 WHERE a=2;
+
+--sorted_result
+SELECT a,b FROM t1;
+DELETE FROM t1;
+
+DROP TABLE t1;
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'x'),(7,'y'),(8,'z');
+DELETE FROM t1 WHERE b > 'y';
+DELETE FROM t1 WHERE a=2;
+
+--sorted_result
+SELECT a,b FROM t1;
+DELETE FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a INT, b INT, c INT, pk INT AUTO_INCREMENT PRIMARY KEY, KEY(a), KEY (b)) ENGINE=rocksdb;
+
+INSERT INTO t1 (a,b,c) VALUES (1,2,3),(4,5,6),(7,8,9);
+DELETE FROM t1 WHERE a = 10 OR b = 20 ORDER BY c LIMIT 1;
+--sorted_result
+SELECT a,b,c FROM t1;
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/describe.result b/mysql-test/suite/rocksdb/describe.result
new file mode 100644
index 0000000..ec82857
--- /dev/null
+++ b/mysql-test/suite/rocksdb/describe.result
@@ -0,0 +1,19 @@
+DROP TABLE IF EXISTS t1, t2, t3;
+CREATE TABLE t1 (a INT, b CHAR(8), PRIMARY KEY (a)) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (100,'foo'),(2, 'b');
+CREATE TABLE t2 (a INT, b CHAR(8), PRIMARY KEY (b)) ENGINE=rocksdb CHARACTER SET utf8;
+INSERT INTO t2 (a,b) VALUES (1, 'bar');
+CREATE TABLE t3 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb CHARACTER SET utf8;
+DESCRIBE t1;
+Field	Type	Null	Key	Default	Extra
+a	int(11)	NO	PRI	0	
+b	char(8)	YES		NULL	
+DESC t2 a;
+Field	Type	Null	Key	Default	Extra
+a	int(11)	YES		NULL	
+DESCRIBE t3 '%';
+Field	Type	Null	Key	Default	Extra
+a	int(11)	YES		NULL	
+b	char(8)	YES		NULL	
+pk	int(11)	NO	PRI	NULL	auto_increment
+DROP TABLE t1, t2, t3;
diff --git a/mysql-test/suite/rocksdb/describe.test b/mysql-test/suite/rocksdb/describe.test
new file mode 100644
index 0000000..04b58b5
--- /dev/null
+++ b/mysql-test/suite/rocksdb/describe.test
@@ -0,0 +1,22 @@
+# 
+# DESCRIBE statement
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2, t3;
+--enable_warnings
+
+CREATE TABLE t1 (a INT, b CHAR(8), PRIMARY KEY (a)) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (100,'foo'),(2, 'b');
+
+CREATE TABLE t2 (a INT, b CHAR(8), PRIMARY KEY (b)) ENGINE=rocksdb CHARACTER SET utf8;
+INSERT INTO t2 (a,b) VALUES (1, 'bar');
+
+CREATE TABLE t3 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb CHARACTER SET utf8;
+
+DESCRIBE t1;
+DESC t2 a;
+DESCRIBE t3 '%';
+
+DROP TABLE t1, t2, t3;
+
diff --git a/mysql-test/suite/rocksdb/disabled.def b/mysql-test/suite/rocksdb/disabled.def
new file mode 100644
index 0000000..fea7093
--- /dev/null
+++ b/mysql-test/suite/rocksdb/disabled.def
@@ -0,0 +1,11 @@
+type_blob_indexes : MDEV-4097 (Indexes on text/blob fields are not allowed)
+type_text_indexes : MDEV-4097 (Indexes on text/blob fields are not allowed)
+cons_snapshot_repeatable_read : Consistent read does not work
+cons_snapshot_serializable : Consistent read does not work
+select_for_update : Not supported?
+select_lock_in_share_mode : Not supported?
+level_read_committed : Not supported?
+level_read_uncommitted : Not supported?
+level_serializable: Not supported?
+level_repeatable_read: Can't seen own changes
+
diff --git a/mysql-test/suite/rocksdb/index.inc b/mysql-test/suite/rocksdb/index.inc
new file mode 100644
index 0000000..5786971
--- /dev/null
+++ b/mysql-test/suite/rocksdb/index.inc
@@ -0,0 +1,113 @@
+# 
+# Basic syntax related to indexes: 
+#   unique and non-unique keys,
+#   single- and multi-column keys,
+#   index option COMMENT.
+#   
+# See other index* tests for operations 
+# which are less likely to be supported
+#
+# PRIMARY KEY syntax is covered in index_primary test.
+# Index types BTREE|HASH -- in index_type_btree|hash tests.
+# SPATIAL -- in type_spatial_indexes test.
+# FULLTEXT -- in fulltext_search test.
+# KEY_BLOCK_SIZE -- in index_key_block_size test.
+#
+# Usage to call the test from another test:
+#
+# A calling test may define $index_type, in which case
+#   USING clause will be added to the syntax.
+# 
+
+################################################
+# TODO:
+# A part of the test is disabled because unique indexes
+# are not currently supported
+################################################
+
+
+let $using_index_type = ;
+if ($index_type)
+{
+  let $using_index_type = USING $index_type;
+}
+
+
+eval CREATE TABLE t1 (a INT,
+  b CHAR(8),
+  pk INT PRIMARY KEY,
+  KEY $using_index_type (a)
+) ENGINE=rocksdb;
+
+SHOW KEYS IN t1;
+DROP TABLE t1;
+
+eval CREATE TABLE t1 (a INT,
+  b CHAR(8),
+  pk INT PRIMARY KEY,
+  KEY a_b $using_index_type (a,b) COMMENT 'a_b index'
+) ENGINE=rocksdb;
+
+SHOW KEYS IN t1;
+DROP TABLE t1;
+
+eval CREATE TABLE t1 (a INT,
+  b CHAR(8),
+  pk INT PRIMARY KEY,
+  KEY $using_index_type (a),
+  KEY $using_index_type (b)
+) ENGINE=rocksdb;
+
+SHOW KEYS IN t1;
+DROP TABLE t1;
+
+--disable_parsing
+
+eval CREATE TABLE t1 (a INT,
+  b CHAR(8),
+  pk INT PRIMARY KEY,
+  UNIQUE INDEX $using_index_type (a)
+) ENGINE=rocksdb;
+
+SHOW KEYS IN t1;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b');
+--error ER_DUP_ENTRY,ER_DUP_KEY
+INSERT INTO t1 (a,b) VALUES (1,'c');
+
+DROP TABLE t1;
+
+--enable_parsing
+
+#
+# ALTER TABLE
+#
+
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (100,'z');
+
+eval ALTER TABLE t1 ADD KEY (a) $using_index_type COMMENT 'simple index on a';
+SHOW INDEX FROM t1;
+ALTER TABLE t1 DROP KEY a;
+DROP TABLE t1;
+
+--disable_parsing
+
+eval CREATE TABLE t1 (a INT,
+  b CHAR(8),
+  pk INT AUTO_INCREMENT PRIMARY KEY,
+  UNIQUE INDEX $using_index_type (a)
+) ENGINE=rocksdb;
+
+SHOW KEYS IN t1;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b');
+--error ER_DUP_ENTRY,ER_DUP_KEY
+INSERT INTO t1 (a,b) VALUES (1,'c');
+
+ALTER TABLE t1 DROP INDEX a;
+INSERT INTO t1 (a,b) VALUES (1,'c');
+--error ER_DUP_ENTRY
+eval ALTER TABLE t1 ADD UNIQUE INDEX a(a) $using_index_type;
+DROP TABLE t1;
+
+--enable_parsing
+
diff --git a/mysql-test/suite/rocksdb/index.result b/mysql-test/suite/rocksdb/index.result
new file mode 100644
index 0000000..fd5430e
--- /dev/null
+++ b/mysql-test/suite/rocksdb/index.result
@@ -0,0 +1,42 @@
+CREATE TABLE t1 (a INT,
+b CHAR(8),
+pk INT PRIMARY KEY,
+KEY  (a)
+) ENGINE=rocksdb;
+SHOW KEYS IN t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
+t1	0	PRIMARY	1	pk	A	NULL	NULL	NULL		BTREE		
+t1	1	a	1	a	A	NULL	NULL	NULL	YES	BTREE		
+DROP TABLE t1;
+CREATE TABLE t1 (a INT,
+b CHAR(8),
+pk INT PRIMARY KEY,
+KEY a_b  (a,b) COMMENT 'a_b index'
+) ENGINE=rocksdb;
+SHOW KEYS IN t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
+t1	0	PRIMARY	1	pk	A	NULL	NULL	NULL		BTREE		
+t1	1	a_b	1	a	A	NULL	NULL	NULL	YES	BTREE		a_b index
+t1	1	a_b	2	b	A	NULL	NULL	NULL	YES	BTREE		a_b index
+DROP TABLE t1;
+CREATE TABLE t1 (a INT,
+b CHAR(8),
+pk INT PRIMARY KEY,
+KEY  (a),
+KEY  (b)
+) ENGINE=rocksdb;
+SHOW KEYS IN t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
+t1	0	PRIMARY	1	pk	A	NULL	NULL	NULL		BTREE		
+t1	1	a	1	a	A	NULL	NULL	NULL	YES	BTREE		
+t1	1	b	1	b	A	NULL	NULL	NULL	YES	BTREE		
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (100,'z');
+ALTER TABLE t1 ADD KEY (a)  COMMENT 'simple index on a';
+SHOW INDEX FROM t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
+t1	0	PRIMARY	1	pk	A	NULL	NULL	NULL		BTREE		
+t1	1	a	1	a	A	NULL	NULL	NULL	YES	BTREE		simple index on a
+ALTER TABLE t1 DROP KEY a;
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/index.test b/mysql-test/suite/rocksdb/index.test
new file mode 100644
index 0000000..86b6464
--- /dev/null
+++ b/mysql-test/suite/rocksdb/index.test
@@ -0,0 +1,21 @@
+# 
+# Basic syntax related to indexes: 
+#   unique and non-unique keys,
+#   single- and multi-column keys,
+#   index option COMMENT.
+#   
+# See other index* tests for operations 
+# which are less likely to be supported
+#
+# PRIMARY KEY syntax is covered in index_primary test.
+# Index types BTREE|HASH -- in index_type_btree|hash tests.
+# SPATIAL -- in type_spatial_indexes test.
+# FULLTEXT -- in fulltext_search test.
+# KEY_BLOCK_SIZE -- in index_key_block_size test.
+#
+
+# (Default index type)
+
+--source index.inc
+
+
diff --git a/mysql-test/suite/rocksdb/index_key_block_size.result b/mysql-test/suite/rocksdb/index_key_block_size.result
new file mode 100644
index 0000000..1b7d8c2
--- /dev/null
+++ b/mysql-test/suite/rocksdb/index_key_block_size.result
@@ -0,0 +1,51 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT,
+b CHAR(8),
+pk INT PRIMARY KEY,
+KEY (a) KEY_BLOCK_SIZE=8
+) ENGINE=rocksdb;
+SHOW KEYS IN t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
+t1	0	PRIMARY	1	pk	A	NULL	NULL	NULL		BTREE		
+t1	1	a	1	a	A	NULL	NULL	NULL	YES	BTREE		
+DROP TABLE t1;
+CREATE TABLE t1 (a INT,
+b CHAR(8),
+pk INT PRIMARY KEY,
+KEY ind1(b ASC) KEY_BLOCK_SIZE=0
+) ENGINE=rocksdb;
+SHOW INDEX IN t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
+t1	0	PRIMARY	1	pk	A	NULL	NULL	NULL		BTREE		
+t1	1	ind1	1	b	A	NULL	NULL	NULL	YES	BTREE		
+DROP TABLE t1;
+CREATE TABLE t1 (a INT,
+b CHAR(8),
+PRIMARY KEY ind2(b(1) DESC) KEY_BLOCK_SIZE=32768 COMMENT 'big key_block_size value'
+) ENGINE=rocksdb;
+SHOW INDEX IN t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
+t1	0	PRIMARY	1	b	A	NULL	1	NULL		BTREE		big key_block_size value
+DROP TABLE t1;
+CREATE TABLE t1 (a INT,
+b CHAR(8),
+pk INT AUTO_INCREMENT PRIMARY KEY,
+KEY a_b(a,b) KEY_BLOCK_SIZE=8192
+) ENGINE=rocksdb;
+SHOW INDEX IN t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
+t1	0	PRIMARY	1	pk	A	NULL	NULL	NULL		BTREE		
+t1	1	a_b	1	a	A	NULL	NULL	NULL	YES	BTREE		
+t1	1	a_b	2	b	A	NULL	NULL	NULL	YES	BTREE		
+DROP TABLE t1;
+CREATE TABLE t1 (a INT,
+b CHAR(8),
+PRIMARY KEY (b)
+) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (100,'z');
+ALTER TABLE t1 ADD KEY(a) KEY_BLOCK_SIZE 8192;
+SHOW INDEX FROM t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
+t1	0	PRIMARY	1	b	A	NULL	NULL	NULL		BTREE		
+t1	1	a	1	a	A	NULL	NULL	NULL	YES	BTREE		
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/index_key_block_size.test b/mysql-test/suite/rocksdb/index_key_block_size.test
new file mode 100644
index 0000000..d458cde
--- /dev/null
+++ b/mysql-test/suite/rocksdb/index_key_block_size.test
@@ -0,0 +1,65 @@
+# 
+# KEY_BLOCK_SIZE index option.
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT,
+  b CHAR(8),
+  pk INT PRIMARY KEY,
+  KEY (a) KEY_BLOCK_SIZE=8
+) ENGINE=rocksdb;
+
+#--replace_column 6 # 7 # 10 # 11 #
+SHOW KEYS IN t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a INT,
+  b CHAR(8),
+  pk INT PRIMARY KEY,
+  KEY ind1(b ASC) KEY_BLOCK_SIZE=0
+) ENGINE=rocksdb;
+
+# --replace_column 6 # 7 # 10 # 11 #
+SHOW INDEX IN t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a INT,
+  b CHAR(8),
+  PRIMARY KEY ind2(b(1) DESC) KEY_BLOCK_SIZE=32768 COMMENT 'big key_block_size value'
+) ENGINE=rocksdb;
+
+#--replace_column 6 # 7 # 10 # 11 # 
+SHOW INDEX IN t1;
+
+DROP TABLE t1;
+
+CREATE TABLE t1 (a INT,
+  b CHAR(8),
+  pk INT AUTO_INCREMENT PRIMARY KEY,
+  KEY a_b(a,b) KEY_BLOCK_SIZE=8192
+) ENGINE=rocksdb;
+
+#--replace_column 6 # 7 # 10 # 11 #
+SHOW INDEX IN t1;
+  
+DROP TABLE t1;
+
+#
+# ALTER TABLE
+#
+
+CREATE TABLE t1 (a INT,
+  b CHAR(8),
+  PRIMARY KEY (b)
+) ENGINE=rocksdb;
+
+INSERT INTO t1 (a,b) VALUES (100,'z');
+
+ALTER TABLE t1 ADD KEY(a) KEY_BLOCK_SIZE 8192;
+SHOW INDEX FROM t1;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/index_primary.result b/mysql-test/suite/rocksdb/index_primary.result
new file mode 100644
index 0000000..f9a3204
--- /dev/null
+++ b/mysql-test/suite/rocksdb/index_primary.result
@@ -0,0 +1,52 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT PRIMARY KEY,
+b CHAR(8)
+) ENGINE=rocksdb;
+SHOW KEYS IN t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
+t1	0	PRIMARY	1	a	A	NULL	NULL	NULL		BTREE		
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b');
+INSERT INTO t1 (a,b) VALUES (1,'c');
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+DROP TABLE t1;
+CREATE TABLE t1 (a INT PRIMARY KEY,
+b CHAR(8) PRIMARY KEY
+) ENGINE=rocksdb;
+ERROR 42000: Multiple primary key defined
+CREATE TABLE t1 (a INT,
+b CHAR(8),
+PRIMARY KEY (a,b)
+) ENGINE=rocksdb;
+SHOW INDEX IN t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
+t1	0	PRIMARY	1	a	A	NULL	NULL	NULL		BTREE		
+t1	0	PRIMARY	2	b	A	NULL	NULL	NULL		BTREE		
+INSERT INTO t1 (a,b) VALUES (1,'a'),(1,'b'),(2,'a'),(2,'b');
+INSERT INTO t1 (a,b) VALUES (1,'b');
+ERROR 23000: Duplicate entry '1-b' for key 'PRIMARY'
+DROP TABLE t1;
+CREATE TABLE t1 (a INT KEY,
+b CHAR(8),
+KEY (b)
+) ENGINE=rocksdb;
+SHOW INDEX IN t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
+t1	0	PRIMARY	1	a	A	NULL	NULL	NULL		BTREE		
+t1	1	b	1	b	A	NULL	NULL	NULL	YES	BTREE		
+DROP TABLE t1;
+CREATE TABLE t1 (a INT,
+b CHAR(8) PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW INDEX IN t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
+t1	0	PRIMARY	1	b	A	NULL	NULL	NULL		BTREE		
+ALTER TABLE t1 DROP INDEX `PRIMARY`;
+ERROR 42000: This table type requires a primary key
+ALTER TABLE t1 ADD CONSTRAINT PRIMARY KEY pk (a);
+ERROR 42000: Multiple primary key defined
+SHOW KEYS IN t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
+t1	0	PRIMARY	1	b	A	NULL	NULL	NULL		BTREE		
+ALTER TABLE t1 DROP PRIMARY KEY;
+ERROR 42000: This table type requires a primary key
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/index_primary.test b/mysql-test/suite/rocksdb/index_primary.test
new file mode 100644
index 0000000..b3e8bcb
--- /dev/null
+++ b/mysql-test/suite/rocksdb/index_primary.test
@@ -0,0 +1,61 @@
+# 
+# Basic syntax related to primary keys 
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT PRIMARY KEY,
+  b CHAR(8)
+) ENGINE=rocksdb;
+
+SHOW KEYS IN t1;
+
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b');
+--error ER_DUP_ENTRY
+INSERT INTO t1 (a,b) VALUES (1,'c');
+
+DROP TABLE t1;
+
+--error ER_MULTIPLE_PRI_KEY
+CREATE TABLE t1 (a INT PRIMARY KEY,
+  b CHAR(8) PRIMARY KEY
+) ENGINE=rocksdb;
+
+CREATE TABLE t1 (a INT,
+  b CHAR(8),
+  PRIMARY KEY (a,b)
+) ENGINE=rocksdb;
+
+SHOW INDEX IN t1;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(1,'b'),(2,'a'),(2,'b');
+--error ER_DUP_ENTRY
+INSERT INTO t1 (a,b) VALUES (1,'b');
+  DROP TABLE t1;
+
+# KEY in a column definition means PK!
+
+CREATE TABLE t1 (a INT KEY,
+  b CHAR(8),
+  KEY (b)
+) ENGINE=rocksdb;
+
+SHOW INDEX IN t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a INT,
+  b CHAR(8) PRIMARY KEY
+) ENGINE=rocksdb;
+
+SHOW INDEX IN t1;
+
+--error ER_REQUIRES_PRIMARY_KEY
+ALTER TABLE t1 DROP INDEX `PRIMARY`;
+--error ER_MULTIPLE_PRI_KEY
+ALTER TABLE t1 ADD CONSTRAINT PRIMARY KEY pk (a);
+SHOW KEYS IN t1;
+--error ER_REQUIRES_PRIMARY_KEY
+ALTER TABLE t1 DROP PRIMARY KEY;
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/index_type_btree.result b/mysql-test/suite/rocksdb/index_type_btree.result
new file mode 100644
index 0000000..91f8d9c
--- /dev/null
+++ b/mysql-test/suite/rocksdb/index_type_btree.result
@@ -0,0 +1,42 @@
+CREATE TABLE t1 (a INT,
+b CHAR(8),
+pk INT PRIMARY KEY,
+KEY USING BTREE (a)
+) ENGINE=rocksdb;
+SHOW KEYS IN t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
+t1	0	PRIMARY	1	pk	A	NULL	NULL	NULL		BTREE		
+t1	1	a	1	a	A	NULL	NULL	NULL	YES	BTREE		
+DROP TABLE t1;
+CREATE TABLE t1 (a INT,
+b CHAR(8),
+pk INT PRIMARY KEY,
+KEY a_b USING BTREE (a,b) COMMENT 'a_b index'
+) ENGINE=rocksdb;
+SHOW KEYS IN t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
+t1	0	PRIMARY	1	pk	A	NULL	NULL	NULL		BTREE		
+t1	1	a_b	1	a	A	NULL	NULL	NULL	YES	BTREE		a_b index
+t1	1	a_b	2	b	A	NULL	NULL	NULL	YES	BTREE		a_b index
+DROP TABLE t1;
+CREATE TABLE t1 (a INT,
+b CHAR(8),
+pk INT PRIMARY KEY,
+KEY USING BTREE (a),
+KEY USING BTREE (b)
+) ENGINE=rocksdb;
+SHOW KEYS IN t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
+t1	0	PRIMARY	1	pk	A	NULL	NULL	NULL		BTREE		
+t1	1	a	1	a	A	NULL	NULL	NULL	YES	BTREE		
+t1	1	b	1	b	A	NULL	NULL	NULL	YES	BTREE		
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (100,'z');
+ALTER TABLE t1 ADD KEY (a) USING BTREE COMMENT 'simple index on a';
+SHOW INDEX FROM t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
+t1	0	PRIMARY	1	pk	A	NULL	NULL	NULL		BTREE		
+t1	1	a	1	a	A	NULL	NULL	NULL	YES	BTREE		simple index on a
+ALTER TABLE t1 DROP KEY a;
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/index_type_btree.test b/mysql-test/suite/rocksdb/index_type_btree.test
new file mode 100644
index 0000000..a5de672
--- /dev/null
+++ b/mysql-test/suite/rocksdb/index_type_btree.test
@@ -0,0 +1,10 @@
+#
+# Index type BTREE
+#
+
+let $index_type = BTREE;
+
+--source index.inc
+
+let $index_type =;
+
diff --git a/mysql-test/suite/rocksdb/index_type_hash.result b/mysql-test/suite/rocksdb/index_type_hash.result
new file mode 100644
index 0000000..b616b91
--- /dev/null
+++ b/mysql-test/suite/rocksdb/index_type_hash.result
@@ -0,0 +1,42 @@
+CREATE TABLE t1 (a INT,
+b CHAR(8),
+pk INT PRIMARY KEY,
+KEY USING HASH (a)
+) ENGINE=rocksdb;
+SHOW KEYS IN t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
+t1	0	PRIMARY	1	pk	A	NULL	NULL	NULL		BTREE		
+t1	1	a	1	a	A	NULL	NULL	NULL	YES	BTREE		
+DROP TABLE t1;
+CREATE TABLE t1 (a INT,
+b CHAR(8),
+pk INT PRIMARY KEY,
+KEY a_b USING HASH (a,b) COMMENT 'a_b index'
+) ENGINE=rocksdb;
+SHOW KEYS IN t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
+t1	0	PRIMARY	1	pk	A	NULL	NULL	NULL		BTREE		
+t1	1	a_b	1	a	A	NULL	NULL	NULL	YES	BTREE		a_b index
+t1	1	a_b	2	b	A	NULL	NULL	NULL	YES	BTREE		a_b index
+DROP TABLE t1;
+CREATE TABLE t1 (a INT,
+b CHAR(8),
+pk INT PRIMARY KEY,
+KEY USING HASH (a),
+KEY USING HASH (b)
+) ENGINE=rocksdb;
+SHOW KEYS IN t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
+t1	0	PRIMARY	1	pk	A	NULL	NULL	NULL		BTREE		
+t1	1	a	1	a	A	NULL	NULL	NULL	YES	BTREE		
+t1	1	b	1	b	A	NULL	NULL	NULL	YES	BTREE		
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (100,'z');
+ALTER TABLE t1 ADD KEY (a) USING HASH COMMENT 'simple index on a';
+SHOW INDEX FROM t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
+t1	0	PRIMARY	1	pk	A	NULL	NULL	NULL		BTREE		
+t1	1	a	1	a	A	NULL	NULL	NULL	YES	BTREE		simple index on a
+ALTER TABLE t1 DROP KEY a;
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/index_type_hash.test b/mysql-test/suite/rocksdb/index_type_hash.test
new file mode 100644
index 0000000..f67f248
--- /dev/null
+++ b/mysql-test/suite/rocksdb/index_type_hash.test
@@ -0,0 +1,10 @@
+#
+# Index type HASH
+#
+
+let $index_type = HASH;
+
+--source index.inc
+
+let $index_type =;
+
diff --git a/mysql-test/suite/rocksdb/insert.result b/mysql-test/suite/rocksdb/insert.result
new file mode 100644
index 0000000..6a15ef8
--- /dev/null
+++ b/mysql-test/suite/rocksdb/insert.result
@@ -0,0 +1,209 @@
+DROP TABLE IF EXISTS t1, t2;
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 VALUES (100,'foobar',100),(1,'a',101),(2,'b',103),(3,'c',104),(4,'d',105),(5,'e',106);
+SELECT a,b FROM t1;
+a	b
+1	a
+100	foobar
+2	b
+3	c
+4	d
+5	e
+INSERT t1 VALUE (10,'foo',107),(11,'abc',108);
+SELECT a,b FROM t1;
+a	b
+1	a
+10	foo
+100	foobar
+11	abc
+2	b
+3	c
+4	d
+5	e
+INSERT INTO t1 (b,a) VALUES ('test',0);
+SELECT a,b FROM t1;
+a	b
+0	test
+1	a
+10	foo
+100	foobar
+11	abc
+2	b
+3	c
+4	d
+5	e
+INSERT INTO t1 VALUES (DEFAULT,DEFAULT,NULL);
+SELECT a,b FROM t1;
+a	b
+0	test
+1	a
+10	foo
+100	foobar
+11	abc
+2	b
+3	c
+4	d
+5	e
+NULL	NULL
+INSERT t1 (a) VALUE (10),(20);
+SELECT a,b FROM t1;
+a	b
+0	test
+1	a
+10	NULL
+10	foo
+100	foobar
+11	abc
+2	b
+20	NULL
+3	c
+4	d
+5	e
+NULL	NULL
+INSERT INTO t1 SET a = 11, b = 'f';
+SELECT a,b FROM t1;
+a	b
+0	test
+1	a
+10	NULL
+10	foo
+100	foobar
+11	abc
+11	f
+2	b
+20	NULL
+3	c
+4	d
+5	e
+NULL	NULL
+INSERT t1 SET b = DEFAULT;
+SELECT a,b FROM t1;
+a	b
+0	test
+1	a
+10	NULL
+10	foo
+100	foobar
+11	abc
+11	f
+2	b
+20	NULL
+3	c
+4	d
+5	e
+NULL	NULL
+NULL	NULL
+CREATE TABLE t2 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t2 SELECT a,b,pk FROM t1;
+INSERT INTO t1 (a) SELECT a FROM t2 WHERE b = 'foo';
+SELECT a,b FROM t1;
+a	b
+0	test
+1	a
+10	NULL
+10	NULL
+10	foo
+100	foobar
+11	abc
+11	f
+2	b
+20	NULL
+3	c
+4	d
+5	e
+NULL	NULL
+NULL	NULL
+INSERT t1 (a,b) SELECT a,b FROM t1;
+SELECT a,b FROM t1;
+a	b
+0	test
+0	test
+1	a
+1	a
+10	NULL
+10	NULL
+10	NULL
+10	NULL
+10	foo
+10	foo
+100	foobar
+100	foobar
+11	abc
+11	abc
+11	f
+11	f
+2	b
+2	b
+20	NULL
+20	NULL
+3	c
+3	c
+4	d
+4	d
+5	e
+5	e
+NULL	NULL
+NULL	NULL
+NULL	NULL
+NULL	NULL
+DROP TABLE t1, t2;
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+BEGIN;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(100,'foo');
+INSERT t1 (a,b) VALUE (10,'foo'),(11,'abc');
+COMMIT;
+SELECT a,b FROM t1;
+a	b
+1	a
+10	foo
+100	foo
+11	abc
+2	b
+3	c
+4	d
+5	e
+BEGIN;
+INSERT INTO t1 (b,a) VALUES ('test',0);
+SAVEPOINT spt1;
+ERROR 42000: The storage engine for the table doesn't support SAVEPOINT
+INSERT INTO t1 (a,b) VALUES (DEFAULT,DEFAULT);
+RELEASE SAVEPOINT spt1;
+Got one of the listed errors
+INSERT INTO t1 (a,b) VALUES (DEFAULT,DEFAULT);
+ROLLBACK;
+SELECT a,b FROM t1;
+a	b
+1	a
+10	foo
+100	foo
+11	abc
+2	b
+3	c
+4	d
+5	e
+BEGIN;
+INSERT t1 (a) VALUE (10),(20);
+SAVEPOINT spt1;
+ERROR 42000: The storage engine for the table doesn't support SAVEPOINT
+INSERT INTO t1 SET a = 11, b = 'f';
+INSERT t1 SET b = DEFAULT;
+ROLLBACK TO SAVEPOINT spt1;
+Got one of the listed errors
+INSERT INTO t1 (b,a) VALUES ('test1',10);
+COMMIT;
+SELECT a,b FROM t1;
+a	b
+1	a
+10	NULL
+10	foo
+10	test1
+100	foo
+11	abc
+11	f
+2	b
+20	NULL
+3	c
+4	d
+5	e
+NULL	NULL
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/insert.test b/mysql-test/suite/rocksdb/insert.test
new file mode 100644
index 0000000..22d2a78
--- /dev/null
+++ b/mysql-test/suite/rocksdb/insert.test
@@ -0,0 +1,99 @@
+# 
+# Basic INSERT statements
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
+
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+
+# INSERT [INTO] .. VALUES|VALUE ..
+
+INSERT INTO t1 VALUES (100,'foobar',100),(1,'a',101),(2,'b',103),(3,'c',104),(4,'d',105),(5,'e',106);
+--sorted_result
+SELECT a,b FROM t1;
+
+INSERT t1 VALUE (10,'foo',107),(11,'abc',108);
+--sorted_result
+SELECT a,b FROM t1;
+
+INSERT INTO t1 (b,a) VALUES ('test',0);
+--sorted_result
+SELECT a,b FROM t1;
+
+INSERT INTO t1 VALUES (DEFAULT,DEFAULT,NULL);
+--sorted_result
+SELECT a,b FROM t1;
+
+INSERT t1 (a) VALUE (10),(20);
+--sorted_result
+SELECT a,b FROM t1;
+
+# INSERT [INTO] .. SET 
+
+INSERT INTO t1 SET a = 11, b = 'f';
+--sorted_result
+SELECT a,b FROM t1;
+
+INSERT t1 SET b = DEFAULT;
+--sorted_result
+SELECT a,b FROM t1;
+
+
+# INSERT .. SELECT
+
+CREATE TABLE t2 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+
+INSERT INTO t2 SELECT a,b,pk FROM t1;
+INSERT INTO t1 (a) SELECT a FROM t2 WHERE b = 'foo';
+--sorted_result
+SELECT a,b FROM t1;
+
+INSERT t1 (a,b) SELECT a,b FROM t1;
+--sorted_result
+SELECT a,b FROM t1;
+
+DROP TABLE t1, t2;
+
+# 
+# Transactional INSERT
+#
+
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+
+BEGIN;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(100,'foo');
+INSERT t1 (a,b) VALUE (10,'foo'),(11,'abc');
+COMMIT;
+--sorted_result
+SELECT a,b FROM t1;
+
+BEGIN;
+INSERT INTO t1 (b,a) VALUES ('test',0);
+--error ER_CHECK_NOT_IMPLEMENTED
+SAVEPOINT spt1;
+INSERT INTO t1 (a,b) VALUES (DEFAULT,DEFAULT);
+--error ER_CHECK_NOT_IMPLEMENTED,ER_SP_DOES_NOT_EXIST
+RELEASE SAVEPOINT spt1;
+INSERT INTO t1 (a,b) VALUES (DEFAULT,DEFAULT);
+ROLLBACK;
+--sorted_result
+SELECT a,b FROM t1;
+
+BEGIN;
+INSERT t1 (a) VALUE (10),(20);
+--error ER_CHECK_NOT_IMPLEMENTED
+SAVEPOINT spt1;
+INSERT INTO t1 SET a = 11, b = 'f';
+INSERT t1 SET b = DEFAULT;
+--error ER_CHECK_NOT_IMPLEMENTED,ER_SP_DOES_NOT_EXIST
+ROLLBACK TO SAVEPOINT spt1;
+INSERT INTO t1 (b,a) VALUES ('test1',10);
+COMMIT;
+--sorted_result
+SELECT a,b FROM t1;
+
+DROP TABLE t1;
+
+
diff --git a/mysql-test/suite/rocksdb/insert_with_keys.result b/mysql-test/suite/rocksdb/insert_with_keys.result
new file mode 100644
index 0000000..9d0fef2
--- /dev/null
+++ b/mysql-test/suite/rocksdb/insert_with_keys.result
@@ -0,0 +1,63 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY, KEY(b)) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e');
+INSERT INTO t1 (a,b) VALUES (100,'a'), (6,'f');
+INSERT INTO t1 (a,b) VALUES (30,'m'),(29,'n');
+INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z');
+INSERT INTO t1 (a,b) VALUES (3,'a'),(0,'');
+SELECT a,b FROM t1;
+a	b
+0	
+1	a
+1	a
+100	a
+12345	z
+2	b
+29	n
+3	a
+3	c
+30	m
+4	d
+5	e
+6	f
+DROP TABLE t1;
+#----------------------------------------
+# UNIQUE KEYS are not supported currently
+#-----------------------------------------
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e');
+INSERT INTO t1 (a,b) VALUES (100,'a'), (6,'f');
+INSERT INTO t1 (a,b) VALUES (30,'m'),(29,'n');
+INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z');
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+INSERT INTO t1 (a,b) VALUES (3,'a'),(0,'');
+ERROR 23000: Duplicate entry '3' for key 'PRIMARY'
+INSERT INTO t1 (a,b) VALUES (0,'');
+SELECT a,b FROM t1;
+a	b
+0	
+1	a
+100	a
+2	b
+29	n
+3	c
+30	m
+4	d
+5	e
+6	f
+INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z');
+INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z') ON DUPLICATE KEY UPDATE b = CONCAT(b,b);
+SELECT a,b FROM t1;
+a	b
+0	
+1	aa
+100	a
+12345	zz
+2	b
+29	n
+3	c
+30	m
+4	d
+5	e
+6	f
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/insert_with_keys.test b/mysql-test/suite/rocksdb/insert_with_keys.test
new file mode 100644
index 0000000..2475a02
--- /dev/null
+++ b/mysql-test/suite/rocksdb/insert_with_keys.test
@@ -0,0 +1,91 @@
+# 
+# INSERT statements for tables with keys
+#
+
+##################################################
+# TODO:
+# A part of the test is disabled because currently
+# unique indexes are not supported
+##################################################
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY, KEY(b)) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e');
+INSERT INTO t1 (a,b) VALUES (100,'a'), (6,'f');
+INSERT INTO t1 (a,b) VALUES (30,'m'),(29,'n');
+INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z');
+INSERT INTO t1 (a,b) VALUES (3,'a'),(0,'');
+--sorted_result
+SELECT a,b FROM t1;
+DROP TABLE t1;
+
+--echo #----------------------------------------
+--echo # UNIQUE KEYS are not supported currently
+--echo #-----------------------------------------
+
+--disable_parsing
+
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY, UNIQUE INDEX(a)) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e');
+INSERT INTO t1 (a,b) VALUES (100,'a'), (6,'f');
+INSERT INTO t1 (a,b) VALUES (30,'m'),(29,'n');
+--error ER_DUP_ENTRY
+INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z');
+--error ER_DUP_ENTRY
+INSERT INTO t1 (a,b) VALUES (3,'a'),(0,'');
+INSERT INTO t1 (a,b) VALUES (0,'');
+--sorted_result
+SELECT a,b FROM t1;
+
+INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z');
+INSERT INTO t1 (a,b) VALUES (3,'a'),(4,'d') ON DUPLICATE KEY UPDATE a = a+10;
+
+--sorted_result
+SELECT a,b FROM t1;
+
+DROP TABLE t1;
+
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY, UNIQUE INDEX(a,b)) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e');
+INSERT INTO t1 (a,b) VALUES (100,'a'), (6,'f');
+INSERT INTO t1 (a,b) VALUES (30,'m'),(29,'n');
+INSERT INTO t1 (a,b) VALUES (100,'b'), (2,'c');
+--error ER_DUP_ENTRY
+INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z');
+--sorted_result
+SELECT a,b FROM t1;
+
+INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z');
+INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z') ON DUPLICATE KEY UPDATE a = a+VALUES(a);
+--sorted_result
+SELECT a,b FROM t1;
+
+--error ER_DUP_ENTRY
+INSERT INTO t1 (a,b) VALUES (101,'x'),(101,'x');
+DROP TABLE t1;
+
+--enable_parsing
+
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e');
+INSERT INTO t1 (a,b) VALUES (100,'a'), (6,'f');
+INSERT INTO t1 (a,b) VALUES (30,'m'),(29,'n');
+--error ER_DUP_ENTRY
+INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z');
+--error ER_DUP_ENTRY
+INSERT INTO t1 (a,b) VALUES (3,'a'),(0,'');
+INSERT INTO t1 (a,b) VALUES (0,'');
+--sorted_result
+SELECT a,b FROM t1;
+
+INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z');
+INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z') ON DUPLICATE KEY UPDATE b = CONCAT(b,b);
+--sorted_result
+SELECT a,b FROM t1;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/level_read_committed.result b/mysql-test/suite/rocksdb/level_read_committed.result
new file mode 100644
index 0000000..ce1b126
--- /dev/null
+++ b/mysql-test/suite/rocksdb/level_read_committed.result
@@ -0,0 +1,91 @@
+DROP TABLE IF EXISTS t1;
+connect  con1,localhost,root,,;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+connect  con2,localhost,root,,;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+connection con1;
+CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
+START TRANSACTION;
+SELECT a FROM t1;
+a
+connection con2;
+BEGIN;
+INSERT INTO t1 (a) VALUES(1);
+# WARNING: Statement ended with errno 0, errname ''. 
+#          If it differs from the result file, it might indicate a problem.
+connection con1;
+SELECT a FROM t1;
+a
+connection con2;
+INSERT INTO t1 (a) VALUES (2);
+# WARNING: Statement ended with errno 0, errname ''. 
+#          If it differs from the result file, it might indicate a problem.
+connection con1;
+SELECT a FROM t1;
+a
+INSERT INTO t1 (a) SELECT a+100 FROM t1;
+# WARNING: Statement ended with errno 0, errname ''. 
+#          If it differs from the result file, it might indicate a problem.
+SELECT a FROM t1;
+a
+connection con2;
+SELECT a FROM t1;
+a
+1
+2
+COMMIT;
+SELECT a FROM t1;
+a
+1
+2
+connection con1;
+SELECT a FROM t1;
+a
+1
+2
+INSERT INTO t1 (a) SELECT a+200 FROM t1;
+# WARNING: Statement ended with errno 0, errname ''. 
+#          If it differs from the result file, it might indicate a problem.
+SELECT a FROM t1;
+a
+1
+2
+201
+202
+COMMIT;
+SELECT a FROM t1;
+a
+1
+2
+201
+202
+connection con2;
+SELECT a FROM t1;
+a
+1
+2
+201
+202
+connection default;
+disconnect con1;
+disconnect con2;
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+connect  con1,localhost,root,,;
+connect  con2,localhost,root,,;
+connection con1;
+CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+connection con2;
+INSERT INTO t1 (a) VALUES (1);
+connection con1;
+# If consistent read works on this isolation level (READ COMMITTED), the following SELECT should not return the value we inserted (1)
+SELECT a FROM t1;
+a
+1
+COMMIT;
+connection default;
+disconnect con1;
+disconnect con2;
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/level_read_committed.test b/mysql-test/suite/rocksdb/level_read_committed.test
new file mode 100644
index 0000000..cc27fc4
--- /dev/null
+++ b/mysql-test/suite/rocksdb/level_read_committed.test
@@ -0,0 +1,5 @@
+let $trx_isolation = READ COMMITTED;
+
+--source transaction_isolation.inc
+--source consistent_snapshot.inc
+
diff --git a/mysql-test/suite/rocksdb/level_read_uncommitted.result b/mysql-test/suite/rocksdb/level_read_uncommitted.result
new file mode 100644
index 0000000..68fbe56
--- /dev/null
+++ b/mysql-test/suite/rocksdb/level_read_uncommitted.result
@@ -0,0 +1,116 @@
+DROP TABLE IF EXISTS t1;
+connect  con1,localhost,root,,;
+SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+connect  con2,localhost,root,,;
+SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+connection con1;
+CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
+START TRANSACTION;
+SELECT a FROM t1;
+a
+connection con2;
+BEGIN;
+INSERT INTO t1 (a) VALUES(1);
+# WARNING: Statement ended with errno 0, errname ''. 
+#          If it differs from the result file, it might indicate a problem.
+connection con1;
+SELECT a FROM t1;
+a
+1
+connection con2;
+INSERT INTO t1 (a) VALUES (2);
+# WARNING: Statement ended with errno 0, errname ''. 
+#          If it differs from the result file, it might indicate a problem.
+connection con1;
+SELECT a FROM t1;
+a
+1
+2
+INSERT INTO t1 (a) SELECT a+100 FROM t1;
+# WARNING: Statement ended with errno 0, errname ''. 
+#          If it differs from the result file, it might indicate a problem.
+SELECT a FROM t1;
+a
+1
+101
+102
+2
+connection con2;
+SELECT a FROM t1;
+a
+1
+101
+102
+2
+COMMIT;
+SELECT a FROM t1;
+a
+1
+101
+102
+2
+connection con1;
+SELECT a FROM t1;
+a
+1
+101
+102
+2
+INSERT INTO t1 (a) SELECT a+200 FROM t1;
+# WARNING: Statement ended with errno 0, errname ''. 
+#          If it differs from the result file, it might indicate a problem.
+SELECT a FROM t1;
+a
+1
+101
+102
+2
+201
+202
+301
+302
+COMMIT;
+SELECT a FROM t1;
+a
+1
+101
+102
+2
+201
+202
+301
+302
+connection con2;
+SELECT a FROM t1;
+a
+1
+101
+102
+2
+201
+202
+301
+302
+connection default;
+disconnect con1;
+disconnect con2;
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+connect  con1,localhost,root,,;
+connect  con2,localhost,root,,;
+connection con1;
+CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
+SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+connection con2;
+INSERT INTO t1 (a) VALUES (1);
+connection con1;
+# If consistent read works on this isolation level (READ UNCOMMITTED), the following SELECT should not return the value we inserted (1)
+SELECT a FROM t1;
+a
+1
+COMMIT;
+connection default;
+disconnect con1;
+disconnect con2;
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/level_read_uncommitted.test b/mysql-test/suite/rocksdb/level_read_uncommitted.test
new file mode 100644
index 0000000..c26d3c9
--- /dev/null
+++ b/mysql-test/suite/rocksdb/level_read_uncommitted.test
@@ -0,0 +1,4 @@
+let $trx_isolation = READ UNCOMMITTED;
+--source transaction_isolation.inc
+--source consistent_snapshot.inc
+
diff --git a/mysql-test/suite/rocksdb/level_repeatable_read.result b/mysql-test/suite/rocksdb/level_repeatable_read.result
new file mode 100644
index 0000000..c828b18
--- /dev/null
+++ b/mysql-test/suite/rocksdb/level_repeatable_read.result
@@ -0,0 +1,69 @@
+DROP TABLE IF EXISTS t1;
+connect  con1,localhost,root,,;
+SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+connect  con2,localhost,root,,;
+SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+connection con1;
+CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
+START TRANSACTION;
+SELECT a FROM t1;
+a
+connection con2;
+BEGIN;
+INSERT INTO t1 (a) VALUES(1);
+# WARNING: Statement ended with errno 0, errname ''. 
+#          If it differs from the result file, it might indicate a problem.
+connection con1;
+SELECT a FROM t1;
+a
+connection con2;
+INSERT INTO t1 (a) VALUES (2);
+# WARNING: Statement ended with errno 0, errname ''. 
+#          If it differs from the result file, it might indicate a problem.
+connection con1;
+SELECT a FROM t1;
+a
+INSERT INTO t1 (a) SELECT a+100 FROM t1;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+# WARNING: Statement ended with errno 1205, errname 'ER_LOCK_WAIT_TIMEOUT'. 
+#          If it differs from the result file, it might indicate a problem.
+SELECT a FROM t1;
+a
+connection con2;
+SELECT a FROM t1;
+a
+1
+2
+COMMIT;
+SELECT a FROM t1;
+a
+1
+2
+connection con1;
+SELECT a FROM t1;
+a
+INSERT INTO t1 (a) SELECT a+200 FROM t1;
+# WARNING: Statement ended with errno 0, errname ''. 
+#          If it differs from the result file, it might indicate a problem.
+SELECT a FROM t1;
+a
+201
+202
+COMMIT;
+SELECT a FROM t1;
+a
+1
+2
+201
+202
+connection con2;
+SELECT a FROM t1;
+a
+1
+2
+201
+202
+connection default;
+disconnect con1;
+disconnect con2;
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/level_repeatable_read.test b/mysql-test/suite/rocksdb/level_repeatable_read.test
new file mode 100644
index 0000000..9a3fe5b
--- /dev/null
+++ b/mysql-test/suite/rocksdb/level_repeatable_read.test
@@ -0,0 +1,3 @@
+let $trx_isolation = REPEATABLE READ;
+--source transaction_isolation.inc
+
diff --git a/mysql-test/suite/rocksdb/level_serializable.result b/mysql-test/suite/rocksdb/level_serializable.result
new file mode 100644
index 0000000..3f57395
--- /dev/null
+++ b/mysql-test/suite/rocksdb/level_serializable.result
@@ -0,0 +1,56 @@
+DROP TABLE IF EXISTS t1;
+connect  con1,localhost,root,,;
+SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+connect  con2,localhost,root,,;
+SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+connection con1;
+CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
+START TRANSACTION;
+SELECT a FROM t1;
+a
+connection con2;
+BEGIN;
+INSERT INTO t1 (a) VALUES(1);
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+# WARNING: Statement ended with errno 1205, errname 'ER_LOCK_WAIT_TIMEOUT'. 
+#          If it differs from the result file, it might indicate a problem.
+connection con1;
+SELECT a FROM t1;
+a
+connection con2;
+INSERT INTO t1 (a) VALUES (2);
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+# WARNING: Statement ended with errno 1205, errname 'ER_LOCK_WAIT_TIMEOUT'. 
+#          If it differs from the result file, it might indicate a problem.
+connection con1;
+SELECT a FROM t1;
+a
+INSERT INTO t1 (a) SELECT a+100 FROM t1;
+# WARNING: Statement ended with errno 0, errname ''. 
+#          If it differs from the result file, it might indicate a problem.
+SELECT a FROM t1;
+a
+connection con2;
+SELECT a FROM t1;
+a
+COMMIT;
+SELECT a FROM t1;
+a
+connection con1;
+SELECT a FROM t1;
+a
+INSERT INTO t1 (a) SELECT a+200 FROM t1;
+# WARNING: Statement ended with errno 0, errname ''. 
+#          If it differs from the result file, it might indicate a problem.
+SELECT a FROM t1;
+a
+COMMIT;
+SELECT a FROM t1;
+a
+connection con2;
+SELECT a FROM t1;
+a
+connection default;
+disconnect con1;
+disconnect con2;
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/level_serializable.test b/mysql-test/suite/rocksdb/level_serializable.test
new file mode 100644
index 0000000..207aa43
--- /dev/null
+++ b/mysql-test/suite/rocksdb/level_serializable.test
@@ -0,0 +1,3 @@
+let $trx_isolation = SERIALIZABLE;
+--source transaction_isolation.inc
+
diff --git a/mysql-test/suite/rocksdb/loaddata.result b/mysql-test/suite/rocksdb/loaddata.result
new file mode 100644
index 0000000..81b4652
--- /dev/null
+++ b/mysql-test/suite/rocksdb/loaddata.result
@@ -0,0 +1,93 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+LOAD DATA INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1 
+FIELDS TERMINATED BY ',' (a,b);
+SELECT a,b FROM t1;
+a	b
+1	foo
+2	bar
+3	
+4	abc
+LOAD DATA LOCAL INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1
+CHARACTER SET utf8 COLUMNS TERMINATED BY ','
+  ESCAPED BY '/' (a,b);
+SELECT a,b FROM t1;
+a	b
+1	foo
+1	foo
+2	bar
+2	bar
+3	
+3	
+4	abc
+4	abc
+LOAD DATA LOCAL INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1
+FIELDS TERMINATED BY ';'
+  (a) SET b='loaded';
+Warnings:
+Warning	1262	Row 1 was truncated; it contained more data than there were input columns
+Warning	1262	Row 2 was truncated; it contained more data than there were input columns
+Warning	1262	Row 3 was truncated; it contained more data than there were input columns
+SELECT a,b FROM t1;
+a	b
+0	loaded
+1	foo
+1	foo
+102	loaded
+2	bar
+2	bar
+3	
+3	
+4	abc
+4	abc
+5	loaded
+LOAD DATA INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1
+FIELDS TERMINATED BY ';'
+  OPTIONALLY ENCLOSED BY ''''
+  LINES STARTING BY 'prefix:' 
+IGNORE 2 LINES (a,b);
+Warnings:
+Warning	1262	Row 2 was truncated; it contained more data than there were input columns
+SELECT a,b FROM t1;
+a	b
+0	
+0	loaded
+1	foo
+1	foo
+100	foo
+102	loaded
+2	bar
+2	bar
+3	
+3	
+4	abc
+4	abc
+5	loaded
+7	test
+LOAD DATA INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1;
+Warnings:
+Warning	1261	Row 1 doesn't contain data for all columns
+Warning	1261	Row 2 doesn't contain data for all columns
+Warning	1261	Row 3 doesn't contain data for all columns
+Warning	1261	Row 4 doesn't contain data for all columns
+SELECT a,b FROM t1;
+a	b
+0	
+0	loaded
+1	foo
+1	foo
+1	foo
+100	foo
+102	loaded
+2	bar
+2	bar
+2	bar
+3	
+3	
+3	
+4	abc
+4	abc
+4	abc
+5	loaded
+7	test
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/loaddata.test b/mysql-test/suite/rocksdb/loaddata.test
new file mode 100644
index 0000000..f40f306
--- /dev/null
+++ b/mysql-test/suite/rocksdb/loaddata.test
@@ -0,0 +1,91 @@
+# 
+# Basic LOAD DATA statements
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+
+let $datadir = `SELECT @@datadir`;
+
+--write_file $datadir/se_loaddata.dat
+1,foo,
+2,bar,
+3,,
+4,abc,
+EOF
+
+--replace_result $datadir <DATADIR>
+eval
+LOAD DATA INFILE '$datadir/se_loaddata.dat' INTO TABLE t1 
+  FIELDS TERMINATED BY ',' (a,b);
+--sorted_result
+SELECT a,b FROM t1;
+
+--replace_result $datadir <DATADIR>
+eval
+LOAD DATA LOCAL INFILE '$datadir/se_loaddata.dat' INTO TABLE t1
+  CHARACTER SET utf8 COLUMNS TERMINATED BY ','
+  ESCAPED BY '/' (a,b);
+--sorted_result
+SELECT a,b FROM t1;
+
+--remove_file $datadir/se_loaddata.dat
+--write_file $datadir/se_loaddata.dat
+5;YYY;
+102;'zzz';
+0;'test';
+EOF
+
+--replace_result $datadir <DATADIR>
+eval
+LOAD DATA LOCAL INFILE '$datadir/se_loaddata.dat' INTO TABLE t1
+  FIELDS TERMINATED BY ';'
+  (a) SET b='loaded';
+
+--sorted_result
+SELECT a,b FROM t1;
+
+--remove_file $datadir/se_loaddata.dat
+--write_file $datadir/se_loaddata.dat
+prefix:5;'foo';
+prefix:6;'';
+prefix:100;foo;
+prefix:7;'test';suffix
+101;abc;
+102;'z';
+prefix:0;;
+EOF
+
+--replace_result $datadir <DATADIR>
+eval
+LOAD DATA INFILE '$datadir/se_loaddata.dat' INTO TABLE t1
+  FIELDS TERMINATED BY ';'
+  OPTIONALLY ENCLOSED BY ''''
+  LINES STARTING BY 'prefix:' 
+  IGNORE 2 LINES (a,b);
+
+--sorted_result
+SELECT a,b FROM t1;
+
+--remove_file $datadir/se_loaddata.dat
+--write_file $datadir/se_loaddata.dat
+1	foo
+2	bar
+3	
+4	abc
+EOF
+
+--replace_result $datadir <DATADIR>
+eval
+LOAD DATA INFILE '$datadir/se_loaddata.dat' INTO TABLE t1;
+--sorted_result
+SELECT a,b FROM t1;
+
+--remove_file $datadir/se_loaddata.dat
+
+# Cleanup
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/lock.result b/mysql-test/suite/rocksdb/lock.result
new file mode 100644
index 0000000..1e047c1
--- /dev/null
+++ b/mysql-test/suite/rocksdb/lock.result
@@ -0,0 +1,108 @@
+connect  con1,localhost,root,,;
+SET lock_wait_timeout=1;
+connection default;
+DROP TABLE IF EXISTS t1, t2, t3;
+CREATE TABLE t1 (id INT, id2 INT, pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (id,id2) VALUES (1,1),(1,2),(1,3);
+LOCK TABLE t1 LOW_PRIORITY WRITE;
+Warnings:
+Warning	1287	'LOW_PRIORITY WRITE' is deprecated and will be removed in a future release. Please use WRITE instead
+SELECT id2,COUNT(DISTINCT id) FROM t1 GROUP BY id2;
+id2	COUNT(DISTINCT id)
+1	1
+2	1
+3	1
+UPDATE t1 SET id=-1 WHERE id=1;
+connection con1;
+SELECT id,id2 FROM t1;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+LOCK TABLE t1 READ;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection default;
+LOCK TABLE t1 READ;
+UPDATE t1 SET id=1 WHERE id=1;
+ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
+connection con1;
+SELECT COUNT(DISTINCT id) FROM t1;
+COUNT(DISTINCT id)
+1
+UPDATE t1 SET id=2 WHERE id=2;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+LOCK TABLE t1 WRITE;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+LOCK TABLE t1 READ;
+UNLOCK TABLES;
+connection default;
+CREATE TABLE t2 (a INT, b CHAR(8), PRIMARY KEY(a)) ENGINE=rocksdb;
+ERROR HY000: Table 't2' was not locked with LOCK TABLES
+UNLOCK TABLES;
+CREATE TABLE t2 (id INT, id2 INT, pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+LOCK TABLE t1 WRITE, t2 WRITE;
+INSERT INTO t2 (id,id2) SELECT id,id2 FROM t1;
+UPDATE t1 SET id=1 WHERE id=-1;
+DROP TABLE t1,t2;
+CREATE TABLE t1 (i1 INT, nr INT, pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+CREATE TABLE t2 (nr INT, nm INT, pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t2 (nr,nm) VALUES (1,3);
+INSERT INTO t2 (nr,nm) VALUES (2,4);
+LOCK TABLES t1 WRITE, t2 READ;
+INSERT INTO t1 (i1,nr) SELECT 1, nr FROM t2 WHERE nm=3;
+INSERT INTO t1 (i1,nr) SELECT 2, nr FROM t2 WHERE nm=4;
+UNLOCK TABLES;
+LOCK TABLES t1 WRITE;
+INSERT INTO t1 (i1,nr) SELECT i1, nr FROM t1;
+ERROR HY000: Table 't1' was not locked with LOCK TABLES
+UNLOCK TABLES;
+LOCK TABLES t1 WRITE, t1 AS t1_alias READ;
+INSERT INTO t1 (i1,nr) SELECT i1, nr FROM t1 AS t1_alias;
+DROP TABLE t1,t2;
+ERROR HY000: Table 't2' was not locked with LOCK TABLES
+UNLOCK TABLES;
+DROP TABLE t1,t2;
+CREATE TABLE t1 (a INT, b CHAR(8), PRIMARY KEY(a)) ENGINE=rocksdb;
+CREATE TABLE t2 (a INT, b CHAR(8), PRIMARY KEY(b)) ENGINE=rocksdb;
+CREATE TABLE t3 (a INT, b CHAR(8), pk INT PRIMARY KEY) ENGINE=rocksdb;
+LOCK TABLES t1 WRITE, t2 WRITE, t3 WRITE;
+DROP TABLE t2, t3, t1;
+CREATE TABLE t1 (a INT, b CHAR(8), PRIMARY KEY(a)) ENGINE=rocksdb;
+CREATE TABLE t2 (a INT, b CHAR(8), PRIMARY KEY(b)) ENGINE=rocksdb;
+CREATE TABLE t3 (a INT, b CHAR(8), pk INT PRIMARY KEY) ENGINE=rocksdb;
+LOCK TABLES t1 WRITE, t2 WRITE, t3 WRITE, t1 AS t4 READ;
+ALTER TABLE t2 ADD COLUMN c2 INT;
+DROP TABLE t1, t2, t3;
+CREATE TABLE t1 (a INT, b CHAR(8), PRIMARY KEY(a)) ENGINE=rocksdb;
+CREATE TABLE t2 (a INT, b CHAR(8), PRIMARY KEY(b)) ENGINE=rocksdb;
+LOCK TABLE t1 READ, t2 READ;
+FLUSH TABLE t1;
+ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
+FLUSH TABLES;
+ERROR HY000: Table 't2' was locked with a READ lock and can't be updated
+FLUSH TABLES t1, t2 WITH READ LOCK;
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
+UNLOCK TABLES;
+FLUSH TABLES t1, t2 WITH READ LOCK;
+connection con1;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b');
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection default;
+UNLOCK TABLES;
+FLUSH TABLES WITH READ LOCK;
+connection con1;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b');
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection default;
+UNLOCK TABLES;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b');
+FLUSH TABLES WITH READ LOCK;
+DROP TABLE t1, t2;
+ERROR HY000: Can't execute the query because you have a conflicting read lock
+UNLOCK TABLES;
+DROP TABLE t1, t2;
+disconnect con1;
+CREATE TABLE t1 (a INT, b CHAR(8), PRIMARY KEY(a)) ENGINE=rocksdb;
+CREATE TABLE t2 (a INT, b CHAR(8), PRIMARY KEY(b)) ENGINE=rocksdb;
+LOCK TABLE t1 WRITE, t2 WRITE;
+SELECT a,b FROM t1;
+a	b
+UNLOCK TABLES;
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/rocksdb/lock.test b/mysql-test/suite/rocksdb/lock.test
new file mode 100644
index 0000000..f169830
--- /dev/null
+++ b/mysql-test/suite/rocksdb/lock.test
@@ -0,0 +1,200 @@
+# Standard table locking:
+#   LOCK TABLE .. READ 
+#   LOCK TABLE .. [LOW_PRIORITY] WRITE 
+#   UNLOCK TABLES
+#
+# and global locking:
+# FLUSH TABLES [..] WITH READ LOCK
+# 
+############################################
+# TODO:   
+# A part of the test is currently disabled
+# because temporary tables are not supported
+############################################
+
+--enable_connect_log
+
+# Save the initial number of concurrent sessions.
+--source include/count_sessions.inc
+
+connect (con1,localhost,root,,);
+SET lock_wait_timeout=1;
+
+connection default;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2, t3;
+--enable_warnings
+
+CREATE TABLE t1 (id INT, id2 INT, pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (id,id2) VALUES (1,1),(1,2),(1,3);
+
+# LOW_PRIORITY has no effect, but is still syntactically correct
+LOCK TABLE t1 LOW_PRIORITY WRITE;
+SELECT id2,COUNT(DISTINCT id) FROM t1 GROUP BY id2;
+
+UPDATE t1 SET id=-1 WHERE id=1;
+
+connection con1;
+# With WRITE lock held by connection 'default',
+# nobody else can access the table
+--error ER_LOCK_WAIT_TIMEOUT
+SELECT id,id2 FROM t1;
+--error ER_LOCK_WAIT_TIMEOUT
+LOCK TABLE t1 READ;
+
+connection default;
+LOCK TABLE t1 READ;
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
+UPDATE t1 SET id=1 WHERE id=1;
+
+connection con1;
+# With READ lock held by connection 'default',
+# it should be possible to read from the table
+# or acquire another READ lock, 
+# but not update it or acquire WRITE lock
+SELECT COUNT(DISTINCT id) FROM t1;
+--error ER_LOCK_WAIT_TIMEOUT
+UPDATE t1 SET id=2 WHERE id=2;
+--error ER_LOCK_WAIT_TIMEOUT
+LOCK TABLE t1 WRITE;
+LOCK TABLE t1 READ;
+UNLOCK TABLES;
+
+
+--connection default
+
+--error ER_TABLE_NOT_LOCKED
+CREATE TABLE t2 (a INT, b CHAR(8), PRIMARY KEY(a)) ENGINE=rocksdb;
+
+--disable_parsing
+
+CREATE TEMPORARY TABLE t2 (a INT, b CHAR(8), PRIMARY KEY(a)) ENGINE=rocksdb;
+DROP TABLE IF EXISTS t2;
+
+--enable_parsing
+
+UNLOCK TABLES;
+
+CREATE TABLE t2 (id INT, id2 INT, pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+LOCK TABLE t1 WRITE, t2 WRITE;
+INSERT INTO t2 (id,id2) SELECT id,id2 FROM t1;
+UPDATE t1 SET id=1 WHERE id=-1;
+DROP TABLE t1,t2;
+
+#
+# INSERT ... SELECT with lock tables
+#
+
+CREATE TABLE t1 (i1 INT, nr INT, pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+CREATE TABLE t2 (nr INT, nm INT, pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t2 (nr,nm) VALUES (1,3);
+INSERT INTO t2 (nr,nm) VALUES (2,4);
+
+LOCK TABLES t1 WRITE, t2 READ;
+INSERT INTO t1 (i1,nr) SELECT 1, nr FROM t2 WHERE nm=3;
+INSERT INTO t1 (i1,nr) SELECT 2, nr FROM t2 WHERE nm=4;
+UNLOCK TABLES;
+
+LOCK TABLES t1 WRITE;
+--error ER_TABLE_NOT_LOCKED
+INSERT INTO t1 (i1,nr) SELECT i1, nr FROM t1;
+UNLOCK TABLES;
+LOCK TABLES t1 WRITE, t1 AS t1_alias READ;
+INSERT INTO t1 (i1,nr) SELECT i1, nr FROM t1 AS t1_alias;
+--error ER_TABLE_NOT_LOCKED
+DROP TABLE t1,t2;
+UNLOCK TABLES;
+DROP TABLE t1,t2;
+
+#
+# Check that a dropped table is removed from a lock
+
+CREATE TABLE t1 (a INT, b CHAR(8), PRIMARY KEY(a)) ENGINE=rocksdb;
+CREATE TABLE t2 (a INT, b CHAR(8), PRIMARY KEY(b)) ENGINE=rocksdb;
+CREATE TABLE t3 (a INT, b CHAR(8), pk INT PRIMARY KEY) ENGINE=rocksdb;
+LOCK TABLES t1 WRITE, t2 WRITE, t3 WRITE;
+# This removes one table after the other from the lock.
+DROP TABLE t2, t3, t1;
+#
+# Check that a lock merge works
+
+CREATE TABLE t1 (a INT, b CHAR(8), PRIMARY KEY(a)) ENGINE=rocksdb;
+CREATE TABLE t2 (a INT, b CHAR(8), PRIMARY KEY(b)) ENGINE=rocksdb;
+CREATE TABLE t3 (a INT, b CHAR(8), pk INT PRIMARY KEY) ENGINE=rocksdb;
+LOCK TABLES t1 WRITE, t2 WRITE, t3 WRITE, t1 AS t4 READ;
+
+ALTER TABLE t2 ADD COLUMN c2 INT;
+
+DROP TABLE t1, t2, t3;
+
+# FLUSH TABLES is not permitted when there is an active LOCK TABLES .. READ,
+# FLUSH TABLES .. WITH READ LOCK should be used instead
+# (and for other connections the table is locked)
+
+CREATE TABLE t1 (a INT, b CHAR(8), PRIMARY KEY(a)) ENGINE=rocksdb;
+CREATE TABLE t2 (a INT, b CHAR(8), PRIMARY KEY(b)) ENGINE=rocksdb;
+
+LOCK TABLE t1 READ, t2 READ;
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
+FLUSH TABLE t1;
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
+FLUSH TABLES;
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
+FLUSH TABLES t1, t2 WITH READ LOCK;
+UNLOCK TABLES;
+
+FLUSH TABLES t1, t2 WITH READ LOCK;
+
+--connection con1
+--error ER_LOCK_WAIT_TIMEOUT
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b');
+
+--connection default
+UNLOCK TABLES;
+
+# Global lock
+
+FLUSH TABLES WITH READ LOCK;
+
+--connection con1
+--error ER_LOCK_WAIT_TIMEOUT
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b');
+
+--connection default
+UNLOCK TABLES;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b');
+FLUSH TABLES WITH READ LOCK;
+--error ER_CANT_UPDATE_WITH_READLOCK
+DROP TABLE t1, t2;
+UNLOCK TABLES;
+DROP TABLE t1, t2;
+
+--disconnect con1
+
+#
+# Ensure that FLUSH TABLES doesn't substitute a base locked table
+# with a temporary one.
+#
+
+CREATE TABLE t1 (a INT, b CHAR(8), PRIMARY KEY(a)) ENGINE=rocksdb;
+CREATE TABLE t2 (a INT, b CHAR(8), PRIMARY KEY(b)) ENGINE=rocksdb;
+
+LOCK TABLE t1 WRITE, t2 WRITE;
+
+--disable_parsing
+
+CREATE TEMPORARY TABLE t1 (a INT, b CHAR(8), PRIMARY KEY(a)) ENGINE=rocksdb;
+FLUSH TABLE t1;
+DROP TEMPORARY TABLE t1;
+
+--enable_parsing
+
+SELECT a,b FROM t1;
+UNLOCK TABLES;
+DROP TABLE t1, t2;
+
+# Check that all connections opened by test cases in this file are really
+# gone so execution of other tests won't be affected by their presence.
+--source include/wait_until_count_sessions.inc
+
diff --git a/mysql-test/suite/rocksdb/misc.result b/mysql-test/suite/rocksdb/misc.result
new file mode 100644
index 0000000..812a7f2
--- /dev/null
+++ b/mysql-test/suite/rocksdb/misc.result
@@ -0,0 +1,89 @@
+INSERT INTO mysql.event (
+db,
+name,
+body,
+definer,
+interval_value,
+interval_field,
+originator,
+character_set_client,
+collation_connection,
+db_collation,
+body_utf8)
+values (
+database(),
+"ev1",
+"select 1",
+user(),
+100,
+"SECOND_MICROSECOND",
+1,
+'utf8',
+'utf8_general_ci',
+'utf8_general_ci',
+'select 1');
+SHOW EVENTS;
+ERROR 42000: This version of MySQL doesn't yet support 'MICROSECOND'
+DROP EVENT ev1;
+SELECT TABLE_NAME, COLUMN_NAME, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME
+FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE ORDER BY TABLE_NAME;
+TABLE_NAME	COLUMN_NAME	REFERENCED_TABLE_NAME	REFERENCED_COLUMN_NAME
+columns_priv	Column_name	NULL	NULL
+columns_priv	Db	NULL	NULL
+columns_priv	Host	NULL	NULL
+columns_priv	Table_name	NULL	NULL
+columns_priv	User	NULL	NULL
+db	Db	NULL	NULL
+db	Host	NULL	NULL
+db	User	NULL	NULL
+event	db	NULL	NULL
+event	name	NULL	NULL
+func	name	NULL	NULL
+help_category	help_category_id	NULL	NULL
+help_category	name	NULL	NULL
+help_keyword	help_keyword_id	NULL	NULL
+help_keyword	name	NULL	NULL
+help_relation	help_keyword_id	NULL	NULL
+help_relation	help_topic_id	NULL	NULL
+help_topic	help_topic_id	NULL	NULL
+help_topic	name	NULL	NULL
+innodb_index_stats	database_name	NULL	NULL
+innodb_index_stats	index_name	NULL	NULL
+innodb_index_stats	stat_name	NULL	NULL
+innodb_index_stats	table_name	NULL	NULL
+innodb_table_stats	database_name	NULL	NULL
+innodb_table_stats	table_name	NULL	NULL
+ndb_binlog_index	epoch	NULL	NULL
+ndb_binlog_index	orig_epoch	NULL	NULL
+ndb_binlog_index	orig_server_id	NULL	NULL
+plugin	name	NULL	NULL
+proc	db	NULL	NULL
+proc	name	NULL	NULL
+proc	type	NULL	NULL
+procs_priv	Db	NULL	NULL
+procs_priv	Host	NULL	NULL
+procs_priv	Routine_name	NULL	NULL
+procs_priv	Routine_type	NULL	NULL
+procs_priv	User	NULL	NULL
+proxies_priv	Host	NULL	NULL
+proxies_priv	Proxied_host	NULL	NULL
+proxies_priv	Proxied_user	NULL	NULL
+proxies_priv	User	NULL	NULL
+servers	Server_name	NULL	NULL
+slave_master_info	Host	NULL	NULL
+slave_master_info	Port	NULL	NULL
+slave_relay_log_info	Id	NULL	NULL
+slave_worker_info	Id	NULL	NULL
+tables_priv	Db	NULL	NULL
+tables_priv	Host	NULL	NULL
+tables_priv	Table_name	NULL	NULL
+tables_priv	User	NULL	NULL
+time_zone	Time_zone_id	NULL	NULL
+time_zone_leap_second	Transition_time	NULL	NULL
+time_zone_name	Name	NULL	NULL
+time_zone_transition	Time_zone_id	NULL	NULL
+time_zone_transition	Transition_time	NULL	NULL
+time_zone_transition_type	Time_zone_id	NULL	NULL
+time_zone_transition_type	Transition_type_id	NULL	NULL
+user	Host	NULL	NULL
+user	User	NULL	NULL
diff --git a/mysql-test/suite/rocksdb/misc.test b/mysql-test/suite/rocksdb/misc.test
new file mode 100644
index 0000000..177c29b
--- /dev/null
+++ b/mysql-test/suite/rocksdb/misc.test
@@ -0,0 +1,43 @@
+#
+# Different statements not related to an engine,
+# but added to provide function coverage for handler.cc and handler.h.
+# The test can be disabled or removed later.
+#
+
+# hits get_error_message(int, String*) 
+
+INSERT INTO mysql.event (
+  db,
+  name,
+  body,
+  definer,
+  interval_value,
+  interval_field,
+  originator,
+  character_set_client,
+  collation_connection,
+  db_collation,
+  body_utf8)
+values (
+  database(),
+  "ev1",
+  "select 1",
+  user(),
+  100,
+  "SECOND_MICROSECOND",
+  1,
+  'utf8',
+  'utf8_general_ci',
+  'utf8_general_ci',
+  'select 1');
+
+--error ER_NOT_SUPPORTED_YET
+SHOW EVENTS;
+DROP EVENT ev1;
+
+# hits get_foreign_key_list(THD*, List<st_foreign_key_info>*)
+--sorted_result
+SELECT TABLE_NAME, COLUMN_NAME, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME
+FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE ORDER BY TABLE_NAME;
+
+
diff --git a/mysql-test/suite/rocksdb/my.cnf b/mysql-test/suite/rocksdb/my.cnf
new file mode 100644
index 0000000..95832d7
--- /dev/null
+++ b/mysql-test/suite/rocksdb/my.cnf
@@ -0,0 +1,7 @@
+!include include/default_my.cnf
+
+[server]
+sql-mode=NO_ENGINE_SUBSTITUTION
+explicit-defaults-for-timestamp=1
+rocksdb_lock_wait_timeout=1
+
diff --git a/mysql-test/suite/rocksdb/optimize_table.inc b/mysql-test/suite/rocksdb/optimize_table.inc
new file mode 100644
index 0000000..e0fdfca
--- /dev/null
+++ b/mysql-test/suite/rocksdb/optimize_table.inc
@@ -0,0 +1,30 @@
+# 
+# OPTIMIZE TABLE statements
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2;
+--enable_warnings
+
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b');
+CREATE TABLE t2 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+
+INSERT INTO t1 (a,b) VALUES (3,'c'),(4,'d');
+OPTIMIZE TABLE t1;
+INSERT INTO t2 (a,b) VALUES (4,'d');
+OPTIMIZE NO_WRITE_TO_BINLOG TABLE t2;
+INSERT INTO t2 (a,b) VALUES (5,'e');
+INSERT INTO t1 (a,b) VALUES (6,'f');
+OPTIMIZE LOCAL TABLE t1, t2;
+OPTIMIZE TABLE t1, t2;
+
+DROP TABLE t1, t2;
+
+# OPTIMIZE on a table with index
+
+CREATE TABLE t1 (a INT, b CHAR(8), KEY(a), PRIMARY KEY(b)) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(100,'b'),(2,'c'),(3,'d');
+OPTIMIZE TABLE t1;
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/optimize_table.result b/mysql-test/suite/rocksdb/optimize_table.result
new file mode 100644
index 0000000..119b322
--- /dev/null
+++ b/mysql-test/suite/rocksdb/optimize_table.result
@@ -0,0 +1,29 @@
+DROP TABLE IF EXISTS t1,t2;
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b');
+CREATE TABLE t2 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (3,'c'),(4,'d');
+OPTIMIZE TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	optimize	note	The storage engine for the table doesn't support optimize
+INSERT INTO t2 (a,b) VALUES (4,'d');
+OPTIMIZE NO_WRITE_TO_BINLOG TABLE t2;
+Table	Op	Msg_type	Msg_text
+test.t2	optimize	note	The storage engine for the table doesn't support optimize
+INSERT INTO t2 (a,b) VALUES (5,'e');
+INSERT INTO t1 (a,b) VALUES (6,'f');
+OPTIMIZE LOCAL TABLE t1, t2;
+Table	Op	Msg_type	Msg_text
+test.t1	optimize	note	The storage engine for the table doesn't support optimize
+test.t2	optimize	note	The storage engine for the table doesn't support optimize
+OPTIMIZE TABLE t1, t2;
+Table	Op	Msg_type	Msg_text
+test.t1	optimize	note	The storage engine for the table doesn't support optimize
+test.t2	optimize	note	The storage engine for the table doesn't support optimize
+DROP TABLE t1, t2;
+CREATE TABLE t1 (a INT, b CHAR(8), KEY(a), PRIMARY KEY(b)) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(100,'b'),(2,'c'),(3,'d');
+OPTIMIZE TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	optimize	note	The storage engine for the table doesn't support optimize
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/optimize_table.test b/mysql-test/suite/rocksdb/optimize_table.test
new file mode 100644
index 0000000..aaef6d2
--- /dev/null
+++ b/mysql-test/suite/rocksdb/optimize_table.test
@@ -0,0 +1,6 @@
+# 
+# OPTIMIZE TABLE statements
+#
+
+--source optimize_table.inc
+
diff --git a/mysql-test/suite/rocksdb/repair_table.inc b/mysql-test/suite/rocksdb/repair_table.inc
new file mode 100644
index 0000000..47d6a29
--- /dev/null
+++ b/mysql-test/suite/rocksdb/repair_table.inc
@@ -0,0 +1,38 @@
+# 
+# REPAIR TABLE statements
+#
+# Note: the output is likely to be different for the engine under test,
+# in which case rdiff will be needed. Or, the output might say that
+# the storage engine does not support REPAIR.
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2;
+--enable_warnings
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b');
+CREATE TABLE t2 (a INT, b CHAR(8) PRIMARY KEY) ENGINE=rocksdb;
+
+REPAIR TABLE t1;
+
+INSERT INTO t1 (a,b) VALUES (3,'c');
+INSERT INTO t2 (a,b) VALUES (4,'d');
+REPAIR NO_WRITE_TO_BINLOG TABLE t1, t2;
+INSERT INTO t2 (a,b) VALUES (5,'e'),(6,'f');
+REPAIR LOCAL TABLE t2;
+INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h');
+INSERT INTO t2 (a,b) VALUES (9,'i');
+REPAIR LOCAL TABLE t2, t1 EXTENDED;
+INSERT INTO t1 (a,b) VALUES (10,'j');
+INSERT INTO t2 (a,b) VALUES (11,'k');
+REPAIR TABLE t1, t2 QUICK USE_FRM;
+INSERT INTO t1 (a,b) VALUES (12,'l');
+INSERT INTO t2 (a,b) VALUES (13,'m');
+REPAIR NO_WRITE_TO_BINLOG TABLE t1, t2 QUICK EXTENDED USE_FRM;
+FLUSH TABLE t1;
+
+DROP TABLE t1, t2;
+
+
+
diff --git a/mysql-test/suite/rocksdb/repair_table.result b/mysql-test/suite/rocksdb/repair_table.result
new file mode 100644
index 0000000..f227d20
--- /dev/null
+++ b/mysql-test/suite/rocksdb/repair_table.result
@@ -0,0 +1,37 @@
+DROP TABLE IF EXISTS t1,t2;
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b');
+CREATE TABLE t2 (a INT, b CHAR(8) PRIMARY KEY) ENGINE=rocksdb;
+REPAIR TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	repair	note	The storage engine for the table doesn't support repair
+INSERT INTO t1 (a,b) VALUES (3,'c');
+INSERT INTO t2 (a,b) VALUES (4,'d');
+REPAIR NO_WRITE_TO_BINLOG TABLE t1, t2;
+Table	Op	Msg_type	Msg_text
+test.t1	repair	note	The storage engine for the table doesn't support repair
+test.t2	repair	note	The storage engine for the table doesn't support repair
+INSERT INTO t2 (a,b) VALUES (5,'e'),(6,'f');
+REPAIR LOCAL TABLE t2;
+Table	Op	Msg_type	Msg_text
+test.t2	repair	note	The storage engine for the table doesn't support repair
+INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h');
+INSERT INTO t2 (a,b) VALUES (9,'i');
+REPAIR LOCAL TABLE t2, t1 EXTENDED;
+Table	Op	Msg_type	Msg_text
+test.t2	repair	note	The storage engine for the table doesn't support repair
+test.t1	repair	note	The storage engine for the table doesn't support repair
+INSERT INTO t1 (a,b) VALUES (10,'j');
+INSERT INTO t2 (a,b) VALUES (11,'k');
+REPAIR TABLE t1, t2 QUICK USE_FRM;
+Table	Op	Msg_type	Msg_text
+test.t1	repair	note	The storage engine for the table doesn't support repair
+test.t2	repair	note	The storage engine for the table doesn't support repair
+INSERT INTO t1 (a,b) VALUES (12,'l');
+INSERT INTO t2 (a,b) VALUES (13,'m');
+REPAIR NO_WRITE_TO_BINLOG TABLE t1, t2 QUICK EXTENDED USE_FRM;
+Table	Op	Msg_type	Msg_text
+test.t1	repair	note	The storage engine for the table doesn't support repair
+test.t2	repair	note	The storage engine for the table doesn't support repair
+FLUSH TABLE t1;
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/rocksdb/repair_table.test b/mysql-test/suite/rocksdb/repair_table.test
new file mode 100644
index 0000000..993331d
--- /dev/null
+++ b/mysql-test/suite/rocksdb/repair_table.test
@@ -0,0 +1,6 @@
+# 
+# REPAIR TABLE statements
+#
+
+--source repair_table.inc
+
diff --git a/mysql-test/suite/rocksdb/replace.result b/mysql-test/suite/rocksdb/replace.result
new file mode 100644
index 0000000..f8f61a3
--- /dev/null
+++ b/mysql-test/suite/rocksdb/replace.result
@@ -0,0 +1,32 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+REPLACE INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e');
+SELECT a,b FROM t1;
+a	b
+1	a
+2	b
+3	c
+4	d
+5	e
+REPLACE t1 (a,b) VALUE (10,'foo'),(10,'foo');
+SELECT a,b FROM t1;
+a	b
+1	a
+10	foo
+10	foo
+2	b
+3	c
+4	d
+5	e
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, b CHAR(8), PRIMARY KEY (b)) ENGINE=rocksdb;
+REPLACE INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c');
+INSERT INTO t1 (a,b) VALUES (4,'b');
+ERROR 23000: Duplicate entry 'b' for key 'PRIMARY'
+REPLACE INTO t1 (a,b) VALUES (4,'b');
+SELECT a,b FROM t1;
+a	b
+1	a
+3	c
+4	b
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/replace.test b/mysql-test/suite/rocksdb/replace.test
new file mode 100644
index 0000000..bd7138c
--- /dev/null
+++ b/mysql-test/suite/rocksdb/replace.test
@@ -0,0 +1,52 @@
+# 
+# Basic REPLACE statements
+#
+
+###########################################
+# TODO:
+# A part of the test is currently disabled
+# because unique indexes are not supported
+###########################################
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+
+# When there is no duplicate key, REPLACE should work as INSERT
+
+REPLACE INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e');
+--sorted_result
+SELECT a,b FROM t1;
+
+REPLACE t1 (a,b) VALUE (10,'foo'),(10,'foo');
+--sorted_result
+SELECT a,b FROM t1;
+
+DROP TABLE t1;
+
+--disable_parsing
+
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY, UNIQUE INDEX (a)) ENGINE=rocksdb;
+REPLACE INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c');
+--error ER_DUP_ENTRY
+INSERT INTO t1 (a,b) VALUES (2,'d');
+REPLACE INTO t1 (a,b) VALUES (2,'d');
+--sorted_result
+SELECT a,b FROM t1;
+
+DROP TABLE t1;
+
+--enable_parsing
+
+CREATE TABLE t1 (a INT, b CHAR(8), PRIMARY KEY (b)) ENGINE=rocksdb;
+REPLACE INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c');
+--error ER_DUP_ENTRY
+INSERT INTO t1 (a,b) VALUES (4,'b');
+REPLACE INTO t1 (a,b) VALUES (4,'b');
+--sorted_result
+SELECT a,b FROM t1;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/se-innodb.out b/mysql-test/suite/rocksdb/se-innodb.out
new file mode 100644
index 0000000..406e506
--- /dev/null
+++ b/mysql-test/suite/rocksdb/se-innodb.out
@@ -0,0 +1 @@
+Can't open perl script "./mtr": No such file or directory
diff --git a/mysql-test/suite/rocksdb/select.result b/mysql-test/suite/rocksdb/select.result
new file mode 100644
index 0000000..22a6ca9
--- /dev/null
+++ b/mysql-test/suite/rocksdb/select.result
@@ -0,0 +1,373 @@
+DROP TABLE IF EXISTS t1, t2;
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (100,'foobar'),(1,'z'),(200,'bar');
+CREATE TABLE t2 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t2 (a,b) SELECT a, b FROM t1;
+INSERT INTO t1 (a,b) SELECT a, b FROM t2;
+SELECT * FROM t1;
+a	b	pk
+1	z	2
+1	z	5
+100	foobar	1
+100	foobar	4
+200	bar	3
+200	bar	6
+SELECT DISTINCT a FROM t1;
+a
+1
+100
+200
+SELECT ALL b, a FROM t1;
+b	a
+bar	200
+bar	200
+foobar	100
+foobar	100
+z	1
+z	1
+SELECT STRAIGHT_JOIN SQL_CACHE t1.* FROM t2, t1 WHERE t1.a <> t2.a;
+a	b	pk
+1	z	2
+1	z	2
+1	z	5
+1	z	5
+100	foobar	1
+100	foobar	1
+100	foobar	4
+100	foobar	4
+200	bar	3
+200	bar	3
+200	bar	6
+200	bar	6
+SELECT SQL_SMALL_RESULT SQL_NO_CACHE t1.a FROM t1, t2;
+a
+1
+1
+1
+1
+1
+1
+100
+100
+100
+100
+100
+100
+200
+200
+200
+200
+200
+200
+SELECT SQL_BIG_RESULT SQL_CALC_FOUND_ROWS DISTINCT(t2.a) 
+FROM t1 t1_1, t2, t1 t1_2;
+a
+1
+100
+200
+SELECT FOUND_ROWS();
+FOUND_ROWS()
+3
+SET GLOBAL query_cache_size = 1024*1024;
+SELECT SQL_CACHE * FROM t1, t2;
+a	b	pk	a	b	pk
+1	z	2	1	z	2
+1	z	2	100	foobar	1
+1	z	2	200	bar	3
+1	z	5	1	z	2
+1	z	5	100	foobar	1
+1	z	5	200	bar	3
+100	foobar	1	1	z	2
+100	foobar	1	100	foobar	1
+100	foobar	1	200	bar	3
+100	foobar	4	1	z	2
+100	foobar	4	100	foobar	1
+100	foobar	4	200	bar	3
+200	bar	3	1	z	2
+200	bar	3	100	foobar	1
+200	bar	3	200	bar	3
+200	bar	6	1	z	2
+200	bar	6	100	foobar	1
+200	bar	6	200	bar	3
+SET GLOBAL query_cache_size = 1048576;
+SELECT a+10 AS field1, CONCAT(b,':',b) AS field2 FROM t1 
+WHERE b > 'b' AND a IS NOT NULL 
+GROUP BY 2 DESC, field1 ASC
+HAVING field1 < 1000
+ORDER BY field2, 1 DESC, field1*2
+LIMIT 5 OFFSET 1;
+field1	field2
+11	z:z
+110	foobar:foobar
+SELECT SUM(a), MAX(a), b FROM t1 GROUP BY b WITH ROLLUP;
+SUM(a)	MAX(a)	b
+2	1	z
+200	100	foobar
+400	200	bar
+602	200	NULL
+SELECT * FROM t2 WHERE a>0 PROCEDURE ANALYSE();
+Field_name	Min_value	Max_value	Min_length	Max_length	Empties_or_zeros	Nulls	Avg_value_or_avg_length	Std	Optimal_fieldtype
+test.t2.a	1	200	1	3	0	0	100.3333	81.2418	ENUM('1','100','200') NOT NULL
+test.t2.b	bar	z	1	6	0	0	3.3333	NULL	ENUM('bar','foobar','z') NOT NULL
+test.t2.pk	1	3	1	1	0	0	2.0000	0.8165	ENUM('1','2','3') NOT NULL
+SELECT t1.a, t2.b FROM t2, t1 WHERE t1.a = t2.a ORDER BY t2.b, t1.a 
+INTO OUTFILE '<DATADIR>/select.out' 
+CHARACTER SET utf8
+FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '''';
+200,'bar'
+200,'bar'
+100,'foobar'
+100,'foobar'
+1,'z'
+1,'z'
+SELECT t1.a, t2.b FROM t2, t1 WHERE t1.a = t2.a ORDER BY t2.b, t1.a
+INTO DUMPFILE '<DATADIR>/select.dump';
+ERROR 42000: Result consisted of more than one row
+SELECT t1.*, t2.* FROM t1, t2 ORDER BY t2.b, t1.a, t2.a, t1.b, t1.pk, t2.pk LIMIT 1
+INTO DUMPFILE '<DATADIR>/select.dump';
+1z2200bar3
+SELECT MIN(a), MAX(a) FROM t1 INTO @min, @max;
+SELECT @min, @max;
+ at min	@max
+1	200
+SELECT t1_1.*, t2.* FROM t2, t1 AS t1_1, t1 AS t1_2 
+WHERE t1_1.a = t1_2.a AND t2.a = t1_1.a;
+a	b	pk	a	b	pk
+1	z	2	1	z	2
+1	z	2	1	z	2
+1	z	5	1	z	2
+1	z	5	1	z	2
+100	foobar	1	100	foobar	1
+100	foobar	1	100	foobar	1
+100	foobar	4	100	foobar	1
+100	foobar	4	100	foobar	1
+200	bar	3	200	bar	3
+200	bar	3	200	bar	3
+200	bar	6	200	bar	3
+200	bar	6	200	bar	3
+SELECT alias1.* FROM ( SELECT a,b FROM t1 ) alias1, t2 WHERE t2.a IN (100,200);
+a	b
+1	z
+1	z
+1	z
+1	z
+100	foobar
+100	foobar
+100	foobar
+100	foobar
+200	bar
+200	bar
+200	bar
+200	bar
+SELECT t1.a FROM { OJ t1 LEFT OUTER JOIN t2 ON t1.a = t2.a+10 };
+a
+1
+1
+100
+100
+200
+200
+SELECT t1.* FROM t2 INNER JOIN t1;
+a	b	pk
+1	z	2
+1	z	2
+1	z	2
+1	z	5
+1	z	5
+1	z	5
+100	foobar	1
+100	foobar	1
+100	foobar	1
+100	foobar	4
+100	foobar	4
+100	foobar	4
+200	bar	3
+200	bar	3
+200	bar	3
+200	bar	6
+200	bar	6
+200	bar	6
+SELECT t1_2.* FROM t1 t1_1 CROSS JOIN t1 t1_2 ON t1_1.b = t1_2.b;
+a	b	pk
+1	z	2
+1	z	2
+1	z	5
+1	z	5
+100	foobar	1
+100	foobar	1
+100	foobar	4
+100	foobar	4
+200	bar	3
+200	bar	3
+200	bar	6
+200	bar	6
+SELECT t1.a, t2.b FROM t2 STRAIGHT_JOIN t1 WHERE t1.b > t2.b;
+a	b
+1	bar
+1	bar
+1	foobar
+1	foobar
+100	bar
+100	bar
+SELECT t1.a, t2.b FROM t2 STRAIGHT_JOIN t1 ON t1.b > t2.b ORDER BY t1.a, t2.b;
+a	b
+1	bar
+1	bar
+1	foobar
+1	foobar
+100	bar
+100	bar
+SELECT t2.* FROM t1 LEFT JOIN t2 USING (a) ORDER BY t2.a, t2.b LIMIT 1;
+a	b	pk
+1	z	2
+SELECT t2.* FROM t2 LEFT OUTER JOIN t1 ON t1.a = t2.a WHERE t1.a IS NOT NULL;
+a	b	pk
+1	z	2
+1	z	2
+100	foobar	1
+100	foobar	1
+200	bar	3
+200	bar	3
+SELECT SUM(t2.a) FROM t1 RIGHT JOIN t2 ON t2.b = t1.b;
+SUM(t2.a)
+602
+SELECT MIN(t2.a) FROM t1 RIGHT OUTER JOIN t2 USING (b,a);
+MIN(t2.a)
+1
+SELECT alias.b FROM t1 NATURAL JOIN ( SELECT a,b FROM t1 ) alias WHERE b > '';
+b
+bar
+bar
+bar
+bar
+foobar
+foobar
+foobar
+foobar
+z
+z
+z
+z
+SELECT t2.b FROM ( SELECT a,b FROM t1 ) alias NATURAL LEFT JOIN t2 WHERE b IS NOT NULL;
+b
+bar
+bar
+foobar
+foobar
+z
+z
+SELECT t1.*, t2.* FROM t1 NATURAL LEFT OUTER JOIN t2;
+a	b	pk	a	b	pk
+1	z	2	1	z	2
+1	z	5	NULL	NULL	NULL
+100	foobar	1	100	foobar	1
+100	foobar	4	NULL	NULL	NULL
+200	bar	3	200	bar	3
+200	bar	6	NULL	NULL	NULL
+SELECT t2_2.* FROM t2 t2_1 NATURAL RIGHT JOIN t2 t2_2 WHERE t2_1.a IN ( SELECT a FROM t1 );
+a	b	pk
+1	z	2
+100	foobar	1
+200	bar	3
+SELECT t1_2.b FROM t1 t1_1 NATURAL RIGHT OUTER JOIN t1 t1_2 INNER JOIN t2;
+b
+bar
+bar
+bar
+bar
+bar
+bar
+foobar
+foobar
+foobar
+foobar
+foobar
+foobar
+z
+z
+z
+z
+z
+z
+SELECT ( SELECT MIN(a) FROM ( SELECT a,b FROM t1 ) alias1 ) AS min_a FROM t2;
+min_a
+1
+1
+1
+SELECT a,b FROM t2 WHERE a = ( SELECT MIN(a) FROM t1 );
+a	b
+1	z
+SELECT a,b FROM t2 WHERE b LIKE ( SELECT b FROM t1 ORDER BY b LIMIT 1 );
+a	b
+200	bar
+SELECT t2.* FROM t1 t1_outer, t2 WHERE ( t1_outer.a, t2.b ) IN ( SELECT a, b FROM t2 WHERE a = t1_outer.a );
+a	b	pk
+1	z	2
+1	z	2
+100	foobar	1
+100	foobar	1
+200	bar	3
+200	bar	3
+SELECT a,b FROM t2 WHERE b = ANY ( SELECT b FROM t1 WHERE a > 1 );
+a	b
+100	foobar
+200	bar
+SELECT a,b FROM t2 WHERE b > ALL ( SELECT b FROM t1 WHERE b < 'foo' );
+a	b
+1	z
+100	foobar
+SELECT a,b FROM t1 WHERE ROW(a, b) = ( SELECT a, b FROM t2 ORDER BY a, b LIMIT 1 );
+a	b
+1	z
+1	z
+SELECT a,b FROM t1 WHERE EXISTS ( SELECT a,b FROM t2 WHERE t2.b > t1.b );
+a	b
+100	foobar
+100	foobar
+200	bar
+200	bar
+SELECT t1.* FROM t1, t2 ORDER BY ( SELECT b FROM t1 WHERE a IS NULL ORDER BY b LIMIT 1 ) DESC;
+a	b	pk
+1	z	2
+1	z	2
+1	z	2
+1	z	5
+1	z	5
+1	z	5
+100	foobar	1
+100	foobar	1
+100	foobar	1
+100	foobar	4
+100	foobar	4
+100	foobar	4
+200	bar	3
+200	bar	3
+200	bar	3
+200	bar	6
+200	bar	6
+200	bar	6
+SELECT a, b FROM t1 HAVING a IN ( SELECT a FROM t2 WHERE b = t1.b );
+a	b
+1	z
+1	z
+100	foobar
+100	foobar
+200	bar
+200	bar
+SELECT a,b FROM t1 UNION SELECT a,b FROM t2 UNION DISTINCT SELECT a,b FROM t1;
+a	b
+1	z
+100	foobar
+200	bar
+SELECT a,b FROM t1 UNION SELECT a,b FROM t2 UNION ALL SELECT a,b FROM t1;
+a	b
+1	z
+1	z
+1	z
+100	foobar
+100	foobar
+100	foobar
+200	bar
+200	bar
+200	bar
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/rocksdb/select.test b/mysql-test/suite/rocksdb/select.test
new file mode 100644
index 0000000..1b17b1e
--- /dev/null
+++ b/mysql-test/suite/rocksdb/select.test
@@ -0,0 +1,200 @@
+# 
+# Basic SELECT statements
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
+
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (100,'foobar'),(1,'z'),(200,'bar');
+
+CREATE TABLE t2 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t2 (a,b) SELECT a, b FROM t1;
+INSERT INTO t1 (a,b) SELECT a, b FROM t2;
+
+--sorted_result
+SELECT * FROM t1;
+
+# Modifiers
+
+--sorted_result
+SELECT DISTINCT a FROM t1;
+
+--sorted_result
+SELECT ALL b, a FROM t1;
+
+# Optimizer and cache directives should not have any visible effect here,
+# but we will add them for completness
+
+--sorted_result
+SELECT STRAIGHT_JOIN SQL_CACHE t1.* FROM t2, t1 WHERE t1.a <> t2.a;
+
+--sorted_result
+SELECT SQL_SMALL_RESULT SQL_NO_CACHE t1.a FROM t1, t2;
+
+--sorted_result
+SELECT SQL_BIG_RESULT SQL_CALC_FOUND_ROWS DISTINCT(t2.a) 
+  FROM t1 t1_1, t2, t1 t1_2;
+SELECT FOUND_ROWS();
+
+let $query_cache = `SELECT @@query_cache_size`;
+SET GLOBAL query_cache_size = 1024*1024;
+--sorted_result
+SELECT SQL_CACHE * FROM t1, t2;
+eval SET GLOBAL query_cache_size = $query_cache;
+
+# Combination of main clauses
+
+--sorted_result
+SELECT a+10 AS field1, CONCAT(b,':',b) AS field2 FROM t1 
+WHERE b > 'b' AND a IS NOT NULL 
+GROUP BY 2 DESC, field1 ASC
+HAVING field1 < 1000
+ORDER BY field2, 1 DESC, field1*2
+LIMIT 5 OFFSET 1;
+
+# ROLLUP
+--sorted_result
+SELECT SUM(a), MAX(a), b FROM t1 GROUP BY b WITH ROLLUP;
+
+# Procedure
+
+--sorted_result
+SELECT * FROM t2 WHERE a>0 PROCEDURE ANALYSE();
+
+# SELECT INTO
+let $datadir = `SELECT @@datadir`;
+
+--replace_result $datadir <DATADIR>
+eval
+SELECT t1.a, t2.b FROM t2, t1 WHERE t1.a = t2.a ORDER BY t2.b, t1.a 
+  INTO OUTFILE '$datadir/select.out' 
+  CHARACTER SET utf8
+  FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '''';
+--cat_file $datadir/select.out
+--remove_file $datadir/select.out
+
+--replace_result $datadir <DATADIR>
+--error ER_TOO_MANY_ROWS
+eval
+SELECT t1.a, t2.b FROM t2, t1 WHERE t1.a = t2.a ORDER BY t2.b, t1.a
+  INTO DUMPFILE '$datadir/select.dump';
+--remove_file $datadir/select.dump
+--replace_result $datadir <DATADIR>
+eval
+SELECT t1.*, t2.* FROM t1, t2 ORDER BY t2.b, t1.a, t2.a, t1.b, t1.pk, t2.pk LIMIT 1
+  INTO DUMPFILE '$datadir/select.dump';
+
+--cat_file $datadir/select.dump
+--echo
+--remove_file $datadir/select.dump
+
+SELECT MIN(a), MAX(a) FROM t1 INTO @min, @max;
+SELECT @min, @max;
+
+# Joins
+
+--sorted_result
+SELECT t1_1.*, t2.* FROM t2, t1 AS t1_1, t1 AS t1_2 
+  WHERE t1_1.a = t1_2.a AND t2.a = t1_1.a;
+
+--sorted_result
+SELECT alias1.* FROM ( SELECT a,b FROM t1 ) alias1, t2 WHERE t2.a IN (100,200);
+
+--sorted_result
+SELECT t1.a FROM { OJ t1 LEFT OUTER JOIN t2 ON t1.a = t2.a+10 };
+
+--sorted_result
+SELECT t1.* FROM t2 INNER JOIN t1;
+
+--sorted_result 
+SELECT t1_2.* FROM t1 t1_1 CROSS JOIN t1 t1_2 ON t1_1.b = t1_2.b;
+
+--sorted_result
+SELECT t1.a, t2.b FROM t2 STRAIGHT_JOIN t1 WHERE t1.b > t2.b;
+
+SELECT t1.a, t2.b FROM t2 STRAIGHT_JOIN t1 ON t1.b > t2.b ORDER BY t1.a, t2.b;
+
+SELECT t2.* FROM t1 LEFT JOIN t2 USING (a) ORDER BY t2.a, t2.b LIMIT 1;
+
+--sorted_result
+SELECT t2.* FROM t2 LEFT OUTER JOIN t1 ON t1.a = t2.a WHERE t1.a IS NOT NULL;
+
+SELECT SUM(t2.a) FROM t1 RIGHT JOIN t2 ON t2.b = t1.b;
+
+SELECT MIN(t2.a) FROM t1 RIGHT OUTER JOIN t2 USING (b,a);
+
+--sorted_result
+SELECT alias.b FROM t1 NATURAL JOIN ( SELECT a,b FROM t1 ) alias WHERE b > '';
+
+--sorted_result
+SELECT t2.b FROM ( SELECT a,b FROM t1 ) alias NATURAL LEFT JOIN t2 WHERE b IS NOT NULL;
+
+--sorted_result
+SELECT t1.*, t2.* FROM t1 NATURAL LEFT OUTER JOIN t2;
+
+--sorted_result
+SELECT t2_2.* FROM t2 t2_1 NATURAL RIGHT JOIN t2 t2_2 WHERE t2_1.a IN ( SELECT a FROM t1 );
+
+--sorted_result
+SELECT t1_2.b FROM t1 t1_1 NATURAL RIGHT OUTER JOIN t1 t1_2 INNER JOIN t2;
+
+# Subquery as scalar operand, subquery in the FROM clause
+
+--sorted_result
+SELECT ( SELECT MIN(a) FROM ( SELECT a,b FROM t1 ) alias1 ) AS min_a FROM t2;
+
+# Comparison using subqueries
+
+--sorted_result
+SELECT a,b FROM t2 WHERE a = ( SELECT MIN(a) FROM t1 );
+
+--sorted_result
+SELECT a,b FROM t2 WHERE b LIKE ( SELECT b FROM t1 ORDER BY b LIMIT 1 );
+
+# Subquery with IN, correlated subquery
+
+--sorted_result
+SELECT t2.* FROM t1 t1_outer, t2 WHERE ( t1_outer.a, t2.b ) IN ( SELECT a, b FROM t2 WHERE a = t1_outer.a );
+
+# Subquery with ANY, ALL
+
+--sorted_result
+SELECT a,b FROM t2 WHERE b = ANY ( SELECT b FROM t1 WHERE a > 1 );
+
+--sorted_result
+SELECT a,b FROM t2 WHERE b > ALL ( SELECT b FROM t1 WHERE b < 'foo' );
+
+# Row subqueries
+
+--sorted_result
+SELECT a,b FROM t1 WHERE ROW(a, b) = ( SELECT a, b FROM t2 ORDER BY a, b LIMIT 1 );
+
+# Subquery with EXISTS
+
+--sorted_result
+SELECT a,b FROM t1 WHERE EXISTS ( SELECT a,b FROM t2 WHERE t2.b > t1.b );
+
+# Subquery in ORDER BY
+
+--sorted_result
+SELECT t1.* FROM t1, t2 ORDER BY ( SELECT b FROM t1 WHERE a IS NULL ORDER BY b LIMIT 1 ) DESC;
+
+# Subquery in HAVING
+
+--sorted_result
+SELECT a, b FROM t1 HAVING a IN ( SELECT a FROM t2 WHERE b = t1.b );
+
+# Union
+
+--sorted_result
+SELECT a,b FROM t1 UNION SELECT a,b FROM t2 UNION DISTINCT SELECT a,b FROM t1;
+
+--sorted_result
+SELECT a,b FROM t1 UNION SELECT a,b FROM t2 UNION ALL SELECT a,b FROM t1;
+
+
+# Cleanup
+DROP TABLE t1, t2;
+
diff --git a/mysql-test/suite/rocksdb/select_for_update.result b/mysql-test/suite/rocksdb/select_for_update.result
new file mode 100644
index 0000000..f595448
--- /dev/null
+++ b/mysql-test/suite/rocksdb/select_for_update.result
@@ -0,0 +1,35 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'a');
+connect  con1,localhost,root,,;
+BEGIN;
+SELECT a,b FROM t1 WHERE b='a' FOR UPDATE;
+a	b
+1	a
+3	a
+connection default;
+SET lock_wait_timeout = 1;
+SELECT a,b FROM t1 WHERE b='a';
+a	b
+1	a
+3	a
+SELECT a,b FROM t1 WHERE b='a' LOCK IN SHARE MODE;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+UPDATE t1 SET b='c' WHERE b='a';
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection con1;
+COMMIT;
+SELECT a,b FROM t1;
+a	b
+1	a
+2	b
+3	a
+disconnect con1;
+connection default;
+UPDATE t1 SET b='c' WHERE b='a';
+SELECT a,b FROM t1;
+a	b
+1	c
+2	b
+3	c
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/select_for_update.test b/mysql-test/suite/rocksdb/select_for_update.test
new file mode 100644
index 0000000..916c2c4
--- /dev/null
+++ b/mysql-test/suite/rocksdb/select_for_update.test
@@ -0,0 +1,53 @@
+#
+# SELECT .. FOR UPDATE
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+--enable_connect_log
+
+--source include/count_sessions.inc
+
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'a');
+
+--connect (con1,localhost,root,,)
+BEGIN;
+--sorted_result
+SELECT a,b FROM t1 WHERE b='a' FOR UPDATE;
+
+--connection default
+SET lock_wait_timeout = 1;
+
+# Should still be able to select 
+
+--sorted_result
+SELECT a,b FROM t1 WHERE b='a';
+
+# ... but not with LOCK IN SHARE MODE
+
+--sorted_result
+--error ER_LOCK_WAIT_TIMEOUT
+SELECT a,b FROM t1 WHERE b='a' LOCK IN SHARE MODE;
+
+--error ER_LOCK_WAIT_TIMEOUT
+UPDATE t1 SET b='c' WHERE b='a';
+
+--connection con1
+COMMIT;
+--sorted_result
+SELECT a,b FROM t1;
+
+--disconnect con1
+--connection default
+# Now it can be updated all right
+UPDATE t1 SET b='c' WHERE b='a';  
+--sorted_result
+SELECT a,b FROM t1;
+
+DROP TABLE t1;
+
+--source include/wait_until_count_sessions.inc
+
diff --git a/mysql-test/suite/rocksdb/select_lock_in_share_mode.result b/mysql-test/suite/rocksdb/select_lock_in_share_mode.result
new file mode 100644
index 0000000..3d668d7
--- /dev/null
+++ b/mysql-test/suite/rocksdb/select_lock_in_share_mode.result
@@ -0,0 +1,37 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'a');
+connect  con1,localhost,root,,;
+BEGIN;
+SELECT a,b FROM t1 WHERE b='a' LOCK IN SHARE MODE;
+a	b
+1	a
+3	a
+connection default;
+SET lock_wait_timeout = 1;
+SELECT a,b FROM t1 WHERE b='a';
+a	b
+1	a
+3	a
+SELECT a,b FROM t1 WHERE b='a' LOCK IN SHARE MODE;
+a	b
+1	a
+3	a
+UPDATE t1 SET b='c' WHERE b='a';
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection con1;
+COMMIT;
+SELECT a,b FROM t1;
+a	b
+1	a
+2	b
+3	a
+disconnect con1;
+connection default;
+UPDATE t1 SET b='c' WHERE b='a';
+SELECT a,b FROM t1;
+a	b
+1	c
+2	b
+3	c
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/select_lock_in_share_mode.test b/mysql-test/suite/rocksdb/select_lock_in_share_mode.test
new file mode 100644
index 0000000..5e31db1
--- /dev/null
+++ b/mysql-test/suite/rocksdb/select_lock_in_share_mode.test
@@ -0,0 +1,52 @@
+#
+# SELECT .. LOCK IN SHARE MODE 
+#
+# If the engine has its own lock timeouts, 
+# it makes sense to set them to minimum to decrease
+# the duration of the test.
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+--enable_connect_log
+
+--source include/count_sessions.inc
+
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'a');
+
+--connect (con1,localhost,root,,)
+BEGIN;
+--sorted_result
+SELECT a,b FROM t1 WHERE b='a' LOCK IN SHARE MODE;
+
+--connection default
+SET lock_wait_timeout = 1;
+
+# Should still be able to select 
+
+--sorted_result
+SELECT a,b FROM t1 WHERE b='a';
+--sorted_result
+SELECT a,b FROM t1 WHERE b='a' LOCK IN SHARE MODE;
+
+--error ER_LOCK_WAIT_TIMEOUT
+UPDATE t1 SET b='c' WHERE b='a';
+
+--connection con1
+COMMIT;
+--sorted_result
+SELECT a,b FROM t1;
+
+--disconnect con1
+--connection default
+# Now it can be updated all right
+UPDATE t1 SET b='c' WHERE b='a';  
+--sorted_result
+SELECT a,b FROM t1;
+
+DROP TABLE t1;
+
+--source include/wait_until_count_sessions.inc
+
diff --git a/mysql-test/suite/rocksdb/show_engine.result b/mysql-test/suite/rocksdb/show_engine.result
new file mode 100644
index 0000000..3908a82
--- /dev/null
+++ b/mysql-test/suite/rocksdb/show_engine.result
@@ -0,0 +1,5 @@
+SHOW ENGINE rocksdb STATUS;
+Type	Name	Status
+SHOW ENGINE rocksdb MUTEX;
+Type	Name	Status
+SHOW ENGINE ALL MUTEX;
diff --git a/mysql-test/suite/rocksdb/show_engine.test b/mysql-test/suite/rocksdb/show_engine.test
new file mode 100644
index 0000000..98d5b5b
--- /dev/null
+++ b/mysql-test/suite/rocksdb/show_engine.test
@@ -0,0 +1,13 @@
+#
+# SHOW ENGINE STATUS command
+# Checking that the command doesn't produce an error.
+# If it starts producing an actual result, the result file
+# will need to be updated, and possibly masked.
+
+SHOW ENGINE rocksdb STATUS;
+SHOW ENGINE rocksdb MUTEX;
+# For SHOW ALL MUTEX even the number of lines is volatile, so the result logging is disabled
+--disable_result_log
+SHOW ENGINE ALL MUTEX;
+--enable_result_log
+
diff --git a/mysql-test/suite/rocksdb/show_table_status.result b/mysql-test/suite/rocksdb/show_table_status.result
new file mode 100644
index 0000000..fb443fb
--- /dev/null
+++ b/mysql-test/suite/rocksdb/show_table_status.result
@@ -0,0 +1,62 @@
+DROP TABLE IF EXISTS t1, t2, t3;
+CREATE TABLE t1 (a INT, b CHAR(8) PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (100,'a'),(2,'foo');
+CREATE TABLE t2 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb;
+INSERT INTO t2 (a,b) VALUES (1,'bar');
+CREATE TABLE t3 (a INT, b CHAR(8), pk INT PRIMARY KEY) ENGINE=rocksdb CHARACTER SET utf8;
+SHOW TABLE STATUS WHERE name IN ( 't1', 't2', 't3' );
+Name	t1
+Engine	ROCKSDB
+Version	10
+Row_format	Fixed
+Rows	1000
+Avg_row_length	0
+Data_length	0
+Max_data_length	0
+Index_length	0
+Data_free	0
+Auto_increment	NULL
+Create_time	NULL
+Update_time	NULL
+Check_time	NULL
+Collation	latin1_swedish_ci
+Checksum	NULL
+Create_options	
+Comment	
+Name	t2
+Engine	ROCKSDB
+Version	10
+Row_format	Fixed
+Rows	1000
+Avg_row_length	0
+Data_length	0
+Max_data_length	0
+Index_length	0
+Data_free	0
+Auto_increment	NULL
+Create_time	NULL
+Update_time	NULL
+Check_time	NULL
+Collation	latin1_swedish_ci
+Checksum	NULL
+Create_options	
+Comment	
+Name	t3
+Engine	ROCKSDB
+Version	10
+Row_format	Fixed
+Rows	1000
+Avg_row_length	0
+Data_length	0
+Max_data_length	0
+Index_length	0
+Data_free	0
+Auto_increment	NULL
+Create_time	NULL
+Update_time	NULL
+Check_time	NULL
+Collation	utf8_general_ci
+Checksum	NULL
+Create_options	
+Comment	
+DROP TABLE t1, t2, t3;
diff --git a/mysql-test/suite/rocksdb/show_table_status.test b/mysql-test/suite/rocksdb/show_table_status.test
new file mode 100644
index 0000000..f39161b
--- /dev/null
+++ b/mysql-test/suite/rocksdb/show_table_status.test
@@ -0,0 +1,26 @@
+# 
+# SHOW TABLE STATUS statement
+#
+
+###################################
+# TODO:
+# The result file is likely to change 
+# if MDEV-4197 is fixed
+###################################
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2, t3;
+--enable_warnings
+
+CREATE TABLE t1 (a INT, b CHAR(8) PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (100,'a'),(2,'foo');
+
+CREATE TABLE t2 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb;
+INSERT INTO t2 (a,b) VALUES (1,'bar');
+
+CREATE TABLE t3 (a INT, b CHAR(8), pk INT PRIMARY KEY) ENGINE=rocksdb CHARACTER SET utf8;
+
+#--replace_column 2 <STORAGE_ENGINE> 4 ### 6 ### 7 ### 8 ### 9 ### 10 ### 12 ### 13 ### 
+--query_vertical SHOW TABLE STATUS WHERE name IN ( 't1', 't2', 't3' )
+DROP TABLE t1, t2, t3;
+
diff --git a/mysql-test/suite/rocksdb/tbl_opt_avg_row_length.result b/mysql-test/suite/rocksdb/tbl_opt_avg_row_length.result
new file mode 100644
index 0000000..f904c04
--- /dev/null
+++ b/mysql-test/suite/rocksdb/tbl_opt_avg_row_length.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb AVG_ROW_LENGTH=300;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  `b` char(8) DEFAULT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 AVG_ROW_LENGTH=300
+ALTER TABLE t1 AVG_ROW_LENGTH=30000000;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  `b` char(8) DEFAULT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 AVG_ROW_LENGTH=30000000
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/tbl_opt_avg_row_length.test b/mysql-test/suite/rocksdb/tbl_opt_avg_row_length.test
new file mode 100644
index 0000000..458c458
--- /dev/null
+++ b/mysql-test/suite/rocksdb/tbl_opt_avg_row_length.test
@@ -0,0 +1,21 @@
+# 
+# Check whether AVG_ROW_LENGTH option 
+# is supported in CREATE and ALTER TABLE
+#
+# Note: the test does not check whether the option
+#       has any real effect on the table, only 
+#       that it's accepted
+# 
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb AVG_ROW_LENGTH=300;
+SHOW CREATE TABLE t1;
+
+ALTER TABLE t1 AVG_ROW_LENGTH=30000000;
+SHOW CREATE TABLE t1;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/tbl_opt_checksum.result b/mysql-test/suite/rocksdb/tbl_opt_checksum.result
new file mode 100644
index 0000000..d9cc69e
--- /dev/null
+++ b/mysql-test/suite/rocksdb/tbl_opt_checksum.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb CHECKSUM=1;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  `b` char(8) DEFAULT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 CHECKSUM=1
+ALTER TABLE t1 CHECKSUM=0;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  `b` char(8) DEFAULT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/tbl_opt_checksum.test b/mysql-test/suite/rocksdb/tbl_opt_checksum.test
new file mode 100644
index 0000000..319c6e1
--- /dev/null
+++ b/mysql-test/suite/rocksdb/tbl_opt_checksum.test
@@ -0,0 +1,17 @@
+# 
+# Check whether CHECKSUM option is supported
+# in CREATE and ALTER TABLE.
+# 
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb CHECKSUM=1;
+SHOW CREATE TABLE t1;
+
+ALTER TABLE t1 CHECKSUM=0;
+SHOW CREATE TABLE t1;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/tbl_opt_connection.result b/mysql-test/suite/rocksdb/tbl_opt_connection.result
new file mode 100644
index 0000000..0beddd9
--- /dev/null
+++ b/mysql-test/suite/rocksdb/tbl_opt_connection.result
@@ -0,0 +1,26 @@
+DROP TABLE IF EXISTS t1;
+CREATE DATABASE test_remote;
+CREATE SERVER test_connection FOREIGN DATA WRAPPER mysql
+OPTIONS (USER 'root', HOST 'localhost', DATABASE 'test_remote');
+CREATE SERVER test_connection2 FOREIGN DATA WRAPPER mysql
+OPTIONS (USER 'root', HOST 'localhost', DATABASE 'test_remote');
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb CONNECTION='test_connection';
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  `b` char(8) DEFAULT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 CONNECTION='test_connection'
+ALTER TABLE t1 CONNECTION='test_connection2';
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  `b` char(8) DEFAULT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 CONNECTION='test_connection2'
+DROP TABLE t1;
+DROP SERVER test_connection;
+DROP SERVER test_connection2;
+DROP DATABASE test_remote;
diff --git a/mysql-test/suite/rocksdb/tbl_opt_connection.test b/mysql-test/suite/rocksdb/tbl_opt_connection.test
new file mode 100644
index 0000000..d81d42c
--- /dev/null
+++ b/mysql-test/suite/rocksdb/tbl_opt_connection.test
@@ -0,0 +1,30 @@
+# 
+# Check whether CONNECTION option is supported
+# is supported in CREATE and ALTER TABLE
+#
+# Note: the test does not check whether the option
+#       has any real effect on the table, only 
+#       that it's accepted
+# 
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE DATABASE test_remote;
+CREATE SERVER test_connection FOREIGN DATA WRAPPER mysql
+OPTIONS (USER 'root', HOST 'localhost', DATABASE 'test_remote');
+CREATE SERVER test_connection2 FOREIGN DATA WRAPPER mysql
+OPTIONS (USER 'root', HOST 'localhost', DATABASE 'test_remote');
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb CONNECTION='test_connection';
+SHOW CREATE TABLE t1;
+ALTER TABLE t1 CONNECTION='test_connection2';
+SHOW CREATE TABLE t1;
+
+DROP TABLE t1;
+
+DROP SERVER test_connection;
+DROP SERVER test_connection2;
+DROP DATABASE test_remote;
+
diff --git a/mysql-test/suite/rocksdb/tbl_opt_data_index_dir.result b/mysql-test/suite/rocksdb/tbl_opt_data_index_dir.result
new file mode 100644
index 0000000..5821369
--- /dev/null
+++ b/mysql-test/suite/rocksdb/tbl_opt_data_index_dir.result
@@ -0,0 +1,20 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb DATA DIRECTORY = '<DATA_DIR>' INDEX DIRECTORY = '<INDEX_DIR>';
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  `b` char(8) DEFAULT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
+ALTER TABLE t1 INDEX DIRECTORY = '<DATA_DIR>';
+Warnings:
+Warning	1618	<INDEX DIRECTORY> option ignored
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  `b` char(8) DEFAULT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/tbl_opt_data_index_dir.test b/mysql-test/suite/rocksdb/tbl_opt_data_index_dir.test
new file mode 100644
index 0000000..07343e5
--- /dev/null
+++ b/mysql-test/suite/rocksdb/tbl_opt_data_index_dir.test
@@ -0,0 +1,35 @@
+# 
+# Check whether DATA DIRECTORY and INDEX DIRECTORY
+# are supported in CREATE and ALTER TABLE
+#
+# Note: the test does not check whether the options
+#       have any real effect on the table, only 
+#       that they are accepted
+#       (and apparently ignored)
+# 
+
+--let $data_dir = $MYSQLTEST_VARDIR/storage_engine_data_dir/
+--let $index_dir = $MYSQLTEST_VARDIR/storage_engine_index_dir/
+--mkdir $data_dir
+--mkdir $index_dir
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+--replace_result $data_dir <DATA_DIR> $index_dir <INDEX_DIR>
+eval CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb DATA DIRECTORY = '$data_dir' INDEX DIRECTORY = '$index_dir';
+--replace_result $data_dir <DATA_DIR> $index_dir <INDEX_DIR>
+SHOW CREATE TABLE t1;
+
+--replace_result $data_dir <DATA_DIR> $index_dir <INDEX_DIR>
+eval ALTER TABLE t1 INDEX DIRECTORY = '$data_dir';
+--replace_result $data_dir <DATA_DIR> $index_dir <INDEX_DIR> 
+SHOW CREATE TABLE t1;
+
+DROP TABLE t1;
+
+--rmdir $data_dir
+--rmdir $index_dir
+
+
diff --git a/mysql-test/suite/rocksdb/tbl_opt_delay_key_write.result b/mysql-test/suite/rocksdb/tbl_opt_delay_key_write.result
new file mode 100644
index 0000000..c5d1ad8
--- /dev/null
+++ b/mysql-test/suite/rocksdb/tbl_opt_delay_key_write.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb DELAY_KEY_WRITE=1;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  `b` char(8) DEFAULT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 DELAY_KEY_WRITE=1
+ALTER TABLE t1 DELAY_KEY_WRITE=0;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  `b` char(8) DEFAULT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/tbl_opt_delay_key_write.test b/mysql-test/suite/rocksdb/tbl_opt_delay_key_write.test
new file mode 100644
index 0000000..9bbdca7
--- /dev/null
+++ b/mysql-test/suite/rocksdb/tbl_opt_delay_key_write.test
@@ -0,0 +1,21 @@
+# 
+# Check whether DELAY_KEY_WRITE option 
+# is supported in CREATE and ALTER TABLE
+#
+# Note: the test does not check whether the option
+#       has any real effect on the table, only 
+#       that it's accepted
+# 
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb DELAY_KEY_WRITE=1;
+SHOW CREATE TABLE t1;
+
+ALTER TABLE t1 DELAY_KEY_WRITE=0;
+SHOW CREATE TABLE t1;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/tbl_opt_insert_method.result b/mysql-test/suite/rocksdb/tbl_opt_insert_method.result
new file mode 100644
index 0000000..bd5e65f
--- /dev/null
+++ b/mysql-test/suite/rocksdb/tbl_opt_insert_method.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb INSERT_METHOD=FIRST;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  `b` char(8) DEFAULT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
+ALTER TABLE t1 INSERT_METHOD=NO;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  `b` char(8) DEFAULT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/tbl_opt_insert_method.test b/mysql-test/suite/rocksdb/tbl_opt_insert_method.test
new file mode 100644
index 0000000..13e6fb4
--- /dev/null
+++ b/mysql-test/suite/rocksdb/tbl_opt_insert_method.test
@@ -0,0 +1,21 @@
+# 
+# Check whether INSERT_METHOD option 
+# is supported in CREATE and ALTER TABLE
+#
+# Note: the test does not check whether the option
+#       has any real effect on the table, only 
+#       that it's accepted (and apparently ignored)
+# 
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb INSERT_METHOD=FIRST;
+SHOW CREATE TABLE t1;
+
+ALTER TABLE t1 INSERT_METHOD=NO;
+SHOW CREATE TABLE t1;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/tbl_opt_key_block_size.result b/mysql-test/suite/rocksdb/tbl_opt_key_block_size.result
new file mode 100644
index 0000000..6c34d08
--- /dev/null
+++ b/mysql-test/suite/rocksdb/tbl_opt_key_block_size.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb KEY_BLOCK_SIZE=8;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  `b` char(8) DEFAULT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=8
+ALTER TABLE t1 KEY_BLOCK_SIZE=1;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  `b` char(8) DEFAULT NULL,
+  PRIMARY KEY (`a`) KEY_BLOCK_SIZE=8
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/tbl_opt_key_block_size.test b/mysql-test/suite/rocksdb/tbl_opt_key_block_size.test
new file mode 100644
index 0000000..4d9c99b
--- /dev/null
+++ b/mysql-test/suite/rocksdb/tbl_opt_key_block_size.test
@@ -0,0 +1,21 @@
+# 
+# Check whether KEY_BLOCK_SIZE option 
+# is supported in CREATE and ALTER TABLE
+#
+# Note: the test does not check whether the option
+#       has any real effect on the table, only 
+#       that it's accepted
+# 
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb KEY_BLOCK_SIZE=8;
+SHOW CREATE TABLE t1;
+
+ALTER TABLE t1 KEY_BLOCK_SIZE=1;
+SHOW CREATE TABLE t1;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/tbl_opt_max_rows.result b/mysql-test/suite/rocksdb/tbl_opt_max_rows.result
new file mode 100644
index 0000000..679e00e
--- /dev/null
+++ b/mysql-test/suite/rocksdb/tbl_opt_max_rows.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb MAX_ROWS=10000000;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  `b` char(8) DEFAULT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 MAX_ROWS=10000000
+ALTER TABLE t1 MAX_ROWS=30000000;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  `b` char(8) DEFAULT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 MAX_ROWS=30000000
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/tbl_opt_max_rows.test b/mysql-test/suite/rocksdb/tbl_opt_max_rows.test
new file mode 100644
index 0000000..ce87ca7
--- /dev/null
+++ b/mysql-test/suite/rocksdb/tbl_opt_max_rows.test
@@ -0,0 +1,21 @@
+# 
+# Check whether MAX_ROWS option
+# is supported in CREATE and ALTER TABLE
+#
+# Note: the test does not check whether the option
+#       has any real effect on the table, only 
+#       that it's accepted
+# 
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb MAX_ROWS=10000000;
+SHOW CREATE TABLE t1;
+
+ALTER TABLE t1 MAX_ROWS=30000000;
+SHOW CREATE TABLE t1;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/tbl_opt_min_rows.result b/mysql-test/suite/rocksdb/tbl_opt_min_rows.result
new file mode 100644
index 0000000..bc65043
--- /dev/null
+++ b/mysql-test/suite/rocksdb/tbl_opt_min_rows.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb MIN_ROWS=1;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  `b` char(8) DEFAULT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 MIN_ROWS=1
+ALTER TABLE t1 MIN_ROWS=10000;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  `b` char(8) DEFAULT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 MIN_ROWS=10000
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/tbl_opt_min_rows.test b/mysql-test/suite/rocksdb/tbl_opt_min_rows.test
new file mode 100644
index 0000000..2a1cdb9
--- /dev/null
+++ b/mysql-test/suite/rocksdb/tbl_opt_min_rows.test
@@ -0,0 +1,21 @@
+# 
+# Check whether MIN_ROWS option 
+# is supported in CREATE and ALTER TABLE
+#
+# Note: the test does not check whether the option
+#       has any real effect on the table, only 
+#       that it's accepted
+# 
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb MIN_ROWS=1;
+SHOW CREATE TABLE t1;
+
+ALTER TABLE t1 MIN_ROWS=10000;
+SHOW CREATE TABLE t1;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/tbl_opt_pack_keys.result b/mysql-test/suite/rocksdb/tbl_opt_pack_keys.result
new file mode 100644
index 0000000..b42d3f4
--- /dev/null
+++ b/mysql-test/suite/rocksdb/tbl_opt_pack_keys.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb PACK_KEYS=1;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  `b` char(8) DEFAULT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 PACK_KEYS=1
+ALTER TABLE t1 PACK_KEYS=0;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  `b` char(8) DEFAULT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 PACK_KEYS=0
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/tbl_opt_pack_keys.test b/mysql-test/suite/rocksdb/tbl_opt_pack_keys.test
new file mode 100644
index 0000000..df60d67
--- /dev/null
+++ b/mysql-test/suite/rocksdb/tbl_opt_pack_keys.test
@@ -0,0 +1,21 @@
+# 
+# Check whether PACK KEYS option 
+# is supported in CREATE and ALTER TABLE
+#
+# Note: the test does not check whether the option
+#       has any real effect on the table, only 
+#       that it's accepted
+# 
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb PACK_KEYS=1;
+SHOW CREATE TABLE t1;
+
+ALTER TABLE t1 PACK_KEYS=0;
+SHOW CREATE TABLE t1;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/tbl_opt_password.result b/mysql-test/suite/rocksdb/tbl_opt_password.result
new file mode 100644
index 0000000..80ec794
--- /dev/null
+++ b/mysql-test/suite/rocksdb/tbl_opt_password.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb PASSWORD='password';
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  `b` char(8) DEFAULT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
+ALTER TABLE t1 PASSWORD='new_password';
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  `b` char(8) DEFAULT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/tbl_opt_password.test b/mysql-test/suite/rocksdb/tbl_opt_password.test
new file mode 100644
index 0000000..8f860ba
--- /dev/null
+++ b/mysql-test/suite/rocksdb/tbl_opt_password.test
@@ -0,0 +1,25 @@
+# 
+# Check whether PASSWORD option 
+# is supported in CREATE and ALTER TABLE
+#
+# Note: the test does not check whether the option
+#       has any real effect on the table, only 
+#       that it's accepted
+# 
+# This option is not supported by any known engines,
+# that's why the result file does not contain it;
+# but it's syntactically acceptable.
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb PASSWORD='password';
+SHOW CREATE TABLE t1;
+
+ALTER TABLE t1 PASSWORD='new_password';
+SHOW CREATE TABLE t1;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/tbl_opt_row_format.result b/mysql-test/suite/rocksdb/tbl_opt_row_format.result
new file mode 100644
index 0000000..a0c480e
--- /dev/null
+++ b/mysql-test/suite/rocksdb/tbl_opt_row_format.result
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT, b CHAR(8) PRIMARY KEY) ENGINE=rocksdb ROW_FORMAT=FIXED;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) DEFAULT NULL,
+  `b` char(8) NOT NULL,
+  PRIMARY KEY (`b`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED
+ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) DEFAULT NULL,
+  `b` char(8) NOT NULL,
+  PRIMARY KEY (`b`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/tbl_opt_row_format.test b/mysql-test/suite/rocksdb/tbl_opt_row_format.test
new file mode 100644
index 0000000..f05b690
--- /dev/null
+++ b/mysql-test/suite/rocksdb/tbl_opt_row_format.test
@@ -0,0 +1,21 @@
+# 
+# Check whether ROW_FORMAT option 
+# is supported in CREATE and ALTER TABLE
+#
+# Note: the test does not check whether the option
+#       has any real effect on the table, only 
+#       that it's accepted
+# 
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT, b CHAR(8) PRIMARY KEY) ENGINE=rocksdb ROW_FORMAT=FIXED;
+SHOW CREATE TABLE t1;
+
+ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
+SHOW CREATE TABLE t1;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/tbl_opt_union.result b/mysql-test/suite/rocksdb/tbl_opt_union.result
new file mode 100644
index 0000000..fb021db
--- /dev/null
+++ b/mysql-test/suite/rocksdb/tbl_opt_union.result
@@ -0,0 +1,16 @@
+DROP TABLE IF EXISTS t1, child1, child2;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=rocksdb UNION(child1);
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
+ALTER TABLE t1 UNION = (child1,child2);
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
+DROP TABLE t1, child1, child2;
diff --git a/mysql-test/suite/rocksdb/tbl_opt_union.test b/mysql-test/suite/rocksdb/tbl_opt_union.test
new file mode 100644
index 0000000..849c27b
--- /dev/null
+++ b/mysql-test/suite/rocksdb/tbl_opt_union.test
@@ -0,0 +1,26 @@
+# 
+# Check whether UNION option 
+# is supported in CREATE and ALTER TABLE
+#
+# Note: the test does not check whether the option
+#       has any real effect on the table, only 
+#       that it's accepted
+# 
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, child1, child2;
+--enable_warnings
+
+--disable_query_log
+CREATE TABLE child1 (a INT PRIMARY KEY) ENGINE=MyISAM;
+CREATE TABLE child2 (a INT PRIMARY KEY) ENGINE=MyISAM;
+--enable_query_log
+
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=rocksdb UNION(child1);
+SHOW CREATE TABLE t1;
+
+ALTER TABLE t1 UNION = (child1,child2);
+SHOW CREATE TABLE t1;
+
+DROP TABLE t1, child1, child2;
+
diff --git a/mysql-test/suite/rocksdb/tbl_standard_opts.result b/mysql-test/suite/rocksdb/tbl_standard_opts.result
new file mode 100644
index 0000000..ecfc729
--- /dev/null
+++ b/mysql-test/suite/rocksdb/tbl_standard_opts.result
@@ -0,0 +1,46 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb 
+DEFAULT CHARACTER SET = utf8
+COLLATE = utf8_general_ci
+COMMENT = 'standard table options'
+;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  `b` char(8) DEFAULT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=utf8 COMMENT='standard table options'
+ALTER TABLE t1 COMMENT = 'table altered';
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  `b` char(8) DEFAULT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=utf8 COMMENT='table altered'
+ALTER TABLE t1 ENGINE=MEMORY;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  `b` char(8) DEFAULT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=MEMORY DEFAULT CHARSET=utf8 COMMENT='table altered'
+ALTER TABLE t1 ENGINE=rocksdb;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  `b` char(8) DEFAULT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=utf8 COMMENT='table altered'
+ALTER TABLE t1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL,
+  `b` char(8) CHARACTER SET utf8 DEFAULT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COMMENT='table altered'
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/tbl_standard_opts.test b/mysql-test/suite/rocksdb/tbl_standard_opts.test
new file mode 100644
index 0000000..eb3f049
--- /dev/null
+++ b/mysql-test/suite/rocksdb/tbl_standard_opts.test
@@ -0,0 +1,40 @@
+# 
+# Standard options in CREATE and ALTER TABLE 
+#
+# Note: the test does not check whether the options
+#       have any real effect on the table, only 
+#       that they are accepted
+# 
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# Create table with standard options
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb 
+  DEFAULT CHARACTER SET = utf8
+  COLLATE = utf8_general_ci
+  COMMENT = 'standard table options'
+;
+SHOW CREATE TABLE t1;  
+
+# Alter comment
+
+ALTER TABLE t1 COMMENT = 'table altered';
+SHOW CREATE TABLE t1;
+
+# Alter ENGINE value
+
+ALTER TABLE t1 ENGINE=MEMORY;
+SHOW CREATE TABLE t1;
+ALTER TABLE t1 ENGINE=rocksdb;
+SHOW CREATE TABLE t1;
+
+# Alter character set and collation
+
+ALTER TABLE t1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci;
+SHOW CREATE TABLE t1;
+
+DROP TABLE t1;
+  
diff --git a/mysql-test/suite/rocksdb/transaction_isolation.inc b/mysql-test/suite/rocksdb/transaction_isolation.inc
new file mode 100644
index 0000000..1a21fa1
--- /dev/null
+++ b/mysql-test/suite/rocksdb/transaction_isolation.inc
@@ -0,0 +1,92 @@
+#
+# Basic check for transaction isolation. 
+# The results should be different depending on the isolation level.
+# For some isolation levels, some statements will end with a timeout.
+# If the engine has its own timeout parameters, reduce them to minimum,
+# otherwise the test will take very long.
+# If the timeout value is greater than the testcase-timeout the test is run with,
+# it might fail due to the testcase timeout.
+#
+
+--enable_connect_log
+
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+connect (con1,localhost,root,,);
+eval SET SESSION TRANSACTION ISOLATION LEVEL $trx_isolation;
+connect (con2,localhost,root,,);
+eval SET SESSION TRANSACTION ISOLATION LEVEL $trx_isolation;
+
+connection con1;
+
+CREATE TABLE t1 (a INT, pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+
+START TRANSACTION; 
+--sorted_result
+SELECT a FROM t1; # First snapshot
+
+connection con2;
+
+BEGIN;
+--error 0,ER_LOCK_WAIT_TIMEOUT
+INSERT INTO t1 (a) VALUES(1); 
+
+connection con1;
+--sorted_result
+SELECT a FROM t1; # Second snapshot
+
+connection con2;
+--error 0,ER_LOCK_WAIT_TIMEOUT
+INSERT INTO t1 (a) VALUES (2); 
+
+connection con1;
+--sorted_result
+SELECT a FROM t1; # Third snapshot
+
+--error 0,ER_LOCK_WAIT_TIMEOUT
+INSERT INTO t1 (a) SELECT a+100 FROM t1; 
+
+--sorted_result
+SELECT a FROM t1;
+
+connection con2;
+--sorted_result
+SELECT a FROM t1; # Inside the transaction
+COMMIT;
+--sorted_result
+SELECT a FROM t1; # Outside the transaction
+
+connection con1;
+--sorted_result
+SELECT a FROM t1; # Inside the transaction
+
+# Note: INSERT .. SELECT might be tricky, for example for InnoDB
+# even with REPEATABLE-READ it works as if it is executed with READ COMMITTED.
+# The test will have a 'logical' result for repeatable read, even although
+# we currently don't have an engine which works this way.
+
+--error 0,ER_LOCK_WAIT_TIMEOUT
+INSERT INTO t1 (a) SELECT a+200 FROM t1; 
+
+--sorted_result
+SELECT a FROM t1;
+COMMIT;
+--sorted_result
+SELECT a FROM t1; # Outside the transaction
+
+connection con2;
+--sorted_result
+SELECT a FROM t1; # After both transactions have committed
+
+connection default;
+disconnect con1;
+disconnect con2;
+DROP TABLE t1;
+
+--source include/wait_until_count_sessions.inc
+
diff --git a/mysql-test/suite/rocksdb/truncate_table.result b/mysql-test/suite/rocksdb/truncate_table.result
new file mode 100644
index 0000000..9154686
--- /dev/null
+++ b/mysql-test/suite/rocksdb/truncate_table.result
@@ -0,0 +1,33 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb;
+TRUNCATE TABLE t1;
+INSERT INTO t1 (a,b) VALUES (1,'a'), (2,'b'), (3,'c');
+TRUNCATE TABLE t1;
+SELECT a,b FROM t1;
+a	b
+DROP TABLE t1;
+CREATE TABLE t1 (a INT KEY AUTO_INCREMENT, c CHAR(8)) ENGINE=rocksdb;
+SHOW TABLE STATUS LIKE 't1';
+Name	Engine	Version	Row_format	Rows	Avg_row_length	Data_length	Max_data_length	Index_length	Data_free	Auto_increment	Create_time	Update_time	Check_time	Collation	Checksum	Create_options	Comment
+t1	ROCKSDB	10	Fixed	1000	0	0	0	0	0	1	NULL	NULL	NULL	latin1_swedish_ci	NULL		
+INSERT INTO t1 (c) VALUES ('a'),('b'),('c');
+SHOW TABLE STATUS LIKE 't1';
+Name	Engine	Version	Row_format	Rows	Avg_row_length	Data_length	Max_data_length	Index_length	Data_free	Auto_increment	Create_time	Update_time	Check_time	Collation	Checksum	Create_options	Comment
+t1	ROCKSDB	10	Fixed	1000	0	0	0	0	0	4	NULL	NULL	NULL	latin1_swedish_ci	NULL		
+TRUNCATE TABLE t1;
+SHOW TABLE STATUS LIKE 't1';
+Name	Engine	Version	Row_format	Rows	Avg_row_length	Data_length	Max_data_length	Index_length	Data_free	Auto_increment	Create_time	Update_time	Check_time	Collation	Checksum	Create_options	Comment
+t1	ROCKSDB	10	Fixed	1000	0	0	0	0	0	1	NULL	NULL	NULL	latin1_swedish_ci	NULL		
+INSERT INTO t1 (c) VALUES ('d');
+SHOW TABLE STATUS LIKE 't1';
+Name	Engine	Version	Row_format	Rows	Avg_row_length	Data_length	Max_data_length	Index_length	Data_free	Auto_increment	Create_time	Update_time	Check_time	Collation	Checksum	Create_options	Comment
+t1	ROCKSDB	10	Fixed	1000	0	0	0	0	0	2	NULL	NULL	NULL	latin1_swedish_ci	NULL		
+SELECT a,c FROM t1;
+a	c
+1	d
+DROP TABLE t1;
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c');
+HANDLER t1 OPEN AS h1;
+ERROR HY000: Table storage engine for 'h1' doesn't have this option
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/truncate_table.test b/mysql-test/suite/rocksdb/truncate_table.test
new file mode 100644
index 0000000..b31f585
--- /dev/null
+++ b/mysql-test/suite/rocksdb/truncate_table.test
@@ -0,0 +1,68 @@
+# 
+# TRUNCATE TABLE
+#
+
+########################################
+# TODO:
+# A part of the test is disabled because
+# HANDLER is not supported. If it ever
+# changes, the test will complain about
+# NOT producing ER_ILLEGAL_HA
+########################################
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb;
+TRUNCATE TABLE t1;
+INSERT INTO t1 (a,b) VALUES (1,'a'), (2,'b'), (3,'c');
+TRUNCATE TABLE t1;
+SELECT a,b FROM t1;
+DROP TABLE t1;
+
+
+# Truncate resets auto-increment value on the table
+
+CREATE TABLE t1 (a INT KEY AUTO_INCREMENT, c CHAR(8)) ENGINE=rocksdb;
+
+#--replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 #
+SHOW TABLE STATUS LIKE 't1';
+
+INSERT INTO t1 (c) VALUES ('a'),('b'),('c');
+#--replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 #
+SHOW TABLE STATUS LIKE 't1';
+
+TRUNCATE TABLE t1;
+#--replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 #
+SHOW TABLE STATUS LIKE 't1';
+
+INSERT INTO t1 (c) VALUES ('d');
+#--replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 #
+SHOW TABLE STATUS LIKE 't1';
+
+--sorted_result
+SELECT a,c FROM t1;
+DROP TABLE t1;
+
+# Truncate closes handlers
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c');
+
+--error ER_ILLEGAL_HA
+HANDLER t1 OPEN AS h1;
+
+--disable_parsing
+
+HANDLER h1 READ FIRST;
+TRUNCATE TABLE t1;
+--error ER_UNKNOWN_TABLE
+HANDLER h1 READ NEXT;
+HANDLER t1 OPEN AS h2;
+HANDLER h2 READ FIRST;
+
+--enable_parsing
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/type_binary.inc b/mysql-test/suite/rocksdb/type_binary.inc
new file mode 100644
index 0000000..8e2b0e8
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_binary.inc
@@ -0,0 +1,45 @@
+#
+# BINARY column types
+#
+
+# $extra_col_options is set by a calling test
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+eval CREATE TABLE t1 (
+  b BINARY $extra_col_opts,
+  b0 BINARY(0) $extra_col_opts,
+  b1 BINARY(1) $extra_col_opts,
+  b20 BINARY(20) $extra_col_opts,
+  b255 BINARY(255) $extra_col_opts,
+  pk BINARY PRIMARY KEY
+) ENGINE=rocksdb;
+
+SHOW COLUMNS IN t1;
+
+# Valid values 
+
+INSERT INTO t1 VALUES ('','','','','','');
+INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.','a');
+
+--sorted_result
+SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255), HEX(pk) FROM t1 ORDER BY pk;
+
+# Invalid values
+
+INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256),'b');
+--error ER_DUP_ENTRY
+INSERT INTO t1 SELECT b255, b255, b255, b255, CONCAT('a',b255,b255), 'c' FROM t1;
+
+--sorted_result
+SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255), HEX(pk) FROM t1 ORDER BY pk;
+
+--error ER_TOO_BIG_FIELDLENGTH
+eval ALTER TABLE t1 ADD COLUMN b257 BINARY(257) $extra_col_opts;
+
+SHOW COLUMNS IN t1;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/type_binary.result b/mysql-test/suite/rocksdb/type_binary.result
new file mode 100644
index 0000000..bbdd6d2
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_binary.result
@@ -0,0 +1,48 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+b BINARY ,
+b0 BINARY(0) ,
+b1 BINARY(1) ,
+b20 BINARY(20) ,
+b255 BINARY(255) ,
+pk BINARY PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+b	binary(1)	YES		NULL	
+b0	binary(0)	YES		NULL	
+b1	binary(1)	YES		NULL	
+b20	binary(20)	YES		NULL	
+b255	binary(255)	YES		NULL	
+pk	binary(1)	NO	PRI	NULL	
+INSERT INTO t1 VALUES ('','','','','','');
+INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.','a');
+SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255), HEX(pk) FROM t1 ORDER BY pk;
+HEX(b)	HEX(b0)	HEX(b1)	HEX(b20)	HEX(b255)	HEX(pk)
+00		00	0000000000000000000000000000000000000000	000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000	00
+61		62	616263646566676869206B6C6D6E6F7071727374	4372656174696E6720616E2061727469636C6520666F7220746865204B6E6F776C65646765626173652069732073696D696C617220746F2061736B696E67207175657374696F6E732E2046697273742C206E6176696761746520746F207468652063617465676F727920776865726520796F75206665656C207468652061727469636C652073686F756C642062652E204F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C726561647920657869737420776869636820776F756C6420776F726B2E00000000000000000000000000000000000000000000000000000000000000	61
+INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256),'b');
+Warnings:
+Warning	1265	Data truncated for column 'b' at row 1
+Warning	1265	Data truncated for column 'b0' at row 1
+Warning	1265	Data truncated for column 'b1' at row 1
+Warning	1265	Data truncated for column 'b20' at row 1
+Warning	1265	Data truncated for column 'b255' at row 1
+INSERT INTO t1 SELECT b255, b255, b255, b255, CONCAT('a',b255,b255), 'c' FROM t1;
+ERROR 23000: Duplicate entry 'c' for key 'PRIMARY'
+SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255), HEX(pk) FROM t1 ORDER BY pk;
+HEX(b)	HEX(b0)	HEX(b1)	HEX(b20)	HEX(b255)	HEX(pk)
+00		00	0000000000000000000000000000000000000000	000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000	00
+61		61	6161616161616161616161616161616161616161	787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878	62
+61		62	616263646566676869206B6C6D6E6F7071727374	4372656174696E6720616E2061727469636C6520666F7220746865204B6E6F776C65646765626173652069732073696D696C617220746F2061736B696E67207175657374696F6E732E2046697273742C206E6176696761746520746F207468652063617465676F727920776865726520796F75206665656C207468652061727469636C652073686F756C642062652E204F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C726561647920657869737420776869636820776F756C6420776F726B2E00000000000000000000000000000000000000000000000000000000000000	61
+ALTER TABLE t1 ADD COLUMN b257 BINARY(257) ;
+ERROR 42000: Column length too big for column 'b257' (max = 255); use BLOB or TEXT instead
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+b	binary(1)	YES		NULL	
+b0	binary(0)	YES		NULL	
+b1	binary(1)	YES		NULL	
+b20	binary(20)	YES		NULL	
+b255	binary(255)	YES		NULL	
+pk	binary(1)	NO	PRI	NULL	
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/type_binary.test b/mysql-test/suite/rocksdb/type_binary.test
new file mode 100644
index 0000000..7fbb180
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_binary.test
@@ -0,0 +1,6 @@
+#
+# BINARY column types
+#
+
+--source type_binary.inc
+
diff --git a/mysql-test/suite/rocksdb/type_bit.inc b/mysql-test/suite/rocksdb/type_bit.inc
new file mode 100644
index 0000000..ba0c653
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_bit.inc
@@ -0,0 +1,53 @@
+#
+# BIT column type
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# Valid values
+
+eval CREATE TABLE t1 (
+  a BIT $extra_col_opts,
+  b BIT(20) $extra_col_opts,
+  c BIT(64) $extra_col_opts,
+  d BIT(1) $extra_col_opts,
+  PRIMARY KEY (c)
+) ENGINE=rocksdb;
+
+SHOW COLUMNS IN t1;
+
+ALTER TABLE t1 DROP COLUMN d;
+eval ALTER TABLE t1 ADD COLUMN d BIT(0) $extra_col_opts;
+SHOW COLUMNS IN t1;
+
+INSERT INTO t1 (a,b,c,d) VALUES (0,POW(2,20)-1,b'1111111111111111111111111111111111111111111111111111111111111111',1);
+SELECT BIN(a), HEX(b), c+0 FROM t1 WHERE d>0;
+
+INSERT INTO t1 (a,b,c,d) VALUES (1,0,-2,0);
+--sorted_result
+SELECT a+0, b+0, c+0 FROM t1 WHERE d<100;
+
+INSERT INTO t1 (a,b,c,d) VALUES (b'1', 'f', 0xFF, 0x0);
+--sorted_result
+SELECT a+0, b+0, c+0 FROM t1 WHERE d IN (0, 2);
+
+DELETE FROM t1;
+
+# Out of range values
+# (should produce warnings)
+
+INSERT INTO t1 (a,b,c,d) VALUES (0x10,0,0,1);
+SELECT a+0,b+0,c+0,d+0 FROM t1;
+
+INSERT INTO t1 (a,b,c,d) VALUES (0x01,0,0x10000000000000000,0);
+--sorted_result
+SELECT a+0,b+0,c+0,d+0 FROM t1;
+
+DROP TABLE t1;
+
+--error ER_TOO_BIG_DISPLAYWIDTH
+eval CREATE TABLE t1 (pk INT PRIMARY KEY, a BIT(65) $extra_col_opts) ENGINE=rocksdb;
+
+
diff --git a/mysql-test/suite/rocksdb/type_bit.result b/mysql-test/suite/rocksdb/type_bit.result
new file mode 100644
index 0000000..d385c0d
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_bit.result
@@ -0,0 +1,53 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+a BIT ,
+b BIT(20) ,
+c BIT(64) ,
+d BIT(1) ,
+PRIMARY KEY (c)
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+a	bit(1)	YES		NULL	
+b	bit(20)	YES		NULL	
+c	bit(64)	NO	PRI	b'0'	
+d	bit(1)	YES		NULL	
+ALTER TABLE t1 DROP COLUMN d;
+ALTER TABLE t1 ADD COLUMN d BIT(0) ;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+a	bit(1)	YES		NULL	
+b	bit(20)	YES		NULL	
+c	bit(64)	NO	PRI	b'0'	
+d	bit(1)	YES		NULL	
+INSERT INTO t1 (a,b,c,d) VALUES (0,POW(2,20)-1,b'1111111111111111111111111111111111111111111111111111111111111111',1);
+SELECT BIN(a), HEX(b), c+0 FROM t1 WHERE d>0;
+BIN(a)	HEX(b)	c+0
+0	FFFFF	18446744073709551615
+INSERT INTO t1 (a,b,c,d) VALUES (1,0,-2,0);
+SELECT a+0, b+0, c+0 FROM t1 WHERE d<100;
+a+0	b+0	c+0
+0	1048575	18446744073709551615
+1	0	18446744073709551614
+INSERT INTO t1 (a,b,c,d) VALUES (b'1', 'f', 0xFF, 0x0);
+SELECT a+0, b+0, c+0 FROM t1 WHERE d IN (0, 2);
+a+0	b+0	c+0
+1	0	18446744073709551614
+1	102	255
+DELETE FROM t1;
+INSERT INTO t1 (a,b,c,d) VALUES (0x10,0,0,1);
+Warnings:
+Warning	1264	Out of range value for column 'a' at row 1
+SELECT a+0,b+0,c+0,d+0 FROM t1;
+a+0	b+0	c+0	d+0
+1	0	0	1
+INSERT INTO t1 (a,b,c,d) VALUES (0x01,0,0x10000000000000000,0);
+Warnings:
+Warning	1264	Out of range value for column 'c' at row 1
+SELECT a+0,b+0,c+0,d+0 FROM t1;
+a+0	b+0	c+0	d+0
+1	0	0	1
+1	0	18446744073709551615	0
+DROP TABLE t1;
+CREATE TABLE t1 (pk INT PRIMARY KEY, a BIT(65) ) ENGINE=rocksdb;
+ERROR 42000: Display width out of range for column 'a' (max = 64)
diff --git a/mysql-test/suite/rocksdb/type_bit.test b/mysql-test/suite/rocksdb/type_bit.test
new file mode 100644
index 0000000..4247e40
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_bit.test
@@ -0,0 +1,6 @@
+#
+# BIT column type
+#
+
+--source type_bit.inc
+
diff --git a/mysql-test/suite/rocksdb/type_blob.inc b/mysql-test/suite/rocksdb/type_blob.inc
new file mode 100644
index 0000000..723b3ee
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_blob.inc
@@ -0,0 +1,49 @@
+#
+# BLOB column types
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+eval CREATE TABLE t1 (
+  pk INT AUTO_INCREMENT PRIMARY KEY,
+  b BLOB $extra_col_opts,
+  b0 BLOB(0) $extra_col_opts,
+  b1 BLOB(1) $extra_col_opts,
+  b300 BLOB(300) $extra_col_opts,
+  bm BLOB(65535) $extra_col_opts,
+  b70k BLOB(70000) $extra_col_opts,
+  b17m BLOB(17000000) $extra_col_opts,
+  t TINYBLOB $extra_col_opts,
+  m MEDIUMBLOB $extra_col_opts,
+  l LONGBLOB $extra_col_opts
+) ENGINE=rocksdb;
+
+SHOW COLUMNS IN t1;
+
+# Valid values 
+# (cannot get MAX for all columns due to max_allowed_packet limitations)
+
+INSERT INTO t1 (b,b0,b1,b300,bm,b70k,b17m,t,m,l) VALUES
+('','','','','','','','','',''),
+('a','b','c','d','e','f','g','h','i','j'),
+('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'),
+( REPEAT('a',65535), REPEAT('b',65535), REPEAT('c',255), REPEAT('d',65535), REPEAT('e',65535), REPEAT('f',1048576), HEX(REPEAT('g',1048576)), REPEAT('h',255), REPEAT('i',1048576), HEX(REPEAT('j',1048576)) );
+
+--sorted_result
+SELECT LENGTH(b), LENGTH(b0), LENGTH(b1), LENGTH(b300), LENGTH(bm), LENGTH(b70k), LENGTH(b17m), LENGTH(t), LENGTH(m), LENGTH(l) FROM t1;
+
+# Invalid values (produce warnings, except for mediumblob and longblob columns for which the values are within limits)
+
+INSERT INTO t1 (b,b0,b1,b300,bm,b70k,b17m,t,m,l) VALUES
+( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) );
+
+--sorted_result
+SELECT LENGTH(b), LENGTH(b0), LENGTH(b1), LENGTH(b300), LENGTH(bm), LENGTH(b70k), LENGTH(b17m), LENGTH(t), LENGTH(m), LENGTH(l) FROM t1;
+
+--error ER_TOO_BIG_DISPLAYWIDTH
+ALTER TABLE t1 ADD COLUMN bbb BLOB(4294967296);
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/type_blob.result b/mysql-test/suite/rocksdb/type_blob.result
new file mode 100644
index 0000000..e36c916
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_blob.result
@@ -0,0 +1,57 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+b BLOB ,
+b0 BLOB(0) ,
+b1 BLOB(1) ,
+b300 BLOB(300) ,
+bm BLOB(65535) ,
+b70k BLOB(70000) ,
+b17m BLOB(17000000) ,
+t TINYBLOB ,
+m MEDIUMBLOB ,
+l LONGBLOB 
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+b	blob	YES		NULL	
+b0	blob	YES		NULL	
+b1	tinyblob	YES		NULL	
+b300	blob	YES		NULL	
+bm	blob	YES		NULL	
+b70k	mediumblob	YES		NULL	
+b17m	longblob	YES		NULL	
+t	tinyblob	YES		NULL	
+m	mediumblob	YES		NULL	
+l	longblob	YES		NULL	
+INSERT INTO t1 (b,b0,b1,b300,bm,b70k,b17m,t,m,l) VALUES
+('','','','','','','','','',''),
+('a','b','c','d','e','f','g','h','i','j'),
+('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'),
+( REPEAT('a',65535), REPEAT('b',65535), REPEAT('c',255), REPEAT('d',65535), REPEAT('e',65535), REPEAT('f',1048576), HEX(REPEAT('g',1048576)), REPEAT('h',255), REPEAT('i',1048576), HEX(REPEAT('j',1048576)) );
+SELECT LENGTH(b), LENGTH(b0), LENGTH(b1), LENGTH(b300), LENGTH(bm), LENGTH(b70k), LENGTH(b17m), LENGTH(t), LENGTH(m), LENGTH(l) FROM t1;
+LENGTH(b)	LENGTH(b0)	LENGTH(b1)	LENGTH(b300)	LENGTH(bm)	LENGTH(b70k)	LENGTH(b17m)	LENGTH(t)	LENGTH(m)	LENGTH(l)
+0	0	0	0	0	0	0	0	0	0
+1	1	1	1	1	1	1	1	1	1
+5	5	5	5	5	5	5	5	5	6
+65535	65535	255	65535	65535	1048576	2097152	255	1048576	2097152
+INSERT INTO t1 (b,b0,b1,b300,bm,b70k,b17m,t,m,l) VALUES
+( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) );
+Warnings:
+Warning	1265	Data truncated for column 'b' at row 1
+Warning	1265	Data truncated for column 'b0' at row 1
+Warning	1265	Data truncated for column 'b1' at row 1
+Warning	1265	Data truncated for column 'b300' at row 1
+Warning	1265	Data truncated for column 'bm' at row 1
+Warning	1265	Data truncated for column 't' at row 1
+SELECT LENGTH(b), LENGTH(b0), LENGTH(b1), LENGTH(b300), LENGTH(bm), LENGTH(b70k), LENGTH(b17m), LENGTH(t), LENGTH(m), LENGTH(l) FROM t1;
+LENGTH(b)	LENGTH(b0)	LENGTH(b1)	LENGTH(b300)	LENGTH(bm)	LENGTH(b70k)	LENGTH(b17m)	LENGTH(t)	LENGTH(m)	LENGTH(l)
+0	0	0	0	0	0	0	0	0	0
+1	1	1	1	1	1	1	1	1	1
+5	5	5	5	5	5	5	5	5	6
+65535	65535	255	65535	65535	1048576	1048576	255	1048576	1048576
+65535	65535	255	65535	65535	1048576	2097152	255	1048576	2097152
+ALTER TABLE t1 ADD COLUMN bbb BLOB(4294967296);
+ERROR 42000: Display width out of range for column 'bbb' (max = 4294967295)
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/type_blob.test b/mysql-test/suite/rocksdb/type_blob.test
new file mode 100644
index 0000000..d642169
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_blob.test
@@ -0,0 +1,6 @@
+#
+# BLOB column types
+#
+
+--source type_blob.inc
+
diff --git a/mysql-test/suite/rocksdb/type_blob_indexes.result b/mysql-test/suite/rocksdb/type_blob_indexes.result
new file mode 100644
index 0000000..8e732e1
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_blob_indexes.result
@@ -0,0 +1,152 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (b BLOB <CUSTOM_COL_OPTIONS>,
+t TINYBLOB <CUSTOM_COL_OPTIONS>,
+m MEDIUMBLOB <CUSTOM_COL_OPTIONS>,
+l LONGBLOB <CUSTOM_COL_OPTIONS>,
+<CUSTOM_INDEX> b (b(32))
+) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
+SHOW INDEX IN t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
+t1	1	#	1	b	#	#	32	NULL	#	#		
+INSERT INTO t1 (b,t,m,l) VALUES
+('','','',''),
+('a','b','c','d'),
+('b','d','c','b'),
+('test1','test2','test3','test4'),
+(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)),
+(HEX('abcd'),HEX('def'),HEX('a'),HEX('abc')),
+('abc','def','ghi','jkl'),
+('test2','test3','test4','test5'),
+('test3','test4','test5','test6'),
+(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)),
+(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128));
+SELECT SUBSTRING(b,16) AS f FROM t1 WHERE b IN ('test1','test2') ORDER BY f;
+f
+
+
+SELECT SUBSTRING(b,16) AS f FROM t1 USE INDEX () WHERE b IN ('test1','test2') ORDER BY f;
+f
+
+
+DROP TABLE t1;
+CREATE TABLE t1 (b BLOB <CUSTOM_COL_OPTIONS>,
+t TINYBLOB <CUSTOM_COL_OPTIONS>,
+m MEDIUMBLOB <CUSTOM_COL_OPTIONS>,
+l LONGBLOB <CUSTOM_COL_OPTIONS>,
+PRIMARY KEY b (b(32))
+) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
+SHOW INDEX IN t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
+t1	0	PRIMARY	1	b	#	#	32	NULL	#	#		
+INSERT INTO t1 (b,t,m,l) VALUES
+('','','',''),
+('a','b','c','d'),
+('b','d','c','b'),
+('test1','test2','test3','test4'),
+(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)),
+(HEX('abcd'),HEX('def'),HEX('a'),HEX('abc')),
+('abc','def','ghi','jkl'),
+('test2','test3','test4','test5'),
+('test3','test4','test5','test6'),
+(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)),
+(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128));
+EXPLAIN SELECT SUBSTRING(b,16) AS f FROM t1 WHERE b IN ('test1','test2') ORDER BY f;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+#	#	#	#	#	PRIMARY	#	#	#	#
+SELECT SUBSTRING(b,16) AS f FROM t1 WHERE b IN ('test1','test2') ORDER BY f;
+f
+
+
+EXPLAIN SELECT SUBSTRING(b,16) AS f FROM t1 USE INDEX () WHERE b IN ('test1','test2') ORDER BY f;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+#	#	#	#	#	NULL	#	#	#	#
+SELECT SUBSTRING(b,16) AS f FROM t1 USE INDEX () WHERE b IN ('test1','test2') ORDER BY f;
+f
+
+
+DROP TABLE t1;
+CREATE TABLE t1 (b BLOB <CUSTOM_COL_OPTIONS>,
+t TINYBLOB <CUSTOM_COL_OPTIONS>,
+m MEDIUMBLOB <CUSTOM_COL_OPTIONS>,
+l LONGBLOB <CUSTOM_COL_OPTIONS>,
+UNIQUE INDEX l_t (l(256),t(64))
+) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
+SHOW INDEX IN t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
+t1	0	l_t	1	l	#	#	256	NULL	#	#		
+t1	0	l_t	2	t	#	#	64	NULL	#	#		
+INSERT INTO t1 (b,t,m,l) VALUES
+('','','',''),
+('a','b','c','d'),
+('b','d','c','b'),
+('test1','test2','test3','test4'),
+(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)),
+(HEX('abcd'),HEX('def'),HEX('a'),HEX('abc')),
+('abc','def','ghi','jkl'),
+('test2','test3','test4','test5'),
+('test3','test4','test5','test6'),
+(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)),
+(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128));
+EXPLAIN SELECT SUBSTRING(t,64), SUBSTRING(l,256) FROM t1 WHERE t!=l AND l NOT IN ('test1') ORDER BY t, l DESC;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+#	#	#	#	l_t	#	#	#	#	#
+SELECT SUBSTRING(t,64), SUBSTRING(l,256) FROM t1 WHERE t!=l AND l NOT IN ('test1') ORDER BY t, l DESC;
+SUBSTRING(t,64)	SUBSTRING(l,256)
+	
+	
+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb	
+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb	
+	
+	
+fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff	
+	
+	
+	
+EXPLAIN SELECT SUBSTRING(t,64), SUBSTRING(l,256) FROM t1 FORCE INDEX (l_t) WHERE t!=l AND l NOT IN ('test1') ORDER BY t, l DESC;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+#	#	#	#	l_t	#	#	#	#	#
+SELECT SUBSTRING(t,64), SUBSTRING(l,256) FROM t1 FORCE INDEX (l_t) WHERE t!=l AND l NOT IN ('test1') ORDER BY t, l DESC;
+SUBSTRING(t,64)	SUBSTRING(l,256)
+	
+	
+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb	
+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb	
+	
+	
+fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff	
+	
+	
+	
+DROP TABLE t1;
+CREATE TABLE t1 (b BLOB <CUSTOM_COL_OPTIONS>,
+t TINYBLOB <CUSTOM_COL_OPTIONS>,
+m MEDIUMBLOB <CUSTOM_COL_OPTIONS>,
+l LONGBLOB <CUSTOM_COL_OPTIONS>,
+INDEX (m(128))
+) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
+SHOW INDEX IN t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
+t1	1	m	1	m	#	#	128	NULL	#	#		
+INSERT INTO t1 (b,t,m,l) VALUES
+('','','',''),
+('a','b','c','d'),
+('b','d','c','b'),
+('test1','test2','test3','test4'),
+(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)),
+(HEX('abcd'),HEX('def'),HEX('a'),HEX('abc')),
+('abc','def','ghi','jkl'),
+('test2','test3','test4','test5'),
+('test3','test4','test5','test6'),
+(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)),
+(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128));
+EXPLAIN SELECT SUBSTRING(m,128) AS f FROM t1 WHERE m = 'test1' ORDER BY f DESC;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+#	#	#	#	#	m	#	#	#	#
+SELECT SUBSTRING(m,128) AS f FROM t1 WHERE m = 'test1' ORDER BY f DESC;
+f
+EXPLAIN SELECT SUBSTRING(m,128) AS f FROM t1 IGNORE INDEX FOR ORDER BY (m) WHERE m = 'test1' ORDER BY f DESC;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+#	#	#	#	#	m	#	#	#	#
+SELECT SUBSTRING(m,128) AS f FROM t1 IGNORE INDEX FOR ORDER BY (m) WHERE m = 'test1' ORDER BY f DESC;
+f
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/type_blob_indexes.test b/mysql-test/suite/rocksdb/type_blob_indexes.test
new file mode 100644
index 0000000..0674bab
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_blob_indexes.test
@@ -0,0 +1,109 @@
+#
+# BLOB columns with indexes
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (
+  b BLOB,
+  t TINYBLOB,
+  m MEDIUMBLOB,
+  l LONGBLOB,
+  PRIMARY KEY b (b(32))
+) ENGINE=rocksdb;
+
+SHOW INDEX IN t1;
+
+INSERT INTO t1 (b,t,m,l) VALUES
+('','','',''),
+('a','b','c','d'),
+('b','d','c','b'),
+('test1','test2','test3','test4'),
+(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)),
+(HEX('abcd'),HEX('def'),HEX('a'),HEX('abc')),
+('abc','def','ghi','jkl'),
+('test2','test3','test4','test5'),
+('test3','test4','test5','test6'),
+(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)),
+(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128));
+
+--replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 #
+EXPLAIN SELECT SUBSTRING(b,16) AS f FROM t1 WHERE b IN ('test1','test2') ORDER BY f;
+SELECT SUBSTRING(b,16) AS f FROM t1 WHERE b IN ('test1','test2') ORDER BY f;
+
+--replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 #
+EXPLAIN SELECT SUBSTRING(b,16) AS f FROM t1 USE INDEX () WHERE b IN ('test1','test2') ORDER BY f;
+SELECT SUBSTRING(b,16) AS f FROM t1 USE INDEX () WHERE b IN ('test1','test2') ORDER BY f;
+
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (
+  b BLOB,
+  t TINYBLOB,
+  m MEDIUMBLOB,
+  l LONGBLOB,
+  pk INT AUTO_INCREMENT PRIMARY KEY,
+  UNIQUE INDEX l_t (l(256),t(64))
+) ENGINE=rocksdb;
+
+--replace_column 6 # 7 # 10 # 11 #
+SHOW INDEX IN t1;
+
+INSERT INTO t1 (b,t,m,l) VALUES
+('','','',''),
+('a','b','c','d'),
+('b','d','c','b'),
+('test1','test2','test3','test4'),
+(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)),
+(HEX('abcd'),HEX('def'),HEX('a'),HEX('abc')),
+('abc','def','ghi','jkl'),
+('test2','test3','test4','test5'),
+('test3','test4','test5','test6'),
+(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)),
+(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128));
+
+# Here we are getting possible key l_t, but not the final key
+EXPLAIN SELECT SUBSTRING(t,64), SUBSTRING(l,256) FROM t1 WHERE t!=l AND l NOT IN ('test1') ORDER BY t, l DESC;
+SELECT SUBSTRING(t,64), SUBSTRING(l,256) FROM t1 WHERE t!=l AND l NOT IN ('test1') ORDER BY t, l DESC;
+
+EXPLAIN SELECT SUBSTRING(t,64), SUBSTRING(l,256) FROM t1 FORCE INDEX (l_t) WHERE t!=l AND l NOT IN ('test1') ORDER BY t, l DESC;
+SELECT SUBSTRING(t,64), SUBSTRING(l,256) FROM t1 FORCE INDEX (l_t) WHERE t!=l AND l NOT IN ('test1') ORDER BY t, l DESC;
+
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (
+  b BLOB,
+  t TINYBLOB,
+  m MEDIUMBLOB,
+  l LONGBLOB,
+  pk INT AUTO_INCREMENT PRIMARY KEY,
+  INDEX (m(128))
+) ENGONE=rocksdb;
+
+SHOW INDEX IN t1;
+
+INSERT INTO t1 (b,t,m,l) VALUES
+('','','',''),
+('a','b','c','d'),
+('b','d','c','b'),
+('test1','test2','test3','test4'),
+(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)),
+(HEX('abcd'),HEX('def'),HEX('a'),HEX('abc')),
+('abc','def','ghi','jkl'),
+('test2','test3','test4','test5'),
+('test3','test4','test5','test6'),
+(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)),
+(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128));
+
+EXPLAIN SELECT SUBSTRING(m,128) AS f FROM t1 WHERE m = 'test1' ORDER BY f DESC;
+SELECT SUBSTRING(m,128) AS f FROM t1 WHERE m = 'test1' ORDER BY f DESC;
+
+EXPLAIN SELECT SUBSTRING(m,128) AS f FROM t1 IGNORE INDEX FOR ORDER BY (m) WHERE m = 'test1' ORDER BY f DESC;
+SELECT SUBSTRING(m,128) AS f FROM t1 IGNORE INDEX FOR ORDER BY (m) WHERE m = 'test1' ORDER BY f DESC;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/type_bool.inc b/mysql-test/suite/rocksdb/type_bool.inc
new file mode 100644
index 0000000..cddc082
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_bool.inc
@@ -0,0 +1,64 @@
+#
+# BOOLEAN column type
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+eval CREATE TABLE t1 (
+  pk INT AUTO_INCREMENT PRIMARY KEY,
+  b1 BOOL $extra_col_opts,
+  b2 BOOLEAN $extra_col_opts
+) ENGINE=rocksdb;
+
+SHOW COLUMNS IN t1;
+
+# Valid values 
+
+INSERT INTO t1 (b1,b2) VALUES (1,TRUE);
+SELECT b1,b2 FROM t1;
+
+INSERT INTO t1 (b1,b2) VALUES (FALSE,0);
+--sorted_result
+SELECT b1,b2 FROM t1;
+
+INSERT INTO t1 (b1,b2) VALUES (2,3);
+--sorted_result
+SELECT b1,b2 FROM t1;
+
+INSERT INTO t1 (b1,b2) VALUES (-1,-2);
+--sorted_result
+SELECT b1,b2 FROM t1;
+
+--sorted_result
+SELECT IF(b1,'true','false') AS a, IF(b2,'true','false') AS b FROM t1;
+
+--sorted_result
+SELECT b1,b2 FROM t1 WHERE b1 = TRUE;
+
+--sorted_result
+SELECT b1,b2 FROM t1 WHERE b2 = FALSE;
+
+# Invalid values
+
+INSERT INTO t1 (b1,b2) VALUES ('a','b');
+--sorted_result
+SELECT b1,b2 FROM t1;
+
+INSERT INTO t1 (b1,b2) VALUES (128,-129);
+--sorted_result
+SELECT b1,b2 FROM t1;
+
+# This is why we don't have zerofill and unsigned tests
+# for boolean columns:
+--error ER_PARSE_ERROR
+eval ALTER TABLE t1 ADD COLUMN b3 BOOLEAN UNSIGNED $extra_col_opts;
+
+--error ER_PARSE_ERROR
+eval ALTER TABLE ADD COLUMN b3 BOOL ZEROFILL $extra_col_opts;
+
+DROP TABLE t1;
+
+
+
diff --git a/mysql-test/suite/rocksdb/type_bool.result b/mysql-test/suite/rocksdb/type_bool.result
new file mode 100644
index 0000000..dd9dc6d
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_bool.result
@@ -0,0 +1,73 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+b1 BOOL ,
+b2 BOOLEAN 
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+b1	tinyint(1)	YES		NULL	
+b2	tinyint(1)	YES		NULL	
+INSERT INTO t1 (b1,b2) VALUES (1,TRUE);
+SELECT b1,b2 FROM t1;
+b1	b2
+1	1
+INSERT INTO t1 (b1,b2) VALUES (FALSE,0);
+SELECT b1,b2 FROM t1;
+b1	b2
+0	0
+1	1
+INSERT INTO t1 (b1,b2) VALUES (2,3);
+SELECT b1,b2 FROM t1;
+b1	b2
+0	0
+1	1
+2	3
+INSERT INTO t1 (b1,b2) VALUES (-1,-2);
+SELECT b1,b2 FROM t1;
+b1	b2
+-1	-2
+0	0
+1	1
+2	3
+SELECT IF(b1,'true','false') AS a, IF(b2,'true','false') AS b FROM t1;
+a	b
+false	false
+true	true
+true	true
+true	true
+SELECT b1,b2 FROM t1 WHERE b1 = TRUE;
+b1	b2
+1	1
+SELECT b1,b2 FROM t1 WHERE b2 = FALSE;
+b1	b2
+0	0
+INSERT INTO t1 (b1,b2) VALUES ('a','b');
+Warnings:
+Warning	1366	Incorrect integer value: 'a' for column 'b1' at row 1
+Warning	1366	Incorrect integer value: 'b' for column 'b2' at row 1
+SELECT b1,b2 FROM t1;
+b1	b2
+-1	-2
+0	0
+0	0
+1	1
+2	3
+INSERT INTO t1 (b1,b2) VALUES (128,-129);
+Warnings:
+Warning	1264	Out of range value for column 'b1' at row 1
+Warning	1264	Out of range value for column 'b2' at row 1
+SELECT b1,b2 FROM t1;
+b1	b2
+-1	-2
+0	0
+0	0
+1	1
+127	-128
+2	3
+ALTER TABLE t1 ADD COLUMN b3 BOOLEAN UNSIGNED ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNSIGNED' at line 1
+ALTER TABLE ADD COLUMN b3 BOOL ZEROFILL ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ADD COLUMN b3 BOOL ZEROFILL' at line 1
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/type_bool.test b/mysql-test/suite/rocksdb/type_bool.test
new file mode 100644
index 0000000..66611e9
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_bool.test
@@ -0,0 +1,6 @@
+#
+# BOOLEAN column type
+#
+
+--source type_bool.inc
+
diff --git a/mysql-test/suite/rocksdb/type_char.inc b/mysql-test/suite/rocksdb/type_char.inc
new file mode 100644
index 0000000..d770dc6
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_char.inc
@@ -0,0 +1,45 @@
+#
+# CHAR column types
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+eval CREATE TABLE t1 (
+  c CHAR $extra_col_opts,
+  c0 CHAR(0) $extra_col_opts,
+  c1 CHAR(1) $extra_col_opts,
+  c20 CHAR(20) $extra_col_opts,
+  c255 CHAR(255) $extra_col_opts,
+  PRIMARY KEY (c255)
+) ENGINE=rocksdb;
+
+SHOW COLUMNS IN t1;
+
+# Valid values 
+
+INSERT INTO t1 (c,c0,c1,c20,c255) VALUES ('','','','','');
+INSERT INTO t1 (c,c0,c1,c20,c255) VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.');
+
+--sorted_result
+SELECT c,c0,c1,c20,c255 FROM t1;
+
+# Invalid values
+
+INSERT INTO t1 (c,c0,c1,c20,c255) VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256));
+INSERT INTO t1 (c,c0,c1,c20,c255) SELECT c255, c255, c255, c255, CONCAT('a',c255,c1) FROM t1;
+
+--sorted_result
+SELECT c,c0,c1,c20,c255 FROM t1;
+
+--sorted_result
+SELECT DISTINCT c20, REPEAT('a',LENGTH(c20)), COUNT(*) FROM t1 GROUP BY c1, c20;
+
+--error ER_TOO_BIG_FIELDLENGTH
+eval ALTER TABLE t1 ADD COLUMN c257 CHAR(257) $extra_col_opts;
+
+DROP TABLE t1;
+
+
+
diff --git a/mysql-test/suite/rocksdb/type_char.result b/mysql-test/suite/rocksdb/type_char.result
new file mode 100644
index 0000000..39a71d5
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_char.result
@@ -0,0 +1,58 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c CHAR ,
+c0 CHAR(0) ,
+c1 CHAR(1) ,
+c20 CHAR(20) ,
+c255 CHAR(255) ,
+PRIMARY KEY (c255)
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+c	char(1)	YES		NULL	
+c0	char(0)	YES		NULL	
+c1	char(1)	YES		NULL	
+c20	char(20)	YES		NULL	
+c255	char(255)	NO	PRI		
+INSERT INTO t1 (c,c0,c1,c20,c255) VALUES ('','','','','');
+INSERT INTO t1 (c,c0,c1,c20,c255) VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.');
+SELECT c,c0,c1,c20,c255 FROM t1;
+c	c0	c1	c20	c255
+				
+a		b	abcdefghi klmnopqrst	Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work.
+INSERT INTO t1 (c,c0,c1,c20,c255) VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256));
+Warnings:
+Warning	1265	Data truncated for column 'c' at row 1
+Warning	1265	Data truncated for column 'c0' at row 1
+Warning	1265	Data truncated for column 'c1' at row 1
+Warning	1265	Data truncated for column 'c20' at row 1
+Warning	1265	Data truncated for column 'c255' at row 1
+INSERT INTO t1 (c,c0,c1,c20,c255) SELECT c255, c255, c255, c255, CONCAT('a',c255,c1) FROM t1;
+Warnings:
+Warning	1265	Data truncated for column 'c' at row 5
+Warning	1265	Data truncated for column 'c0' at row 5
+Warning	1265	Data truncated for column 'c1' at row 5
+Warning	1265	Data truncated for column 'c20' at row 5
+Warning	1265	Data truncated for column 'c' at row 6
+Warning	1265	Data truncated for column 'c0' at row 6
+Warning	1265	Data truncated for column 'c1' at row 6
+Warning	1265	Data truncated for column 'c20' at row 6
+Warning	1265	Data truncated for column 'c255' at row 6
+SELECT c,c0,c1,c20,c255 FROM t1;
+c	c0	c1	c20	c255
+				
+				a
+C		C	Creating an article	aCreating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work.b
+a		a	aaaaaaaaaaaaaaaaaaaa	xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+a		b	abcdefghi klmnopqrst	Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work.
+x		x	xxxxxxxxxxxxxxxxxxxx	axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+SELECT DISTINCT c20, REPEAT('a',LENGTH(c20)), COUNT(*) FROM t1 GROUP BY c1, c20;
+c20	REPEAT('a',LENGTH(c20))	COUNT(*)
+		2
+Creating an article	aaaaaaaaaaaaaaaaaaa	1
+aaaaaaaaaaaaaaaaaaaa	aaaaaaaaaaaaaaaaaaaa	1
+abcdefghi klmnopqrst	aaaaaaaaaaaaaaaaaaaa	1
+xxxxxxxxxxxxxxxxxxxx	aaaaaaaaaaaaaaaaaaaa	1
+ALTER TABLE t1 ADD COLUMN c257 CHAR(257) ;
+ERROR 42000: Column length too big for column 'c257' (max = 255); use BLOB or TEXT instead
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/type_char.test b/mysql-test/suite/rocksdb/type_char.test
new file mode 100644
index 0000000..f67f6b0
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_char.test
@@ -0,0 +1,6 @@
+#
+# CHAR column types
+#
+
+--source type_char.inc
+
diff --git a/mysql-test/suite/rocksdb/type_date_time.inc b/mysql-test/suite/rocksdb/type_date_time.inc
new file mode 100644
index 0000000..69d1154
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_date_time.inc
@@ -0,0 +1,45 @@
+#
+# Date and time column types
+# (DATE, DATETIME, TIMESTAMP, TIME, YEAR)
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+eval CREATE TABLE t1 (
+  d DATE $extra_col_opts,
+  dt DATETIME $extra_col_opts,
+  ts TIMESTAMP $extra_col_opts,
+  t TIME $extra_col_opts,
+  y YEAR $extra_col_opts,
+  y4 YEAR(4) $extra_col_opts,
+  y2 YEAR(2) $extra_col_opts,
+  pk DATETIME PRIMARY KEY
+) ENGINE=rocksdb;
+
+SHOW COLUMNS IN t1;
+
+SET @tm = '2012-04-09 05:27:00';
+
+# Valid values 
+# '1970-01-01 00:00:01'
+INSERT INTO t1 (d,dt,ts,t,y,y4,y2,pk) VALUES
+('1000-01-01', '1000-01-01 00:00:00', FROM_UNIXTIME(1), '-838:59:59', '1901', '1901', '00','2012-12-12 12:12:12'),
+('9999-12-31', '9999-12-31 23:59:59', FROM_UNIXTIME(2147483647), '838:59:59', '2155', '2155', '99','2012-12-12 12:12:13'),
+('0000-00-00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:00:00', '0', '0', '0','2012-12-12 12:12:14'),
+(DATE(@tm), at tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm),YEAR(@tm),YEAR(@tm),'2012-12-12 12:12:15'); 
+
+--sorted_result
+SELECT d,dt,ts,t,y,y4,y2 FROM t1;
+
+# Invalid values
+
+INSERT INTO t1 (d,dt,ts,t,y,y4,y2,pk) VALUES
+('999-13-32', '999-11-31 00:00:00', '0', '-839:00:00', '1900', '1900', '-1','2012-12-12 12:12:16');
+
+SELECT d,dt,ts,t,y,y4,y2 FROM t1;
+
+DROP TABLE t1;
+
+
diff --git a/mysql-test/suite/rocksdb/type_date_time.result b/mysql-test/suite/rocksdb/type_date_time.result
new file mode 100644
index 0000000..1a5ec57
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_date_time.result
@@ -0,0 +1,53 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+d DATE ,
+dt DATETIME ,
+ts TIMESTAMP ,
+t TIME ,
+y YEAR ,
+y4 YEAR(4) ,
+y2 YEAR(2) ,
+pk DATETIME PRIMARY KEY
+) ENGINE=rocksdb;
+Warnings:
+Warning	1818	YEAR(2) column type is deprecated. Creating YEAR(4) column instead.
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+d	date	YES		NULL	
+dt	datetime	YES		NULL	
+ts	timestamp	YES		NULL	
+t	time	YES		NULL	
+y	year(4)	YES		NULL	
+y4	year(4)	YES		NULL	
+y2	year(4)	YES		NULL	
+pk	datetime	NO	PRI	NULL	
+SET @tm = '2012-04-09 05:27:00';
+INSERT INTO t1 (d,dt,ts,t,y,y4,y2,pk) VALUES
+('1000-01-01', '1000-01-01 00:00:00', FROM_UNIXTIME(1), '-838:59:59', '1901', '1901', '00','2012-12-12 12:12:12'),
+('9999-12-31', '9999-12-31 23:59:59', FROM_UNIXTIME(2147483647), '838:59:59', '2155', '2155', '99','2012-12-12 12:12:13'),
+('0000-00-00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:00:00', '0', '0', '0','2012-12-12 12:12:14'),
+(DATE(@tm), at tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm),YEAR(@tm),YEAR(@tm),'2012-12-12 12:12:15');
+SELECT d,dt,ts,t,y,y4,y2 FROM t1;
+d	dt	ts	t	y	y4	y2
+0000-00-00	0000-00-00 00:00:00	0000-00-00 00:00:00	00:00:00	2000	2000	2000
+1000-01-01	1000-01-01 00:00:00	1970-01-01 03:00:01	-838:59:59	1901	1901	2000
+2012-04-09	2012-04-09 05:27:00	2012-04-09 05:27:00	05:27:00	2012	2012	2012
+9999-12-31	9999-12-31 23:59:59	2038-01-19 06:14:07	838:59:59	2155	2155	1999
+INSERT INTO t1 (d,dt,ts,t,y,y4,y2,pk) VALUES
+('999-13-32', '999-11-31 00:00:00', '0', '-839:00:00', '1900', '1900', '-1','2012-12-12 12:12:16');
+Warnings:
+Warning	1265	Data truncated for column 'd' at row 1
+Warning	1264	Out of range value for column 'dt' at row 1
+Warning	1264	Out of range value for column 'ts' at row 1
+Warning	1264	Out of range value for column 't' at row 1
+Warning	1264	Out of range value for column 'y' at row 1
+Warning	1264	Out of range value for column 'y4' at row 1
+Warning	1264	Out of range value for column 'y2' at row 1
+SELECT d,dt,ts,t,y,y4,y2 FROM t1;
+d	dt	ts	t	y	y4	y2
+1000-01-01	1000-01-01 00:00:00	1970-01-01 03:00:01	-838:59:59	1901	1901	2000
+9999-12-31	9999-12-31 23:59:59	2038-01-19 06:14:07	838:59:59	2155	2155	1999
+0000-00-00	0000-00-00 00:00:00	0000-00-00 00:00:00	00:00:00	2000	2000	2000
+2012-04-09	2012-04-09 05:27:00	2012-04-09 05:27:00	05:27:00	2012	2012	2012
+0000-00-00	0000-00-00 00:00:00	0000-00-00 00:00:00	-838:59:59	0000	0000	0000
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/type_date_time.test b/mysql-test/suite/rocksdb/type_date_time.test
new file mode 100644
index 0000000..0ca9e6b
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_date_time.test
@@ -0,0 +1,7 @@
+#
+# Date and time column types
+# (DATE, DATETIME, TIMESTAMP, TIME, YEAR)
+#
+
+--source type_date_time.inc
+
diff --git a/mysql-test/suite/rocksdb/type_enum.inc b/mysql-test/suite/rocksdb/type_enum.inc
new file mode 100644
index 0000000..8184f62
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_enum.inc
@@ -0,0 +1,50 @@
+#
+# ENUM column type
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# Valid values.
+# We cannot test the maximum of 65,536 here,
+# because mysqltest has the standard limit of MAX_QUERY=256K;
+# but we can at least try 257
+
+eval CREATE TABLE t1 (
+  a ENUM('') $extra_col_opts,
+  b ENUM('test1','test2','test3','test4','test5') $extra_col_opts,
+  c ENUM('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',' ','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','
 5o','5p'
 ,'5q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75') $extra_col_opts,
+  PRIMARY KEY (b)
+) ENGINE=rocksdb;
+
+SHOW COLUMNS IN t1;
+
+INSERT INTO t1 (a,b,c) VALUES ('','test2','4'),('',5,2);
+SELECT a,b,c FROM t1;
+
+# Out of range values 
+# (should produce warnings)
+
+INSERT INTO t1 (a,b,c) VALUES (0,'test6',-1);
+--sorted_result
+SELECT a,b,c FROM t1;
+
+# Non-unique values in enum
+# (should produce a warning)
+eval ALTER TABLE t1 ADD COLUMN e ENUM('a','A') $extra_col_opts;
+SHOW COLUMNS IN t1;
+
+INSERT INTO t1 (a,b,c,e) VALUES ('','test3','75','A');
+--sorted_result
+SELECT a,b,c,e FROM t1;
+
+# Simple comparison
+
+--sorted_result
+SELECT a,b,c,e FROM t1 WHERE b='test2' OR a != '';
+
+DROP TABLE t1;
+
+
+
diff --git a/mysql-test/suite/rocksdb/type_enum.result b/mysql-test/suite/rocksdb/type_enum.result
new file mode 100644
index 0000000..009b342
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_enum.result
@@ -0,0 +1,47 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+a ENUM('') ,
+b ENUM('test1','test2','test3','test4','test5') ,
+c ENUM('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',' ','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o
 ','5p','
 5q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75') ,
+PRIMARY KEY (b)
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+a	enum('')	YES		NULL	
+b	enum('test1','test2','test3','test4','test5')	NO	PRI	test1	
+c	enum('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o'
 ,'5p','5
 q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75')	YES		NULL	
+INSERT INTO t1 (a,b,c) VALUES ('','test2','4'),('',5,2);
+SELECT a,b,c FROM t1;
+a	b	c
+	test2	4
+	test5	2
+INSERT INTO t1 (a,b,c) VALUES (0,'test6',-1);
+Warnings:
+Warning	1265	Data truncated for column 'a' at row 1
+Warning	1265	Data truncated for column 'b' at row 1
+Warning	1265	Data truncated for column 'c' at row 1
+SELECT a,b,c FROM t1;
+a	b	c
+		
+	test2	4
+	test5	2
+ALTER TABLE t1 ADD COLUMN e ENUM('a','A') ;
+Warnings:
+Note	1291	Column 'e' has duplicated value 'a' in ENUM
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+a	enum('')	YES		NULL	
+b	enum('test1','test2','test3','test4','test5')	NO	PRI	test1	
+c	enum('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o'
 ,'5p','5
 q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75')	YES		NULL	
+e	enum('a','A')	YES		NULL	
+INSERT INTO t1 (a,b,c,e) VALUES ('','test3','75','A');
+SELECT a,b,c,e FROM t1;
+a	b	c	e
+			NULL
+	test2	4	NULL
+	test3	75	a
+	test5	2	NULL
+SELECT a,b,c,e FROM t1 WHERE b='test2' OR a != '';
+a	b	c	e
+	test2	4	NULL
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/type_enum.test b/mysql-test/suite/rocksdb/type_enum.test
new file mode 100644
index 0000000..a527195
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_enum.test
@@ -0,0 +1,6 @@
+#
+# ENUM column type
+#
+
+--source type_enum.inc
+
diff --git a/mysql-test/suite/rocksdb/type_fixed.inc b/mysql-test/suite/rocksdb/type_fixed.inc
new file mode 100644
index 0000000..424f7c4
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_fixed.inc
@@ -0,0 +1,85 @@
+#
+# Fixed point types
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+eval CREATE TABLE t1 (
+  d DECIMAL $extra_col_opts,
+  d0 DECIMAL(0) $extra_col_opts,
+  d1_1 DECIMAL(1,1) $extra_col_opts,
+  d10_2 DECIMAL(10,2) $extra_col_opts,
+  d60_10 DECIMAL(60,10) $extra_col_opts,
+  n NUMERIC $extra_col_opts,
+  n0_0 NUMERIC(0,0) $extra_col_opts,
+  n1 NUMERIC(1) $extra_col_opts,
+  n20_4 NUMERIC(20,4) $extra_col_opts,
+  n65_4 NUMERIC(65,4) $extra_col_opts,
+  pk NUMERIC $extra_col_opts PRIMARY KEY
+) ENGINE=rocksdb;
+
+SHOW COLUMNS IN t1;
+
+# Always valid values 
+
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807,1);
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (0,0,0,0,0,0,0,0,0,0,2);
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999,3);
+
+--sorted_result
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
+
+# Values which can be valid or not, 
+# depending on whether columns are SIGNED or UNSIGNED
+# (if not valid should produce warnings)
+
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807,4);
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999,5);
+
+--sorted_result
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
+
+--sorted_result
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100;
+
+# Invalid values
+
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (
+  9999999999999999999999999999999999999999999999999999999999999.9999,
+  9999999999999999999999999999999999999999999999999999999999999.9999,
+  9999999999999999999999999999999999999999999999999999999999999.9999,
+  9999999999999999999999999999999999999999999999999999999999999.9999,
+  9999999999999999999999999999999999999999999999999999999999999.9999,
+  9999999999999999999999999999999999999999999999999999999999999.9999,
+  9999999999999999999999999999999999999999999999999999999999999.9999,
+  9999999999999999999999999999999999999999999999999999999999999.9999,
+  9999999999999999999999999999999999999999999999999999999999999.9999,
+  9999999999999999999999999999999999999999999999999999999999999.9999,
+  6
+);
+
+--sorted_result
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
+
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999,7);
+--sorted_result
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
+
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111,8);
+--sorted_result
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
+
+--error ER_TOO_BIG_PRECISION
+eval ALTER TABLE t1 ADD COLUMN n66 NUMERIC(66) $extra_col_opts;
+
+--error ER_TOO_BIG_PRECISION
+eval ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(66,6) $extra_col_opts;
+
+--error ER_TOO_BIG_SCALE
+eval ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(66,66) $extra_col_opts;
+
+DROP TABLE t1;
+
+
diff --git a/mysql-test/suite/rocksdb/type_fixed.result b/mysql-test/suite/rocksdb/type_fixed.result
new file mode 100644
index 0000000..45fd402
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_fixed.result
@@ -0,0 +1,131 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+d DECIMAL ,
+d0 DECIMAL(0) ,
+d1_1 DECIMAL(1,1) ,
+d10_2 DECIMAL(10,2) ,
+d60_10 DECIMAL(60,10) ,
+n NUMERIC ,
+n0_0 NUMERIC(0,0) ,
+n1 NUMERIC(1) ,
+n20_4 NUMERIC(20,4) ,
+n65_4 NUMERIC(65,4) ,
+pk NUMERIC  PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+d	decimal(10,0)	YES		NULL	
+d0	decimal(10,0)	YES		NULL	
+d1_1	decimal(1,1)	YES		NULL	
+d10_2	decimal(10,2)	YES		NULL	
+d60_10	decimal(60,10)	YES		NULL	
+n	decimal(10,0)	YES		NULL	
+n0_0	decimal(10,0)	YES		NULL	
+n1	decimal(1,0)	YES		NULL	
+n20_4	decimal(20,4)	YES		NULL	
+n65_4	decimal(65,4)	YES		NULL	
+pk	decimal(10,0)	NO	PRI	NULL	
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807,1);
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (0,0,0,0,0,0,0,0,0,0,2);
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999,3);
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
+d	d0	d1_1	d10_2	d60_10	n	n0_0	n1	n20_4	n65_4
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+100	123456	0.3	40000.25	123456789123456789.1000100000	1024	7000	8	999999.9000	9223372036854775807.0000
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807,4);
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999,5);
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
+d	d0	d1_1	d10_2	d60_10	n	n0_0	n1	n20_4	n65_4
+-100	-123456	-0.3	-40000.25	-123456789123456789.1000100000	-1024	-7000	-8	-999999.9000	-9223372036854775807.0000
+-9999999999	-9999999999	-0.9	-99999999.99	-99999999999999999999999999999999999999999999999999.9999999999	-9999999999	-9999999999	-9	-9999999999999999.9999	-9999999999999999999999999999999999999999999999999999999999999.9999
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+100	123456	0.3	40000.25	123456789123456789.1000100000	1024	7000	8	999999.9000	9223372036854775807.0000
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100;
+d	d0	d1_1	d10_2	d60_10	n	n0_0	n1	n20_4	n65_4
+-100	-123456	-0.3	-40000.25	-123456789123456789.1000100000	-1024	-7000	-8	-999999.9000	-9223372036854775807.0000
+-9999999999	-9999999999	-0.9	-99999999.99	-99999999999999999999999999999999999999999999999999.9999999999	-9999999999	-9999999999	-9	-9999999999999999.9999	-9999999999999999999999999999999999999999999999999999999999999.9999
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+6
+);
+Warnings:
+Warning	1264	Out of range value for column 'd' at row 1
+Warning	1264	Out of range value for column 'd0' at row 1
+Warning	1264	Out of range value for column 'd1_1' at row 1
+Warning	1264	Out of range value for column 'd10_2' at row 1
+Warning	1264	Out of range value for column 'd60_10' at row 1
+Warning	1264	Out of range value for column 'n' at row 1
+Warning	1264	Out of range value for column 'n0_0' at row 1
+Warning	1264	Out of range value for column 'n1' at row 1
+Warning	1264	Out of range value for column 'n20_4' at row 1
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
+d	d0	d1_1	d10_2	d60_10	n	n0_0	n1	n20_4	n65_4
+-100	-123456	-0.3	-40000.25	-123456789123456789.1000100000	-1024	-7000	-8	-999999.9000	-9223372036854775807.0000
+-9999999999	-9999999999	-0.9	-99999999.99	-99999999999999999999999999999999999999999999999999.9999999999	-9999999999	-9999999999	-9	-9999999999999999.9999	-9999999999999999999999999999999999999999999999999999999999999.9999
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+100	123456	0.3	40000.25	123456789123456789.1000100000	1024	7000	8	999999.9000	9223372036854775807.0000
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999,7);
+Warnings:
+Warning	1264	Out of range value for column 'd' at row 1
+Warning	1264	Out of range value for column 'd0' at row 1
+Warning	1264	Out of range value for column 'd1_1' at row 1
+Warning	1264	Out of range value for column 'd10_2' at row 1
+Warning	1264	Out of range value for column 'd60_10' at row 1
+Warning	1264	Out of range value for column 'n' at row 1
+Warning	1264	Out of range value for column 'n0_0' at row 1
+Warning	1264	Out of range value for column 'n1' at row 1
+Warning	1264	Out of range value for column 'n20_4' at row 1
+Warning	1264	Out of range value for column 'n65_4' at row 1
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
+d	d0	d1_1	d10_2	d60_10	n	n0_0	n1	n20_4	n65_4
+-100	-123456	-0.3	-40000.25	-123456789123456789.1000100000	-1024	-7000	-8	-999999.9000	-9223372036854775807.0000
+-9999999999	-9999999999	-0.9	-99999999.99	-99999999999999999999999999999999999999999999999999.9999999999	-9999999999	-9999999999	-9	-9999999999999999.9999	-9999999999999999999999999999999999999999999999999999999999999.9999
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+100	123456	0.3	40000.25	123456789123456789.1000100000	1024	7000	8	999999.9000	9223372036854775807.0000
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4,pk) VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111,8);
+Warnings:
+Note	1265	Data truncated for column 'd' at row 1
+Note	1265	Data truncated for column 'd0' at row 1
+Warning	1264	Out of range value for column 'd1_1' at row 1
+Note	1265	Data truncated for column 'd10_2' at row 1
+Note	1265	Data truncated for column 'd60_10' at row 1
+Note	1265	Data truncated for column 'n' at row 1
+Note	1265	Data truncated for column 'n0_0' at row 1
+Note	1265	Data truncated for column 'n1' at row 1
+Note	1265	Data truncated for column 'n20_4' at row 1
+Note	1265	Data truncated for column 'n65_4' at row 1
+SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1;
+d	d0	d1_1	d10_2	d60_10	n	n0_0	n1	n20_4	n65_4
+-100	-123456	-0.3	-40000.25	-123456789123456789.1000100000	-1024	-7000	-8	-999999.9000	-9223372036854775807.0000
+-9999999999	-9999999999	-0.9	-99999999.99	-99999999999999999999999999999999999999999999999999.9999999999	-9999999999	-9999999999	-9	-9999999999999999.9999	-9999999999999999999999999999999999999999999999999999999999999.9999
+0	0	0.0	0.00	0.0000000000	0	0	0	0.0000	0.0000
+100	123456	0.3	40000.25	123456789123456789.1000100000	1024	7000	8	999999.9000	9223372036854775807.0000
+9999999999	9999999999	0.9	99999999.00	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.0000	9999999999999999999999999999999999999999999999999999999999999.1111
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+9999999999	9999999999	0.9	99999999.99	99999999999999999999999999999999999999999999999999.9999999999	9999999999	9999999999	9	9999999999999999.9999	9999999999999999999999999999999999999999999999999999999999999.9999
+ALTER TABLE t1 ADD COLUMN n66 NUMERIC(66) ;
+ERROR 42000: Too big precision 66 specified for column 'n66'. Maximum is 65.
+ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(66,6) ;
+ERROR 42000: Too big precision 66 specified for column 'n66_6'. Maximum is 65.
+ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(66,66) ;
+ERROR 42000: Too big scale 66 specified for column 'n66_66'. Maximum is 30.
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/type_fixed.test b/mysql-test/suite/rocksdb/type_fixed.test
new file mode 100644
index 0000000..2e486e2
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_fixed.test
@@ -0,0 +1,6 @@
+#
+# Fixed point types
+#
+
+--source type_fixed.inc
+
diff --git a/mysql-test/suite/rocksdb/type_float.inc b/mysql-test/suite/rocksdb/type_float.inc
new file mode 100644
index 0000000..2f37e55
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_float.inc
@@ -0,0 +1,108 @@
+#
+# Float types
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+eval CREATE TABLE t1 (
+  f FLOAT $extra_col_opts,
+  f0 FLOAT(0) $extra_col_opts,
+  r1_1 REAL(1,1) $extra_col_opts,
+  f23_0 FLOAT(23) $extra_col_opts,
+  f20_3 FLOAT(20,3) $extra_col_opts,
+  d DOUBLE $extra_col_opts,
+  d1_0 DOUBLE(1,0) $extra_col_opts,
+  d10_10 DOUBLE PRECISION (10,10) $extra_col_opts,
+  d53 DOUBLE(53,0) $extra_col_opts,
+  d53_10 DOUBLE(53,10) $extra_col_opts,
+  pk DOUBLE $extra_col_opts PRIMARY KEY
+) ENGINE=rocksdb;
+
+SHOW COLUMNS IN t1;
+
+# Always valid values 
+
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999,1);
+
+--sorted_result
+--query_vertical SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1
+
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (0,0,0,0,0,0,0,0,0,0,2);
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (
+  99999999999999999999999999999999999999,
+  99999999999999999999999999999999999999.9999999999999999,
+  0.9,
+  99999999999999999999999999999999999999.9,
+  99999999999999999.999,
+  999999999999999999999999999999999999999999999999999999999999999999999999999999999,
+  9,
+  0.9999999999, 
+  1999999999999999999999999999999999999999999999999999999,
+  19999999999999999999999999999999999999999999.9999999999,
+  3
+);
+
+--sorted_result
+--query_vertical SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1
+
+# Values which can be valid or not, 
+# depending on whether columns are SIGNED or UNSIGNED
+# (if not valid should produce warnings)
+
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999,4);
+
+--sorted_result
+--query_vertical SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1
+
+--sorted_result
+--query_vertical SELECT MAX(f), MAX(f0), MAX(r1_1), MAX(f23_0), MAX(f20_3), MAX(d), MAX(d1_0), MAX(d10_10), MAX(d53), MAX(d53_10) FROM t1
+
+# Invalid values
+
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (
+  9999999999999999999999999999999999999999999999999999999999999.9999,
+  9999999999999999999999999999999999999999999999999999999999999.9999,
+  9999999999999999999999999999999999999999999999999999999999999.9999,
+  9999999999999999999999999999999999999999999999999999999999999.9999,
+  9999999999999999999999999999999999999999999999999999999999999.9999,
+  9999999999999999999999999999999999999999999999999999999999999.9999,
+  9999999999999999999999999999999999999999999999999999999999999.9999,
+  9999999999999999999999999999999999999999999999999999999999999.9999,
+  9999999999999999999999999999999999999999999999999999999999999.9999,
+  9999999999999999999999999999999999999999999999999999999999999.9999,
+  5
+);
+
+--sorted_result
+--query_vertical SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1
+
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (
+  999999999999999999999999999999999999999,
+  999999999999999999999999999999999999999.9999999999999999,
+  1.9,
+  999999999999999999999999999999999999999.9,
+  999999999999999999.999,
+  9999999999999999999999999999999999999999999999999999999999999999999999999999999999,
+  99,
+  1.9999999999,
+  1999999999999999999999999999999999999999999999999999999,
+  19999999999999999999999999999999999999999999.9999999999,
+  6
+);
+
+--sorted_result
+--query_vertical SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1
+
+--error ER_TOO_BIG_DISPLAYWIDTH
+eval ALTER TABLE t1 ADD COLUMN d0_0 DOUBLE(0,0) $extra_col_opts;
+
+--error ER_TOO_BIG_PRECISION
+eval ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(256,1) $extra_col_opts;
+
+--error ER_TOO_BIG_SCALE
+eval ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(40,35) $extra_col_opts;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/type_float.result b/mysql-test/suite/rocksdb/type_float.result
new file mode 100644
index 0000000..0f78926
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_float.result
@@ -0,0 +1,306 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+f FLOAT ,
+f0 FLOAT(0) ,
+r1_1 REAL(1,1) ,
+f23_0 FLOAT(23) ,
+f20_3 FLOAT(20,3) ,
+d DOUBLE ,
+d1_0 DOUBLE(1,0) ,
+d10_10 DOUBLE PRECISION (10,10) ,
+d53 DOUBLE(53,0) ,
+d53_10 DOUBLE(53,10) ,
+pk DOUBLE  PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+f	float	YES		NULL	
+f0	float	YES		NULL	
+r1_1	double(1,1)	YES		NULL	
+f23_0	float	YES		NULL	
+f20_3	float(20,3)	YES		NULL	
+d	double	YES		NULL	
+d1_0	double(1,0)	YES		NULL	
+d10_10	double(10,10)	YES		NULL	
+d53	double(53,0)	YES		NULL	
+d53_10	double(53,10)	YES		NULL	
+pk	double	NO	PRI	NULL	
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999,1);
+SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1;
+f	12345.1
+d	11111111.111
+d10_10	0.0123456789
+d1_0	8
+d53	1234566789123456800
+d53_10	100000000000000000.0000000000
+f0	12345.1
+f20_3	56789.988
+f23_0	123457000
+r1_1	0.9
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (0,0,0,0,0,0,0,0,0,0,2);
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (
+99999999999999999999999999999999999999,
+99999999999999999999999999999999999999.9999999999999999,
+0.9,
+99999999999999999999999999999999999999.9,
+99999999999999999.999,
+999999999999999999999999999999999999999999999999999999999999999999999999999999999,
+9,
+0.9999999999, 
+1999999999999999999999999999999999999999999999999999999,
+19999999999999999999999999999999999999999999.9999999999,
+3
+);
+Warnings:
+Warning	1264	Out of range value for column 'd53' at row 1
+Warning	1264	Out of range value for column 'd53_10' at row 1
+SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1;
+f	12345.1
+d	0
+d	11111111.111
+d	1e81
+d10_10	0.0000000000
+d10_10	0.0123456789
+d10_10	0.9999999999
+d1_0	0
+d1_0	8
+d1_0	9
+d53	0
+d53	100000000000000000000000000000000000000000000000000000
+d53	1234566789123456800
+d53_10	0.0000000000
+d53_10	100000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+f	0
+f	1e38
+f0	0
+f0	12345.1
+f0	1e38
+f20_3	0.000
+f20_3	56789.988
+f20_3	99999998430674940.000
+f23_0	0
+f23_0	123457000
+f23_0	1e38
+r1_1	0.0
+r1_1	0.9
+r1_1	0.9
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999,4);
+SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1;
+f	12345.1
+d	-1e60
+d	0
+d	11111111.111
+d	1e81
+d10_10	-0.9999999999
+d10_10	0.0000000000
+d10_10	0.0123456789
+d10_10	0.9999999999
+d1_0	-9
+d1_0	0
+d1_0	8
+d1_0	9
+d53	-1000000000000000000000000000000
+d53	0
+d53	100000000000000000000000000000000000000000000000000000
+d53	1234566789123456800
+d53_10	-10000000000000000000000000000000000000000000.0000000000
+d53_10	0.0000000000
+d53_10	100000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+f	-1e24
+f	0
+f	1e38
+f0	-100000000000
+f0	0
+f0	12345.1
+f0	1e38
+f20_3	-99999998430674940.000
+f20_3	0.000
+f20_3	56789.988
+f20_3	99999998430674940.000
+f23_0	-1000
+f23_0	0
+f23_0	123457000
+f23_0	1e38
+r1_1	-0.9
+r1_1	0.0
+r1_1	0.9
+r1_1	0.9
+SELECT MAX(f), MAX(f0), MAX(r1_1), MAX(f23_0), MAX(f20_3), MAX(d), MAX(d1_0), MAX(d10_10), MAX(d53), MAX(d53_10) FROM t1;
+MAX(f)	9.999999680285692e37
+MAX(d)	1e81
+MAX(d10_10)	0.9999999999
+MAX(d1_0)	9
+MAX(d53)	100000000000000000000000000000000000000000000000000000
+MAX(d53_10)	10000000000000000000000000000000000000000000.0000000000
+MAX(f0)	9.999999680285692e37
+MAX(f20_3)	99999998430674940.000
+MAX(f23_0)	9.999999680285692e37
+MAX(r1_1)	0.9
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+9999999999999999999999999999999999999999999999999999999999999.9999,
+5
+);
+Warnings:
+Warning	1264	Out of range value for column 'f' at row 1
+Warning	1264	Out of range value for column 'f0' at row 1
+Warning	1264	Out of range value for column 'r1_1' at row 1
+Warning	1264	Out of range value for column 'f23_0' at row 1
+Warning	1264	Out of range value for column 'f20_3' at row 1
+Warning	1264	Out of range value for column 'd1_0' at row 1
+Warning	1264	Out of range value for column 'd10_10' at row 1
+Warning	1264	Out of range value for column 'd53' at row 1
+Warning	1264	Out of range value for column 'd53_10' at row 1
+SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1;
+f	12345.1
+d	-1e60
+d	0
+d	11111111.111
+d	1e61
+d	1e81
+d10_10	-0.9999999999
+d10_10	0.0000000000
+d10_10	0.0123456789
+d10_10	0.9999999999
+d10_10	0.9999999999
+d1_0	-9
+d1_0	0
+d1_0	8
+d1_0	9
+d1_0	9
+d53	-1000000000000000000000000000000
+d53	0
+d53	100000000000000000000000000000000000000000000000000000
+d53	100000000000000000000000000000000000000000000000000000
+d53	1234566789123456800
+d53_10	-10000000000000000000000000000000000000000000.0000000000
+d53_10	0.0000000000
+d53_10	100000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+f	-1e24
+f	0
+f	1e38
+f	3.40282e38
+f0	-100000000000
+f0	0
+f0	12345.1
+f0	1e38
+f0	3.40282e38
+f20_3	-99999998430674940.000
+f20_3	0.000
+f20_3	56789.988
+f20_3	99999998430674940.000
+f20_3	99999998430674940.000
+f23_0	-1000
+f23_0	0
+f23_0	123457000
+f23_0	1e38
+f23_0	3.40282e38
+r1_1	-0.9
+r1_1	0.0
+r1_1	0.9
+r1_1	0.9
+r1_1	0.9
+INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (
+999999999999999999999999999999999999999,
+999999999999999999999999999999999999999.9999999999999999,
+1.9,
+999999999999999999999999999999999999999.9,
+999999999999999999.999,
+9999999999999999999999999999999999999999999999999999999999999999999999999999999999,
+99,
+1.9999999999,
+1999999999999999999999999999999999999999999999999999999,
+19999999999999999999999999999999999999999999.9999999999,
+6
+);
+Warnings:
+Warning	1292	Truncated incorrect DECIMAL value: ''
+Warning	1264	Out of range value for column 'f' at row 1
+Warning	1264	Out of range value for column 'f0' at row 1
+Warning	1264	Out of range value for column 'r1_1' at row 1
+Warning	1264	Out of range value for column 'f23_0' at row 1
+Warning	1264	Out of range value for column 'f20_3' at row 1
+Warning	1264	Out of range value for column 'd1_0' at row 1
+Warning	1264	Out of range value for column 'd10_10' at row 1
+Warning	1264	Out of range value for column 'd53' at row 1
+Warning	1264	Out of range value for column 'd53_10' at row 1
+SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1;
+f	12345.1
+d	-1e60
+d	0
+d	11111111.111
+d	1e61
+d	1e65
+d	1e81
+d10_10	-0.9999999999
+d10_10	0.0000000000
+d10_10	0.0123456789
+d10_10	0.9999999999
+d10_10	0.9999999999
+d10_10	0.9999999999
+d1_0	-9
+d1_0	0
+d1_0	8
+d1_0	9
+d1_0	9
+d1_0	9
+d53	-1000000000000000000000000000000
+d53	0
+d53	100000000000000000000000000000000000000000000000000000
+d53	100000000000000000000000000000000000000000000000000000
+d53	100000000000000000000000000000000000000000000000000000
+d53	1234566789123456800
+d53_10	-10000000000000000000000000000000000000000000.0000000000
+d53_10	0.0000000000
+d53_10	100000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+d53_10	10000000000000000000000000000000000000000000.0000000000
+f	-1e24
+f	0
+f	1e38
+f	3.40282e38
+f	3.40282e38
+f0	-100000000000
+f0	0
+f0	12345.1
+f0	1e38
+f0	3.40282e38
+f0	3.40282e38
+f20_3	-99999998430674940.000
+f20_3	0.000
+f20_3	56789.988
+f20_3	99999998430674940.000
+f20_3	99999998430674940.000
+f20_3	99999998430674940.000
+f23_0	-1000
+f23_0	0
+f23_0	123457000
+f23_0	1e38
+f23_0	3.40282e38
+f23_0	3.40282e38
+r1_1	-0.9
+r1_1	0.0
+r1_1	0.9
+r1_1	0.9
+r1_1	0.9
+r1_1	0.9
+ALTER TABLE t1 ADD COLUMN d0_0 DOUBLE(0,0) ;
+ERROR 42000: Display width out of range for column 'd0_0' (max = 255)
+ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(256,1) ;
+ERROR 42000: Too big precision 256 specified for column 'n66_6'. Maximum is 65.
+ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(40,35) ;
+ERROR 42000: Too big scale 35 specified for column 'n66_66'. Maximum is 30.
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/type_float.test b/mysql-test/suite/rocksdb/type_float.test
new file mode 100644
index 0000000..638effb
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_float.test
@@ -0,0 +1,6 @@
+#
+# Float types
+#
+
+--source type_float.inc
+
diff --git a/mysql-test/suite/rocksdb/type_int.inc b/mysql-test/suite/rocksdb/type_int.inc
new file mode 100644
index 0000000..dbcdfe4
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_int.inc
@@ -0,0 +1,68 @@
+#
+# INT column types
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+eval CREATE TABLE t1 (
+  i INT $extra_col_opts,
+  i0 INT(0) $extra_col_opts,
+  i1 INT(1) $extra_col_opts,
+  i20 INT(20) $extra_col_opts,
+  t TINYINT $extra_col_opts,
+  t0 TINYINT(0) $extra_col_opts,
+  t1 TINYINT(1) $extra_col_opts,
+  t20 TINYINT(20) $extra_col_opts,
+  s SMALLINT $extra_col_opts,
+  s0 SMALLINT(0) $extra_col_opts,
+  s1 SMALLINT(1) $extra_col_opts,
+  s20 SMALLINT(20) $extra_col_opts,
+  m MEDIUMINT $extra_col_opts,
+  m0 MEDIUMINT(0) $extra_col_opts,
+  m1 MEDIUMINT(1) $extra_col_opts,
+  m20 MEDIUMINT(20) $extra_col_opts,
+  b BIGINT $extra_col_opts,
+  b0 BIGINT(0) $extra_col_opts,
+  b1 BIGINT(1) $extra_col_opts,
+  b20 BIGINT(20) $extra_col_opts,
+  pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+
+SHOW COLUMNS IN t1;
+
+# Always valid values 
+
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20);
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807);
+--sorted_result
+SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1;
+
+# Values which can be valid or not, 
+# depending on whether columns are SIGNED or UNSIGNED
+# (if not valid should produce warnings)
+
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808);
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615);
+
+--sorted_result
+SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1;
+
+# Invalid values
+
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809);
+
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616);
+
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615);
+
+--sorted_result
+SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1;
+
+--error ER_TOO_BIG_DISPLAYWIDTH
+eval ALTER TABLE t1 ADD COLUMN i257 INT(257) $extra_col_opts;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/type_int.result b/mysql-test/suite/rocksdb/type_int.result
new file mode 100644
index 0000000..06866e9
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_int.result
@@ -0,0 +1,212 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+i INT ,
+i0 INT(0) ,
+i1 INT(1) ,
+i20 INT(20) ,
+t TINYINT ,
+t0 TINYINT(0) ,
+t1 TINYINT(1) ,
+t20 TINYINT(20) ,
+s SMALLINT ,
+s0 SMALLINT(0) ,
+s1 SMALLINT(1) ,
+s20 SMALLINT(20) ,
+m MEDIUMINT ,
+m0 MEDIUMINT(0) ,
+m1 MEDIUMINT(1) ,
+m20 MEDIUMINT(20) ,
+b BIGINT ,
+b0 BIGINT(0) ,
+b1 BIGINT(1) ,
+b20 BIGINT(20) ,
+pk INT AUTO_INCREMENT PRIMARY KEY
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+i	int(11)	YES		NULL	
+i0	int(11)	YES		NULL	
+i1	int(1)	YES		NULL	
+i20	int(20)	YES		NULL	
+t	tinyint(4)	YES		NULL	
+t0	tinyint(4)	YES		NULL	
+t1	tinyint(1)	YES		NULL	
+t20	tinyint(20)	YES		NULL	
+s	smallint(6)	YES		NULL	
+s0	smallint(6)	YES		NULL	
+s1	smallint(1)	YES		NULL	
+s20	smallint(20)	YES		NULL	
+m	mediumint(9)	YES		NULL	
+m0	mediumint(9)	YES		NULL	
+m1	mediumint(1)	YES		NULL	
+m20	mediumint(20)	YES		NULL	
+b	bigint(20)	YES		NULL	
+b0	bigint(20)	YES		NULL	
+b1	bigint(1)	YES		NULL	
+b20	bigint(20)	YES		NULL	
+pk	int(11)	NO	PRI	NULL	auto_increment
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20);
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807);
+SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1;
+i	i0	i1	i20	t	t0	t1	t20	s	s0	s1	s20	m	m0	m1	m20	b	b0	b1	b20
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
+1	2	3	4	5	6	7	8	9	10	11	12	13	14	15	16	17	18	19	20
+2147483647	2147483647	2147483647	2147483647	127	127	127	127	32767	32767	32767	32767	8388607	8388607	8388607	8388607	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808);
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615);
+Warnings:
+Warning	1264	Out of range value for column 'i' at row 1
+Warning	1264	Out of range value for column 'i0' at row 1
+Warning	1264	Out of range value for column 'i1' at row 1
+Warning	1264	Out of range value for column 'i20' at row 1
+Warning	1264	Out of range value for column 't' at row 1
+Warning	1264	Out of range value for column 't0' at row 1
+Warning	1264	Out of range value for column 't1' at row 1
+Warning	1264	Out of range value for column 't20' at row 1
+Warning	1264	Out of range value for column 's' at row 1
+Warning	1264	Out of range value for column 's0' at row 1
+Warning	1264	Out of range value for column 's1' at row 1
+Warning	1264	Out of range value for column 's20' at row 1
+Warning	1264	Out of range value for column 'm' at row 1
+Warning	1264	Out of range value for column 'm0' at row 1
+Warning	1264	Out of range value for column 'm1' at row 1
+Warning	1264	Out of range value for column 'm20' at row 1
+Warning	1264	Out of range value for column 'b' at row 1
+Warning	1264	Out of range value for column 'b0' at row 1
+Warning	1264	Out of range value for column 'b1' at row 1
+Warning	1264	Out of range value for column 'b20' at row 1
+SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1;
+i	i0	i1	i20	t	t0	t1	t20	s	s0	s1	s20	m	m0	m1	m20	b	b0	b1	b20
+-2147483648	-2147483648	-2147483648	-2147483648	-128	-128	-128	-128	-32768	-32768	-32768	-32768	-8388608	-8388608	-8388608	-8388608	-9223372036854775808	-9223372036854775808	-9223372036854775808	-9223372036854775808
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
+1	2	3	4	5	6	7	8	9	10	11	12	13	14	15	16	17	18	19	20
+2147483647	2147483647	2147483647	2147483647	127	127	127	127	32767	32767	32767	32767	8388607	8388607	8388607	8388607	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+2147483647	2147483647	2147483647	2147483647	127	127	127	127	32767	32767	32767	32767	8388607	8388607	8388607	8388607	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809);
+Warnings:
+Warning	1264	Out of range value for column 'i' at row 1
+Warning	1264	Out of range value for column 'i0' at row 1
+Warning	1264	Out of range value for column 'i1' at row 1
+Warning	1264	Out of range value for column 'i20' at row 1
+Warning	1264	Out of range value for column 't' at row 1
+Warning	1264	Out of range value for column 't0' at row 1
+Warning	1264	Out of range value for column 't1' at row 1
+Warning	1264	Out of range value for column 't20' at row 1
+Warning	1264	Out of range value for column 's' at row 1
+Warning	1264	Out of range value for column 's0' at row 1
+Warning	1264	Out of range value for column 's1' at row 1
+Warning	1264	Out of range value for column 's20' at row 1
+Warning	1264	Out of range value for column 'm' at row 1
+Warning	1264	Out of range value for column 'm0' at row 1
+Warning	1264	Out of range value for column 'm1' at row 1
+Warning	1264	Out of range value for column 'm20' at row 1
+Warning	1264	Out of range value for column 'b' at row 1
+Warning	1264	Out of range value for column 'b0' at row 1
+Warning	1264	Out of range value for column 'b1' at row 1
+Warning	1264	Out of range value for column 'b20' at row 1
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616);
+Warnings:
+Warning	1264	Out of range value for column 'i' at row 1
+Warning	1264	Out of range value for column 'i0' at row 1
+Warning	1264	Out of range value for column 'i1' at row 1
+Warning	1264	Out of range value for column 'i20' at row 1
+Warning	1264	Out of range value for column 't' at row 1
+Warning	1264	Out of range value for column 't0' at row 1
+Warning	1264	Out of range value for column 't1' at row 1
+Warning	1264	Out of range value for column 't20' at row 1
+Warning	1264	Out of range value for column 's' at row 1
+Warning	1264	Out of range value for column 's0' at row 1
+Warning	1264	Out of range value for column 's1' at row 1
+Warning	1264	Out of range value for column 's20' at row 1
+Warning	1264	Out of range value for column 'm' at row 1
+Warning	1264	Out of range value for column 'm0' at row 1
+Warning	1264	Out of range value for column 'm1' at row 1
+Warning	1264	Out of range value for column 'm20' at row 1
+Warning	1264	Out of range value for column 'b' at row 1
+Warning	1264	Out of range value for column 'b0' at row 1
+Warning	1264	Out of range value for column 'b1' at row 1
+Warning	1264	Out of range value for column 'b20' at row 1
+INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615);
+Warnings:
+Warning	1264	Out of range value for column 'i' at row 8
+Warning	1264	Out of range value for column 'i0' at row 8
+Warning	1264	Out of range value for column 'i1' at row 8
+Warning	1264	Out of range value for column 'i20' at row 8
+Warning	1264	Out of range value for column 't' at row 8
+Warning	1264	Out of range value for column 't0' at row 8
+Warning	1264	Out of range value for column 't1' at row 8
+Warning	1264	Out of range value for column 't20' at row 8
+Warning	1264	Out of range value for column 's' at row 8
+Warning	1264	Out of range value for column 's0' at row 8
+Warning	1264	Out of range value for column 's1' at row 8
+Warning	1264	Out of range value for column 's20' at row 8
+Warning	1264	Out of range value for column 'm' at row 8
+Warning	1264	Out of range value for column 'm0' at row 8
+Warning	1264	Out of range value for column 'm1' at row 8
+Warning	1264	Out of range value for column 'm20' at row 8
+Warning	1264	Out of range value for column 'i' at row 9
+Warning	1264	Out of range value for column 'i0' at row 9
+Warning	1264	Out of range value for column 'i1' at row 9
+Warning	1264	Out of range value for column 'i20' at row 9
+Warning	1264	Out of range value for column 't' at row 9
+Warning	1264	Out of range value for column 't0' at row 9
+Warning	1264	Out of range value for column 't1' at row 9
+Warning	1264	Out of range value for column 't20' at row 9
+Warning	1264	Out of range value for column 's' at row 9
+Warning	1264	Out of range value for column 's0' at row 9
+Warning	1264	Out of range value for column 's1' at row 9
+Warning	1264	Out of range value for column 's20' at row 9
+Warning	1264	Out of range value for column 'm' at row 9
+Warning	1264	Out of range value for column 'm0' at row 9
+Warning	1264	Out of range value for column 'm1' at row 9
+Warning	1264	Out of range value for column 'm20' at row 9
+Warning	1264	Out of range value for column 'i' at row 10
+Warning	1264	Out of range value for column 'i0' at row 10
+Warning	1264	Out of range value for column 'i1' at row 10
+Warning	1264	Out of range value for column 'i20' at row 10
+Warning	1264	Out of range value for column 't' at row 10
+Warning	1264	Out of range value for column 't0' at row 10
+Warning	1264	Out of range value for column 't1' at row 10
+Warning	1264	Out of range value for column 't20' at row 10
+Warning	1264	Out of range value for column 's' at row 10
+Warning	1264	Out of range value for column 's0' at row 10
+Warning	1264	Out of range value for column 's1' at row 10
+Warning	1264	Out of range value for column 's20' at row 10
+Warning	1264	Out of range value for column 'm' at row 10
+Warning	1264	Out of range value for column 'm0' at row 10
+Warning	1264	Out of range value for column 'm1' at row 10
+Warning	1264	Out of range value for column 'm20' at row 10
+Warning	1264	Out of range value for column 'i' at row 11
+Warning	1264	Out of range value for column 'i0' at row 11
+Warning	1264	Out of range value for column 'i1' at row 11
+Warning	1264	Out of range value for column 'i20' at row 11
+Warning	1264	Out of range value for column 't' at row 11
+Warning	1264	Out of range value for column 't0' at row 11
+Warning	1264	Out of range value for column 't1' at row 11
+Warning	1264	Out of range value for column 't20' at row 11
+Warning	1264	Out of range value for column 's' at row 11
+Warning	1264	Out of range value for column 's0' at row 11
+Warning	1264	Out of range value for column 's1' at row 11
+Warning	1264	Out of range value for column 's20' at row 11
+Warning	1264	Out of range value for column 'm' at row 11
+Warning	1264	Out of range value for column 'm0' at row 11
+Warning	1264	Out of range value for column 'm1' at row 11
+Warning	1264	Out of range value for column 'm20' at row 11
+SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1;
+i	i0	i1	i20	t	t0	t1	t20	s	s0	s1	s20	m	m0	m1	m20	b	b0	b1	b20
+-2147483648	-2147483648	-2147483648	-2147483648	-128	-128	-128	-128	-32768	-32768	-32768	-32768	-8388608	-8388608	-8388608	-8388608	-9223372036854775808	-9223372036854775808	-9223372036854775808	-9223372036854775808
+-2147483648	-2147483648	-2147483648	-2147483648	-128	-128	-128	-128	-32768	-32768	-32768	-32768	-8388608	-8388608	-8388608	-8388608	-9223372036854775808	-9223372036854775808	-9223372036854775808	-9223372036854775808
+-2147483648	-2147483648	-2147483648	-2147483648	-128	-128	-128	-128	-32768	-32768	-32768	-32768	-8388608	-8388608	-8388608	-8388608	-9223372036854775808	-9223372036854775808	-9223372036854775808	-9223372036854775808
+-2147483648	-2147483648	-2147483648	-2147483648	-128	-128	-128	-128	-32768	-32768	-32768	-32768	-8388608	-8388608	-8388608	-8388608	-9223372036854775808	-9223372036854775808	-9223372036854775808	-9223372036854775808
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
+1	2	3	4	5	6	7	8	9	10	11	12	13	14	15	16	17	18	19	20
+2147483647	2147483647	2147483647	2147483647	127	127	127	127	32767	32767	32767	32767	8388607	8388607	8388607	8388607	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+2147483647	2147483647	2147483647	2147483647	127	127	127	127	32767	32767	32767	32767	8388607	8388607	8388607	8388607	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+2147483647	2147483647	2147483647	2147483647	127	127	127	127	32767	32767	32767	32767	8388607	8388607	8388607	8388607	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+2147483647	2147483647	2147483647	2147483647	127	127	127	127	32767	32767	32767	32767	8388607	8388607	8388607	8388607	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+2147483647	2147483647	2147483647	2147483647	127	127	127	127	32767	32767	32767	32767	8388607	8388607	8388607	8388607	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+2147483647	2147483647	2147483647	2147483647	127	127	127	127	32767	32767	32767	32767	8388607	8388607	8388607	8388607	9223372036854775807	9223372036854775807	9223372036854775807	9223372036854775807
+ALTER TABLE t1 ADD COLUMN i257 INT(257) ;
+ERROR 42000: Display width out of range for column 'i257' (max = 255)
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/type_int.test b/mysql-test/suite/rocksdb/type_int.test
new file mode 100644
index 0000000..c7a86c0
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_int.test
@@ -0,0 +1,6 @@
+#
+# INT column types
+#
+
+--source type_int.inc
+
diff --git a/mysql-test/suite/rocksdb/type_set.inc b/mysql-test/suite/rocksdb/type_set.inc
new file mode 100644
index 0000000..25ae582
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_set.inc
@@ -0,0 +1,49 @@
+#
+# SET column type
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# Valid values.
+
+eval CREATE TABLE t1 (
+  a SET('') $extra_col_opts,
+  b SET('test1','test2','test3','test4','test5') $extra_col_opts,
+  c SET('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64') $extra_col_opts,
+  PRIMARY KEY (c)
+) ENGINE=rocksdb;
+
+SHOW COLUMNS IN t1;
+
+INSERT INTO t1 (a,b,c) VALUES 
+('','test2,test3','01,34,44,,23'),
+('',5,2),
+(',','test4,test2','');
+--sorted_result
+SELECT a,b,c FROM t1;
+
+# Out of range values 
+# (should produce warnings)
+
+INSERT INTO t1 (a,b,c) VALUES (0,'test6',-1);
+--sorted_result
+SELECT a,b,c FROM t1;
+
+# Non-unique values in set
+# (should produce a warning)
+eval ALTER TABLE t1 ADD COLUMN e SET('a','A') $extra_col_opts;
+
+SHOW COLUMNS IN t1;
+
+--error ER_TOO_BIG_SET
+eval ALTER TABLE t1 ADD COLUMN f SET('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',' ','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i') $extra_col_opts;
+
+# Simple comparison
+
+--sorted_result
+SELECT a,b,c,e FROM t1 WHERE FIND_IN_SET('test2',b)>0 OR a != '';
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/type_set.result b/mysql-test/suite/rocksdb/type_set.result
new file mode 100644
index 0000000..f401af4
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_set.result
@@ -0,0 +1,49 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+a SET('') ,
+b SET('test1','test2','test3','test4','test5') ,
+c SET('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64') ,
+PRIMARY KEY (c)
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+a	set('')	YES		NULL	
+b	set('test1','test2','test3','test4','test5')	YES		NULL	
+c	set('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64')	NO	PRI		
+INSERT INTO t1 (a,b,c) VALUES 
+('','test2,test3','01,34,44,,23'),
+('',5,2),
+(',','test4,test2','');
+Warnings:
+Warning	1265	Data truncated for column 'c' at row 1
+SELECT a,b,c FROM t1;
+a	b	c
+	test1,test3	02
+	test2,test3	01,23,34,44
+	test2,test4	
+INSERT INTO t1 (a,b,c) VALUES (0,'test6',-1);
+Warnings:
+Warning	1265	Data truncated for column 'b' at row 1
+Warning	1265	Data truncated for column 'c' at row 1
+SELECT a,b,c FROM t1;
+a	b	c
+		01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50'51,52,53,54,55,56,57,58,59,60,61,62,63,64
+	test1,test3	02
+	test2,test3	01,23,34,44
+	test2,test4	
+ALTER TABLE t1 ADD COLUMN e SET('a','A') ;
+Warnings:
+Note	1291	Column 'e' has duplicated value 'a' in SET
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+a	set('')	YES		NULL	
+b	set('test1','test2','test3','test4','test5')	YES		NULL	
+c	set('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64')	NO	PRI		
+e	set('a','A')	YES		NULL	
+ALTER TABLE t1 ADD COLUMN f SET('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',' ','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i') ;
+ERROR HY000: Too many strings for column f and SET
+SELECT a,b,c,e FROM t1 WHERE FIND_IN_SET('test2',b)>0 OR a != '';
+a	b	c	e
+	test2,test3	01,23,34,44	NULL
+	test2,test4		NULL
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/type_set.test b/mysql-test/suite/rocksdb/type_set.test
new file mode 100644
index 0000000..ce6c4f4
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_set.test
@@ -0,0 +1,6 @@
+#
+# SET column type
+#
+
+--source type_set.inc
+
diff --git a/mysql-test/suite/rocksdb/type_text.inc b/mysql-test/suite/rocksdb/type_text.inc
new file mode 100644
index 0000000..f5c9c3b
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_text.inc
@@ -0,0 +1,49 @@
+#
+# TEXT column types
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+eval CREATE TABLE t1 (
+  pk INT AUTO_INCREMENT PRIMARY KEY,
+  t TEXT $extra_col_opts,
+  t0 TEXT(0) $extra_col_opts,
+  t1 TEXT(1) $extra_col_opts,
+  t300 TEXT(300) $extra_col_opts,
+  tm TEXT(65535) $extra_col_opts,
+  t70k TEXT(70000) $extra_col_opts,
+  t17m TEXT(17000000) $extra_col_opts,
+  tt TINYTEXT $extra_col_opts,
+  m MEDIUMTEXT $extra_col_opts,
+  l LONGTEXT $extra_col_opts
+) ENGINE=rocksdb;
+
+SHOW COLUMNS IN t1;
+
+# Valid values 
+# (cannot get MAX for all columns due to max_allowed_packet limitations)
+
+INSERT INTO t1 (t,t0,t1,t300,tm,t70k,t17m,tt,m,l) VALUES
+('','','','','','','','','',''),
+('a','b','c','d','e','f','g','h','i','j'),
+('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'),
+( REPEAT('a',65535), REPEAT('b',65535), REPEAT('c',255), REPEAT('d',65535), REPEAT('e',65535), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',255), REPEAT('i',1048576), REPEAT('j',1048576) );
+
+--sorted_result
+SELECT LENGTH(t), LENGTH(t0), LENGTH(t1), LENGTH(t300), LENGTH(tm), LENGTH(t70k), LENGTH(t17m), LENGTH(tt), LENGTH(m), LENGTH(l) FROM t1;
+
+# Invalid values (produce warnings, except for mediumtext and longtext columns for which the values are within limits)
+
+INSERT INTO t1 (t,t0,t1,t300,tm,t70k,t17m,tt,m,l) VALUES
+( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) );
+
+--sorted_result
+SELECT LENGTH(t), LENGTH(t0), LENGTH(t1), LENGTH(t300), LENGTH(tm), LENGTH(t70k), LENGTH(t17m), LENGTH(tt), LENGTH(m), LENGTH(l) FROM t1;
+
+--error ER_TOO_BIG_DISPLAYWIDTH
+eval ALTER TABLE t1 ADD COLUMN ttt TEXT(4294967296) $extra_col_opts;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/type_text.result b/mysql-test/suite/rocksdb/type_text.result
new file mode 100644
index 0000000..bd10e38
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_text.result
@@ -0,0 +1,57 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+t TEXT ,
+t0 TEXT(0) ,
+t1 TEXT(1) ,
+t300 TEXT(300) ,
+tm TEXT(65535) ,
+t70k TEXT(70000) ,
+t17m TEXT(17000000) ,
+tt TINYTEXT ,
+m MEDIUMTEXT ,
+l LONGTEXT 
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+pk	int(11)	NO	PRI	NULL	auto_increment
+t	text	YES		NULL	
+t0	text	YES		NULL	
+t1	tinytext	YES		NULL	
+t300	text	YES		NULL	
+tm	text	YES		NULL	
+t70k	mediumtext	YES		NULL	
+t17m	longtext	YES		NULL	
+tt	tinytext	YES		NULL	
+m	mediumtext	YES		NULL	
+l	longtext	YES		NULL	
+INSERT INTO t1 (t,t0,t1,t300,tm,t70k,t17m,tt,m,l) VALUES
+('','','','','','','','','',''),
+('a','b','c','d','e','f','g','h','i','j'),
+('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'),
+( REPEAT('a',65535), REPEAT('b',65535), REPEAT('c',255), REPEAT('d',65535), REPEAT('e',65535), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',255), REPEAT('i',1048576), REPEAT('j',1048576) );
+SELECT LENGTH(t), LENGTH(t0), LENGTH(t1), LENGTH(t300), LENGTH(tm), LENGTH(t70k), LENGTH(t17m), LENGTH(tt), LENGTH(m), LENGTH(l) FROM t1;
+LENGTH(t)	LENGTH(t0)	LENGTH(t1)	LENGTH(t300)	LENGTH(tm)	LENGTH(t70k)	LENGTH(t17m)	LENGTH(tt)	LENGTH(m)	LENGTH(l)
+0	0	0	0	0	0	0	0	0	0
+1	1	1	1	1	1	1	1	1	1
+5	5	5	5	5	5	5	5	5	6
+65535	65535	255	65535	65535	1048576	1048576	255	1048576	1048576
+INSERT INTO t1 (t,t0,t1,t300,tm,t70k,t17m,tt,m,l) VALUES
+( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) );
+Warnings:
+Warning	1265	Data truncated for column 't' at row 1
+Warning	1265	Data truncated for column 't0' at row 1
+Warning	1265	Data truncated for column 't1' at row 1
+Warning	1265	Data truncated for column 't300' at row 1
+Warning	1265	Data truncated for column 'tm' at row 1
+Warning	1265	Data truncated for column 'tt' at row 1
+SELECT LENGTH(t), LENGTH(t0), LENGTH(t1), LENGTH(t300), LENGTH(tm), LENGTH(t70k), LENGTH(t17m), LENGTH(tt), LENGTH(m), LENGTH(l) FROM t1;
+LENGTH(t)	LENGTH(t0)	LENGTH(t1)	LENGTH(t300)	LENGTH(tm)	LENGTH(t70k)	LENGTH(t17m)	LENGTH(tt)	LENGTH(m)	LENGTH(l)
+0	0	0	0	0	0	0	0	0	0
+1	1	1	1	1	1	1	1	1	1
+5	5	5	5	5	5	5	5	5	6
+65535	65535	255	65535	65535	1048576	1048576	255	1048576	1048576
+65535	65535	255	65535	65535	1048576	1048576	255	1048576	1048576
+ALTER TABLE t1 ADD COLUMN ttt TEXT(4294967296) ;
+ERROR 42000: Display width out of range for column 'ttt' (max = 4294967295)
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/type_text.test b/mysql-test/suite/rocksdb/type_text.test
new file mode 100644
index 0000000..41e91b1
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_text.test
@@ -0,0 +1,6 @@
+#
+# TEXT column types
+#
+
+--source type_text.inc
+
diff --git a/mysql-test/suite/rocksdb/type_text_indexes.result b/mysql-test/suite/rocksdb/type_text_indexes.result
new file mode 100644
index 0000000..a23373e
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_text_indexes.result
@@ -0,0 +1,137 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (t TEXT <CUSTOM_COL_OPTIONS>,
+tt TINYTEXT <CUSTOM_COL_OPTIONS>,
+m MEDIUMTEXT <CUSTOM_COL_OPTIONS>,
+l LONGTEXT <CUSTOM_COL_OPTIONS>,
+<CUSTOM_INDEX> t (t(32))
+) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
+SHOW INDEX IN t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
+t1	1	#	1	t	#	#	32	NULL	#	#		
+INSERT INTO t1 (t,tt,m,l) VALUES
+('','','',''),
+('a','b','c','d'),
+('b','d','c','b'),
+('test1','test2','test3','test4'),
+(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)),
+('abc','def','ghi','jkl'),
+('test2','test3','test4','test5'),
+('test3','test4','test5','test6'),
+(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)),
+(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128));
+SELECT SUBSTRING(t,16) AS f FROM t1 WHERE t IN ('test1','test2') ORDER BY f;
+f
+
+
+DROP TABLE t1;
+CREATE TABLE t1 (t TEXT <CUSTOM_COL_OPTIONS>,
+tt TINYTEXT <CUSTOM_COL_OPTIONS>,
+m MEDIUMTEXT <CUSTOM_COL_OPTIONS>,
+l LONGTEXT <CUSTOM_COL_OPTIONS>,
+PRIMARY KEY t (t(32))
+) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
+SHOW INDEX IN t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
+t1	0	PRIMARY	1	t	#	#	32	NULL	#	#		
+INSERT INTO t1 (t,tt,m,l) VALUES
+('','','',''),
+('a','b','c','d'),
+('b','d','c','b'),
+('test1','test2','test3','test4'),
+(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)),
+('abc','def','ghi','jkl'),
+('test2','test3','test4','test5'),
+('test3','test4','test5','test6'),
+(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)),
+(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128));
+EXPLAIN SELECT SUBSTRING(t,16) AS f FROM t1 WHERE t IN ('test1','test2') ORDER BY f;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+#	#	#	#	#	PRIMARY	#	#	#	#
+SELECT SUBSTRING(t,16) AS f FROM t1 WHERE t IN ('test1','test2') ORDER BY f;
+f
+
+
+EXPLAIN SELECT SUBSTRING(t,16) AS f FROM t1 IGNORE INDEX (PRIMARY) WHERE t IN ('test1','test2') ORDER BY f;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+#	#	#	#	#	NULL	#	#	#	#
+SELECT SUBSTRING(t,16) AS f FROM t1 IGNORE INDEX (PRIMARY) WHERE t IN ('test1','test2') ORDER BY f;
+f
+
+
+DROP TABLE t1;
+CREATE TABLE t1 (t TEXT <CUSTOM_COL_OPTIONS>,
+tt TINYTEXT <CUSTOM_COL_OPTIONS>,
+m MEDIUMTEXT <CUSTOM_COL_OPTIONS>,
+l LONGTEXT <CUSTOM_COL_OPTIONS>,
+UNIQUE INDEX l_tt (l(256),tt(64))
+) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
+SHOW INDEX IN t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
+t1	0	l_tt	1	l	#	#	256	NULL	#	#		
+t1	0	l_tt	2	tt	#	#	64	NULL	#	#		
+INSERT INTO t1 (t,tt,m,l) VALUES
+('','','',''),
+('a','b','c','d'),
+('b','d','c','b'),
+('test1','test2','test3','test4'),
+(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)),
+('abc','def','ghi','jkl'),
+('test2','test3','test4','test5'),
+('test3','test4','test5','test6'),
+(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)),
+(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128));
+EXPLAIN SELECT SUBSTRING(tt,64), SUBSTRING(l,256) FROM t1 WHERE tt!=l AND l NOT IN ('test1') ORDER BY tt, l DESC;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+#	#	#	#	l_tt	#	#	#	#	#
+SELECT SUBSTRING(tt,64), SUBSTRING(l,256) FROM t1 WHERE tt!=l AND l NOT IN ('test1') ORDER BY tt, l DESC;
+SUBSTRING(tt,64)	SUBSTRING(l,256)
+	
+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb	
+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb	
+	
+	
+fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff	
+	
+	
+	
+EXPLAIN SELECT SUBSTRING(tt,64), SUBSTRING(l,256) FROM t1 FORCE INDEX (l_t) WHERE tt!=l AND l NOT IN ('test1') ORDER BY tt, l DESC;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+#	#	#	#	l_tt	l_tt	#	#	#	#
+SELECT SUBSTRING(tt,64), SUBSTRING(l,256) FROM t1 FORCE INDEX (l_t) WHERE tt!=l AND l NOT IN ('test1') ORDER BY tt, l DESC;
+SUBSTRING(tt,64)	SUBSTRING(l,256)
+	
+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb	
+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb	
+	
+	
+fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff	
+	
+	
+	
+DROP TABLE t1;
+CREATE TABLE t1 (t TEXT <CUSTOM_COL_OPTIONS>,
+tt TINYTEXT <CUSTOM_COL_OPTIONS>,
+m MEDIUMTEXT <CUSTOM_COL_OPTIONS>,
+l LONGTEXT <CUSTOM_COL_OPTIONS>,
+INDEX (m(128))
+) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
+SHOW INDEX IN t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_comment
+t1	1	m	1	m	#	#	128	NULL	#	#		
+INSERT INTO t1 (t,tt,m,l) VALUES
+('','','',''),
+('a','b','c','d'),
+('b','d','c','b'),
+('test1','test2','test3','test4'),
+(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)),
+('abc','def','ghi','jkl'),
+('test2','test3','test4','test5'),
+('test3','test4','test5','test6'),
+(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)),
+(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128));
+EXPLAIN SELECT SUBSTRING(m,128) AS f FROM t1 WHERE m = 'test1' ORDER BY f DESC;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+#	#	#	#	#	m	#	#	#	#
+SELECT SUBSTRING(m,128) AS f FROM t1 WHERE m = 'test1' ORDER BY f DESC;
+f
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/type_text_indexes.test b/mysql-test/suite/rocksdb/type_text_indexes.test
new file mode 100644
index 0000000..e7fb1b2
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_text_indexes.test
@@ -0,0 +1,102 @@
+#
+# TEXT columns with indexes
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+
+CREATE TABLE t1 (
+  t TEXT,
+  tt TINYTEXT,
+  m MEDIUMTEXT,
+  l LONGTEXT,
+  PRIMARY KEY t (t(32))
+) ENGINE=rocksdb;
+
+SHOW INDEX IN t1;
+
+INSERT INTO t1 (t,tt,m,l) VALUES
+('','','',''),
+('a','b','c','d'),
+('b','d','c','b'),
+('test1','test2','test3','test4'),
+(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)),
+('abc','def','ghi','jkl'),
+('test2','test3','test4','test5'),
+('test3','test4','test5','test6'),
+(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)),
+(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128));
+
+EXPLAIN SELECT SUBSTRING(t,16) AS f FROM t1 WHERE t IN ('test1','test2') ORDER BY f;
+SELECT SUBSTRING(t,16) AS f FROM t1 WHERE t IN ('test1','test2') ORDER BY f;
+
+EXPLAIN SELECT SUBSTRING(t,16) AS f FROM t1 IGNORE INDEX (PRIMARY) WHERE t IN ('test1','test2') ORDER BY f;
+SELECT SUBSTRING(t,16) AS f FROM t1 IGNORE INDEX (PRIMARY) WHERE t IN ('test1','test2') ORDER BY f;
+DROP TABLE t1;
+
+--error ER_GET_ERRMSG
+CREATE TABLE t1 (
+  t TEXT,
+  tt TINYTEXT,
+  m MEDIUMTEXT,
+  l LONGTEXT,
+  pk TINYTEXT PRIMARY KEY,
+  UNIQUE INDEX l_tt (l(256),tt(64))
+) ENGINE=rocksdb;
+
+--disable_parsing
+
+SHOW INDEX IN t1;
+
+INSERT INTO t1 (t,tt,m,l,pk) VALUES
+('','','','','1'),
+('a','b','c','d','2'),
+('b','d','c','b','3'),
+('test1','test2','test3','test4','4'),
+(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128),'5'),
+('abc','def','ghi','jkl','6'),
+('test2','test3','test4','test5','7'),
+('test3','test4','test5','test6','8'),
+(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128),'9'),
+(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128),'10');
+
+# Here we are getting possible key l_t, but not the final key
+EXPLAIN SELECT SUBSTRING(tt,64), SUBSTRING(l,256) FROM t1 WHERE tt!=l AND l NOT IN ('test1') ORDER BY tt, l DESC;
+SELECT SUBSTRING(tt,64), SUBSTRING(l,256) FROM t1 WHERE tt!=l AND l NOT IN ('test1') ORDER BY tt, l DESC;
+
+EXPLAIN SELECT SUBSTRING(tt,64), SUBSTRING(l,256) FROM t1 FORCE INDEX (l_t) WHERE tt!=l AND l NOT IN ('test1') ORDER BY tt, l DESC;
+SELECT SUBSTRING(tt,64), SUBSTRING(l,256) FROM t1 FORCE INDEX (l_t) WHERE tt!=l AND l NOT IN ('test1') ORDER BY tt, l DESC;
+DROP TABLE t1;
+
+--enable_parsing
+
+CREATE TABLE t1 (
+  t TEXT,
+  tt TINYTEXT,
+  m MEDIUMTEXT,
+  l LONGTEXT,
+  pk MEDIUMTEXT PRIMARY KEY,
+  INDEX (m(128))
+) ENGINE=rocksdb;
+
+SHOW INDEX IN t1;
+
+INSERT INTO t1 (t,tt,m,l,pk) VALUES
+('','','','','0'),
+('a','b','c','d','1'),
+('b','d','c','b','2'),
+('test1','test2','test3','test4','3'),
+(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128),'4'),
+('abc','def','ghi','jkl','5'),
+('test2','test3','test4','test5','6'),
+('test3','test4','test5','test6','7'),
+(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128),'8'),
+(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128),'9');
+
+EXPLAIN SELECT SUBSTRING(m,128) AS f FROM t1 WHERE m = 'test1' ORDER BY f DESC;
+SELECT SUBSTRING(m,128) AS f FROM t1 WHERE m = 'test1' ORDER BY f DESC;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/type_varbinary.inc b/mysql-test/suite/rocksdb/type_varbinary.inc
new file mode 100644
index 0000000..a9f9883
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_varbinary.inc
@@ -0,0 +1,75 @@
+#
+# VARBINARY column types
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
+
+eval CREATE TABLE t1 (
+  v0 VARBINARY(0) $extra_col_opts,
+  v1 VARBINARY(1) $extra_col_opts,
+  v64 VARBINARY(64) $extra_col_opts,
+  v65000 VARBINARY(65000) $extra_col_opts,
+  PRIMARY KEY (v64)
+) ENGINE=rocksdb;
+
+SHOW COLUMNS IN t1;
+
+eval CREATE TABLE t2 (v VARBINARY(65532) $extra_col_opts, PRIMARY KEY(v(255))) ENGINE=rocksdb;
+SHOW COLUMNS IN t2;
+
+INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','','','');
+INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','y','Once there, double check that an article doesn\'t already exist','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off.
+
+  If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment.
+  For developers who want to code on MariaDB or MySQL
+
+      * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB.
+            o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB!
+            o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. 
+      * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings
+            o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! 
+
+  For MariaDB / MySQL end users
+
+      * MariaDB Crash Course by Ben Forta
+            o First MariaDB book!
+            o For people who want to learn SQL and the basics of MariaDB.
+            o Now shipping. Purchase at Amazon.com or your favorite bookseller. 
+
+      * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer.
+            o Everything you wanted to know about the SQL 99 standard. Excellent reference book!
+            o Free to read in the Knowledgebase! 
+
+      * MySQL (4th Edition) by Paul DuBois
+            o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. 
+
+      * MySQL Cookbook by Paul DuBois
+            o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. 
+
+      * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al.
+            o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) 
+
+      * MySQL Admin Cookbook
+            o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration 
+
+      * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen
+            o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. ');
+
+--sorted_result
+SELECT HEX(v0), HEX(v1), HEX(v64), HEX(v65000) FROM t1;
+
+# Invalid values
+
+INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('y', 'yy', REPEAT('c',65), REPEAT('abcdefghi ',6501));
+INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, CONCAT('a',v65000), CONCAT(v65000,v1) FROM t1;
+
+--sorted_result
+SELECT HEX(v0), HEX(v1), HEX(v64), LENGTH(HEX(v65000)) FROM t1;
+
+eval ALTER TABLE t1 ADD COLUMN v65536 VARBINARY(65536) $extra_col_opts;
+SHOW COLUMNS IN t1;
+
+DROP TABLE t1, t2;
+
diff --git a/mysql-test/suite/rocksdb/type_varbinary.result b/mysql-test/suite/rocksdb/type_varbinary.result
new file mode 100644
index 0000000..06afbb9
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_varbinary.result
@@ -0,0 +1,93 @@
+DROP TABLE IF EXISTS t1, t2;
+CREATE TABLE t1 (
+v0 VARBINARY(0) ,
+v1 VARBINARY(1) ,
+v64 VARBINARY(64) ,
+v65000 VARBINARY(65000) ,
+PRIMARY KEY (v64)
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+v0	varbinary(0)	YES		NULL	
+v1	varbinary(1)	YES		NULL	
+v64	varbinary(64)	NO	PRI		
+v65000	varbinary(65000)	YES		NULL	
+CREATE TABLE t2 (v VARBINARY(65532) , PRIMARY KEY(v(255))) ENGINE=rocksdb;
+SHOW COLUMNS IN t2;
+Field	Type	Null	Key	Default	Extra
+v	varbinary(65532)	NO	PRI		
+INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','','','');
+INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','y','Once there, double check that an article doesn\'t already exist','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off.
+
+  If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment.
+  For developers who want to code on MariaDB or MySQL
+
+      * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB.
+            o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB!
+            o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. 
+      * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings
+            o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! 
+
+  For MariaDB / MySQL end users
+
+      * MariaDB Crash Course by Ben Forta
+            o First MariaDB book!
+            o For people who want to learn SQL and the basics of MariaDB.
+            o Now shipping. Purchase at Amazon.com or your favorite bookseller. 
+
+      * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer.
+            o Everything you wanted to know about the SQL 99 standard. Excellent reference book!
+            o Free to read in the Knowledgebase! 
+
+      * MySQL (4th Edition) by Paul DuBois
+            o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. 
+
+      * MySQL Cookbook by Paul DuBois
+            o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. 
+
+      * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al.
+            o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) 
+
+      * MySQL Admin Cookbook
+            o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration 
+
+      * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen
+            o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. ');
+SELECT HEX(v0), HEX(v1), HEX(v64), HEX(v65000) FROM t1;
+HEX(v0)	HEX(v1)	HEX(v64)	HEX(v65000)
+			
+	79	4F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C7265616479206578697374	486572652069732061206C697374206F66207265636F6D6D656E64656420626F6F6B73206F6E204D61726961444220616E64204D7953514C2E2057652776652070726F7669646564206C696E6B7320746F20416D617A6F6E2E636F6D206865726520666F7220636F6E76656E69656E63652C2062757420746865792063616E20626520666F756E64206174206D616E79206F7468657220626F6F6B73746F7265732C20626F7468206F6E6C696E6520616E64206F66662E0A0A2020496620796F752077616E7420746F206861766520796F7572206661766F72697465204D7953514C202F204D61726961444220626F6F6B206C697374656420686572652C20706C65617365206C65617665206120636F6D6D656E742E0A2020466F7220646576656C6F706572732077686F2077616E7420746F20636F6465206F6E204D617269614442206F72204D7953514C0A0A2020202020202A20556E6465727374616E64696E67204D7953514C20496E7465726E616C73206279205361736861205061636865762C20666F726D6572204D7953514C20646576656C6F706572206174204D7953514C2041422E0A2020202020
 20202020
 2020206F205468697320697320746865206F6E6C7920626F6F6B207765206B6E6F772061626F75742074686174206465736372696265732074686520696E7465726E616C73206F66204D617269614442202F204D7953514C2E2041206D757374206861766520666F7220616E796F6E652077686F2077616E747320746F20756E6465727374616E6420616E6420646576656C6F70206F6E204D617269614442210A2020202020202020202020206F204E6F7420616C6C20746F706963732061726520636F766572656420616E6420736F6D652070617274732061726520736C696768746C79206F757464617465642C20627574207374696C6C20746865206265737420626F6F6B206F6E207468697320746F7069632E200A2020202020202A204D7953514C20352E3120506C7567696E20446576656C6F706D656E742062792053657267656920476F6C75626368696B20616E6420416E64726577204875746368696E67730A2020202020202020202020206F2041206D757374207265616420666F7220616E796F6E652077616E74696E6720746F207772697465206120706C7567696E20666F72204D6172696144422C207772697474656E20627920746865205365726765692077686F2064657369676E65642074686520706C7567696E20696E7465726661636520666F72204
 D7953514
 C20616E64204D61726961444221200A0A2020466F72204D617269614442202F204D7953514C20656E642075736572730A0A2020202020202A204D61726961444220437261736820436F757273652062792042656E20466F7274610A2020202020202020202020206F204669727374204D61726961444220626F6F6B210A2020202020202020202020206F20466F722070656F706C652077686F2077616E7420746F206C6561726E2053514C20616E642074686520626173696373206F66204D6172696144422E0A2020202020202020202020206F204E6F77207368697070696E672E20507572636861736520617420416D617A6F6E2E636F6D206F7220796F7572206661766F7269746520626F6F6B73656C6C65722E200A0A2020202020202A2053514C2D393920436F6D706C6574652C205265616C6C792062792050657465722047756C75747A616E20262054727564792050656C7A65722E0A2020202020202020202020206F2045766572797468696E6720796F752077616E74656420746F206B6E6F772061626F7574207468652053514C203939207374616E646172642E20457863656C6C656E74207265666572656E636520626F6F6B210A2020202020202020202020206F204672656520746F207265616420696E20746865204B6E6F776C656467656261736521200A
 0A202020
 2020202A204D7953514C20283474682045646974696F6E29206279205061756C204475426F69730A2020202020202020202020206F20546865202764656661756C742720626F6F6B20746F207265616420696620796F7520776F6E7420746F206C6561726E20746F20757365204D7953514C202F204D6172696144422E200A0A2020202020202A204D7953514C20436F6F6B626F6F6B206279205061756C204475426F69730A2020202020202020202020206F2041206C6F74206F66206578616D706C6573206F6620686F7720746F20757365204D7953514C2E204173207769746820616C6C206F66205061756C277320626F6F6B732C206974277320776F727468206974732077656967687420696E20676F6C6420616E64206576656E20656E6A6F7961626C652072656164696E6720666F7220737563682061202764727927207375626A6563742E200A0A2020202020202A204869676820506572666F726D616E6365204D7953514C2C205365636F6E642045646974696F6E2C204279204261726F6E20536368776172747A2C205065746572205A6169747365762C20566164696D20546B616368656E6B6F2C204A6572656D7920442E205A61776F646E792C2041726A656E204C656E747A2C20446572656B204A2E2042616C6C696E672C20657420616C2E0A20202020202
 02020202
 020206F20224869676820506572666F726D616E6365204D7953514C2069732074686520646566696E697469766520677569646520746F206275696C64696E6720666173742C2072656C6961626C652073797374656D732077697468204D7953514C2E205772697474656E206279206E6F74656420657870657274732077697468207965617273206F66207265616C2D776F726C6420657870657269656E6365206275696C64696E672076657279206C617267652073797374656D732C207468697320626F6F6B20636F7665727320657665727920617370656374206F66204D7953514C20706572666F726D616E636520696E2064657461696C2C20616E6420666F6375736573206F6E20726F627573746E6573732C2073656375726974792C20616E64206461746120696E746567726974792E204C6561726E20616476616E63656420746563686E697175657320696E20646570746820736F20796F752063616E206272696E67206F7574204D7953514C27732066756C6C20706F7765722E22202846726F6D2074686520626F6F6B206465736372697074696F6E206174204F275265696C6C7929200A0A2020202020202A204D7953514C2041646D696E20436F6F6B626F6F6B0A2020202020202020202020206F204120717569636B20737465702D62792D7374657020677569
 64652066
 6F72204D7953514C20757365727320616E642064617461626173652061646D696E6973747261746F727320746F207461636B6C65207265616C2D776F726C64206368616C6C656E6765732077697468204D7953514C20636F6E66696775726174696F6E20616E642061646D696E697374726174696F6E200A0A2020202020202A204D7953514C20352E302043657274696669636174696F6E2053747564792047756964652C204279205061756C204475426F69732C2053746566616E2048696E7A2C204361727374656E20506564657273656E0A2020202020202020202020206F205468697320697320746865206F6666696369616C20677569646520746F20636F766572207468652070617373696E67206F66207468652074776F204D7953514C2043657274696669636174696F6E206578616D696E6174696F6E732E2049742069732076616C69642074696C6C2076657273696F6E20352E30206F6620746865207365727665722C20736F207768696C65206974206D697373657320616C6C2074686520666561747572657320617661696C61626C6520696E204D7953514C20352E3120616E6420677265617465722028696E636C7564696E67204D61726961444220352E3120616E642067726561746572292C2069742070726F7669646573206120676F6F6420626173696
 320756E6
 465727374616E64696E67206F66204D7953514C20666F722074686520656E642D757365722E20
+INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('y', 'yy', REPEAT('c',65), REPEAT('abcdefghi ',6501));
+Warnings:
+Warning	1265	Data truncated for column 'v0' at row 1
+Warning	1265	Data truncated for column 'v1' at row 1
+Warning	1265	Data truncated for column 'v64' at row 1
+Warning	1265	Data truncated for column 'v65000' at row 1
+INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, CONCAT('a',v65000), CONCAT(v65000,v1) FROM t1;
+Warnings:
+Warning	1265	Data truncated for column 'v0' at row 5
+Warning	1265	Data truncated for column 'v1' at row 5
+Warning	1265	Data truncated for column 'v64' at row 5
+Warning	1265	Data truncated for column 'v0' at row 6
+Warning	1265	Data truncated for column 'v1' at row 6
+Warning	1265	Data truncated for column 'v64' at row 6
+Warning	1265	Data truncated for column 'v65000' at row 6
+SELECT HEX(v0), HEX(v1), HEX(v64), LENGTH(HEX(v65000)) FROM t1;
+HEX(v0)	HEX(v1)	HEX(v64)	LENGTH(HEX(v65000))
+			0
+		61	0
+	48	61486572652069732061206C697374206F66207265636F6D6D656E64656420626F6F6B73206F6E204D61726961444220616E64204D7953514C2E205765277665	5932
+	61	61616263646566676869206162636465666768692061626364656667686920616263646566676869206162636465666768692061626364656667686920616263	130000
+	79	4F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C7265616479206578697374	5930
+	79	63636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363	130000
+ALTER TABLE t1 ADD COLUMN v65536 VARBINARY(65536) ;
+Warnings:
+Note	1246	Converting column 'v65536' from VARBINARY to BLOB
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+v0	varbinary(0)	YES		NULL	
+v1	varbinary(1)	YES		NULL	
+v64	varbinary(64)	NO	PRI		
+v65000	varbinary(65000)	YES		NULL	
+v65536	mediumblob	YES		NULL	
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/rocksdb/type_varbinary.test b/mysql-test/suite/rocksdb/type_varbinary.test
new file mode 100644
index 0000000..b56d1c5
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_varbinary.test
@@ -0,0 +1,6 @@
+#
+# VARBINARY column types
+#
+
+--source type_varbinary.inc
+
diff --git a/mysql-test/suite/rocksdb/type_varchar.inc b/mysql-test/suite/rocksdb/type_varchar.inc
new file mode 100644
index 0000000..ce5dbb4
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_varchar.inc
@@ -0,0 +1,77 @@
+#
+# VARCHAR column types
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
+
+eval CREATE TABLE t1 (
+  v0 VARCHAR(0) $extra_col_opts,
+  v1 VARCHAR(1) $extra_col_opts,
+  v64 VARCHAR(64) $extra_col_opts,
+  v65000 VARCHAR(65000) $extra_col_opts,
+  PRIMARY KEY (v64)
+) ENGINE=rocksdb;
+
+SHOW COLUMNS IN t1;
+
+CREATE TABLE t2 (v VARCHAR(65532), PRIMARY KEY (v(255))) ENGINE=rocksdb;
+SHOW COLUMNS IN t2;
+
+# Valid values 
+
+INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','','','');
+INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','y','Once there, double check that an article doesn\'t already exist','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off.
+
+  If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment.
+  For developers who want to code on MariaDB or MySQL
+
+      * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB.
+            o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB!
+            o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. 
+      * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings
+            o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! 
+
+  For MariaDB / MySQL end users
+
+      * MariaDB Crash Course by Ben Forta
+            o First MariaDB book!
+            o For people who want to learn SQL and the basics of MariaDB.
+            o Now shipping. Purchase at Amazon.com or your favorite bookseller. 
+
+      * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer.
+            o Everything you wanted to know about the SQL 99 standard. Excellent reference book!
+            o Free to read in the Knowledgebase! 
+
+      * MySQL (4th Edition) by Paul DuBois
+            o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. 
+
+      * MySQL Cookbook by Paul DuBois
+            o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. 
+
+      * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al.
+            o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) 
+
+      * MySQL Admin Cookbook
+            o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration 
+
+      * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen
+            o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. ');
+
+--sorted_result
+SELECT v0,v1,v64,v65000 FROM t1;
+
+# Invalid values
+
+INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('y', 'yy', REPEAT('c',65), REPEAT('abcdefghi ',6501));
+INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, CONCAT('a',v65000), CONCAT(v65000,v1) FROM t1;
+
+--sorted_result
+SELECT v0, v1, v64, LENGTH(v65000) FROM t1;
+
+eval ALTER TABLE t1 ADD COLUMN v65536 VARCHAR(65536) $extra_col_opts;
+SHOW COLUMNS IN t1;
+
+DROP TABLE t1, t2;
+
diff --git a/mysql-test/suite/rocksdb/type_varchar.result b/mysql-test/suite/rocksdb/type_varchar.result
new file mode 100644
index 0000000..b84cedb
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_varchar.result
@@ -0,0 +1,128 @@
+DROP TABLE IF EXISTS t1, t2;
+CREATE TABLE t1 (
+v0 VARCHAR(0) ,
+v1 VARCHAR(1) ,
+v64 VARCHAR(64) ,
+v65000 VARCHAR(65000) ,
+PRIMARY KEY (v64)
+) ENGINE=rocksdb;
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+v0	varchar(0)	YES		NULL	
+v1	varchar(1)	YES		NULL	
+v64	varchar(64)	NO	PRI		
+v65000	varchar(65000)	YES		NULL	
+CREATE TABLE t2 (v VARCHAR(65532), PRIMARY KEY (v(255))) ENGINE=rocksdb;
+SHOW COLUMNS IN t2;
+Field	Type	Null	Key	Default	Extra
+v	varchar(65532)	NO	PRI		
+INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','','','');
+INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','y','Once there, double check that an article doesn\'t already exist','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off.
+
+  If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment.
+  For developers who want to code on MariaDB or MySQL
+
+      * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB.
+            o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB!
+            o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. 
+      * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings
+            o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! 
+
+  For MariaDB / MySQL end users
+
+      * MariaDB Crash Course by Ben Forta
+            o First MariaDB book!
+            o For people who want to learn SQL and the basics of MariaDB.
+            o Now shipping. Purchase at Amazon.com or your favorite bookseller. 
+
+      * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer.
+            o Everything you wanted to know about the SQL 99 standard. Excellent reference book!
+            o Free to read in the Knowledgebase! 
+
+      * MySQL (4th Edition) by Paul DuBois
+            o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. 
+
+      * MySQL Cookbook by Paul DuBois
+            o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. 
+
+      * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al.
+            o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) 
+
+      * MySQL Admin Cookbook
+            o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration 
+
+      * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen
+            o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. ');
+SELECT v0,v1,v64,v65000 FROM t1;
+v0	v1	v64	v65000
+
+
+
+
+
+
+
+
+
+
+			
+	y	Once there, double check that an article doesn't already exist	Here is a list of recommended books on MariaDB and MySQL. We've provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off.
+            o "High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL's full power." (From the book description at O'Reilly) 
+            o A lot of examples of how to use MySQL. As with all of Paul's books, it's worth its weight in gold and even enjoyable reading for such a 'dry' subject. 
+            o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! 
+            o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration 
+            o Everything you wanted to know about the SQL 99 standard. Excellent reference book!
+            o First MariaDB book!
+            o For people who want to learn SQL and the basics of MariaDB.
+            o Free to read in the Knowledgebase! 
+            o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. 
+            o Now shipping. Purchase at Amazon.com or your favorite bookseller. 
+            o The 'default' book to read if you wont to learn to use MySQL / MariaDB. 
+            o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. 
+            o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB!
+      * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al.
+      * MariaDB Crash Course by Ben Forta
+      * MySQL (4th Edition) by Paul DuBois
+      * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen
+      * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings
+      * MySQL Admin Cookbook
+      * MySQL Cookbook by Paul DuBois
+      * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer.
+      * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB.
+  For MariaDB / MySQL end users
+  For developers who want to code on MariaDB or MySQL
+  If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment.
+INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('y', 'yy', REPEAT('c',65), REPEAT('abcdefghi ',6501));
+Warnings:
+Warning	1265	Data truncated for column 'v0' at row 1
+Warning	1265	Data truncated for column 'v1' at row 1
+Warning	1265	Data truncated for column 'v64' at row 1
+Warning	1265	Data truncated for column 'v65000' at row 1
+INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, CONCAT('a',v65000), CONCAT(v65000,v1) FROM t1;
+Warnings:
+Warning	1265	Data truncated for column 'v0' at row 5
+Warning	1265	Data truncated for column 'v1' at row 5
+Warning	1265	Data truncated for column 'v64' at row 5
+Warning	1265	Data truncated for column 'v65000' at row 5
+Warning	1265	Data truncated for column 'v0' at row 6
+Warning	1265	Data truncated for column 'v1' at row 6
+Warning	1265	Data truncated for column 'v64' at row 6
+SELECT v0, v1, v64, LENGTH(v65000) FROM t1;
+v0	v1	v64	LENGTH(v65000)
+			0
+		a	0
+	H	aHere is a list of recommended books on MariaDB and MySQL. We've	2966
+	a	aabcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abc	65000
+	y	Once there, double check that an article doesn't already exist	2965
+	y	cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc	65000
+ALTER TABLE t1 ADD COLUMN v65536 VARCHAR(65536) ;
+Warnings:
+Note	1246	Converting column 'v65536' from VARCHAR to TEXT
+SHOW COLUMNS IN t1;
+Field	Type	Null	Key	Default	Extra
+v0	varchar(0)	YES		NULL	
+v1	varchar(1)	YES		NULL	
+v64	varchar(64)	NO	PRI		
+v65000	varchar(65000)	YES		NULL	
+v65536	mediumtext	YES		NULL	
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/rocksdb/type_varchar.test b/mysql-test/suite/rocksdb/type_varchar.test
new file mode 100644
index 0000000..002098a
--- /dev/null
+++ b/mysql-test/suite/rocksdb/type_varchar.test
@@ -0,0 +1,6 @@
+#
+# VARCHAR column types
+#
+
+--source type_varchar.inc
+
diff --git a/mysql-test/suite/rocksdb/update.result b/mysql-test/suite/rocksdb/update.result
new file mode 100644
index 0000000..f205889
--- /dev/null
+++ b/mysql-test/suite/rocksdb/update.result
@@ -0,0 +1,113 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(10000,'foobar');
+INSERT INTO t1 (a,b) SELECT a, b FROM t1;
+UPDATE t1 SET a=a+100;
+SELECT a,b FROM t1;
+a	b
+101	a
+101	a
+10100	foobar
+10100	foobar
+102	b
+102	b
+103	c
+103	c
+104	d
+104	d
+105	e
+105	e
+UPDATE t1 SET a=a-100, b=DEFAULT WHERE a>100;
+SELECT a,b FROM t1;
+a	b
+1	NULL
+1	NULL
+10000	NULL
+10000	NULL
+2	NULL
+2	NULL
+3	NULL
+3	NULL
+4	NULL
+4	NULL
+5	NULL
+5	NULL
+UPDATE t1 SET b = 'update' WHERE a <= 4 ORDER BY b DESC, a ASC LIMIT 1;
+SELECT a,b FROM t1;
+a	b
+1	NULL
+1	update
+10000	NULL
+10000	NULL
+2	NULL
+2	NULL
+3	NULL
+3	NULL
+4	NULL
+4	NULL
+5	NULL
+5	NULL
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(10000,'foobar');
+INSERT INTO t1 (a,b) SELECT a, b FROM t1;
+BEGIN;
+UPDATE t1 SET a=a+100;
+UPDATE t1 SET a=a-50, b=DEFAULT WHERE a>100;
+COMMIT;
+SELECT * FROM t1 ORDER BY pk;
+a	b	pk
+10050	NULL	12
+10050	NULL	6
+51	NULL	1
+51	NULL	7
+52	NULL	2
+52	NULL	8
+53	NULL	3
+53	NULL	9
+54	NULL	10
+54	NULL	4
+55	NULL	11
+55	NULL	5
+BEGIN;
+UPDATE t1 SET b = 'update' WHERE a <= 4 ORDER BY a DESC, b ASC LIMIT 3;
+UPDATE t1 SET b = '';
+ROLLBACK;
+SELECT * FROM t1 ORDER BY pk;
+a	b	pk
+51	NULL	1
+52	NULL	2
+53	NULL	3
+54	NULL	4
+55	NULL	5
+10050	NULL	6
+51	NULL	7
+52	NULL	8
+53	NULL	9
+54	NULL	10
+55	NULL	11
+10050	NULL	12
+BEGIN;
+UPDATE t1 SET b = 'update2' WHERE a <= 100;
+SAVEPOINT spt1;
+ERROR 42000: The storage engine for the table doesn't support SAVEPOINT
+UPDATE t1 SET b = '';
+ROLLBACK TO SAVEPOINT spt1;
+ERROR 42000: SAVEPOINT spt1 does not exist
+UPDATE t1 SET b = 'upd' WHERE a = 10050;
+COMMIT;
+SELECT * FROM t1 ORDER BY pk;
+a	b	pk
+51		1
+52		2
+53		3
+54		4
+55		5
+10050	upd	6
+51		7
+52		8
+53		9
+54		10
+55		11
+10050	upd	12
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/update.test b/mysql-test/suite/rocksdb/update.test
new file mode 100644
index 0000000..8bedae4
--- /dev/null
+++ b/mysql-test/suite/rocksdb/update.test
@@ -0,0 +1,70 @@
+# 
+# Basic UPDATE statements.
+# UPDATE LOW_PRIORITY is covered in update_low_prio test
+# UPDATE IGNORE is covered in update_ignore test
+# Multi-table update is covered in update_multi test
+#
+
+########################################
+# TODO:
+# The results of the transactional part
+# are unusual due to "can't-see-own-changes"
+########################################
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(10000,'foobar');
+INSERT INTO t1 (a,b) SELECT a, b FROM t1;
+
+UPDATE t1 SET a=a+100;
+--sorted_result
+SELECT a,b FROM t1;
+
+UPDATE t1 SET a=a-100, b=DEFAULT WHERE a>100;
+--sorted_result
+SELECT a,b FROM t1;
+
+# ORDER BY and LIMIT
+UPDATE t1 SET b = 'update' WHERE a <= 4 ORDER BY b DESC, a ASC LIMIT 1;
+--sorted_result
+SELECT a,b FROM t1;
+
+DROP TABLE t1;
+
+# 
+# Transactional UPDATE
+#
+
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(10000,'foobar');
+INSERT INTO t1 (a,b) SELECT a, b FROM t1;
+
+BEGIN;
+UPDATE t1 SET a=a+100;
+UPDATE t1 SET a=a-50, b=DEFAULT WHERE a>100;
+COMMIT;
+--sorted_result
+SELECT * FROM t1 ORDER BY pk;
+
+BEGIN;
+UPDATE t1 SET b = 'update' WHERE a <= 4 ORDER BY a DESC, b ASC LIMIT 3;
+UPDATE t1 SET b = '';
+ROLLBACK;
+SELECT * FROM t1 ORDER BY pk;
+
+BEGIN;
+UPDATE t1 SET b = 'update2' WHERE a <= 100;
+--error ER_CHECK_NOT_IMPLEMENTED
+SAVEPOINT spt1;
+UPDATE t1 SET b = '';
+--error ER_SP_DOES_NOT_EXIST
+ROLLBACK TO SAVEPOINT spt1;
+UPDATE t1 SET b = 'upd' WHERE a = 10050;
+COMMIT;
+SELECT * FROM t1 ORDER BY pk;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/rocksdb/update_multi.result b/mysql-test/suite/rocksdb/update_multi.result
new file mode 100644
index 0000000..dbd02ed
--- /dev/null
+++ b/mysql-test/suite/rocksdb/update_multi.result
@@ -0,0 +1,65 @@
+DROP TABLE IF EXISTS t1,t2;
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(10000,'foobar');
+INSERT INTO t1 (a,b) SELECT a, b FROM t1;
+CREATE TABLE t2 (c CHAR(8), d INT, pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t2 (c,d) SELECT b, a FROM t1;
+UPDATE t1, t2 SET t1.a = t2.d+100, t2.c = 'multi' WHERE c < b AND a + d != 1;
+SELECT a,b FROM t1;
+a	b
+1	a
+1	a
+101	b
+101	b
+101	c
+101	c
+101	d
+101	d
+101	e
+101	e
+101	foobar
+101	foobar
+SELECT c,d FROM t2;
+c	d
+foobar	10000
+foobar	10000
+multi	1
+multi	1
+multi	2
+multi	2
+multi	3
+multi	3
+multi	4
+multi	4
+multi	5
+multi	5
+UPDATE t2, t1 SET t2.d = DEFAULT WHERE c = 'foobar' and b = c;
+SELECT a,b FROM t1;
+a	b
+1	a
+1	a
+101	b
+101	b
+101	c
+101	c
+101	d
+101	d
+101	e
+101	e
+101	foobar
+101	foobar
+SELECT c,d FROM t2;
+c	d
+foobar	NULL
+foobar	NULL
+multi	1
+multi	1
+multi	2
+multi	2
+multi	3
+multi	3
+multi	4
+multi	4
+multi	5
+multi	5
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/rocksdb/update_multi.test b/mysql-test/suite/rocksdb/update_multi.test
new file mode 100644
index 0000000..86bcbfd
--- /dev/null
+++ b/mysql-test/suite/rocksdb/update_multi.test
@@ -0,0 +1,30 @@
+# 
+# Multi-table UPDATE statements.
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2;
+--enable_warnings
+
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(10000,'foobar');
+INSERT INTO t1 (a,b) SELECT a, b FROM t1;
+
+CREATE TABLE t2 (c CHAR(8), d INT, pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t2 (c,d) SELECT b, a FROM t1;
+
+UPDATE t1, t2 SET t1.a = t2.d+100, t2.c = 'multi' WHERE c < b AND a + d != 1;
+--sorted_result
+SELECT a,b FROM t1;
+--sorted_result
+SELECT c,d FROM t2;
+
+UPDATE t2, t1 SET t2.d = DEFAULT WHERE c = 'foobar' and b = c;
+--sorted_result
+SELECT a,b FROM t1;
+--sorted_result
+SELECT c,d FROM t2;
+
+# Cleanup
+DROP TABLE t1, t2;
+


More information about the commits mailing list