mirror of
https://github.com/postgres/postgres.git
synced 2026-10-23 13:29:09 +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:
@@ -3,7 +3,7 @@
|
||||
* back to source text
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.157.2.4 2005/04/30 08:36:17 neilc Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.157.2.5 2006/05/21 19:57:07 momjian Exp $
|
||||
*
|
||||
* This software is copyrighted by Jan Wieck - Hamburg.
|
||||
*
|
||||
@@ -585,7 +585,7 @@ pg_get_triggerdef(PG_FUNCTION_ARGS)
|
||||
{
|
||||
/* escape quotes and backslashes */
|
||||
if (*p == '\'' || *p == '\\')
|
||||
appendStringInfoChar(&buf, '\\');
|
||||
appendStringInfoChar(&buf, *p);
|
||||
appendStringInfoChar(&buf, *p++);
|
||||
}
|
||||
p++;
|
||||
@@ -3542,7 +3542,7 @@ get_const_expr(Const *constval, deparse_context *context)
|
||||
|
||||
if (ch == '\'' || ch == '\\')
|
||||
{
|
||||
appendStringInfoChar(buf, '\\');
|
||||
appendStringInfoChar(buf, ch);
|
||||
appendStringInfoChar(buf, ch);
|
||||
}
|
||||
else if (((unsigned char) ch) < ((unsigned char) ' '))
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* by PostgreSQL
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.355.2.7 2006/01/09 21:16:46 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.355.2.8 2006/05/21 19:57:07 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -6544,7 +6544,7 @@ dumpTriggers(Archive *fout, TableInfo *tblinfo, int numTables)
|
||||
for (s = tgargs; s < p;)
|
||||
{
|
||||
if (*s == '\'')
|
||||
appendPQExpBufferChar(query, '\\');
|
||||
appendPQExpBufferChar(query, *s);
|
||||
appendPQExpBufferChar(query, *s++);
|
||||
}
|
||||
appendPQExpBufferChar(query, '\'');
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/bin/psql/large_obj.c,v 1.29 2003/08/04 23:59:40 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/bin/psql/large_obj.c,v 1.29.4.1 2006/05/21 19:57:07 momjian Exp $
|
||||
*/
|
||||
#include "postgres_fe.h"
|
||||
#include "large_obj.h"
|
||||
@@ -185,7 +185,7 @@ do_lo_import(const char *filename_arg, const char *comment_arg)
|
||||
for (i = 0; i < slen; i++)
|
||||
{
|
||||
if (comment_arg[i] == '\'' || comment_arg[i] == '\\')
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = comment_arg[i];
|
||||
*bufptr++ = comment_arg[i];
|
||||
}
|
||||
strcpy(bufptr, "')");
|
||||
|
||||
@@ -84,7 +84,7 @@ exec sql end declare section;
|
||||
exec sql execute immediate :command;
|
||||
printf("New tuple got OID = %ld\n", sqlca.sqlerrd[1]);
|
||||
|
||||
sprintf(command, "insert into \"Test\" (name, amount, letter) values ('db: \\\'mm\\\'', 2, 't')");
|
||||
sprintf(command, "insert into \"Test\" (name, amount, letter) values ('db: ''mm''', 2, 't')");
|
||||
exec sql execute immediate :command;
|
||||
|
||||
strcpy(msg, "execute insert 2");
|
||||
|
||||
@@ -26,7 +26,7 @@ import java.sql.Timestamp;
|
||||
import java.sql.Types;
|
||||
import java.util.Vector;
|
||||
|
||||
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Statement.java,v 1.41.2.8 2004/10/21 19:13:55 jurka Exp $
|
||||
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Statement.java,v 1.41.2.9 2006/05/21 19:57:07 momjian Exp $
|
||||
* This class defines methods of the jdbc1 specification. This class is
|
||||
* extended by org.postgresql.jdbc2.AbstractJdbc2Statement which adds the jdbc2
|
||||
* methods. The real Statement class (for jdbc1) is org.postgresql.jdbc1.Jdbc1Statement
|
||||
@@ -1145,7 +1145,7 @@ public abstract class AbstractJdbc1Statement implements BaseStatement
|
||||
{
|
||||
case '\\':
|
||||
case '\'':
|
||||
p_output.append('\\');
|
||||
p_output.append(c);
|
||||
p_output.append(c);
|
||||
break;
|
||||
case '\0':
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.153.2.4 2004/03/14 22:01:01 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.153.2.5 2006/05/21 19:57:07 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2329,7 +2329,7 @@ PQescapeBytea(const unsigned char *bintext, size_t binlen, size_t *bytealen)
|
||||
}
|
||||
else if (*vp == '\'')
|
||||
{
|
||||
rp[0] = '\\';
|
||||
rp[0] = '\'';
|
||||
rp[1] = '\'';
|
||||
rp += 2;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* procedural language
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/gram.y,v 1.48.2.3 2005/02/08 18:22:11 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/gram.y,v 1.48.2.4 2006/05/21 19:57:07 momjian Exp $
|
||||
*
|
||||
* This software is copyrighted by Jan Wieck - Hamburg.
|
||||
*
|
||||
@@ -421,7 +421,7 @@ decl_statement : decl_varname decl_const decl_datatype decl_notnull decl_defval
|
||||
while (*cp1 != '\0')
|
||||
{
|
||||
if (*cp1 == '\\' || *cp1 == '\'')
|
||||
*cp2++ = '\\';
|
||||
*cp2++ = *cp1;
|
||||
*cp2++ = *cp1++;
|
||||
}
|
||||
strcpy(cp2, "'::refcursor");
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
--
|
||||
-- Copyright (c) 1994-5, Regents of the University of California
|
||||
--
|
||||
-- $Id: funcs.source,v 1.6 2003/10/26 04:51:51 momjian Exp $
|
||||
-- $Id: funcs.source,v 1.6.2.1 2006/05/21 19:57:07 momjian Exp $
|
||||
--
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
@@ -76,10 +76,10 @@ WHERE EMP.cubicle ~= '(2,1)'::point;
|
||||
-- columns of EMP.
|
||||
|
||||
CREATE FUNCTION new_emp() RETURNS EMP
|
||||
AS 'SELECT \'None\'::text AS name,
|
||||
AS 'SELECT ''None''::text AS name,
|
||||
1000 AS salary,
|
||||
25 AS age,
|
||||
\'(2,2)\'::point AS cubicle'
|
||||
''(2,2)''::point AS cubicle'
|
||||
LANGUAGE 'sql';
|
||||
|
||||
-- you can then project a column out of resulting the tuple by using the
|
||||
|
||||
Reference in New Issue
Block a user