summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <reggie@linux.site>2006-01-06 18:52:49 -0600
committerunknown <reggie@linux.site>2006-01-06 18:52:49 -0600
commite262e74419002711770b09f64db9136f08eb3f15 (patch)
tree7cd64a787a8b6134713ecb64f4b907664b59bf20 /mysql-test
parent3c4c332fd0ce4f6ec06a1f3b0c98a25cac80a2f4 (diff)
downloadmariadb-git-e262e74419002711770b09f64db9136f08eb3f15.tar.gz
Bug# 15968 - Partitions: crash when insert with f1 = -1 into partition by hash(f1)
fixed mysql-test/r/partition_hash.result: results for newly added test. mysql-test/t/partition_hash.test: test case for inserting a value into a hash that would generate a negative value sql/sql_partition.cc: fields that generate a negative value would also generate a negative part_id which doesn't index into the m_file array to well.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/partition_hash.result6
-rw-r--r--mysql-test/t/partition_hash.test9
2 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/r/partition_hash.result b/mysql-test/r/partition_hash.result
index 2165630e4fb..b72d47d3748 100644
--- a/mysql-test/r/partition_hash.result
+++ b/mysql-test/r/partition_hash.result
@@ -64,3 +64,9 @@ primary key(a,b))
partition by key (a)
(partition x1);
drop table t1;
+CREATE TABLE t1 (f1 INTEGER, f2 char(20)) ENGINE = 'MYISAM' PARTITION BY HASH(f1) PARTITIONS 2;
+INSERT INTO t1 SET f1 = 0 - 1, f2 = '#######';
+select * from t1;
+f1 f2
+-1 #######
+drop table t1;
diff --git a/mysql-test/t/partition_hash.test b/mysql-test/t/partition_hash.test
index aa1acfe891f..6e3f0f67d47 100644
--- a/mysql-test/t/partition_hash.test
+++ b/mysql-test/t/partition_hash.test
@@ -75,3 +75,12 @@ partition by key (a)
(partition x1);
drop table t1;
+
+#
+# Bug# 15968 - crash when INSERT with f1 = -1 into partition by hash(f1)
+#
+CREATE TABLE t1 (f1 INTEGER, f2 char(20)) ENGINE = 'MYISAM' PARTITION BY HASH(f1) PARTITIONS 2;
+INSERT INTO t1 SET f1 = 0 - 1, f2 = '#######';
+select * from t1;
+drop table t1;
+