aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/lib/ecpglib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/ecpg/lib/ecpglib.c')
-rw-r--r--src/interfaces/ecpg/lib/ecpglib.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/interfaces/ecpg/lib/ecpglib.c b/src/interfaces/ecpg/lib/ecpglib.c
index 2f59c78a67e..ea2ec7a6508 100644
--- a/src/interfaces/ecpg/lib/ecpglib.c
+++ b/src/interfaces/ecpg/lib/ecpglib.c
@@ -368,7 +368,7 @@ next_insert(char *text)
bool string = false;
for (; *ptr != '\0' && (*ptr != '?' || string); ptr++)
- if (*ptr == '\'')
+ if (*ptr == '\'' && *(ptr-1) != '\\')
string = string ? false : true;
return (*ptr == '\0') ? NULL : ptr;
@@ -977,6 +977,7 @@ ECPGexecute(struct statement * stmt)
break;
case PGRES_COMMAND_OK:
status = true;
+ sqlca.sqlerrd[1] = atol(PQoidStatus(results));
sqlca.sqlerrd[2] = atol(PQcmdTuples(results));
ECPGlog("ECPGexecute line %d Ok: %s\n", stmt->lineno, PQcmdStatus(results));
break;