Skip to content

Commit f71d252

Browse files
author
eitam
committed
Minor fix
1 parent 8519f22 commit f71d252

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

canal/canal.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,11 @@ func (c *Canal) GenerateCharsetQuery() (string, error) {
439439
SELECT
440440
c.ORDINAL_POSITION,
441441
COALESCE(
442-
c.CHARACTER_SET_NAME,
443-
col.CHARACTER_SET_NAME,
442+
CASE
443+
WHEN c.CHARACTER_SET_NAME IS NOT NULL THEN c.CHARACTER_SET_NAME
444+
WHEN c.DATA_TYPE IN ('binary','varbinary','tinyblob','blob','mediumblob','longblob') THEN col.CHARACTER_SET_NAME
445+
ELSE col.CHARACTER_SET_NAME
446+
END,
444447
'utf8mb4'
445448
) AS CHARACTER_SET_NAME,
446449
c.COLUMN_NAME

0 commit comments

Comments
 (0)