File tree Expand file tree Collapse file tree 15 files changed +28
-52
lines changed
canal_json_adapter_compatibility
canal_json_content_compatible Expand file tree Collapse file tree 15 files changed +28
-52
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,9 @@ func (c *dbzCodec) writeDebeziumFieldValues(
49
49
colInfos := tableInfo .GetColInfosForRowChangedEvent ()
50
50
writer .WriteObjectField (fieldName , func () {
51
51
for i , col := range cols {
52
+ if col == nil {
53
+ continue
54
+ }
52
55
colx := model .GetColumnDataX (col , tableInfo )
53
56
err = c .writeDebeziumFieldValue (writer , colx , colInfos [i ].Ft )
54
57
if err != nil {
@@ -1088,6 +1091,9 @@ func (c *dbzCodec) EncodeValue(
1088
1091
}
1089
1092
colInfos := e .TableInfo .GetColInfosForRowChangedEvent ()
1090
1093
for i , col := range validCols {
1094
+ if col == nil {
1095
+ continue
1096
+ }
1091
1097
colx := model .GetColumnDataX (col , e .TableInfo )
1092
1098
c .writeDebeziumFieldSchema (fieldsWriter , colx , colInfos [i ].Ft )
1093
1099
}
Original file line number Diff line number Diff line change @@ -19,11 +19,11 @@ while [ $i -lt $check_time ]; do
19
19
break
20
20
fi
21
21
(( i++ ))
22
- echo " table $1 not exists for $i -th check, retry later"
22
+ echo " table $1 exists for $i -th check, retry later"
23
23
sleep 2
24
24
done
25
25
26
26
if [ $i -ge $check_time ]; then
27
- echo " table $1 not exists at last check"
27
+ echo " table $1 exists at last check"
28
28
exit 1
29
29
fi
Original file line number Diff line number Diff line change @@ -33,11 +33,13 @@ function run() {
33
33
run_sql_file $CUR /data/data.sql ${UP_TIDB_HOST} ${UP_TIDB_PORT}
34
34
35
35
# sync_diff can't check non-exist table, so we check expected tables are created in downstream first
36
- check_table_exists test.binary_columns ${DOWN_TIDB_HOST} ${DOWN_TIDB_PORT} 600
36
+ run_sql " CREATE TABLE test.finish_mark1 (a int primary key);" ${UP_TIDB_HOST} ${UP_TIDB_PORT}
37
+ check_table_exists test.finish_mark1 ${DOWN_TIDB_HOST} ${DOWN_TIDB_PORT} 200
37
38
check_sync_diff $WORK_DIR $CUR /conf/diff_config.toml 600
38
39
39
40
run_sql_file $CUR /data/data_gbk.sql ${UP_TIDB_HOST} ${UP_TIDB_PORT}
40
- check_table_exists test.binary_columns ${DOWN_TIDB_HOST} ${DOWN_TIDB_PORT} 600
41
+ run_sql " CREATE TABLE test.finish_mark2 (a int primary key);" ${UP_TIDB_HOST} ${UP_TIDB_PORT}
42
+ check_table_exists test.finish_mark2 ${DOWN_TIDB_HOST} ${DOWN_TIDB_PORT} 200
41
43
check_sync_diff $WORK_DIR $CUR /conf/diff_config.toml 600
42
44
43
45
cleanup_process $CDC_BINARY
Original file line number Diff line number Diff line change @@ -323,8 +323,3 @@ CREATE TABLE 表1 (
323
323
RENAME TABLE 表1 TO 表2 ;
324
324
325
325
DROP TABLE 表2 ;
326
-
327
- create table finish_mark
328
- (
329
- id int PRIMARY KEY
330
- );
Original file line number Diff line number Diff line change @@ -94,8 +94,3 @@ CREATE TABLE
94
94
) ENGINE = InnoDB;
95
95
96
96
RENAME TABLE 表1 TO 表2 ;
97
-
98
- create table finish_mark
99
- (
100
- id int PRIMARY KEY
101
- );
Original file line number Diff line number Diff line change @@ -50,11 +50,13 @@ function run() {
50
50
run_sql_file $CUR /data/data.sql ${UP_TIDB_HOST} ${UP_TIDB_PORT}
51
51
52
52
# sync_diff can't check non-exist table, so we check expected tables are created in downstream first
53
- check_table_exists test.finish_mark ${DOWN_TIDB_HOST} ${DOWN_TIDB_PORT} 200
53
+ run_sql " CREATE TABLE test.finish_mark1 (a int primary key);" ${UP_TIDB_HOST} ${UP_TIDB_PORT}
54
+ check_table_exists test.finish_mark1 ${DOWN_TIDB_HOST} ${DOWN_TIDB_PORT} 200
54
55
check_sync_diff $WORK_DIR $CUR /conf/diff_config.toml
55
56
56
57
run_sql_file $CUR /data/data_gbk.sql ${UP_TIDB_HOST} ${UP_TIDB_PORT}
57
- check_table_exists test.finish_mark ${DOWN_TIDB_HOST} ${DOWN_TIDB_PORT} 200
58
+ run_sql " CREATE TABLE test.finish_mark2 (a int primary key);" ${UP_TIDB_HOST} ${UP_TIDB_PORT}
59
+ check_table_exists test.finish_mark2 ${DOWN_TIDB_HOST} ${DOWN_TIDB_PORT} 200
58
60
check_sync_diff $WORK_DIR $CUR /conf/diff_config.toml
59
61
60
62
cleanup_process $CDC_BINARY
Original file line number Diff line number Diff line change @@ -323,8 +323,3 @@ CREATE TABLE 表1 (
323
323
RENAME TABLE 表1 TO 表2 ;
324
324
325
325
DROP TABLE 表2 ;
326
-
327
- create table finish_mark
328
- (
329
- id int PRIMARY KEY
330
- );
Original file line number Diff line number Diff line change @@ -94,8 +94,3 @@ CREATE TABLE
94
94
) ENGINE = InnoDB;
95
95
96
96
RENAME TABLE 表1 TO 表2 ;
97
-
98
- create table finish_mark
99
- (
100
- id int PRIMARY KEY
101
- );
Original file line number Diff line number Diff line change @@ -50,11 +50,13 @@ function run() {
50
50
run_sql_file $CUR /data/data.sql ${UP_TIDB_HOST} ${UP_TIDB_PORT}
51
51
52
52
# sync_diff can't check non-exist table, so we check expected tables are created in downstream first
53
- check_table_exists test.finish_mark ${DOWN_TIDB_HOST} ${DOWN_TIDB_PORT} 200
53
+ run_sql " CREATE TABLE test.finish_mark1 (a int primary key);" ${UP_TIDB_HOST} ${UP_TIDB_PORT}
54
+ check_table_exists test.finish_mark1 ${DOWN_TIDB_HOST} ${DOWN_TIDB_PORT} 200
54
55
check_sync_diff $WORK_DIR $CUR /conf/diff_config.toml
55
56
56
57
run_sql_file $CUR /data/data_gbk.sql ${UP_TIDB_HOST} ${UP_TIDB_PORT}
57
- check_table_exists test.finish_mark ${DOWN_TIDB_HOST} ${DOWN_TIDB_PORT} 200
58
+ run_sql " CREATE TABLE test.finish_mark2 (a int primary key);" ${UP_TIDB_HOST} ${UP_TIDB_PORT}
59
+ check_table_exists test.finish_mark2 ${DOWN_TIDB_HOST} ${DOWN_TIDB_PORT} 200
58
60
check_sync_diff $WORK_DIR $CUR /conf/diff_config.toml
59
61
60
62
cleanup_process $CDC_BINARY
Original file line number Diff line number Diff line change @@ -407,8 +407,3 @@ CREATE TABLE 表1 (
407
407
RENAME TABLE 表1 TO 表2 ;
408
408
409
409
DROP TABLE 表2 ;
410
-
411
- create table finish_mark
412
- (
413
- id int PRIMARY KEY
414
- );
You can’t perform that action at this time.
0 commit comments