From c26f2f598a042a74a646b80e329f1e4c480d9739 Mon Sep 17 00:00:00 2001
From: Zardosht Kasheff <zardosht@tokutek.com>
Date: Thu, 31 Jan 2013 03:36:59 +0000
Subject: [PATCH] refs #5951, add a mysql layer test

git-svn-id: file:///svn/mysql/tests/mysql-test@52687 c7de825b-a66e-492c-adef-691d508d4ae1
---
 mysql-test/suite/tokudb.bugs/r/5951.result | 22 ++++++++++++++
 mysql-test/suite/tokudb.bugs/t/5951.test   | 34 ++++++++++++++++++++++
 2 files changed, 56 insertions(+)
 create mode 100644 mysql-test/suite/tokudb.bugs/r/5951.result
 create mode 100644 mysql-test/suite/tokudb.bugs/t/5951.test

diff --git a/mysql-test/suite/tokudb.bugs/r/5951.result b/mysql-test/suite/tokudb.bugs/r/5951.result
new file mode 100644
index 0000000000..b945d874b2
--- /dev/null
+++ b/mysql-test/suite/tokudb.bugs/r/5951.result
@@ -0,0 +1,22 @@
+SET DEFAULT_STORAGE_ENGINE = 'tokudb';
+DROP TABLE IF EXISTS t1;
+create table t1
+(c01 bigint unsigned not null auto_increment primary key,
+c02 bigint unsigned not null default 0,
+c03 bigint unsigned not null default 0,
+c04 bigint unsigned not null default 0,
+c05 bigint unsigned not null default 0,
+c06 bigint unsigned not null default 0,
+c07 bigint unsigned not null default 0,
+c08 bigint unsigned not null default 0,
+c09 bigint unsigned not null default 0,
+c10 bigint unsigned not null default 0)
+engine=tokudb;
+insert into t1 (c01) values (NULL);
+insert into t1 (c02,c03,c04,c05,c06,c07,c08,c09,c10) select c02,c03,c04,c05,c06,c07,c08,c09,c10 from t1;
+flush tables;
+select * from t1;
+c01	c02	c03	c04	c05	c06	c07	c08	c09	c10
+1	0	0	0	0	0	0	0	0	0
+2	0	0	0	0	0	0	0	0	0
+DROP TABLE t1;
diff --git a/mysql-test/suite/tokudb.bugs/t/5951.test b/mysql-test/suite/tokudb.bugs/t/5951.test
new file mode 100644
index 0000000000..71cebe681b
--- /dev/null
+++ b/mysql-test/suite/tokudb.bugs/t/5951.test
@@ -0,0 +1,34 @@
+--source include/have_tokudb.inc
+#
+# Record inconsistency.
+#
+#
+SET DEFAULT_STORAGE_ENGINE = 'tokudb';
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+create table t1
+  (c01 bigint unsigned not null auto_increment primary key,
+   c02 bigint unsigned not null default 0,
+   c03 bigint unsigned not null default 0,
+   c04 bigint unsigned not null default 0,
+   c05 bigint unsigned not null default 0,
+   c06 bigint unsigned not null default 0,
+   c07 bigint unsigned not null default 0,
+   c08 bigint unsigned not null default 0,
+   c09 bigint unsigned not null default 0,
+   c10 bigint unsigned not null default 0)
+engine=tokudb;
+
+insert into t1 (c01) values (NULL);
+
+insert into t1 (c02,c03,c04,c05,c06,c07,c08,c09,c10) select c02,c03,c04,c05,c06,c07,c08,c09,c10 from t1;
+
+flush tables;
+
+select * from t1;
+# Final cleanup.
+DROP TABLE t1;
+
-- 
2.30.9