1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-09 17:03:00 +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:56:41 +00:00
parent 506747337b
commit 583a472f7b
14 changed files with 55 additions and 55 deletions

View File

@@ -33,7 +33,7 @@
#
#
##############################################################################
# $Id: DBMirror.pl,v 1.3.2.2 2002/12/05 21:04:14 momjian Exp $
# $Id: DBMirror.pl,v 1.3.2.3 2006/05/21 19:56:40 momjian Exp $
#
##############################################################################
@@ -412,7 +412,7 @@ sub mirrorInsert($$$$$) {
if(defined $recordValues{$column}) {
my $quotedValue = $recordValues{$column};
$quotedValue =~ s/\\/\\\\/g;
$quotedValue =~ s/'/\\'/g;
$quotedValue =~ s/'/''/g;
$valuesQuery .= "'$quotedValue'";
}
else {
@@ -595,7 +595,7 @@ sub mirrorUpdate($$$$$) {
if(defined $currentValue ) {
$quotedValue = $currentValue;
$quotedValue =~ s/\\/\\\\/g;
$quotedValue =~ s/'/\\'/g;
$quotedValue =~ s/'/''/g;
$updateQuery .= "'$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 {

View File

@@ -1,6 +1,6 @@
/****************************************************************************
* pending.c
* $Id: pending.c,v 1.6.2.5 2003/03/20 03:58:48 momjian Exp $
* $Id: pending.c,v 1.6.2.6 2006/05/21 19:56:40 momjian Exp $
*
* This file contains a trigger for Postgresql-7.x to record changes to tables
* to a pending table for mirroring.
@@ -478,7 +478,7 @@ packageData(HeapTuple tTupleData, TupleDesc tTupleDesc,
}
if (*cpUnFormatedPtr == '\\' || *cpUnFormatedPtr == '\'')
{
*cpFormatedPtr = '\\';
*cpFormatedPtr = *cpUnFormatedPtr;
cpFormatedPtr++;
iUsedDataBlock++;
}

View File

@@ -42,31 +42,31 @@ SELECT '1 2'::txtidx;
'1' '2'
(1 row)
SELECT '\'1 2\''::txtidx;
SELECT '''1 2'''::txtidx;
txtidx
--------
'1 2'
(1 row)
SELECT '\'1 \\\'2\''::txtidx;
SELECT '''1 \\''2'''::txtidx;
txtidx
---------
'1 \'2'
(1 row)
SELECT '\'1 \\\'2\'3'::txtidx;
SELECT '''1 \\''2''3'::txtidx;
txtidx
-------------
'3' '1 \'2'
(1 row)
SELECT '\'1 \\\'2\' 3'::txtidx;
SELECT '''1 \\''2'' 3'::txtidx;
txtidx
-------------
'3' '1 \'2'
(1 row)
SELECT '\'1 \\\'2\' \' 3\' 4 '::txtidx;
SELECT '''1 \\''2'' '' 3'' 4 '::txtidx;
txtidx
------------------
'4' ' 3' '1 \'2'
@@ -97,13 +97,13 @@ SELECT ' 1 '::query_txt;
'1'
(1 row)
SELECT '\'1 2\''::query_txt;
SELECT '''1 2'''::query_txt;
query_txt
-----------
'1 2'
(1 row)
SELECT '\'1 \\\'2\''::query_txt;
SELECT '''1 \\''2'''::query_txt;
query_txt
-----------
'1 \'2'
@@ -301,7 +301,7 @@ SELECT '1&(2&(4&(5|!6)))'::query_txt;
'1' & '2' & '4' & ( '5' | !'6' )
(1 row)
SELECT '1&(\'2\'&(\' 4\'&(\\|5 | \'6 \\\' !|&\')))'::query_txt;
SELECT '1&(''2''&('' 4''&(\\|5 | ''6 \\'' !|&'')))'::query_txt;
query_txt
------------------------------------------
'1' & '2' & ' 4' & ( '|5' | '6 \' !|&' )
@@ -331,13 +331,13 @@ SELECT ' 1 '::mquery_txt;
'1'
(1 row)
SELECT '\'1 2\''::mquery_txt;
SELECT '''1 2'''::mquery_txt;
mquery_txt
------------
'1' & '2'
(1 row)
SELECT '\'1 \\\'2\''::mquery_txt;
SELECT '''1 \\''2'''::mquery_txt;
mquery_txt
------------
'1' & '2'
@@ -535,7 +535,7 @@ SELECT '1&(2&(4&(5|!6)))'::mquery_txt;
'1' & '2' & '4' & ( '5' | !'6' )
(1 row)
SELECT '1&(\'2\'&(\' 4\'&(\\|5 | \'6 \\\' !|&\')))'::mquery_txt;
SELECT '1&(''2''&('' 4''&(\\|5 | ''6 \\'' !|&'')))'::mquery_txt;
mquery_txt
---------------------------------
'1' & '2' & '4' & ( '5' | '6' )
@@ -694,7 +694,7 @@ SELECT count(*) FROM test_txtidx WHERE a ## '(eq|yt)&(wR|qh)';
11
(1 row)
SELECT txt2txtidx('345 qwe@efd.r \' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
SELECT txt2txtidx('345 qwe@efd.r '' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
/usr/local/fff /awdf/dwqe/4325 rewt/ewr wefjn /wqe-324/ewr gist.h gist.h.c gist.c. readline 4.2 4.2. 4.2, readline-4.2 readline-4.2. 234
<i <b> wow < jqw <> qwerty');
txt2txtidx
@@ -708,7 +708,7 @@ SELECT txtidxsize(txt2txtidx('345 qw'));
2
(1 row)
SELECT txtidxsize(txt2txtidx('345 qwe@efd.r \' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
SELECT txtidxsize(txt2txtidx('345 qwe@efd.r '' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
/usr/local/fff /awdf/dwqe/4325 rewt/ewr wefjn /wqe-324/ewr gist.h gist.h.c gist.c. readline 4.2 4.2. 4.2, readline-4.2 readline-4.2. 234
<i <b> wow < jqw <> qwerty'));
txtidxsize

View File

@@ -12,19 +12,19 @@ SELECT '1 '::txtidx;
SELECT ' 1'::txtidx;
SELECT ' 1 '::txtidx;
SELECT '1 2'::txtidx;
SELECT '\'1 2\''::txtidx;
SELECT '\'1 \\\'2\''::txtidx;
SELECT '\'1 \\\'2\'3'::txtidx;
SELECT '\'1 \\\'2\' 3'::txtidx;
SELECT '\'1 \\\'2\' \' 3\' 4 '::txtidx;
SELECT '''1 2'''::txtidx;
SELECT '''1 \\''2'''::txtidx;
SELECT '''1 \\''2''3'::txtidx;
SELECT '''1 \\''2'' 3'::txtidx;
SELECT '''1 \\''2'' '' 3'' 4 '::txtidx;
--query_txt
SELECT '1'::query_txt;
SELECT '1 '::query_txt;
SELECT ' 1'::query_txt;
SELECT ' 1 '::query_txt;
SELECT '\'1 2\''::query_txt;
SELECT '\'1 \\\'2\''::query_txt;
SELECT '''1 2'''::query_txt;
SELECT '''1 \\''2'''::query_txt;
SELECT '!1'::query_txt;
SELECT '1|2'::query_txt;
SELECT '1|!2'::query_txt;
@@ -57,13 +57,13 @@ SELECT '1&(2&(4&(5&6)))'::query_txt;
SELECT '1&2&4&5&6'::query_txt;
SELECT '1&(2&(4&(5|6)))'::query_txt;
SELECT '1&(2&(4&(5|!6)))'::query_txt;
SELECT '1&(\'2\'&(\' 4\'&(\\|5 | \'6 \\\' !|&\')))'::query_txt;
SELECT '1&(''2''&('' 4''&(\\|5 | ''6 \\'' !|&'')))'::query_txt;
SELECT '1'::mquery_txt;
SELECT '1 '::mquery_txt;
SELECT ' 1'::mquery_txt;
SELECT ' 1 '::mquery_txt;
SELECT '\'1 2\''::mquery_txt;
SELECT '\'1 \\\'2\''::mquery_txt;
SELECT '''1 2'''::mquery_txt;
SELECT '''1 \\''2'''::mquery_txt;
SELECT '!1'::mquery_txt;
SELECT '1|2'::mquery_txt;
SELECT '1|!2'::mquery_txt;
@@ -96,7 +96,7 @@ SELECT '1&(2&(4&(5&6)))'::mquery_txt;
SELECT '1&2&4&5&6'::mquery_txt;
SELECT '1&(2&(4&(5|6)))'::mquery_txt;
SELECT '1&(2&(4&(5|!6)))'::mquery_txt;
SELECT '1&(\'2\'&(\' 4\'&(\\|5 | \'6 \\\' !|&\')))'::mquery_txt;
SELECT '1&(''2''&('' 4''&(\\|5 | ''6 \\'' !|&'')))'::mquery_txt;
SELECT 'querty-fgries | http://www.google.com/index.html | www.rambler.ru/index.shtml'::mquery_txt;
CREATE TABLE test_txtidx( t text, a txtidx );
@@ -133,13 +133,13 @@ SELECT count(*) FROM test_txtidx WHERE a ## 'eq|yt';
SELECT count(*) FROM test_txtidx WHERE a ## '(eq&yt)|(wR&qh)';
SELECT count(*) FROM test_txtidx WHERE a ## '(eq|yt)&(wR|qh)';
SELECT txt2txtidx('345 qwe@efd.r \' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
SELECT txt2txtidx('345 qwe@efd.r '' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
/usr/local/fff /awdf/dwqe/4325 rewt/ewr wefjn /wqe-324/ewr gist.h gist.h.c gist.c. readline 4.2 4.2. 4.2, readline-4.2 readline-4.2. 234
<i <b> wow < jqw <> qwerty');
SELECT txtidxsize(txt2txtidx('345 qw'));
SELECT txtidxsize(txt2txtidx('345 qwe@efd.r \' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
SELECT txtidxsize(txt2txtidx('345 qwe@efd.r '' http://www.com/ http://aew.werc.ewr/?ad=qwe&dw 1aew.werc.ewr/?ad=qwe&dw 2aew.werc.ewr http://3aew.werc.ewr/?ad=qwe&dw http://4aew.werc.ewr http://5aew.werc.ewr:8100/? ad=qwe&dw 6aew.werc.ewr:8100/?ad=qwe&dw 7aew.werc.ewr:8100/?ad=qwe&dw=%20%32 +4.0e-10 qwe qwe qwqwe 234.435 455 5.005 teodor@stack.net qwe-wer asdf <fr>qwer jf sdjk<we hjwer <werrwe> ewr1> ewri2 <a href="qwe<qwe>">
/usr/local/fff /awdf/dwqe/4325 rewt/ewr wefjn /wqe-324/ewr gist.h gist.h.c gist.c. readline 4.2 4.2. 4.2, readline-4.2 readline-4.2. 234
<i <b> wow < jqw <> qwerty'));