*** empty log message ***

This commit is contained in:
Michael Meskes 1999-11-22 12:48:48 +00:00
parent 316c4c57e2
commit e30c2d67ef
7 changed files with 347 additions and 759 deletions

View File

@ -705,3 +705,18 @@ Mon Nov 1 11:22:06 CET 1999
- Print SQL error message to STDERR instead of STDOUT.
- Added a fourth test source.
- 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.

View File

@ -7,6 +7,9 @@ has to be 100.
sqlwarn[6] should be 'W' if the PRECISION or SCALE value specified in a SET
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
support for dynamic SQL with unknown number of variables with DESCRIPTORS
@ -18,6 +21,8 @@ indicator-error?
Add a semantic check level, e.g. check if a table really exists.
How can on insert arrays from c variables?
Missing statements:
- exec sql ifdef
- exec sql allocate

View File

@ -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.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
SO_MAJOR_VERSION= 3
SO_MINOR_VERSION= 0.5
SO_MINOR_VERSION= 0.6
SRCDIR= @top_srcdir@
include $(SRCDIR)/Makefile.global

View File

@ -84,14 +84,14 @@ struct statement
struct variable *outlist;
};
struct prepared_statement
static struct prepared_statement
{
char *name;
struct statement *stmt;
struct prepared_statement *next;
} *prep_stmts = NULL;
struct auto_mem
static struct auto_mem
{
void *pointer;
struct auto_mem *next;
@ -656,7 +656,7 @@ ECPGexecute(struct statement * stmt)
}
else
{
sqlca.sqlerrd[2] = 0;
/* sqlca.sqlerrd[2] = 0;*/
var = stmt->outlist;
switch (PQresultStatus(results))
{
@ -741,7 +741,7 @@ ECPGexecute(struct statement * stmt)
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 : "");
@ -1112,6 +1112,7 @@ ECPGtrans(int lineno, const char *connection_name, const char *transaction)
}
PQclear(res);
}
if (strcmp(transaction, "commit") == 0 || strcmp(transaction, "rollback") == 0)
{
struct prepared_statement *this;
@ -1140,7 +1141,9 @@ ECPGsetcommit(int lineno, const char *mode, const char *connection_name)
if (!ecpg_init(con, connection_name, lineno))
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)
{
@ -1154,7 +1157,7 @@ ECPGsetcommit(int lineno, const char *mode, const char *connection_name)
}
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)
{
@ -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 : "");
sqlca.sqlcode = 0;
this->connection = PQsetdbLogin(NULL, NULL, NULL, NULL, dbname, user, passwd);
if (PQstatus(this->connection) == CONNECTION_BAD)
@ -1238,6 +1239,7 @@ ECPGdisconnect(int lineno, const char *connection_name)
if (strcmp(connection_name, "ALL") == 0)
{
memcpy((char *) &sqlca, (char *) &sqlca_init, sizeof(sqlca));
for (con = all_connections; con;)
{
struct connection *f = con;

View File

@ -3,7 +3,7 @@ include $(SRCDIR)/Makefile.global
MAJOR_VERSION=2
MINOR_VERSION=6
PATCHLEVEL=9
PATCHLEVEL=10
CFLAGS+=-I../include -DMAJOR_VERSION=$(MAJOR_VERSION) \
-DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,8 @@ int
main ()
{
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;
EXEC SQL END DECLARE SECTION;
FILE *dbgs;
@ -16,23 +17,31 @@ EXEC SQL END DECLARE SECTION;
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 BEGIN WORK;
EXEC SQL SELECT f::float
INTO :f
FROM test
WHERE a = :a;
WHERE i = :i;
printf("Found f::float=%f\n", f);
EXEC SQL SELECT f
INTO :f
FROM test
WHERE a = :a;
WHERE i = :i;
printf("Found f=%f\n", f);
@ -41,4 +50,9 @@ EXEC SQL END DECLARE SECTION;
EXEC SQL COMMIT;
EXEC SQL DISCONNECT;
}
if (dbgs != NULL)
fclose(dbgs);
return (0);
}