提交 cc84163f 编写于 作者: B Bruce Momjian

Use SQL standard '' rather than \' in /contrib. Backpatch to 8.1.X.

上级 40a95aa2
......@@ -33,7 +33,7 @@
#
#
##############################################################################
# $PostgreSQL: pgsql/contrib/dbmirror/DBMirror.pl,v 1.10 2004/07/02 00:58:09 joe Exp $
# $PostgreSQL: pgsql/contrib/dbmirror/DBMirror.pl,v 1.11 2006/05/19 02:38:47 momjian Exp $
#
##############################################################################
......@@ -437,7 +437,7 @@ sub mirrorInsert($$$$$) {
if(defined $recordValues{$column}) {
my $quotedValue = $recordValues{$column};
$quotedValue =~ s/\\/\\\\/g;
$quotedValue =~ s/'/\\'/g;
$quotedValue =~ s/'/''/g;
$valuesQuery .= "'$quotedValue'";
}
else {
......@@ -617,7 +617,7 @@ sub mirrorUpdate($$$$$) {
if(defined $currentValue ) {
$quotedValue = $currentValue;
$quotedValue =~ s/\\/\\\\/g;
$quotedValue =~ s/'/\\'/g;
$quotedValue =~ s/'/''/g;
$updateQuery .= "'$quotedValue'";
}
else {
......@@ -639,7 +639,7 @@ sub mirrorUpdate($$$$$) {
if(defined $currentValue) {
$quotedValue = $currentValue;
$quotedValue =~ s/\\/\\\\/g;
$quotedValue =~ s/'/\\'/g;
$quotedValue =~ s/'/''/g;
$updateQuery .= "'$quotedValue'";
}
else {
......
/****************************************************************************
* pending.c
* $Id: pending.c,v 1.23 2005/10/15 02:49:04 momjian Exp $
* $PostgreSQL: pgsql/contrib/dbmirror/pending.c,v 1.23 2005/10/15 02:49:04 momjian Exp $
* $Id: pending.c,v 1.24 2006/05/19 02:38:47 momjian Exp $
* $PostgreSQL: pgsql/contrib/dbmirror/pending.c,v 1.24 2006/05/19 02:38:47 momjian Exp $
*
* This file contains a trigger for Postgresql-7.x to record changes to tables
* to a pending table for mirroring.
......@@ -541,7 +541,7 @@ packageData(HeapTuple tTupleData, TupleDesc tTupleDesc, Oid tableOid,
}
if (*cpUnFormatedPtr == '\\' || *cpUnFormatedPtr == '\'')
{
*cpFormatedPtr = '\\';
*cpFormatedPtr = *cpUnFormatedPtr;
cpFormatedPtr++;
iUsedDataBlock++;
}
......
......@@ -748,7 +748,7 @@ infix(INFIX * in, bool first)
{
if ( t_iseq(op, '\'') )
{
*(in->cur) = '\\';
*(in->cur) = '\'';
in->cur++;
}
COPYCHAR(in->cur,op);
......
......@@ -529,7 +529,7 @@ tsvector_out(PG_FUNCTION_ARGS)
outbuf = (char *) repalloc((void *) outbuf, ++lenbuf);
curout = outbuf + pos;
*curout++ = '\\';
*curout++ = '\'';
}
while(len--)
*curout++ = *curin++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册