Project

General

Profile

« Previous | Next » 

Revision 8002

my2pg.data: \0 removal: Fixed bug where need to handle all backslashes before the 0, because they might escape just each other (an even number of \) rather than also encoding the \0 (an odd number of \)

View differences:

my2pg.data
11 11
echo 'SET standard_conforming_strings = off;'
12 12
echo 'SET escape_string_warning = off;'
13 13
sed \
14
-e 's/\\0/0/g' \
14
-e 's/([^\\](\\\\)*)\\0/$10/g' \
15 15
-e "s/'0000-00-00( 00:00:00)?'/'-infinity'/g" \
16 16
-e "s/('[[:digit:]]{4}-)00(-[[:digit:]]{2}')/\101\2/g" \
17 17
-e "s/('[[:digit:]]{4}-[[:digit:]]{2}-)00(')/\101\2/g" \
18 18
"$@"
19
# \0 isn't allowed in UTF-8
19
# \0 isn't allowed in UTF-8; note that \ is doubled for sed

Also available in: Unified diff