~tsarev/percona-server/replication_slave_different_schema

« back to all changes in this revision

Viewing changes to rename_field.patch

  • Committer: Oleg Tsarev
  • Date: 2010-11-02 00:36:11 UTC
  • mto: This revision was merged to the branch mainline in revision 136.
  • Revision ID: oleg.tsarev@percona.com-20101102003611-brz6hb9l2uaqz4fq
adapt source code

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
#!!! notice !!!
6
6
# Any small change to this file in the main branch
7
7
# should be done or reviewed by the maintainer!
8
 
diff -Nur /dev/null b/patch_info/rename_field.info
 
8
diff -ruN /dev/null b/patch_info/rename_field.info
9
9
--- /dev/null   1970-01-01 09:00:00.000000000 +0900
10
10
+++ b/patch_info/rename_field.info      2010-09-10 11:22:27.351954038 +0900
11
11
@@ -0,0 +1,15 @@
24
24
+3. if the command ends by error, it should cause inconsistency
25
25
+   of the index name between mysqld and InnoDB.
26
26
+   (Don't use reserved names! "DB_ROW_ID", "DB_TRX_ID", "DB_ROLL_PTR")
27
 
diff -Nur a/sql/handler.h b/sql/handler.h
 
27
diff -ruN a/sql/handler.h b/sql/handler.h
28
28
--- a/sql/handler.h     2010-09-10 10:54:15.464960210 +0900
29
29
+++ b/sql/handler.h     2010-09-10 11:12:15.235922418 +0900
30
 
@@ -1625,6 +1625,10 @@
 
30
@@ -1633,6 +1633,10 @@
31
31
   virtual int rename_index(TABLE *table_arg, const char *from, const char *to)
32
32
   { return (HA_ERR_WRONG_COMMAND); }
33
33
 
38
38
   uint max_record_length() const
39
39
   { return min(HA_MAX_REC_LENGTH, max_supported_record_length()); }
40
40
   uint max_keys() const
41
 
diff -Nur a/sql/sql_table.cc b/sql/sql_table.cc
 
41
diff -ruN a/sql/sql_table.cc b/sql/sql_table.cc
42
42
--- a/sql/sql_table.cc  2010-09-10 10:54:15.485922029 +0900
43
43
+++ b/sql/sql_table.cc  2010-09-10 11:12:15.241891549 +0900
44
 
@@ -7325,6 +7325,33 @@
 
44
@@ -7332,6 +7332,33 @@
45
45
       copy data for MERGE tables. Only the children have data.
46
46
     */
47
47
   }
75
75
 
76
76
   /* Copy the data if necessary. */
77
77
   thd->count_cuted_fields= CHECK_FIELD_WARN;   // calc cuted fields
78
 
diff -Nur a/storage/innodb_plugin/dict/dict0mem.c b/storage/innodb_plugin/dict/dict0mem.c
 
78
diff -ruN a/storage/innodb_plugin/dict/dict0mem.c b/storage/innodb_plugin/dict/dict0mem.c
79
79
--- a/storage/innodb_plugin/dict/dict0mem.c     2010-09-10 10:54:15.082919251 +0900
80
80
+++ b/storage/innodb_plugin/dict/dict0mem.c     2010-09-10 11:12:15.246960627 +0900
81
81
@@ -199,6 +199,17 @@
96
96
        }
97
97
 
98
98
        col = dict_table_get_nth_col(table, i);
99
 
diff -Nur a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc
 
99
diff -ruN a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc
100
100
--- a/storage/innodb_plugin/handler/ha_innodb.cc        2010-09-10 10:54:15.536916334 +0900
101
101
+++ b/storage/innodb_plugin/handler/ha_innodb.cc        2010-09-10 11:12:15.254960837 +0900
102
 
@@ -198,6 +198,8 @@
103
 
 static my_bool innobase_stats_on_metadata              = TRUE;
 
102
@@ -199,6 +199,8 @@
104
103
 static my_bool innobase_use_sys_stats_table            = FALSE;
 
104
 static my_bool innobase_buffer_pool_shm_checksum       = TRUE;
105
105
 
106
106
+static my_bool innobase_internal_rename_field          = FALSE;
107
107
+
108
108
 static char*   internal_innobase_data_file_path        = NULL;
109
109
 
110
110
 static char*   innodb_version_str = (char*) INNODB_VERSION_STR;
111
 
@@ -10578,7 +10580,7 @@
 
111
@@ -10603,7 +10605,7 @@
112
112
        system metadata change. To avoid system metadata inconsistency,
113
113
        currently we can just request a table rebuild/copy by returning
114
114
        COMPATIBLE_DATA_NO */
117
117
                return COMPATIBLE_DATA_NO;
118
118
        }
119
119
 
120
 
@@ -11092,6 +11094,15 @@
 
120
@@ -11117,6 +11119,15 @@
121
121
        return(false);
122
122
 }
123
123
 
133
133
 static SHOW_VAR innodb_status_variables_export[]= {
134
134
   {"Innodb",                   (char*) &show_innodb_vars, SHOW_FUNC},
135
135
   {NullS, NullS, SHOW_LONG}
136
 
@@ -11598,6 +11609,13 @@
 
136
@@ -11634,6 +11645,13 @@
137
137
   "except for the deletion.",
138
138
   NULL, NULL, 0, 0, 1, 0);
139
139
 
147
147
 static struct st_mysql_sys_var* innobase_system_variables[]= {
148
148
   MYSQL_SYSVAR(page_size),
149
149
   MYSQL_SYSVAR(additional_mem_pool_size),
150
 
@@ -11683,6 +11701,7 @@
151
 
   MYSQL_SYSVAR(io_capacity),
 
150
@@ -11721,6 +11739,7 @@
 
151
   MYSQL_SYSVAR(auto_lru_dump),
152
152
   MYSQL_SYSVAR(use_purge_thread),
153
153
   MYSQL_SYSVAR(pass_corrupt_table),
154
154
+  MYSQL_SYSVAR(internal_rename_field),
155
155
   NULL
156
156
 };
157
157
 
158
 
diff -Nur a/storage/innodb_plugin/handler/ha_innodb.h b/storage/innodb_plugin/handler/ha_innodb.h
 
158
diff -ruN a/storage/innodb_plugin/handler/ha_innodb.h b/storage/innodb_plugin/handler/ha_innodb.h
159
159
--- a/storage/innodb_plugin/handler/ha_innodb.h 2010-09-10 10:54:15.513918159 +0900
160
160
+++ b/storage/innodb_plugin/handler/ha_innodb.h 2010-09-10 11:12:15.260959990 +0900
161
161
@@ -224,6 +224,8 @@
178
178
+innobase_rename_field();
179
179
+/*===================*/
180
180
+
181
 
diff -Nur a/storage/innodb_plugin/handler/handler0alter.cc b/storage/innodb_plugin/handler/handler0alter.cc
 
181
diff -ruN a/storage/innodb_plugin/handler/handler0alter.cc b/storage/innodb_plugin/handler/handler0alter.cc
182
182
--- a/storage/innodb_plugin/handler/handler0alter.cc    2010-09-10 10:54:15.514916344 +0900
183
183
+++ b/storage/innodb_plugin/handler/handler0alter.cc    2010-09-10 11:12:15.262959956 +0900
184
184
@@ -1379,3 +1379,124 @@
306
306
+       DBUG_RETURN(error);
307
307
+}
308
308
+
309
 
diff -Nur a/storage/innodb_plugin/include/dict0mem.h b/storage/innodb_plugin/include/dict0mem.h
 
309
diff -ruN a/storage/innodb_plugin/include/dict0mem.h b/storage/innodb_plugin/include/dict0mem.h
310
310
--- a/storage/innodb_plugin/include/dict0mem.h  2010-09-10 10:54:15.127879538 +0900
311
311
+++ b/storage/innodb_plugin/include/dict0mem.h  2010-09-10 11:12:15.264960559 +0900
312
 
@@ -414,6 +414,7 @@
 
312
@@ -429,6 +429,7 @@
313
313
                                the string contains n_cols, it will be
314
314
                                allocated from a temporary heap.  The final
315
315
                                string will be allocated from table->heap. */
317
317
 #ifndef UNIV_HOTBACKUP
318
318
        hash_node_t     name_hash; /*!< hash chain node */
319
319
        hash_node_t     id_hash; /*!< hash chain node */
320
 
diff -Nur a/storage/innodb_plugin/include/row0mysql.h b/storage/innodb_plugin/include/row0mysql.h
 
320
diff -ruN a/storage/innodb_plugin/include/row0mysql.h b/storage/innodb_plugin/include/row0mysql.h
321
321
--- a/storage/innodb_plugin/include/row0mysql.h 2010-09-10 10:54:15.516960655 +0900
322
322
+++ b/storage/innodb_plugin/include/row0mysql.h 2010-09-10 11:12:15.265963598 +0900
323
323
@@ -534,6 +534,18 @@
339
339
 /* A struct describing a place for an individual column in the MySQL
340
340
 row format which is presented to the table handler in ha_innobase.
341
341
 This template struct is used to speed up row transformations between
342
 
diff -Nur a/storage/innodb_plugin/row/row0mysql.c b/storage/innodb_plugin/row/row0mysql.c
 
342
diff -ruN a/storage/innodb_plugin/row/row0mysql.c b/storage/innodb_plugin/row/row0mysql.c
343
343
--- a/storage/innodb_plugin/row/row0mysql.c     2010-09-10 10:54:15.519880499 +0900
344
344
+++ b/storage/innodb_plugin/row/row0mysql.c     2010-09-10 11:12:15.270960787 +0900
345
 
@@ -4250,3 +4250,156 @@
 
345
@@ -4281,3 +4281,156 @@
346
346
 
347
347
        return(err);
348
348
 }