Skip to content

Commit

Permalink
export: add back the missing escapeBackslash field on initialize (pin…
Browse files Browse the repository at this point in the history
  • Loading branch information
kennytm authored Sep 6, 2020
1 parent d395232 commit de69f8e
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 8 deletions.
101 changes: 101 additions & 0 deletions dumpling/tests/rows/data/rows.t.0.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
insert into `rows`.`t` (a) values
('vr/g 8uoZ&26U+*%|(k3'),
(':v3uo7whT`Zz>tD=[,)\r'),
('nuq,%sl5+i/pX2''Ur-"`'),
("\tB>+a?]m\\9T!{2X@I:'k"),
('8_/GI}Oh&|YPo0k,@[FB'),
("Lnx3WawtgN'.J)\n[C-V!"),
("$cislLng'V/`Ce[\\\nA4K"),
('&)Jd_tHBY-!Lz?Ij0f\t*'),
('B1KGE,#[L:@Pq8\n_*ANF'),
("([\\c:'>U/)wDN4zQf\tC6"),
('$G\\pS,%BRzsCUqWr^`}3'),
('L5mNTib.KEJCRcl}>\res'),
("MaQ.3K'e_ 7nirjET;x\r"),
(']!62nVsu <y8vIzQYD0P'),
('\\bWPzU(KFfmx~2E54k!A'),
('H$<j?)C; t2S=\rEdZyL,'),
('t\r''X)G]DLIuH$f@b"-;S'),
('~dptv(IQ _cR7xYE1`yz'),
('E(}|qA%-]u{)BQ:jGLVC'),
('Rg&ya"|w60< KYJ#ElU7'),
('N}p9uE;,rTne^0B"yLhq'),
('{2T7!>s&@|A_<%O1v*8W'),
('+[2lwQ!\tL{RsnK]$%E&?'),
('h]e*:;$k"VcHi\t6%X\nQB'),
('|<KrxRV\ri!p*FfS3:n=\t'),
('/#f-K$Uj3y6&:i`Rh[~}'),
('08ci<#NP:~-,[D\ry}>=A'),
(";]KwM~F$z.(L'S-N@7Ug"),
('IlDa4YQ[\r;?h65/ZU+mS'),
("QwfKAPBs=MW,\r0E'i?V1"),
("k*90\\Re!#vfYGx:)g'r3"),
("YS:I(/<NQf>ro'`kzaH\t"),
('1`Bq|a9;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Xz6]sZiA9DSnH'),
('I<aZs|oK15:x6Vt^9Ww)'),
('S/!_JAI#}`Vc\\4d5{81?'),
('"IB[Q~L@3:c-.O{rkZ}E'),
('8*\n%){GwO~yT^mL/ph0t'),
('`6+/Zy.B_Y[evD@ 9zbp'),
('%zF5&r\\^|N(*kfg{QRjS'),
('p8y"t1-#rq:|mjhM\tWi+'),
('=eBH%l\rP_+qUr)NYDhv;'),
('hr\\z>-:,u+FK32qf0TXw'),
('-sQD>=rN|[ZLR\r\tPGW6u'),
('M)[2EZ.SyzV4dR!~\r"w9'),
('3`Ms\t%!?zZR\no>xG|&JP'),
(':UR8;-x2"{e3P# mlvTG'),
("Z#|> :~or1XS*^$c'j?2"),
('=^?D_Xf\tQ{P%UoYl<pA,'),
('b8cQ0S\n\\>.v_usEO{J\ty'),
('YmW$pkSLqjGxV+)A"KCP'),
('K+aZU\\EnV!qm}vW\rd.c\t'),
("'?dR3JHn(~)p}Gq4z-F!"),
('\\IW(ip!2_Ab}ydfXQ01P'),
(')#b\n&,WwYT{vyMK]\ra/\\'),
('\\F0d~2[K/fk>Ij{^]gLH'),
('78cm$y#4?S;PV]\\Oex=E'),
('d"h=\n\\k)8!:C?qKD(NB['),
(' Vemr1.kpU@B|qQ=M{O#');
4 changes: 2 additions & 2 deletions dumpling/tests/rows/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ run_sql "drop database if exists \`$DB_NAME\`;"

# build data on mysql
run_sql "create database $DB_NAME;"
run_sql "create table $DB_NAME.$TABLE_NAME (id int not null auto_increment primary key, a varchar(8));"
run_sql "create table $DB_NAME.$TABLE_NAME (id int not null auto_increment primary key, a varchar(24));"

# insert 100 records
run_sql "insert into $DB_NAME.$TABLE_NAME (a) values $(seq -s, 100 | sed 's/,*$//g' | sed "s/[0-9]*/('1111_')/g");"
run_sql_file "$cur/data/rows.t.0.sql"

# dumping
export DUMPLING_TEST_DATABASE=$DB_NAME
Expand Down
13 changes: 7 additions & 6 deletions dumpling/v4/export/ir_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,12 +344,13 @@ LOOP:
}

td := &tableData{
database: dbName,
table: tableName,
query: query,
chunkIndex: chunkIndex,
colTypes: colTypes,
selectedField: selectedField,
database: dbName,
table: tableName,
query: query,
chunkIndex: chunkIndex,
colTypes: colTypes,
selectedField: selectedField,
escapeBackslash: conf.EscapeBackslash,
specCmts: []string{
"/*!40101 SET NAMES binary*/;",
},
Expand Down

0 comments on commit de69f8e

Please sign in to comment.