List:Commits« Previous MessageNext Message »
From:konstantin Date:August 18 2007 6:30pm
Subject:bk commit into 5.1 tree (kostja:1.2547)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of kostja. When kostja 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-08-18 22:30:21+04:00, kostja@bodhi.(none) +17 -0
  After-merge fixes (5.1-telco-6.2 merge).

  mysql-test/r/alter_table.result@stripped, 2007-08-18 22:30:16+04:00, kostja@bodhi.(none) +2 -0
    Update results (an extraneous external lock removed).

  mysql-test/r/rpl_extraColmaster_innodb.result@stripped, 2007-08-18 22:30:16+04:00, kostja@bodhi.(none) +499 -493
    Update result (new format of SHOW SLAVE STATUS).

  mysql-test/r/rpl_extraColmaster_myisam.result@stripped, 2007-08-18 22:30:16+04:00, kostja@bodhi.(none) +499 -493
    Update result (new format of SHOW SLAVE STATUS).

  mysql-test/r/rpl_skip_error.result@stripped, 2007-08-18 22:30:16+04:00, kostja@bodhi.(none) +1 -1
    Update result (new format of SHOW SLAVE STATUS).

  mysql-test/r/rpl_slave_skip.result@stripped, 2007-08-18 22:30:16+04:00, kostja@bodhi.(none) +2 -2
    Update result.

  sql/field.cc@stripped, 2007-08-18 22:30:16+04:00, kostja@bodhi.(none) +13 -13
    Fix compile errors (gptr, char -> uchar)

  sql/field.h@stripped, 2007-08-18 22:30:16+04:00, kostja@bodhi.(none) +2 -2
    Fix compile errors (gptr, char -> uchar)

  sql/ha_ndbcluster.cc@stripped, 2007-08-18 22:30:16+04:00, kostja@bodhi.(none) +1 -1
    Fix a compile error (void -> uchar)

  sql/ha_ndbcluster_binlog.h@stripped, 2007-08-18 22:30:16+04:00, kostja@bodhi.(none) +2 -2
    Fix a compile error (gptr is gone)

  sql/log_event.cc@stripped, 2007-08-18 22:30:16+04:00, kostja@bodhi.(none) +5 -3
    Fix compile errors.

  sql/mysql_priv.h@stripped, 2007-08-18 22:30:17+04:00, kostja@bodhi.(none) +2 -1
    An after-merge fix.

  sql/rpl_rli.h@stripped, 2007-08-18 22:30:17+04:00, kostja@bodhi.(none) +1 -0
    An after-merge fix.

  sql/rpl_utility.h@stripped, 2007-08-18 22:30:17+04:00, kostja@bodhi.(none) +3 -2
    Fix compile errors (gptr is gone).

  sql/sql_lex.cc@stripped, 2007-08-18 22:30:17+04:00, kostja@bodhi.(none) +1 -1
    Phase out change_level with build_method.

  sql/sql_lex.h@stripped, 2007-08-18 22:30:17+04:00, kostja@bodhi.(none) +30 -25
    Fix a bad merge.
    Replace change_level with build_level (they have similar semantics).

  sql/sql_table.cc@stripped, 2007-08-18 22:30:17+04:00, kostja@bodhi.(none) +3 -3
    Fix a merge mistake.

  sql/table.cc@stripped, 2007-08-18 22:30:17+04:00, kostja@bodhi.(none) +1 -1
    Fix one place in the new code that didn't use OTM modes.

diff -Nrup a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
--- a/mysql-test/r/alter_table.result	2007-06-04 09:07:19 +04:00
+++ b/mysql-test/r/alter_table.result	2007-08-18 22:30:16 +04:00
@@ -1030,6 +1030,7 @@ select * from t2;
 c
 NULL
 1
+Two
 Three
 lock table t2 write, t3 read;
 alter table t2 change c vc varchar(100) default "Four", rename to t1;
@@ -1046,6 +1047,7 @@ select * from t1;
 vc
 NULL
 1
+Two
 Three
 Four
 drop tables t1, t3;
diff -Nrup a/mysql-test/r/rpl_extraColmaster_innodb.result b/mysql-test/r/rpl_extraColmaster_innodb.result
--- a/mysql-test/r/rpl_extraColmaster_innodb.result	2007-07-28 07:11:29 +04:00
+++ b/mysql-test/r/rpl_extraColmaster_innodb.result	2007-08-18 22:30:16 +04:00
@@ -59,6 +59,10 @@ Master_SSL_Cipher	
 Master_SSL_Key	
 Seconds_Behind_Master	#
 Master_SSL_Verify_Server_Cert	No
+Last_IO_Errno	0
+Last_IO_Error	
+Last_SQL_Errno	0
+Last_SQL_Error	
 select * from t1 order by f3;
 f1	f2	f3	f4
 2	2	2	second
@@ -372,6 +376,10 @@ Master_SSL_Cipher	
 Master_SSL_Key	
 Seconds_Behind_Master	#
 Master_SSL_Verify_Server_Cert	No
+Last_IO_Errno	0
+Last_IO_Error	
+Last_SQL_Errno	0
+Last_SQL_Error	
 set binlog_format=statement;
 CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
 /* extra */
@@ -427,6 +435,10 @@ Master_SSL_Cipher	
 Master_SSL_Key	
 Seconds_Behind_Master	#
 Master_SSL_Verify_Server_Cert	No
+Last_IO_Errno	0
+Last_IO_Error	
+Last_SQL_Errno	0
+Last_SQL_Error	
 select * from t1 order by f3;
 f1	f2	f3	f4
 2	2	2	second
@@ -740,3 +752,7 @@ Master_SSL_Cipher	
 Master_SSL_Key	
 Seconds_Behind_Master	#
 Master_SSL_Verify_Server_Cert	No
+Last_IO_Errno	0
+Last_IO_Error	
+Last_SQL_Errno	0
+Last_SQL_Error	
diff -Nrup a/mysql-test/r/rpl_extraColmaster_myisam.result b/mysql-test/r/rpl_extraColmaster_myisam.result
--- a/mysql-test/r/rpl_extraColmaster_myisam.result	2007-07-28 07:11:30 +04:00
+++ b/mysql-test/r/rpl_extraColmaster_myisam.result	2007-08-18 22:30:16 +04:00
@@ -59,6 +59,10 @@ Master_SSL_Cipher	
 Master_SSL_Key	
 Seconds_Behind_Master	#
 Master_SSL_Verify_Server_Cert	No
+Last_IO_Errno	0
+Last_IO_Error	
+Last_SQL_Errno	0
+Last_SQL_Error	
 select * from t1 order by f3;
 f1	f2	f3	f4
 2	2	2	second
@@ -372,6 +376,10 @@ Master_SSL_Cipher	
 Master_SSL_Key	
 Seconds_Behind_Master	#
 Master_SSL_Verify_Server_Cert	No
+Last_IO_Errno	0
+Last_IO_Error	
+Last_SQL_Errno	0
+Last_SQL_Error	
 set binlog_format=statement;
 CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
 /* extra */
@@ -427,6 +435,10 @@ Master_SSL_Cipher	
 Master_SSL_Key	
 Seconds_Behind_Master	#
 Master_SSL_Verify_Server_Cert	No
+Last_IO_Errno	0
+Last_IO_Error	
+Last_SQL_Errno	0
+Last_SQL_Error	
 select * from t1 order by f3;
 f1	f2	f3	f4
 2	2	2	second
@@ -740,3 +752,7 @@ Master_SSL_Cipher	
 Master_SSL_Key	
 Seconds_Behind_Master	#
 Master_SSL_Verify_Server_Cert	No
+Last_IO_Errno	0
+Last_IO_Error	
+Last_SQL_Errno	0
+Last_SQL_Error	
diff -Nrup a/mysql-test/r/rpl_skip_error.result b/mysql-test/r/rpl_skip_error.result
--- a/mysql-test/r/rpl_skip_error.result	2007-06-25 04:35:08 +04:00
+++ b/mysql-test/r/rpl_skip_error.result	2007-08-18 22:30:16 +04:00
@@ -32,5 +32,5 @@ a
 3
 show slave status;
 Slave_IO_State	Master_Host	Master_User	Master_Port	Connect_Retry	Master_Log_File	Read_Master_Log_Pos	Relay_Log_File	Relay_Log_Pos	Relay_Master_Log_File	Slave_IO_Running	Slave_SQL_Running	Replicate_Do_DB	Replicate_Ignore_DB	Replicate_Do_Table	Replicate_Ignore_Table	Replicate_Wild_Do_Table	Replicate_Wild_Ignore_Table	Last_Errno	Last_Error	Skip_Counter	Exec_Master_Log_Pos	Relay_Log_Space	Until_Condition	Until_Log_File	Until_Log_Pos	Master_SSL_Allowed	Master_SSL_CA_File	Master_SSL_CA_Path	Master_SSL_Cert	Master_SSL_Cipher	Master_SSL_Key	Seconds_Behind_Master	Master_SSL_Verify_Server_Cert	Last_IO_Errno	Last_IO_Error	Last_SQL_Errno	Last_SQL_Error
-#	127.0.0.1	root	MASTER_PORT	1	master-bin.000001	776	#	#	master-bin.000001	Yes	Yes							0		0	776	#	None		0	No						#	No	0		0	
+#	127.0.0.1	root	MASTER_PORT	1	master-bin.000001	786	#	#	master-bin.000001	Yes	Yes							0		0	786	#	None		0	No						#	No	0		0	
 drop table t1;
diff -Nrup a/mysql-test/r/rpl_slave_skip.result b/mysql-test/r/rpl_slave_skip.result
--- a/mysql-test/r/rpl_slave_skip.result	2007-06-13 17:16:26 +04:00
+++ b/mysql-test/r/rpl_slave_skip.result	2007-08-18 22:30:16 +04:00
@@ -44,7 +44,7 @@ Master_User	root
 Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
-Read_Master_Log_Pos	714
+Read_Master_Log_Pos	722
 Relay_Log_File	#
 Relay_Log_Pos	#
 Relay_Master_Log_File	master-bin.000001
@@ -59,7 +59,7 @@ Replicate_Wild_Ignore_Table	
 Last_Errno	0
 Last_Error	
 Skip_Counter	0
-Exec_Master_Log_Pos	484
+Exec_Master_Log_Pos	488
 Relay_Log_Space	#
 Until_Condition	Master
 Until_Log_File	master-bin.000001
diff -Nrup a/sql/field.cc b/sql/field.cc
--- a/sql/field.cc	2007-08-18 14:11:10 +04:00
+++ b/sql/field.cc	2007-08-18 22:30:16 +04:00
@@ -1372,7 +1372,7 @@ bool Field::send_binary(Protocol *protoc
 
    @return  New pointer into memory based on from + length of the data
 */
-const char *Field::unpack(char* to, const char *from, uint param_data)
+const uchar *Field::unpack(uchar* to, const uchar *from, uint param_data)
 {
   uint length=pack_length();
   int from_type= 0;
@@ -2697,9 +2697,9 @@ uint Field_new_decimal::is_equal(Create_
 
    @return  New pointer into memory based on from + length of the data
 */
-const char *Field_new_decimal::unpack(char* to, 
-                                      const char *from, 
-                                      uint param_data)
+const uchar *Field_new_decimal::unpack(uchar* to,
+                                       const uchar *from,
+                                       uint param_data)
 {
   uint from_precision= (param_data & 0xff00) >> 8U;
   uint from_decimal= param_data & 0x00ff;
@@ -2723,7 +2723,7 @@ const char *Field_new_decimal::unpack(ch
       just the first step the resizing operation. The second step does the
       resizing using the precision and decimals from the slave.
     */
-    bin2decimal((char *)from, &dec, from_precision, from_decimal);
+    bin2decimal(from, &dec, from_precision, from_decimal);
     decimal2bin(&dec, to, precision, decimals());
   }
   else
@@ -6406,7 +6406,7 @@ const uchar *Field_string::unpack(uchar 
   DBUG_ASSERT(f_length <= 255);
   length= (uint) *from++;
   bitmap_set_bit(table->write_set,field_index);
-  store(from, length, system_charset_info);
+  store((const char*) from, length, system_charset_info);
   return from+length;
 }
 
@@ -6918,9 +6918,9 @@ uchar *Field_varstring::pack_key_from_ke
 
    @return  New pointer into memory based on from + length of the data
 */
-const char *Field_varstring::unpack(char *to, 
-                                    const char *from,
-                                    uint param_data)
+const uchar *Field_varstring::unpack(uchar *to,
+                                     const uchar *from,
+                                     uint param_data)
 {
   uint length;
   uint l_bytes= (param_data && (param_data < field_length)) ? 
@@ -7663,7 +7663,7 @@ const uchar *Field_blob::unpack(uchar *t
 }
 
 
-const uchar *Field_blob::unpack(uchar *to, uconst char *from)
+const uchar *Field_blob::unpack(uchar *to, const uchar *from)
 {
   memcpy(to,from,packlength);
   uint32 length=get_length(from);
@@ -8722,9 +8722,9 @@ uchar *Field_bit::pack(uchar *to, const 
 
    @return  New pointer into memory based on from + length of the data
 */
-const char *Field_bit::unpack(char *to,
-                              const char *from,
-                              uint param_data)
+const uchar *Field_bit::unpack(uchar *to,
+                               const uchar *from,
+                               uint param_data)
 {
   uint const from_len= (param_data >> 8U) & 0x00ff;
   uint const from_bit_len= param_data & 0x00ff;
diff -Nrup a/sql/field.h b/sql/field.h
--- a/sql/field.h	2007-08-18 14:11:11 +04:00
+++ b/sql/field.h	2007-08-18 22:30:16 +04:00
@@ -1185,7 +1185,7 @@ public:
   void sql_type(String &str) const;
   uchar *pack(uchar *to, const uchar *from, uint max_length=~(uint) 0);
   const uchar *unpack(uchar* to, const uchar *from);
-  virtual const char *unpack(uchar* to, const uchar *from, uint param_data);
+  virtual const uchar *unpack(uchar* to, const uchar *from, uint param_data);
   int pack_cmp(const uchar *a,const uchar *b,uint key_length,
                my_bool insert_or_update);
   int pack_cmp(const uchar *b,uint key_length,my_bool insert_or_update);
@@ -1319,7 +1319,7 @@ public:
     }
   }
   Field_blob(uint32 packlength_arg)
-    :Field_longstr((char*) 0, 0, (uchar*) "", 0, NONE, "temp", system_charset_info),
+    :Field_longstr((uchar*) 0, 0, (uchar*) "", 0, NONE, "temp", system_charset_info),
     packlength(packlength_arg) {}
   enum_field_types type() const { return MYSQL_TYPE_BLOB;}
   enum ha_base_keytype key_type() const
diff -Nrup a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
--- a/sql/ha_ndbcluster.cc	2007-08-18 14:11:11 +04:00
+++ b/sql/ha_ndbcluster.cc	2007-08-18 22:30:16 +04:00
@@ -11038,7 +11038,7 @@ int ha_ndbcluster::alter_table_phase1(TH
 
 int ha_ndbcluster::alter_frm(const char *file, NDB_ALTER_DATA *alter_data)
 {
-  const void *data= NULL, *pack_data= NULL;
+  uchar *data= NULL, *pack_data= NULL;
   uint length, pack_length;
   int error= 0;
 
diff -Nrup a/sql/ha_ndbcluster_binlog.h b/sql/ha_ndbcluster_binlog.h
--- a/sql/ha_ndbcluster_binlog.h	2007-08-18 13:24:50 +04:00
+++ b/sql/ha_ndbcluster_binlog.h	2007-08-18 22:30:16 +04:00
@@ -48,8 +48,8 @@ public:
   ~Ndb_event_data()
   {
     share= 0;
-    my_free((gptr) ndb_value[0], MYF(MY_WME));
-    my_free((gptr) ndb_value[1], MYF(MY_WME));
+    my_free(ndb_value[0], MYF(MY_WME));
+    my_free(ndb_value[1], MYF(MY_WME));
   }
   NDB_SHARE *share;
   NdbValue *ndb_value[2];
diff -Nrup a/sql/log_event.cc b/sql/log_event.cc
--- a/sql/log_event.cc	2007-08-18 14:11:11 +04:00
+++ b/sql/log_event.cc	2007-08-18 22:30:16 +04:00
@@ -6604,7 +6604,8 @@ Table_map_log_event::Table_map_log_event
   */
   uint num_null_bytes= (m_table->s->fields + 7) / 8;
   m_data_size+= num_null_bytes;
-  m_meta_memory= my_multi_malloc(MYF(MY_WME),
+  m_meta_memory= (uchar*)
+                 my_multi_malloc(MYF(MY_WME),
                                  &m_null_bits, num_null_bytes,
                                  &m_field_metadata, m_field_metadata_size,
                                  NULL);
@@ -6714,7 +6715,8 @@ Table_map_log_event::Table_map_log_event
     {
       m_field_metadata_size= net_field_length(&ptr_after_colcnt);
       uint num_null_bytes= (m_colcnt + 7) / 8;
-      m_meta_memory= my_multi_malloc(MYF(MY_WME),
+      m_meta_memory= (uchar*)
+                     my_multi_malloc(MYF(MY_WME),
                                      &m_null_bits, num_null_bytes,
                                      &m_field_metadata, m_field_metadata_size,
                                      NULL);
@@ -6932,7 +6934,7 @@ bool Table_map_log_event::write_data_bod
 
   uchar cbuf[sizeof(m_colcnt)];
   uchar *const cbuf_end= net_store_length(cbuf, (size_t) m_colcnt);
-  DBUG_ASSERT(static_cast<my_size_t>(cbuf_end - cbuf) <= sizeof(cbuf));
+  DBUG_ASSERT(static_cast<size_t>(cbuf_end - cbuf) <= sizeof(cbuf));
 
   /*
     Store the size of the field metadata.
diff -Nrup a/sql/mysql_priv.h b/sql/mysql_priv.h
--- a/sql/mysql_priv.h	2007-08-18 14:11:11 +04:00
+++ b/sql/mysql_priv.h	2007-08-18 22:30:17 +04:00
@@ -230,6 +230,7 @@ protected:
   CHARSET_INFO *m_connection_cl;
 };
 
+
 /**
   Opening modes for open_temporary_table and open_table_from_share
 */
@@ -239,7 +240,7 @@ enum open_table_mode
   OTM_OPEN= 0,
   OTM_CREATE= 1,
   OTM_ALTER= 2
-}
+};
 
 /***************************************************************************
   Configuration parameters
diff -Nrup a/sql/rpl_rli.h b/sql/rpl_rli.h
--- a/sql/rpl_rli.h	2007-08-18 14:11:11 +04:00
+++ b/sql/rpl_rli.h	2007-08-18 22:30:17 +04:00
@@ -17,6 +17,7 @@
 #define RPL_RLI_H
 
 #include "rpl_tblmap.h"
+#include "rpl_utility.h"
 #include "rpl_reporting.h"
 
 struct RPL_TABLE_LIST;
diff -Nrup a/sql/rpl_utility.h b/sql/rpl_utility.h
--- a/sql/rpl_utility.h	2007-08-18 14:11:11 +04:00
+++ b/sql/rpl_utility.h	2007-08-18 22:30:17 +04:00
@@ -64,7 +64,8 @@ public:
     : m_size(size), m_type(0),
       m_field_metadata(0), m_null_bits(0), m_memory(NULL)
   {
-    m_memory= my_multi_malloc(MYF(MY_WME),
+    m_memory= (uchar*)
+              my_multi_malloc(MYF(MY_WME),
                               &m_type, size,
                               &m_field_metadata, size * sizeof(short),
                               &m_null_bits, (m_size + 7) / 8,
@@ -239,7 +240,7 @@ private:
   field_type *m_type;                     // Array of type descriptors
   short int *m_field_metadata;
   uchar *m_null_bits;
-  gptr m_memory;
+  uchar *m_memory;
 };
 
 /**
diff -Nrup a/sql/sql_lex.cc b/sql/sql_lex.cc
--- a/sql/sql_lex.cc	2007-06-29 17:59:17 +04:00
+++ b/sql/sql_lex.cc	2007-08-18 22:30:17 +04:00
@@ -1406,7 +1406,7 @@ Alter_info::Alter_info(const Alter_info 
   tablespace_op(rhs.tablespace_op),
   partition_names(rhs.partition_names, mem_root),
   no_parts(rhs.no_parts),
-  change_level(rhs.change_level),
+  build_method(rhs.build_method),
   datetime_field(rhs.datetime_field),
   error_if_not_empty(rhs.error_if_not_empty)
 {
diff -Nrup a/sql/sql_lex.h b/sql/sql_lex.h
--- a/sql/sql_lex.h	2007-08-18 14:11:11 +04:00
+++ b/sql/sql_lex.h	2007-08-18 22:30:17 +04:00
@@ -806,30 +806,35 @@ inline bool st_select_lex_unit::is_union
 #define ALTER_ADD_COLUMN	(1L << 0)
 #define ALTER_DROP_COLUMN	(1L << 1)
 #define ALTER_CHANGE_COLUMN	(1L << 2)
-#define ALTER_ADD_INDEX		(1L << 3)
-#define ALTER_DROP_INDEX	(1L << 4)
-#define ALTER_RENAME		(1L << 5)
-#define ALTER_ORDER		(1L << 6)
-#define ALTER_OPTIONS		(1L << 7)
-#define ALTER_CHANGE_COLUMN_DEFAULT (1L << 8)
-#define ALTER_KEYS_ONOFF        (1L << 9)
-#define ALTER_CONVERT           (1L << 10)
-#define ALTER_FORCE		(1L << 11)
-#define ALTER_RECREATE          (1L << 12)
-#define ALTER_ADD_PARTITION     (1L << 13)
-#define ALTER_DROP_PARTITION    (1L << 14)
-#define ALTER_COALESCE_PARTITION (1L << 15)
-#define ALTER_REORGANIZE_PARTITION (1L << 16) 
-#define ALTER_PARTITION          (1L << 17)
-#define ALTER_OPTIMIZE_PARTITION (1L << 18)
-#define ALTER_TABLE_REORG        (1L << 19)
-#define ALTER_REBUILD_PARTITION  (1L << 20)
-#define ALTER_ALL_PARTITION      (1L << 21)
-#define ALTER_ANALYZE_PARTITION  (1L << 22)
-#define ALTER_CHECK_PARTITION    (1L << 23)
-#define ALTER_REPAIR_PARTITION   (1L << 24)
-#define ALTER_REMOVE_PARTITIONING (1L << 25)
-#define ALTER_FOREIGN_KEY         (1L << 26)
+#define ALTER_COLUMN_STORAGE	(1L << 3)
+#define ALTER_COLUMN_FORMAT	(1L << 4)
+#define ALTER_COLUMN_ORDER      (1L << 5)
+#define ALTER_ADD_INDEX		(1L << 6)
+#define ALTER_DROP_INDEX	(1L << 7)
+#define ALTER_RENAME		(1L << 8)
+#define ALTER_ORDER		(1L << 9)
+#define ALTER_OPTIONS		(1L << 10)
+#define ALTER_COLUMN_DEFAULT    (1L << 11)
+#define ALTER_KEYS_ONOFF        (1L << 12)
+#define ALTER_STORAGE	        (1L << 13)
+#define ALTER_ROW_FORMAT        (1L << 14)
+#define ALTER_CONVERT           (1L << 15)
+#define ALTER_FORCE		(1L << 16)
+#define ALTER_RECREATE          (1L << 17)
+#define ALTER_ADD_PARTITION     (1L << 18)
+#define ALTER_DROP_PARTITION    (1L << 19)
+#define ALTER_COALESCE_PARTITION (1L << 20)
+#define ALTER_REORGANIZE_PARTITION (1L << 21)
+#define ALTER_PARTITION          (1L << 22)
+#define ALTER_OPTIMIZE_PARTITION (1L << 23)
+#define ALTER_TABLE_REORG        (1L << 24)
+#define ALTER_REBUILD_PARTITION  (1L << 25)
+#define ALTER_ALL_PARTITION      (1L << 26)
+#define ALTER_ANALYZE_PARTITION  (1L << 27)
+#define ALTER_CHECK_PARTITION    (1L << 28)
+#define ALTER_REPAIR_PARTITION   (1L << 29)
+#define ALTER_REMOVE_PARTITIONING (1L << 30)
+#define ALTER_FOREIGN_KEY         (1L << 31)
 
 /**
   @brief Parsing data for CREATE or ALTER TABLE.
@@ -860,7 +865,7 @@ public:
     keys_onoff(LEAVE_AS_IS),
     tablespace_op(NO_TABLESPACE_OP),
     no_parts(0),
-    change_level(ALTER_TABLE_METADATA_ONLY),
+    build_method(HA_BUILD_DEFAULT),
     datetime_field(NULL),
     error_if_not_empty(FALSE)
   {}
diff -Nrup a/sql/sql_table.cc b/sql/sql_table.cc
--- a/sql/sql_table.cc	2007-08-18 14:11:11 +04:00
+++ b/sql/sql_table.cc	2007-08-18 22:30:17 +04:00
@@ -5004,7 +5004,7 @@ compare_tables(THD *thd,
     uint db_options= 0; /* not used */
     /* Create the prepared information. */
     if (mysql_prepare_create_table(thd, create_info,
-                                   tmp_alter_info,
+                                   &tmp_alter_info,
                                    (table->s->tmp_table != NO_TMP_TABLE),
                                    &db_options,
                                    table->file,
@@ -5017,7 +5017,7 @@ compare_tables(THD *thd,
            (uint*) thd->alloc(sizeof(uint) * table->s->keys)) ||
         ! (ha_alter_info->index_add_buffer=
            (uint*) thd->alloc(sizeof(uint) *
-                              tmp_alter_info->key_list.elements)))
+                              tmp_alter_info.key_list.elements)))
       DBUG_RETURN(TRUE);
   }
   /*
@@ -6477,7 +6477,7 @@ view_err:
                                                 table,
                                                 new_db,
                                                 create_info,
-                                                &tmp_alter_info1,
+                                                &tmp_alter_info,
                                                 !strcmp(db, new_db))))
         goto err;
       switch (table->file->check_if_supported_alter(altered_table,
diff -Nrup a/sql/table.cc b/sql/table.cc
--- a/sql/table.cc	2007-08-18 13:24:52 +04:00
+++ b/sql/table.cc	2007-08-18 22:30:17 +04:00
@@ -1796,7 +1796,7 @@ int open_table_from_share(THD *thd, TABL
     if (!tmp)
     {
       if (work_part_info_used)
-        tmp= fix_partition_func(thd, outparam, is_create_table);
+        tmp= fix_partition_func(thd, outparam, (open_mode != OTM_OPEN));
       outparam->part_info->item_free_list= part_func_arena.free_list;
     }
     if (tmp)
Thread
bk commit into 5.1 tree (kostja:1.2547)konstantin18 Aug