Commit e30c2d67 authored by Michael Meskes's avatar Michael Meskes

*** empty log message ***

parent 316c4c57
...@@ -705,3 +705,18 @@ Mon Nov 1 11:22:06 CET 1999 ...@@ -705,3 +705,18 @@ Mon Nov 1 11:22:06 CET 1999
- Print SQL error message to STDERR instead of STDOUT. - Print SQL error message to STDERR instead of STDOUT.
- Added a fourth test source. - Added a fourth test source.
- Set library version to 3.0.5. - Set library version to 3.0.5.
Wed Nov 10 18:33:14 CET 1999
- Synced preproc.y with gram.y.
Thu Nov 11 07:49:44 CET 1999
- Fixed bug in SET AUTOCOMMIT.
Mon Nov 22 18:26:34 CET 1999
- Synced preproc.y with gram.y.
- Clean up parser.
- Set library version to 3.0.6.
- Set ecpg version to 2.6.10.
...@@ -7,6 +7,9 @@ has to be 100. ...@@ -7,6 +7,9 @@ has to be 100.
sqlwarn[6] should be 'W' if the PRECISION or SCALE value specified in a SET sqlwarn[6] should be 'W' if the PRECISION or SCALE value specified in a SET
DESCRIPTOR statement will be ignored. DESCRIPTOR statement will be ignored.
If a NOTICE message is given by the backend it should not be printed to
stderr. Instead it should be listed as a warning.
it would be nice to be able to use :var[:index] as cvariable it would be nice to be able to use :var[:index] as cvariable
support for dynamic SQL with unknown number of variables with DESCRIPTORS support for dynamic SQL with unknown number of variables with DESCRIPTORS
...@@ -18,6 +21,8 @@ indicator-error? ...@@ -18,6 +21,8 @@ indicator-error?
Add a semantic check level, e.g. check if a table really exists. Add a semantic check level, e.g. check if a table really exists.
How can on insert arrays from c variables?
Missing statements: Missing statements:
- exec sql ifdef - exec sql ifdef
- exec sql allocate - exec sql allocate
......
...@@ -6,13 +6,13 @@ ...@@ -6,13 +6,13 @@
# Copyright (c) 1994, Regents of the University of California # Copyright (c) 1994, Regents of the University of California
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.50 1999/11/02 12:11:53 meskes Exp $ # $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.51 1999/11/22 12:48:46 meskes Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
NAME= ecpg NAME= ecpg
SO_MAJOR_VERSION= 3 SO_MAJOR_VERSION= 3
SO_MINOR_VERSION= 0.5 SO_MINOR_VERSION= 0.6
SRCDIR= @top_srcdir@ SRCDIR= @top_srcdir@
include $(SRCDIR)/Makefile.global include $(SRCDIR)/Makefile.global
......
...@@ -84,14 +84,14 @@ struct statement ...@@ -84,14 +84,14 @@ struct statement
struct variable *outlist; struct variable *outlist;
}; };
struct prepared_statement static struct prepared_statement
{ {
char *name; char *name;
struct statement *stmt; struct statement *stmt;
struct prepared_statement *next; struct prepared_statement *next;
} *prep_stmts = NULL; } *prep_stmts = NULL;
struct auto_mem static struct auto_mem
{ {
void *pointer; void *pointer;
struct auto_mem *next; struct auto_mem *next;
...@@ -656,7 +656,7 @@ ECPGexecute(struct statement * stmt) ...@@ -656,7 +656,7 @@ ECPGexecute(struct statement * stmt)
} }
else else
{ {
sqlca.sqlerrd[2] = 0; /* sqlca.sqlerrd[2] = 0;*/
var = stmt->outlist; var = stmt->outlist;
switch (PQresultStatus(results)) switch (PQresultStatus(results))
{ {
...@@ -741,7 +741,7 @@ ECPGexecute(struct statement * stmt) ...@@ -741,7 +741,7 @@ ECPGexecute(struct statement * stmt)
for (act_tuple = 0; act_tuple < ntuples && status; act_tuple++) for (act_tuple = 0; act_tuple < ntuples && status; act_tuple++)
{ {
pval = PQgetvalue(results, act_tuple, act_field); pval = (char *)PQgetvalue(results, act_tuple, act_field);
ECPGlog("ECPGexecute line %d: RESULT: %s\n", stmt->lineno, pval ? pval : ""); ECPGlog("ECPGexecute line %d: RESULT: %s\n", stmt->lineno, pval ? pval : "");
...@@ -1112,6 +1112,7 @@ ECPGtrans(int lineno, const char *connection_name, const char *transaction) ...@@ -1112,6 +1112,7 @@ ECPGtrans(int lineno, const char *connection_name, const char *transaction)
} }
PQclear(res); PQclear(res);
} }
if (strcmp(transaction, "commit") == 0 || strcmp(transaction, "rollback") == 0) if (strcmp(transaction, "commit") == 0 || strcmp(transaction, "rollback") == 0)
{ {
struct prepared_statement *this; struct prepared_statement *this;
...@@ -1140,7 +1141,9 @@ ECPGsetcommit(int lineno, const char *mode, const char *connection_name) ...@@ -1140,7 +1141,9 @@ ECPGsetcommit(int lineno, const char *mode, const char *connection_name)
if (!ecpg_init(con, connection_name, lineno)) if (!ecpg_init(con, connection_name, lineno))
return(false); return(false);
if (con->autocommit == true && strncmp(mode, "OFF", strlen("OFF")) == 0) ECPGlog("ECPGsetcommit line %d action = %s connection = %s\n", lineno, mode, con->name);
if (con->autocommit == true && strncmp(mode, "off", strlen("off")) == 0)
{ {
if (con->committed) if (con->committed)
{ {
...@@ -1154,7 +1157,7 @@ ECPGsetcommit(int lineno, const char *mode, const char *connection_name) ...@@ -1154,7 +1157,7 @@ ECPGsetcommit(int lineno, const char *mode, const char *connection_name)
} }
con->autocommit = false; con->autocommit = false;
} }
else if (con->autocommit == false && strncmp(mode, "ON", strlen("ON")) == 0) else if (con->autocommit == false && strncmp(mode, "on", strlen("on")) == 0)
{ {
if (!con->committed) if (!con->committed)
{ {
...@@ -1213,8 +1216,6 @@ ECPGconnect(int lineno, const char *dbname, const char *user, const char *passwd ...@@ -1213,8 +1216,6 @@ ECPGconnect(int lineno, const char *dbname, const char *user, const char *passwd
ECPGlog("ECPGconnect: opening database %s %s%s\n", dbname ? dbname : "<DEFAULT>", user ? "for user " : "", user ? user : ""); ECPGlog("ECPGconnect: opening database %s %s%s\n", dbname ? dbname : "<DEFAULT>", user ? "for user " : "", user ? user : "");
sqlca.sqlcode = 0;
this->connection = PQsetdbLogin(NULL, NULL, NULL, NULL, dbname, user, passwd); this->connection = PQsetdbLogin(NULL, NULL, NULL, NULL, dbname, user, passwd);
if (PQstatus(this->connection) == CONNECTION_BAD) if (PQstatus(this->connection) == CONNECTION_BAD)
...@@ -1238,6 +1239,7 @@ ECPGdisconnect(int lineno, const char *connection_name) ...@@ -1238,6 +1239,7 @@ ECPGdisconnect(int lineno, const char *connection_name)
if (strcmp(connection_name, "ALL") == 0) if (strcmp(connection_name, "ALL") == 0)
{ {
memcpy((char *) &sqlca, (char *) &sqlca_init, sizeof(sqlca));
for (con = all_connections; con;) for (con = all_connections; con;)
{ {
struct connection *f = con; struct connection *f = con;
......
...@@ -3,7 +3,7 @@ include $(SRCDIR)/Makefile.global ...@@ -3,7 +3,7 @@ include $(SRCDIR)/Makefile.global
MAJOR_VERSION=2 MAJOR_VERSION=2
MINOR_VERSION=6 MINOR_VERSION=6
PATCHLEVEL=9 PATCHLEVEL=10
CFLAGS+=-I../include -DMAJOR_VERSION=$(MAJOR_VERSION) \ CFLAGS+=-I../include -DMAJOR_VERSION=$(MAJOR_VERSION) \
-DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \ -DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \
......
This diff is collapsed.
...@@ -6,7 +6,8 @@ int ...@@ -6,7 +6,8 @@ int
main () main ()
{ {
EXEC SQL BEGIN DECLARE SECTION; EXEC SQL BEGIN DECLARE SECTION;
int a = 1; int i = 1;
int a[10] = {9,8,7,6,5,4,3,2,1,0};
double f; double f;
EXEC SQL END DECLARE SECTION; EXEC SQL END DECLARE SECTION;
FILE *dbgs; FILE *dbgs;
...@@ -16,23 +17,31 @@ EXEC SQL END DECLARE SECTION; ...@@ -16,23 +17,31 @@ EXEC SQL END DECLARE SECTION;
EXEC SQL CONNECT TO mm; EXEC SQL CONNECT TO mm;
EXEC SQL CREATE TABLE test (f decimal(8,2), a int); EXEC SQL SET AUTOCOMMIT = ON;
EXEC SQL INSERT INTO test(f,a) VALUES(17000.00,1); EXEC SQL BEGIN WORK;
EXEC SQL CREATE TABLE test (f decimal(8,2), i int, a int[10]);
EXEC SQL INSERT INTO test(f,i,a) VALUES(17000.00,1,'{0,1,2,3,4,5,6,7,8,9}');
/* EXEC SQL INSERT INTO test(f,i,a) VALUES(140787.0,2,:a);*/
EXEC SQL COMMIT; EXEC SQL COMMIT;
EXEC SQL BEGIN WORK;
EXEC SQL SELECT f::float EXEC SQL SELECT f::float
INTO :f INTO :f
FROM test FROM test
WHERE a = :a; WHERE i = :i;
printf("Found f::float=%f\n", f); printf("Found f::float=%f\n", f);
EXEC SQL SELECT f EXEC SQL SELECT f
INTO :f INTO :f
FROM test FROM test
WHERE a = :a; WHERE i = :i;
printf("Found f=%f\n", f); printf("Found f=%f\n", f);
...@@ -41,4 +50,9 @@ EXEC SQL END DECLARE SECTION; ...@@ -41,4 +50,9 @@ EXEC SQL END DECLARE SECTION;
EXEC SQL COMMIT; EXEC SQL COMMIT;
EXEC SQL DISCONNECT; EXEC SQL DISCONNECT;
}
if (dbgs != NULL)
fclose(dbgs);
return (0);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment