summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2012-11-19 13:04:37 -0800
committerIgor Babaev <igor@askmonty.org>2012-11-19 13:04:37 -0800
commite42024cd0aab425822ae9bf001fb57984e2ef12c (patch)
tree5e7c743c537812cfd351fe390b2d693de90f820d /mysql-test
parent8d612adf70c53dcb741b097133e09d176d0780e1 (diff)
downloadmariadb-git-e42024cd0aab425822ae9bf001fb57984e2ef12c.tar.gz
Fixed bug mdev-3866.
The invalid implementation of the method Field_bit::cmp_max could trigger a valgrind complain or could lead to incorrect statistical data when collecting engine-independent statistics on BIT fields.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/stat_tables_partition.result12
-rw-r--r--mysql-test/t/stat_tables_partition.test17
2 files changed, 29 insertions, 0 deletions
diff --git a/mysql-test/r/stat_tables_partition.result b/mysql-test/r/stat_tables_partition.result
new file mode 100644
index 00000000000..75454b61fe0
--- /dev/null
+++ b/mysql-test/r/stat_tables_partition.result
@@ -0,0 +1,12 @@
+#
+# Bug mdev-3866: valgrind complain from ANALYZE on a table with BIT field
+#
+SET use_stat_tables = 'preferably';
+CREATE TABLE t1 (pk int PRIMARY KEY, a bit(1), INDEX idx(a)
+) ENGINE=MyISAM PARTITION BY KEY(pk) PARTITIONS 2;
+INSERT INTO t1 VALUES (1,1),(2,0),(3,0),(4,1);
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+SET use_stat_tables = DEFAULT;
+DROP TABLE t1;
diff --git a/mysql-test/t/stat_tables_partition.test b/mysql-test/t/stat_tables_partition.test
new file mode 100644
index 00000000000..1316e5cca11
--- /dev/null
+++ b/mysql-test/t/stat_tables_partition.test
@@ -0,0 +1,17 @@
+--source include/have_partition.inc
+
+--echo #
+--echo # Bug mdev-3866: valgrind complain from ANALYZE on a table with BIT field
+--echo #
+
+SET use_stat_tables = 'preferably';
+
+CREATE TABLE t1 (pk int PRIMARY KEY, a bit(1), INDEX idx(a)
+) ENGINE=MyISAM PARTITION BY KEY(pk) PARTITIONS 2;
+INSERT INTO t1 VALUES (1,1),(2,0),(3,0),(4,1);
+
+ANALYZE TABLE t1;
+
+SET use_stat_tables = DEFAULT;
+
+DROP TABLE t1;