1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Change \' to '', for SQL standards compliance. Backpatch to 7.3, 7.4,

and 8.0.  Later releases already patched.
This commit is contained in:
Bruce Momjian
2006-05-21 19:57:07 +00:00
parent c8fd45b059
commit 48498602a0
15 changed files with 80 additions and 80 deletions

View File

@ -33,7 +33,7 @@
#
#
##############################################################################
# $Id: DBMirror.pl,v 1.6 2003/05/14 03:25:55 tgl Exp $
# $Id: DBMirror.pl,v 1.6.4.1 2006/05/21 19:57:06 momjian Exp $
#
##############################################################################
@ -402,7 +402,7 @@ sub mirrorInsert($$$$$) {
if(defined $recordValues{$column}) {
my $quotedValue = $recordValues{$column};
$quotedValue =~ s/\\/\\\\/g;
$quotedValue =~ s/'/\\'/g;
$quotedValue =~ s/'/''/g;
$valuesQuery .= "'$quotedValue'";
}
else {
@ -585,7 +585,7 @@ sub mirrorUpdate($$$$$) {
if(defined $currentValue ) {
$quotedValue = $currentValue;
$quotedValue =~ s/\\/\\\\/g;
$quotedValue =~ s/'/\\'/g;
$quotedValue =~ s/'/''/g;
$updateQuery .= "'$quotedValue'";
}
else {
@ -607,7 +607,7 @@ sub mirrorUpdate($$$$$) {
if(defined $currentValue) {
$quotedValue = $currentValue;
$quotedValue =~ s/\\/\\\\/g;
$quotedValue =~ s/'/\\'/g;
$quotedValue =~ s/'/''/g;
$updateQuery .= "'$quotedValue'";
}
else {

View File

@ -1,6 +1,6 @@
/****************************************************************************
* pending.c
* $Id: pending.c,v 1.14 2003/09/29 18:16:48 momjian Exp $
* $Id: pending.c,v 1.14.2.1 2006/05/21 19:57:06 momjian Exp $
*
* This file contains a trigger for Postgresql-7.x to record changes to tables
* to a pending table for mirroring.
@ -491,7 +491,7 @@ packageData(HeapTuple tTupleData, TupleDesc tTupleDesc,
}
if (*cpUnFormatedPtr == '\\' || *cpUnFormatedPtr == '\'')
{
*cpFormatedPtr = '\\';
*cpFormatedPtr = *cpUnFormatedPtr;
cpFormatedPtr++;
iUsedDataBlock++;
}