File tree 1 file changed +11
-4
lines changed 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -103,14 +103,21 @@ inView != 0 { next }
103
103
# print all INSERT lines
104
104
( /^ * \( / && /\) * [,; ] * $ / ) || /^ (INSERT| insert) / {
105
105
prev = " "
106
+
107
+ # first replace \\ by \_ that mysqldump never generates to deal with
108
+ # sequnces like \\n that should be translated into \n, not \<LF>.
109
+ # After we convert all escapes we replace \_ by backslashes.
110
+ gsub ( /\\\\ /, " \\ _" )
111
+
106
112
# single quotes are escaped by another single quote
107
113
gsub ( /\\ ' /, " ''" )
108
- gsub ( /\\ '', /, " \\ '," )
109
114
gsub ( /\\ n /, " \n " )
110
115
gsub ( /\\ r /, " \r " )
111
116
gsub ( /\\ " /, " \" " )
112
- gsub ( /\\\\ /, " \\ " )
113
117
gsub ( /\\ \032 /, " \032 " ) # substitute char
118
+
119
+ gsub ( /\\ _ /, " \\ " )
120
+
114
121
# sqlite3 is limited to 16 significant digits of precision
115
122
while ( match ( $0 , /0x[0 -9a -fA -F ]{17 } / ) ){
116
123
hexIssue = 1
@@ -221,8 +228,8 @@ aInc == 1 && /PRIMARY KEY|primary key/ { next }
221
228
print " );"
222
229
next
223
230
}
224
- # `KEY` lines are extracted from the `CREATE` block and stored in array for later print
225
- # in a separate `CREATE KEY` command. The index name is prefixed by the table name to
231
+ # `KEY` lines are extracted from the `CREATE` block and stored in array for later print
232
+ # in a separate `CREATE KEY` command. The index name is prefixed by the table name to
226
233
# avoid a sqlite error for duplicate index name.
227
234
/^( (KEY|key)|\);)/ {
228
235
if( prev ){
You can’t perform that action at this time.
0 commit comments