List:Commits« Previous MessageNext Message »
From:Sergey Vojtovich Date:February 28 2007 11:27am
Subject:bk commit into 5.1 tree (svoj:1.2439) BUG#26080
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of svoj. When svoj does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-02-28 14:27:19+04:00, svoj@stripped +3 -0
  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@stripped, 2007-02-28 14:27:17+04:00, svoj@stripped +7 -0
    A test case for BUG#26080.

  mysql-test/t/heap.test@stripped, 2007-02-28 14:27:17+04:00, svoj@stripped +9 -0
    A test case for BUG#26080.

  storage/heap/ha_heap.cc@stripped, 2007-02-28 14:27:17+04:00, svoj@stripped +4 -3
    For MEMORY, if varchar column extended, it should return incompatible for
    now. In other words force copy of a table during alter table.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	svoj
# Host:	june.mysql.com
# Root:	/home/svoj/devel/mysql/BUG26080/mysql-5.1-engines

--- 1.107/storage/heap/ha_heap.cc	2007-01-27 05:46:40 +04:00
+++ 1.108/storage/heap/ha_heap.cc	2007-02-28 14:27:17 +04:00
@@ -703,9 +703,10 @@ bool ha_heap::check_if_incompatible_data
 					 uint table_changes)
 {
   /* Check that auto_increment value was not changed */
-  if ((table_changes != IS_EQUAL_YES &&
-       info->used_fields & HA_CREATE_USED_AUTO) &&
-      info->auto_increment_value != 0)
+  if ((info->used_fields & HA_CREATE_USED_AUTO &&
+       info->auto_increment_value != 0) ||
+      table_changes == IS_EQUAL_NO ||
+      table_changes & IS_EQUAL_PACK_LENGTH) // Not implemented yet
     return COMPATIBLE_DATA_NO;
   return COMPATIBLE_DATA_YES;
 }

--- 1.51/mysql-test/r/heap.result	2006-07-28 22:26:56 +05:00
+++ 1.52/mysql-test/r/heap.result	2007-02-28 14:27:17 +04:00
@@ -731,3 +731,10 @@ SELECT COUNT(*) FROM t1 WHERE c=REPEAT('
 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;

--- 1.36/mysql-test/t/heap.test	2007-01-22 20:42:49 +04:00
+++ 1.37/mysql-test/t/heap.test	2007-02-28 14:27:17 +04:00
@@ -471,3 +471,12 @@ SELECT COUNT(*) FROM t1 WHERE c=REPEAT('
 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;
Thread
bk commit into 5.1 tree (svoj:1.2439) BUG#26080Sergey Vojtovich28 Feb