@@ -128,7 +128,7 @@ def test_read_state_info(self):
128128 "DROP TABLE IF EXISTS test_new_20210303;" ,
129129 "CREATE TABLE test_new_20210303 LIKE test;" ,
130130 "ALTER TABLE test_new_20210303 REMOVE PARTITIONING;" ,
131- "ALTER TABLE test_new_20210303 PARTITION BY RANGE(id) (" ,
131+ "ALTER TABLE test_new_20210303 PARTITION BY RANGE (id) (" ,
132132 "\t PARTITION p_start VALUES LESS THAN MAXVALUE" ,
133133 ");" ,
134134 "ALTER TABLE `test_new_20210303` REORGANIZE PARTITION `p_start` "
@@ -152,22 +152,22 @@ def test_read_state_info(self):
152152 def test_read_state_info_map_table (self ):
153153 self .maxDiff = None
154154 conf = Config ()
155- conf .assume_partitioned_on = ["order " , "auth " ]
155+ conf .assume_partitioned_on = ["orderID " , "authzID " ]
156156 conf .curtime = datetime (2021 , 3 , 3 )
157157 conf .dbcmd = MockDatabase ()
158- conf .dbcmd ._select_response = [[{"auth " : 22 }], [{"order " : 11 }]]
158+ conf .dbcmd ._select_response = [[{"authzID " : 22 }], [{"orderID " : 11 }]]
159159 conf .dbcmd ._response = [
160160 [
161- {"Field" : "order " , "Type" : "bigint UNSIGNED" },
162- {"Field" : "auth " , "Type" : "bigint UNSIGNED" },
161+ {"Field" : "orderID " , "Type" : "bigint UNSIGNED" },
162+ {"Field" : "authzID " , "Type" : "bigint UNSIGNED" },
163163 ]
164164 ]
165165 conf .tables = [Table ("map_table" ).set_partition_period (timedelta (days = 30 ))]
166166
167167 state_fs = io .StringIO ()
168168 yaml .dump (
169169 {
170- "tables" : {"map_table" : {"order " : 11 , "auth " : 22 }},
170+ "tables" : {"map_table" : {"orderID " : 10 , "authzID " : 20 }},
171171 "time" : (conf .curtime - timedelta (days = 1 )),
172172 },
173173 state_fs ,
@@ -183,20 +183,21 @@ def test_read_state_info_map_table(self):
183183 "DROP TABLE IF EXISTS map_table_new_20210303;" ,
184184 "CREATE TABLE map_table_new_20210303 LIKE map_table;" ,
185185 "ALTER TABLE map_table_new_20210303 REMOVE PARTITIONING;" ,
186- "ALTER TABLE map_table_new_20210303 PARTITION BY RANGE(order, auth) (" ,
187- "\t PARTITION p_assumed VALUES LESS THAN MAXVALUE" ,
186+ "ALTER TABLE map_table_new_20210303 PARTITION BY RANGE "
187+ + "COLUMNS (orderID, authzID) (" ,
188+ "\t PARTITION p_assumed VALUES LESS THAN (MAXVALUE, MAXVALUE)" ,
188189 ");" ,
189190 "ALTER TABLE `map_table_new_20210303` REORGANIZE PARTITION "
190191 + "`p_assumed` INTO (PARTITION `p_20210303` VALUES LESS THAN "
191192 + "(11, 22), PARTITION `p_20210402` VALUES LESS THAN "
192- + "(11, 22 ), PARTITION `p_20210502` VALUES LESS THAN "
193- + "MAXVALUE, MAXVALUE);" ,
193+ + "(41, 82 ), PARTITION `p_20210502` VALUES LESS THAN "
194+ + "( MAXVALUE, MAXVALUE) );" ,
194195 "CREATE OR REPLACE TRIGGER copy_inserts_from_map_table_"
195196 + "to_map_table_new_20210303" ,
196197 "\t AFTER INSERT ON map_table FOR EACH ROW" ,
197198 "\t \t INSERT INTO map_table_new_20210303 SET" ,
198- "\t \t \t `auth ` = NEW.`auth `," ,
199- "\t \t \t `order ` = NEW.`order `;" ,
199+ "\t \t \t `authzID ` = NEW.`authzID `," ,
200+ "\t \t \t `orderID ` = NEW.`orderID `;" ,
200201 ]
201202 },
202203 )
@@ -242,7 +243,7 @@ def test_generate_sql_copy_commands(self):
242243 "DROP TABLE IF EXISTS new;" ,
243244 "CREATE TABLE new LIKE old;" ,
244245 "ALTER TABLE new REMOVE PARTITIONING;" ,
245- "ALTER TABLE new PARTITION BY RANGE(id) (" ,
246+ "ALTER TABLE new PARTITION BY RANGE (id) (" ,
246247 "\t PARTITION p_assumed VALUES LESS THAN MAXVALUE" ,
247248 ");" ,
248249 "STRAIGHT_UP_INSERTED" ,
0 commit comments