From d9dbd4caf4d8c53a4e66037fcd344e5c9b7d4f64 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Feb 2007 14:27:19 +0400 Subject: BUG#26080 - Memory Storage engine not working properly Extending varchar column length with ALTER TABLE may result in unusable memory table. The problem is that we use fast ALTER TABLE in this case, which is not supported by now. This is fixed by refusing fast ALTER TABLE when extending varchar column. In other words force copy of a table during ALTER TABLE. Affects MEMORY tables in 5.1 only. mysql-test/r/heap.result: A test case for BUG#26080. mysql-test/t/heap.test: A test case for BUG#26080. storage/heap/ha_heap.cc: For MEMORY, if varchar column extended, it should return incompatible for now. In other words force copy of a table during alter table. --- mysql-test/r/heap.result | 7 +++++++ mysql-test/t/heap.test | 9 +++++++++ 2 files changed, 16 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result index 29bdfcbef7a..ddf675e2f73 100644 --- a/mysql-test/r/heap.result +++ b/mysql-test/r/heap.result @@ -731,3 +731,10 @@ SELECT COUNT(*) FROM t1 WHERE c=REPEAT('a',256); COUNT(*) 2 DROP TABLE t1; +CREATE TABLE t1(c1 VARCHAR(100), c2 INT) ENGINE=MEMORY; +INSERT INTO t1 VALUES('', 0); +ALTER TABLE t1 MODIFY c1 VARCHAR(101); +SELECT c2 FROM t1; +c2 +0 +DROP TABLE t1; diff --git a/mysql-test/t/heap.test b/mysql-test/t/heap.test index 624597cd8d7..b47a5fc2033 100644 --- a/mysql-test/t/heap.test +++ b/mysql-test/t/heap.test @@ -471,3 +471,12 @@ SELECT COUNT(*) FROM t1 WHERE c=REPEAT('a',256); DROP TABLE t1; # End of 5.0 tests + +# +# BUG#26080 - Memory Storage engine not working properly +# +CREATE TABLE t1(c1 VARCHAR(100), c2 INT) ENGINE=MEMORY; +INSERT INTO t1 VALUES('', 0); +ALTER TABLE t1 MODIFY c1 VARCHAR(101); +SELECT c2 FROM t1; +DROP TABLE t1; -- cgit v1.2.1