@@ -102,6 +102,7 @@ quote_postgres(char *arg, int lineno)
102
102
return (res );
103
103
104
104
res [ri ++ ] = '\'' ;
105
+
105
106
for (i = 0 ; arg [i ]; i ++ , ri ++ )
106
107
{
107
108
switch (arg [i ])
@@ -118,6 +119,7 @@ quote_postgres(char *arg, int lineno)
118
119
119
120
res [ri ] = arg [i ];
120
121
}
122
+
121
123
res [ri ++ ] = '\'' ;
122
124
res [ri ] = '\0' ;
123
125
@@ -247,10 +249,17 @@ next_insert(char *text)
247
249
char * ptr = text ;
248
250
bool string = false;
249
251
252
+ printf ("%s\n" , text );
250
253
for (; * ptr != '\0' && (* ptr != '?' || string ); ptr ++ )
251
- if (* ptr == '\'' && * (ptr - 1 ) != '\\' )
252
- string = string ? false : true;
254
+ {
255
+ if (* ptr == '\\' ) /* escape character */
256
+ ptr ++ ;
257
+ else
258
+ if (* ptr == '\'' )
259
+ string = string ? false : true;
260
+ }
253
261
262
+ printf ("%s\n" , ptr );
254
263
return (* ptr == '\0' ) ? NULL : ptr ;
255
264
}
256
265
@@ -704,7 +713,6 @@ ECPGexecute(struct statement * stmt)
704
713
strcpy (newcopy , copiedquery );
705
714
if ((p = next_insert (newcopy + hostvarl )) == NULL )
706
715
{
707
-
708
716
/*
709
717
* We have an argument but we dont have the matched up string
710
718
* in the string
@@ -995,7 +1003,7 @@ ECPGdo(int lineno, const char *connection_name, char *query,...)
995
1003
*
996
1004
* Copyright (c) 2000, Christof Petig <christof.petig@wtal.de>
997
1005
*
998
- * $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/execute.c,v 1.12 2000/10/02 16:15:53 momjian Exp $
1006
+ * $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/execute.c,v 1.13 2000/10/29 09:44:58 meskes Exp $
999
1007
*/
1000
1008
1001
1009
PGconn * ECPG_internal_get_connection (char * name );
0 commit comments