Skip to content

Commit 3a7223e

Browse files
committed
merge from github
1 parent 553438e commit 3a7223e

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/QueryLogEvent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -885,9 +885,9 @@ private static final String findCodeName(final int code) {
885885
return "Q_DEFAULT_TABLE_ENCRYPTION";
886886
case Q_OPT_FLASHBACK_AREA:
887887
// or Q_DDL_SKIP_REWRITE
888-
return "Q_DDL_SKIP_REWRITE";
888+
return "Q_OPT_FLASHBACK_AREA";
889889
case Q_OPT_INDEX_FORMAT_GPP_ENABLED:
890-
return "Q_DDL_SKIP_REWRITE";
890+
return "Q_OPT_INDEX_FORMAT_GPP_ENABLED";
891891
case Q_HRNOW:
892892
// or Q_WSREP_SKIP_READONLY_CHECKS
893893
return "Q_HRNOW";

driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/MysqlConnector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ private void negotiate(SocketChannel channel) throws IOException {
306306
byte[] scramble = authData;
307307
try {
308308
encryptedPassword = MySQLPasswordEncrypter.scrambleCachingSha2(getPassword().getBytes(),
309-
scramble);
309+
scramble);
310310
} catch (DigestException e) {
311311
throw new RuntimeException("can't encrypt password that will be sent to MySQL server.", e);
312312
}

parse/src/test/java/com/alibaba/otter/canal/parse/inbound/mysql/tsdb/FastsqlSchemaTest.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ public void testSimple() throws Throwable {
2020
String sql1 = "CREATE TABLE `table_x1` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, "
2121
+ "`key1` longtext NOT NULL COMMENT 'key1', `value1` longtext NOT NULL COMMENT 'value1', PRIMARY KEY (`id`) )"
2222
+ "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4";
23+
String sql2 = " CREATE TABLE IF NOT EXISTS `table_x1` ( `id` bigint(20) NOT NULL AUTO_INCREMENT,"
24+
+ "`key1` longtext NOT NULL COMMENT 'key1',PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4";
2325
repository.console(sql1);
26+
repository.console(sql2);
2427
repository.setDefaultSchema("test");
2528
SchemaObject table = repository.findTable("table_x1");
2629
System.out.println(table.getStatement().toString());
@@ -45,7 +48,7 @@ public void test_json_index() throws Throwable {
4548
SchemaRepository repository = new SchemaRepository(JdbcConstants.MYSQL);
4649
String sql = " CREATE TABLE `articles` ( `article_id` bigint NOT NULL AUTO_INCREMENT,"
4750
+ " `tags` json DEFAULT NULL, PRIMARY KEY (`article_id`),"
48-
+ " KEY `articles_tags` ((cast(json_extract(`tags`,_utf8mb4'$[*]') as char(40))))"
51+
+ " KEY `articles_tags` ((cast(json_extract(`tags`,_utf8mb4'$[*]') as char(40) array)))"
4952
+ ") ENGINE=InnoDB AUTO_INCREMENT=1054 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci";
5053
repository.console(sql);
5154
repository.setDefaultSchema("test");
@@ -59,7 +62,7 @@ public void test_invisible() throws Throwable {
5962
SchemaRepository repository = new SchemaRepository(JdbcConstants.MYSQL);
6063
String sql = " CREATE TABLE `proposal_order_info` (`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,"
6164
+ "`created_at` timestamp NULL DEFAULT NULL, " + "PRIMARY KEY (`id`) , "
62-
+ "KEY `idx_create_time` (`created_at`)"
65+
+ "KEY `idx_create_time` (`created_at`) /*!80000 INVISIBLE */"
6366
+ ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 BLOCK_FORMAT=ENCRYPTED";
6467
repository.console(sql);
6568
repository.setDefaultSchema("test");
@@ -73,7 +76,7 @@ public void test_persistent() throws Throwable {
7376
SchemaRepository repository = new SchemaRepository(JdbcConstants.MYSQL);
7477
String sql = " create table example_vc_tbl( c1 int not null auto_increment primary key,"
7578
+ "c2 varchar(70), vc1 int as (length(c2)) virtual,"
76-
+ "DIM_SUM varchar(128) AS (MD5(UPPER(CONCAT(c2, c1)))) STORED)";
79+
+ "DIM_SUM varchar(128) AS (MD5(UPPER(CONCAT(c2, c1)))) PERSISTENT)";
7780
repository.console(sql);
7881
repository.setDefaultSchema("test");
7982
SchemaObject table = repository.findTable("example_vc_tbl");
@@ -114,7 +117,7 @@ public void test_partition_table() throws Throwable {
114117
+ " name varchar(32) \n" + " )\n" + " partition by range(id) (\n"
115118
+ " partition p1 values less than (10),\n" + " partition px values less than MAXVALUE\n"
116119
+ " );";
117-
String sql2 = "alter table test add partition ( partition p2 VALUES LESS THAN (738552) ENGINE = InnoDB, PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = InnoDB)";
120+
String sql2 = "alter table test add partition ( partition 2 VALUES LESS THAN (738552) ENGINE = InnoDB, PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = InnoDB)";
118121
repository.console(sql1);
119122
repository.console(sql2);
120123
repository.setDefaultSchema("test");
@@ -133,7 +136,7 @@ public void test_mariadb_aria() throws Throwable {
133136
+ "avg_frequency decimal(12,4) DEFAULT NULL,\n" + "hist_size tinyint(3) unsigned DEFAULT NULL,\n"
134137
+ "hist_type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB') COLLATE utf8_bin DEFAULT NULL,\n"
135138
+ "histogram varbinary(255) DEFAULT NULL,\n" + "PRIMARY KEY (db_name,table_name,column_name)\n"
136-
+ ") ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin";
139+
+ ") ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=0";
137140
repository.console(sql1);
138141
repository.setDefaultSchema("test");
139142
SchemaObject table = repository.findTable("test");
@@ -336,4 +339,5 @@ public void test_function_index () throws Throwable {
336339
SchemaObject table = repository.findTable("test1");
337340
Assert.assertTrue(table != null);
338341
}
342+
339343
}

0 commit comments

Comments
 (0)