summaryrefslogtreecommitdiff
path: root/mysql-test/suite/heap
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-02-28 22:47:29 +0100
committerSergei Golubchik <sergii@pisem.net>2013-02-28 22:47:29 +0100
commit213f1c76a038ad0e6111cd5eb6b0da9b4b9dc45a (patch)
tree79e9a941a078d73ce85da0241871a863fa4eca38 /mysql-test/suite/heap
parentcfa94b4338b5dd5578436df0402b2f2210de3eaa (diff)
parentc4341d50950224bb4e976fd1aac23dddc7d78f71 (diff)
downloadmariadb-git-213f1c76a038ad0e6111cd5eb6b0da9b4b9dc45a.tar.gz
5.3->5.5 merge
Diffstat (limited to 'mysql-test/suite/heap')
-rw-r--r--mysql-test/suite/heap/heap.result20
-rw-r--r--mysql-test/suite/heap/heap.test26
2 files changed, 46 insertions, 0 deletions
diff --git a/mysql-test/suite/heap/heap.result b/mysql-test/suite/heap/heap.result
index ae562a0dda1..e61b9bcc2bf 100644
--- a/mysql-test/suite/heap/heap.result
+++ b/mysql-test/suite/heap/heap.result
@@ -738,6 +738,26 @@ SELECT c2 FROM t1;
c2
0
DROP TABLE t1;
+CREATE TABLE t1 (
+id int(11) NOT NULL AUTO_INCREMENT,
+color enum('GREEN', 'WHITE') DEFAULT NULL,
+ts int,
+PRIMARY KEY (id),
+KEY color (color) USING HASH
+) ENGINE=MEMORY DEFAULT CHARSET=utf8;
+INSERT INTO t1 VALUES("1","GREEN",1);
+INSERT INTO t1 VALUES("2","GREEN",1);
+INSERT INTO t1 VALUES("3","GREEN",1);
+INSERT INTO t1 VALUES("4","GREEN",1);
+INSERT INTO t1 VALUES("5","GREEN",1);
+INSERT INTO t1 VALUES("6","GREEN",1);
+DELETE FROM t1 WHERE id = 1;
+INSERT INTO t1 VALUES("7","GREEN", 2);
+DELETE FROM t1 WHERE ts = 1 AND color = 'GREEN';
+SELECT * from t1;
+id color ts
+7 GREEN 2
+DROP TABLE t1;
CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=10 max_rows=100;
insert into t1 values(1);
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
diff --git a/mysql-test/suite/heap/heap.test b/mysql-test/suite/heap/heap.test
index 6f5046af139..ab2a4f0a6d6 100644
--- a/mysql-test/suite/heap/heap.test
+++ b/mysql-test/suite/heap/heap.test
@@ -487,6 +487,32 @@ SELECT c2 FROM t1;
DROP TABLE t1;
#
+# BUG#51763 Can't delete rows from MEMORY table with HASH key
+#
+
+CREATE TABLE t1 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ color enum('GREEN', 'WHITE') DEFAULT NULL,
+ ts int,
+ PRIMARY KEY (id),
+ KEY color (color) USING HASH
+) ENGINE=MEMORY DEFAULT CHARSET=utf8;
+
+INSERT INTO t1 VALUES("1","GREEN",1);
+INSERT INTO t1 VALUES("2","GREEN",1);
+INSERT INTO t1 VALUES("3","GREEN",1);
+INSERT INTO t1 VALUES("4","GREEN",1);
+INSERT INTO t1 VALUES("5","GREEN",1);
+INSERT INTO t1 VALUES("6","GREEN",1);
+DELETE FROM t1 WHERE id = 1;
+INSERT INTO t1 VALUES("7","GREEN", 2);
+DELETE FROM t1 WHERE ts = 1 AND color = 'GREEN';
+SELECT * from t1;
+DROP TABLE t1;
+
+# End of 5.1 tests
+
+#
# Show that MIN_ROWS and MAX_ROWS have an effect on how data_length
# and index_length are allocated.
# Result is different for 32 / 64 bit machines as pointer lengths are different