List:Commits« Previous MessageNext Message »
From:antony Date:October 26 2006 7:25pm
Subject:bk commit into 4.1 tree (acurtis:1.2535) BUG#10474
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of antony. When antony 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, 2006-10-26 09:50:11-07:00, acurtis@stripped +3 -0
  Bug#10474
    "Alter table forgets original column names when handling 'AFTER'"
    always compare AFTER columns against original column names.

  mysql-test/r/alter_table.result@stripped, 2006-10-26 09:50:09-07:00, acurtis@stripped +13
-0
    test for bug

  mysql-test/t/alter_table.test@stripped, 2006-10-26 09:50:09-07:00, acurtis@stripped +12 -0
    test for bug

  sql/sql_table.cc@stripped, 2006-10-26 09:50:09-07:00, acurtis@stripped +3 -1
    only check original column names when handling 'after'

# 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:	acurtis
# Host:	xiphis.org
# Root:	/home/antony/work2/p3-bug10474.1

--- 1.309/sql/sql_table.cc	2006-10-26 10:25:31 -07:00
+++ 1.310/sql/sql_table.cc	2006-10-26 10:25:31 -07:00
@@ -3129,7 +3129,9 @@
       find_it.rewind();
       while ((find=find_it++))			// Add new columns
       {
-	if (!my_strcasecmp(system_charset_info,def->after, find->field_name))
+        /* only check original column names */
+      	if (!my_strcasecmp(system_charset_info,def->after,
+        		   find->change ? find->change : find->field_name))
 	  break;
       }
       if (!find)

--- 1.49/mysql-test/r/alter_table.result	2006-10-26 10:25:31 -07:00
+++ 1.50/mysql-test/r/alter_table.result	2006-10-26 10:25:31 -07:00
@@ -543,3 +543,16 @@
 alter table test.t1 rename test.t1;
 use test;
 drop table t1;
+create table t1 (c1 int);
+alter table t1
+add c2 int after c1,
+add c3 int after c2,
+change c1 c4 int not null;
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `c4` int(11) NOT NULL default '0',
+  `c2` int(11) default NULL,
+  `c3` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;

--- 1.39/mysql-test/t/alter_table.test	2006-10-26 10:25:31 -07:00
+++ 1.40/mysql-test/t/alter_table.test	2006-10-26 10:25:31 -07:00
@@ -392,4 +392,16 @@
 use test;
 drop table t1;
 
+#
+# Bug#10474 - Alter table forgets original column names
+#
+create table t1 (c1 int);
+alter table t1
+	add c2 int after c1,
+	add c3 int after c2,
+	change c1 c4 int not null;
+show create table t1;
+drop table t1;
+
+
 # End of 4.1 tests
Thread
bk commit into 4.1 tree (acurtis:1.2535) BUG#10474antony26 Oct