Skip to content

Commit fbe8495

Browse files
committed
move test
Signed-off-by: luofei <luoffei@outlook.com>
1 parent 121efd9 commit fbe8495

File tree

2 files changed

+30
-44
lines changed

2 files changed

+30
-44
lines changed

src/test/java/net/sf/jsqlparser/parser/CCJSqlParserUtilTest.java

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -271,48 +271,4 @@ public void testCondExpressionIssue1482_2() throws JSQLParserException {
271271
assertEquals("test_table_enum.f1_enum IN ('TEST2'::test.\"test_enum\")", expr.toString());
272272
}
273273

274-
@Test
275-
public void testParseStatementIssue1488() throws JSQLParserException {
276-
Statements result = CCJSqlParserUtil.parseStatements("CREATE TABLE u_call_record (\n" +
277-
"card_user_id int(11) NOT NULL,\n" +
278-
"device_id int(11) NOT NULL,\n" +
279-
"call_start_at int(11) NOT NULL DEFAULT CURRENT_TIMESTAMP(11),\n" +
280-
"card_user_name varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,\n" +
281-
"sim_id varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,\n" +
282-
"called_number varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,\n" +
283-
"called_nickname varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,\n" +
284-
"talk_time smallint(8) NULL DEFAULT NULL,\n" +
285-
"area_name varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,\n" +
286-
"area_service_id int(11) NULL DEFAULT NULL,\n" +
287-
"operator_id int(4) NULL DEFAULT NULL,\n" +
288-
"status tinyint(4) NULL DEFAULT NULL,\n" +
289-
"create_at timestamp NULL DEFAULT NULL,\n" +
290-
"place_user varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,\n" +
291-
"PRIMARY KEY (card_user_id, device_id, call_start_at) USING BTREE,\n" +
292-
"INDEX ucr_index_area_name(area_name) USING BTREE,\n" +
293-
"INDEX ucr_index_area_service_id(area_service_id) USING BTREE,\n" +
294-
"INDEX ucr_index_called_number(called_number) USING BTREE,\n" +
295-
"INDEX ucr_index_create_at(create_at) USING BTREE,\n" +
296-
"INDEX ucr_index_operator_id(operator_id) USING BTREE,\n" +
297-
"INDEX ucr_index_place_user(place_user) USING BTREE,\n" +
298-
"INDEX ucr_index_sim_id(sim_id) USING BTREE,\n" +
299-
"INDEX ucr_index_status(status) USING BTREE,\n" +
300-
"INDEX ucr_index_talk_time(talk_time) USING BTREE\n" +
301-
") ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;");
302-
303-
assertEquals("CREATE TABLE u_call_record (card_user_id int (11) NOT NULL, device_id int (11) NOT NULL, " +
304-
"call_start_at int (11) NOT NULL DEFAULT CURRENT_TIMESTAMP (11), card_user_name varchar (32) CHARACTER SET " +
305-
"utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, sim_id varchar (32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci" +
306-
" NULL DEFAULT NULL, called_number varchar (12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT " +
307-
"NULL, called_nickname varchar (32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, talk_time " +
308-
"smallint (8) NULL DEFAULT NULL, area_name varchar (32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL " +
309-
"DEFAULT NULL, area_service_id int (11) NULL DEFAULT NULL, operator_id int (4) NULL DEFAULT NULL, status tinyint (4) " +
310-
"NULL DEFAULT NULL, create_at timestamp NULL DEFAULT NULL, place_user varchar (16) CHARACTER SET utf8mb4 COLLATE " +
311-
"utf8mb4_general_ci NULL DEFAULT NULL, PRIMARY KEY (card_user_id, device_id, call_start_at) USING BTREE, INDEX " +
312-
"ucr_index_area_name (area_name) USING BTREE, INDEX ucr_index_area_service_id (area_service_id) USING BTREE, " +
313-
"INDEX ucr_index_called_number (called_number) USING BTREE, INDEX ucr_index_create_at (create_at) USING BTREE, " +
314-
"INDEX ucr_index_operator_id (operator_id) USING BTREE, INDEX ucr_index_place_user (place_user) USING BTREE, " +
315-
"INDEX ucr_index_sim_id (sim_id) USING BTREE, INDEX ucr_index_status (status) USING BTREE, INDEX ucr_index_talk_time " +
316-
"(talk_time) USING BTREE) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;\n", result.toString());
317-
}
318274
}

src/test/java/net/sf/jsqlparser/statement/create/CreateTableTest.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -861,4 +861,34 @@ public void testCreateUnionIssue1309() throws JSQLParserException {
861861
public void testCreateTableBinaryIssue1518() throws JSQLParserException {
862862
assertSqlCanBeParsedAndDeparsed("CREATE TABLE `s` (`a` enum ('a', 'b', 'c') CHARACTER SET binary COLLATE binary)");
863863
}
864+
865+
@Test
866+
public void testCreateTableIssue1488() throws JSQLParserException {
867+
assertSqlCanBeParsedAndDeparsed("CREATE TABLE u_call_record (\n" +
868+
"card_user_id int(11) NOT NULL,\n" +
869+
"device_id int(11) NOT NULL,\n" +
870+
"call_start_at int(11) NOT NULL DEFAULT CURRENT_TIMESTAMP(11),\n" +
871+
"card_user_name varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,\n" +
872+
"sim_id varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,\n" +
873+
"called_number varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,\n" +
874+
"called_nickname varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,\n" +
875+
"talk_time smallint(8) NULL DEFAULT NULL,\n" +
876+
"area_name varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,\n" +
877+
"area_service_id int(11) NULL DEFAULT NULL,\n" +
878+
"operator_id int(4) NULL DEFAULT NULL,\n" +
879+
"status tinyint(4) NULL DEFAULT NULL,\n" +
880+
"create_at timestamp NULL DEFAULT NULL,\n" +
881+
"place_user varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,\n" +
882+
"PRIMARY KEY (card_user_id, device_id, call_start_at) USING BTREE,\n" +
883+
"INDEX ucr_index_area_name(area_name) USING BTREE,\n" +
884+
"INDEX ucr_index_area_service_id(area_service_id) USING BTREE,\n" +
885+
"INDEX ucr_index_called_number(called_number) USING BTREE,\n" +
886+
"INDEX ucr_index_create_at(create_at) USING BTREE,\n" +
887+
"INDEX ucr_index_operator_id(operator_id) USING BTREE,\n" +
888+
"INDEX ucr_index_place_user(place_user) USING BTREE,\n" +
889+
"INDEX ucr_index_sim_id(sim_id) USING BTREE,\n" +
890+
"INDEX ucr_index_status(status) USING BTREE,\n" +
891+
"INDEX ucr_index_talk_time(talk_time) USING BTREE\n" +
892+
") ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic", true);
893+
}
864894
}

0 commit comments

Comments
 (0)