~tsarev/percona-server/replication_slave_different_schema

« back to all changes in this revision

Viewing changes to rename_index.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_index.info
 
8
diff -ruN /dev/null b/patch_info/rename_index.info
9
9
--- /dev/null   1970-01-01 09:00:00.000000000 +0900
10
10
+++ b/patch_info/rename_index.info      2010-09-03 17:18:34.280135668 +0900
11
11
@@ -0,0 +1,11 @@
20
20
+2. for MyISAM or InnoDB (Plugin) only. PARTITION is not allowed
21
21
+3. if the command ends by error, it should cause inconsistency
22
22
+   of the index name between mysqld and InnoDB. (InnoDB only)
23
 
diff -Nur a/sql/handler.h b/sql/handler.h
 
23
diff -ruN a/sql/handler.h b/sql/handler.h
24
24
--- a/sql/handler.h     2010-09-03 17:10:01.236168680 +0900
25
25
+++ b/sql/handler.h     2010-09-03 17:10:21.629543000 +0900
26
 
@@ -1621,6 +1621,10 @@
 
26
@@ -1629,6 +1629,10 @@
27
27
   virtual int final_drop_index(TABLE *table_arg)
28
28
   { return (HA_ERR_WRONG_COMMAND); }
29
29
 
34
34
   uint max_record_length() const
35
35
   { return min(HA_MAX_REC_LENGTH, max_supported_record_length()); }
36
36
   uint max_keys() const
37
 
diff -Nur a/sql/sql_class.cc b/sql/sql_class.cc
 
37
diff -ruN a/sql/sql_class.cc b/sql/sql_class.cc
38
38
--- a/sql/sql_class.cc  2010-09-03 17:10:00.082166558 +0900
39
39
+++ b/sql/sql_class.cc  2010-09-03 17:10:21.632246778 +0900
40
40
@@ -68,6 +68,8 @@
46
46
 #endif
47
47
 
48
48
 /****************************************************************************
49
 
diff -Nur a/sql/sql_class.h b/sql/sql_class.h
 
49
diff -ruN a/sql/sql_class.h b/sql/sql_class.h
50
50
--- a/sql/sql_class.h   2010-09-03 17:10:01.258166856 +0900
51
51
+++ b/sql/sql_class.h   2010-09-03 17:10:21.637251953 +0900
52
 
@@ -172,6 +172,17 @@
 
52
@@ -173,6 +173,17 @@
53
53
 };
54
54
 
55
55
 
67
67
 class Alter_drop :public Sql_alloc {
68
68
 public:
69
69
   enum drop_type {KEY, COLUMN };
70
 
diff -Nur a/sql/sql_lex.cc b/sql/sql_lex.cc
 
70
diff -ruN a/sql/sql_lex.cc b/sql/sql_lex.cc
71
71
--- a/sql/sql_lex.cc    2010-08-04 02:24:19.000000000 +0900
72
72
+++ b/sql/sql_lex.cc    2010-09-03 17:10:21.640242292 +0900
73
 
@@ -1486,6 +1486,7 @@
 
73
@@ -1494,6 +1494,7 @@
74
74
   alter_list(rhs.alter_list, mem_root),
75
75
   key_list(rhs.key_list, mem_root),
76
76
   create_list(rhs.create_list, mem_root),
78
78
   flags(rhs.flags),
79
79
   keys_onoff(rhs.keys_onoff),
80
80
   tablespace_op(rhs.tablespace_op),
81
 
@@ -1508,6 +1509,7 @@
 
81
@@ -1516,6 +1517,7 @@
82
82
   list_copy_and_replace_each_value(alter_list, mem_root);
83
83
   list_copy_and_replace_each_value(key_list, mem_root);
84
84
   list_copy_and_replace_each_value(create_list, mem_root);
86
86
   /* partition_names are not deeply copied currently */
87
87
 }
88
88
 
89
 
diff -Nur a/sql/sql_lex.h b/sql/sql_lex.h
 
89
diff -ruN a/sql/sql_lex.h b/sql/sql_lex.h
90
90
--- a/sql/sql_lex.h     2010-09-03 17:10:00.016135765 +0900
91
91
+++ b/sql/sql_lex.h     2010-09-03 17:10:21.643204100 +0900
92
 
@@ -873,6 +873,7 @@
 
92
@@ -874,6 +874,7 @@
93
93
 #define ALTER_ALL_PARTITION      (1L << 21)
94
94
 #define ALTER_REMOVE_PARTITIONING (1L << 22)
95
95
 #define ALTER_FOREIGN_KEY        (1L << 23)
97
97
 
98
98
 enum enum_alter_table_change_level
99
99
 {
100
 
@@ -895,6 +896,7 @@
 
100
@@ -896,6 +897,7 @@
101
101
   List<Alter_column>            alter_list;
102
102
   List<Key>                     key_list;
103
103
   List<Create_field>            create_list;
105
105
   uint                          flags;
106
106
   enum enum_enable_or_disable   keys_onoff;
107
107
   enum tablespace_op_type       tablespace_op;
108
 
@@ -921,6 +923,7 @@
 
108
@@ -922,6 +924,7 @@
109
109
     alter_list.empty();
110
110
     key_list.empty();
111
111
     create_list.empty();
113
113
     flags= 0;
114
114
     keys_onoff= LEAVE_AS_IS;
115
115
     tablespace_op= NO_TABLESPACE_OP;
116
 
diff -Nur a/sql/sql_table.cc b/sql/sql_table.cc
 
116
diff -ruN a/sql/sql_table.cc b/sql/sql_table.cc
117
117
--- a/sql/sql_table.cc  2010-09-03 17:10:01.272166375 +0900
118
118
+++ b/sql/sql_table.cc  2010-09-03 17:10:21.650203965 +0900
119
119
@@ -49,7 +49,7 @@
206
206
     DBUG_RETURN(1);
207
207
   /* Allocate result buffers. */
208
208
   if (! (*index_drop_buffer=
209
 
@@ -6569,6 +6586,16 @@
 
209
@@ -6568,6 +6585,16 @@
210
210
 
211
211
   mysql_ha_rm_tables(thd, table_list, FALSE);
212
212
 
223
223
   /* DISCARD/IMPORT TABLESPACE is always alone in an ALTER TABLE */
224
224
   if (alter_info->tablespace_op != NO_TABLESPACE_OP)
225
225
     /* Conditionally writes to binlog. */
226
 
@@ -6731,6 +6758,48 @@
 
226
@@ -6730,6 +6757,48 @@
227
227
     new_name= table_name;
228
228
   }
229
229
 
272
272
   old_db_type= table->s->db_type();
273
273
   if (!create_info->db_type)
274
274
   {
275
 
@@ -7380,6 +7449,26 @@
 
275
@@ -7386,6 +7455,26 @@
276
276
   }
277
277
   /*end of if (! new_table) for add/drop index*/
278
278
 
299
299
   if (table->s->tmp_table != NO_TMP_TABLE)
300
300
   {
301
301
     /* We changed a temporary table */
302
 
diff -Nur a/sql/sql_yacc.yy b/sql/sql_yacc.yy
 
302
diff -ruN a/sql/sql_yacc.yy b/sql/sql_yacc.yy
303
303
--- a/sql/sql_yacc.yy   2010-09-03 17:10:00.048138226 +0900
304
304
+++ b/sql/sql_yacc.yy   2010-09-03 17:10:21.679137536 +0900
305
 
@@ -6182,6 +6182,15 @@
 
305
@@ -6206,6 +6206,15 @@
306
306
             LEX *lex=Lex;
307
307
             lex->alter_info.flags|= ALTER_ORDER;
308
308
           }
318
318
         ;
319
319
 
320
320
 opt_column:
321
 
diff -Nur a/storage/innodb_plugin/handler/ha_innodb.h b/storage/innodb_plugin/handler/ha_innodb.h
 
321
diff -ruN a/storage/innodb_plugin/handler/ha_innodb.h b/storage/innodb_plugin/handler/ha_innodb.h
322
322
--- a/storage/innodb_plugin/handler/ha_innodb.h 2010-09-03 17:10:00.914204836 +0900
323
323
+++ b/storage/innodb_plugin/handler/ha_innodb.h 2010-09-03 17:10:21.694845461 +0900
324
324
@@ -221,6 +221,9 @@
331
331
 };
332
332
 
333
333
 /* Some accessor functions which the InnoDB plugin needs, but which
334
 
diff -Nur a/storage/innodb_plugin/handler/handler0alter.cc b/storage/innodb_plugin/handler/handler0alter.cc
 
334
diff -ruN a/storage/innodb_plugin/handler/handler0alter.cc b/storage/innodb_plugin/handler/handler0alter.cc
335
335
--- a/storage/innodb_plugin/handler/handler0alter.cc    2010-08-04 02:24:19.000000000 +0900
336
336
+++ b/storage/innodb_plugin/handler/handler0alter.cc    2010-09-03 17:10:21.697204244 +0900
337
337
@@ -1241,3 +1241,141 @@
476
476
+
477
477
+       DBUG_RETURN(error);
478
478
+}
479
 
diff -Nur a/storage/innodb_plugin/include/row0mysql.h b/storage/innodb_plugin/include/row0mysql.h
 
479
diff -ruN a/storage/innodb_plugin/include/row0mysql.h b/storage/innodb_plugin/include/row0mysql.h
480
480
--- a/storage/innodb_plugin/include/row0mysql.h 2010-09-03 17:10:00.591203928 +0900
481
481
+++ b/storage/innodb_plugin/include/row0mysql.h 2010-09-03 17:10:21.699166081 +0900
482
482
@@ -523,6 +523,17 @@
497
497
 /* A struct describing a place for an individual column in the MySQL
498
498
 row format which is presented to the table handler in ha_innobase.
499
499
 This template struct is used to speed up row transformations between
500
 
diff -Nur a/storage/innodb_plugin/row/row0mysql.c b/storage/innodb_plugin/row/row0mysql.c
 
500
diff -ruN a/storage/innodb_plugin/row/row0mysql.c b/storage/innodb_plugin/row/row0mysql.c
501
501
--- a/storage/innodb_plugin/row/row0mysql.c     2010-09-03 17:10:01.164135774 +0900
502
502
+++ b/storage/innodb_plugin/row/row0mysql.c     2010-09-03 17:10:21.702166315 +0900
503
 
@@ -4200,3 +4200,53 @@
 
503
@@ -4231,3 +4231,53 @@
504
504
 
505
505
        return(FALSE);
506
506
 }
554
554
+
555
555
+       return(err);
556
556
+}
557
 
diff -Nur a/storage/myisam/ha_myisam.h b/storage/myisam/ha_myisam.h
 
557
diff -ruN a/storage/myisam/ha_myisam.h b/storage/myisam/ha_myisam.h
558
558
--- a/storage/myisam/ha_myisam.h        2010-08-04 02:24:27.000000000 +0900
559
559
+++ b/storage/myisam/ha_myisam.h        2010-09-03 17:10:21.704163306 +0900
560
560
@@ -60,6 +60,10 @@