Skip to content

Commit b7c3b42

Browse files
authored
AP-1531 Zero-pad fixed-length binary fields (#1123)
1 parent bb71fd5 commit b7c3b42

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

pipelinewise/fastsync/commons/tap_mysql.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ def get_table_columns(self, table_name, max_num=None, date_type='date'):
357357
WHEN data_type IN ('blob', 'tinyblob', 'mediumblob', 'longblob')
358358
THEN CONCAT('REPLACE(hex(`', column_name, '`)', ", '\n', ' ')")
359359
WHEN data_type IN ('binary', 'varbinary')
360-
THEN concat('REPLACE(REPLACE(hex(trim(trailing CHAR(0x00) from `',COLUMN_NAME,'`))', ", '\n', ' '), '\r', '')")
360+
THEN concat('REPLACE(REPLACE(hex(`',COLUMN_NAME,'`)', ", '\n', ' '), '\r', '')")
361361
WHEN data_type IN ('bit')
362362
THEN concat('cast(`', column_name, '` AS unsigned)')
363363
WHEN data_type IN ('date')
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pipelinewise-tap-mysql==1.5.5
1+
pipelinewise-tap-mysql==1.5.6

tests/db/tap_mysql_data.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1608,7 +1608,7 @@ DROP TABLE IF EXISTS `all_datatypes`;
16081608
CREATE TABLE `all_datatypes` (
16091609
c_char CHAR PRIMARY KEY,
16101610
c_varchar VARCHAR(100),
1611-
c_binary BINARY,
1611+
c_binary BINARY(6),
16121612
c_varbinary VARBINARY(100),
16131613
c_blob BLOB,
16141614
c_tinyblob TINYBLOB,

0 commit comments

Comments
 (0)