]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
'::' is no longer interpreted as a variable in a prepare statement.
authorMichael Meskes <meskes@postgresql.org>
Tue, 5 Oct 2004 10:48:45 +0000 (10:48 +0000)
committerMichael Meskes <meskes@postgresql.org>
Tue, 5 Oct 2004 10:48:45 +0000 (10:48 +0000)
src/interfaces/ecpg/ecpglib/prepare.c

index 923c931a8235cde4fe323479ef9eb1d62f7b5f32..916a5fa8dee25c3dbfa402ba2a8c8998f444340f 100644 (file)
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/prepare.c,v 1.9.4.1 2004/01/28 09:55:53 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/prepare.c,v 1.9.4.2 2004/10/05 10:48:45 meskes Exp $ */
 
 #define POSTGRES_ECPG_INTERNAL
 #include "postgres_fe.h"
@@ -46,9 +46,14 @@ replace_variables(char *text)
 
                if (!string && *ptr == ':')
                {
-                       *ptr = '?';
-                       for (++ptr; *ptr && isvarchar(*ptr); ptr++)
-                               *ptr = ' ';
+                       if (ptr[1]==':')
+                               ptr+=2; /* skip  '::' */
+                       else
+                       {
+                               *ptr = '?';
+                               for (++ptr; *ptr && isvarchar(*ptr); ptr++)
+                                       *ptr = ' ';
+                       }
                }
        }
 }