diff --git a/src/interfaces/ecpg/ChangeLog b/src/interfaces/ecpg/ChangeLog index 8945cd5debf8cb810b3baf30c93894c94d1f16fc..55c1cfde8b97e15f98cbf57e19c032c967c00525 100644 --- a/src/interfaces/ecpg/ChangeLog +++ b/src/interfaces/ecpg/ChangeLog @@ -622,3 +622,12 @@ Sun Aug 1 13:31:19 CEST 1999 - Synced preproc.y with gram.y. - Set ecpg version to 2.6.2 + +Tue Sep 14 22:26:40 CEST 1999 + + - Added patch by Andreas Theofilu to fix yet + another quoting bug. + - Minor bugfixes to ecpg + - Return OID in sqlca.sqlerrd[1] if possible. + - Set ecpg version to 2.6.3 + - Set library version to 3.0.2 diff --git a/src/interfaces/ecpg/TODO b/src/interfaces/ecpg/TODO index 114500850c66f3a19f07042016fbe9d17a1eee56..36d929ea0bae83250d392fd2b15c4ef91b9f77e8 100644 --- a/src/interfaces/ecpg/TODO +++ b/src/interfaces/ecpg/TODO @@ -14,6 +14,7 @@ support for dynamic SQL with unknown number of variables with DESCRIPTORS The line numbering is not exact. Missing statements: + - exec slq ifdef - exec sql allocate - exec sql deallocate - SQLSTATE diff --git a/src/interfaces/ecpg/include/sqlca.h b/src/interfaces/ecpg/include/sqlca.h index d1fedd5b85ba689704b01e093e0f438f2b553ce2..003d6ebff8bc162fa1d88dea0c056d4c05afab4d 100644 --- a/src/interfaces/ecpg/include/sqlca.h +++ b/src/interfaces/ecpg/include/sqlca.h @@ -19,7 +19,7 @@ extern "C" char sqlerrp[8]; long sqlerrd[6]; /* Element 0: empty */ - /* 1: empty */ + /* 1: OID of processed tuple if applicable */ /* 2: number of rows processed */ /* after an INSERT, UPDATE or */ /* DELETE statement */ diff --git a/src/interfaces/ecpg/lib/Makefile.in b/src/interfaces/ecpg/lib/Makefile.in index 6f9f3dce8b9e62c22e22a101cad6f5a55ea68c9f..005ed0d8a13af53197ab87b50d359f3f48a07b83 100644 --- a/src/interfaces/ecpg/lib/Makefile.in +++ b/src/interfaces/ecpg/lib/Makefile.in @@ -6,13 +6,13 @@ # Copyright (c) 1994, Regents of the University of California # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.45 1999/07/19 12:37:46 meskes Exp $ +# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.46 1999/09/15 08:29:14 meskes Exp $ # #------------------------------------------------------------------------- NAME= ecpg SO_MAJOR_VERSION= 3 -SO_MINOR_VERSION= 0.1 +SO_MINOR_VERSION= 0.2 SRCDIR= @top_srcdir@ include $(SRCDIR)/Makefile.global diff --git a/src/interfaces/ecpg/lib/ecpglib.c b/src/interfaces/ecpg/lib/ecpglib.c index 2f59c78a67e565b6f893e88d4be85221af5f71a3..ea2ec7a6508aba4ab4f3d8d3616b367ae283ddc9 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; diff --git a/src/interfaces/ecpg/preproc/Makefile b/src/interfaces/ecpg/preproc/Makefile index 3433ec75ac5337aec699183d2454872a39a565e2..b7894548aef6861491aa4e294d087f3ded09f194 100644 --- a/src/interfaces/ecpg/preproc/Makefile +++ b/src/interfaces/ecpg/preproc/Makefile @@ -3,7 +3,7 @@ include $(SRCDIR)/Makefile.global MAJOR_VERSION=2 MINOR_VERSION=6 -PATCHLEVEL=2 +PATCHLEVEL=3 CFLAGS+=-I../include -DMAJOR_VERSION=$(MAJOR_VERSION) \ -DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \ diff --git a/src/interfaces/ecpg/preproc/pgc.l b/src/interfaces/ecpg/preproc/pgc.l index 211183badf15afbdfec848ccd699344332262fb7..f583a60294b8ac834814b8f5863fd904b28aff59 100644 --- a/src/interfaces/ecpg/preproc/pgc.l +++ b/src/interfaces/ecpg/preproc/pgc.l @@ -239,7 +239,7 @@ cppline {space}*#.*(\\{space}*\n)*\n* } {xqstop} { BEGIN(SQL); - /* yylval.str = scanstr(literal); */ + /* yylval.str = mm_strdup(scanstr(literal));*/ yylval.str = mm_strdup(literal); return SCONST; } @@ -601,7 +601,7 @@ cppline {space}*#.*(\\{space}*\n)*\n* if (strcmp(old, ptr->old) == 0) { free(ptr->new); - /* ptr->new = scanstr(literal); */ + /* ptr->new = mm_strdup(scanstr(literal));*/ ptr->new = mm_strdup(literal); } } @@ -611,7 +611,7 @@ cppline {space}*#.*(\\{space}*\n)*\n* /* initial definition */ this->old = old; - /* this->new = scanstr(literal); */ + /* this->new = mm_strdup(scanstr(literal));*/ this->new = mm_strdup(literal); this->next = defines; defines = this; diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y index a8c135b29773cc2c30f437647bce1c8eb99f6d37..64270e86b2f1b9ec966a83c5cfbe4c3b6032274f 100644 --- a/src/interfaces/ecpg/preproc/preproc.y +++ b/src/interfaces/ecpg/preproc/preproc.y @@ -1142,7 +1142,7 @@ VariableSetStmt: SET ColId TO var_value } | SET NAMES encoding { -#ifdef MB +#ifdef MULTIBYTE $$ = cat2_str(make1_str("set names"), $3); #else yyerror("SET NAMES is not supported"); diff --git a/src/interfaces/ecpg/test/test1.pgc b/src/interfaces/ecpg/test/test1.pgc index 9f7e2de52e8c28d6d1c121d4f221b1667d555281..8f93d20bea797ffb546eb74f939669a6e3dd7eaa 100644 --- a/src/interfaces/ecpg/test/test1.pgc +++ b/src/interfaces/ecpg/test/test1.pgc @@ -48,7 +48,9 @@ exec sql end declare section; strcpy(msg, "execute insert 1"); sprintf(command, "insert into test(name, amount, letter) values ('db: ''mm''', 1, 'f')"); exec sql execute immediate :command; - sprintf(command, "insert into test(name, amount, letter) values ('db: ''mm''', 2, 't')"); + printf("New tuple got OID = %d\n", sqlca.sqlerrd[1]); + + sprintf(command, "insert into test(name, amount, letter) values ('db: \\\'mm\\\'', 2, 't')"); exec sql execute immediate :command; strcpy(msg, "execute insert 2");