Commit ef567413 authored by Marc G. Fournier's avatar Marc G. Fournier

From: Michael Meskes <meskes@topsystem.de>

+
+ Wed May  6 16:09:45 CEST 1998
+
+       - Some more cleanups in the library.
+
+ Thu May  7 12:34:28 CEST 1998
+
+       - Made CONNECT and DISCONNECT statement more SQL3 compliant.
+       - Changed the API for the ECPGconnect function to be able to handle
+         hostnames and ports
+
+ Fri May  8 13:54:45 CEST 1998
+       - More changes to the parser. The connect statement now allows
+         ORACLE style logins.
+       - db-name is accepted in two ways:
+               - <dbname>[@<server>][:<port>]
+               - esql:postgresql://<server>[:<port>][/<dbname>]
+
+ Mon May 11 10:28:37 CEST 1998
+
+       - Added '? options' to connect call.
+       - Also allow USING as keyword for the password
+
+ Thu May 14 15:09:58 CEST 1998
+
+       - Changed preproc.y and pgc.l according to the parser changes in the
+         backend.
+
+ Fri May 15 09:55:21 CEST 1998
+
+       - Added connection_name handling
+
+
+ Mon May 18 10:33:58 CEST 1998
+
+       - Fixed some more bugs
+       - Set version to 2.3.1
+       - Set library version to 2.2
parent d1c5021c
...@@ -189,3 +189,42 @@ Wed May 6 11:42:48 CEST 1998 ...@@ -189,3 +189,42 @@ Wed May 6 11:42:48 CEST 1998
an example) an example)
- Set version to 2.3.0 - Set version to 2.3.0
- Set library version to 2.1 - Set library version to 2.1
Wed May 6 16:09:45 CEST 1998
- Some more cleanups in the library.
Thu May 7 12:34:28 CEST 1998
- Made CONNECT and DISCONNECT statement more SQL3 compliant.
- Changed the API for the ECPGconnect function to be able to handle
hostnames and ports
Fri May 8 13:54:45 CEST 1998
- More changes to the parser. The connect statement now allows
ORACLE style logins.
- db-name is accepted in two ways:
- <dbname>[@<server>][:<port>]
- esql:postgresql://<server>[:<port>][/<dbname>]
Mon May 11 10:28:37 CEST 1998
- Added '? options' to connect call.
- Also allow USING as keyword for the password
Thu May 14 15:09:58 CEST 1998
- Changed preproc.y and pgc.l according to the parser changes in the
backend.
Fri May 15 09:55:21 CEST 1998
- Added connection_name handling
Mon May 18 10:33:58 CEST 1998
- Fixed some more bugs
- Set version to 2.3.1
- Set library version to 2.2
#ifndef _ECPG_ERROR_H #ifndef _ECPG_ERROR_H
#define _ECPG_ERROR_H #define _ECPG_ERROR_H
#include <errno.h>
/* This is a list of all error codes the embedded SQL program can return */ /* This is a list of all error codes the embedded SQL program can return */
#define ECPG_NO_ERROR 0 #define ECPG_NO_ERROR 0
#define ECPG_NOT_FOUND 100 #define ECPG_NOT_FOUND 100
#define ECPG_PGSQL -1 /* system error codes returned by ecpglib get the correct number,
#define ECPG_UNSUPPORTED -2 * but are made negative
#define ECPG_TOO_MANY_ARGUMENTS -3 */
#define ECPG_TOO_FEW_ARGUMENTS -4 #define ECPG_OUT_OF_MEMORY -ENOMEM
#define ECPG_TRANS -5
#define ECPG_TOO_MANY_MATCHES -6 /* first we have a set of ecpg messages, they start at 200 */
#define ECPG_INT_FORMAT -7 #define ECPG_UNSUPPORTED -200
#define ECPG_UINT_FORMAT -8 #define ECPG_TOO_MANY_ARGUMENTS -201
#define ECPG_FLOAT_FORMAT -9 #define ECPG_TOO_FEW_ARGUMENTS -202
#define ECPG_CONVERT_BOOL -10 #define ECPG_TOO_MANY_MATCHES -203
#define ECPG_EMPTY -11 #define ECPG_INT_FORMAT -204
#define ECPG_CONNECT -12 #define ECPG_UINT_FORMAT -205
#define ECPG_DISCONNECT -13 #define ECPG_FLOAT_FORMAT -206
#define ECPG_CONVERT_BOOL -207
#define ECPG_EMPTY -208
#define ECPG_NO_CONN -209
/* finally the backend error messages, they start at 300 */
#define ECPG_PGSQL -300
#define ECPG_TRANS -301
#define ECPG_CONNECT -302
#endif /* !_ECPG_ERROR_H */ #endif /* !_ECPG_ERROR_H */
...@@ -5,11 +5,11 @@ extern "C" { ...@@ -5,11 +5,11 @@ extern "C" {
#endif #endif
void ECPGdebug(int, FILE *); void ECPGdebug(int, FILE *);
bool ECPGconnect(const char *); bool ECPGsetconn(int, const char *);
bool ECPGconnect(int, const char *, const char *, const char *, const char *);
bool ECPGdo(int, char *,...); bool ECPGdo(int, char *,...);
bool ECPGtrans(int, const char *); bool ECPGtrans(int, const char *);
bool ECPGfinish(void); bool ECPGdisconnect(int, const char *);
bool ECPGdisconnect(const char *);
void ECPGlog(const char *format,...); void ECPGlog(const char *format,...);
......
...@@ -4,7 +4,7 @@ include $(SRCDIR)/Makefile.global ...@@ -4,7 +4,7 @@ include $(SRCDIR)/Makefile.global
PQ_INCLUDE=-I$(SRCDIR)/interfaces/libpq PQ_INCLUDE=-I$(SRCDIR)/interfaces/libpq
SO_MAJOR_VERSION=2 SO_MAJOR_VERSION=2
SO_MINOR_VERSION=1 SO_MINOR_VERSION=2
PORTNAME=@PORTNAME@ PORTNAME=@PORTNAME@
......
This diff is collapsed.
...@@ -3,7 +3,7 @@ include $(SRCDIR)/Makefile.global ...@@ -3,7 +3,7 @@ include $(SRCDIR)/Makefile.global
MAJOR_VERSION=2 MAJOR_VERSION=2
MINOR_VERSION=3 MINOR_VERSION=3
PATCHLEVEL=0 PATCHLEVEL=1
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) \
......
...@@ -24,11 +24,13 @@ static ScanKeyword ScanKeywords[] = { ...@@ -24,11 +24,13 @@ static ScanKeyword ScanKeywords[] = {
{"break", SQL_BREAK}, {"break", SQL_BREAK},
{"call", SQL_CALL}, {"call", SQL_CALL},
{"connect", SQL_CONNECT}, {"connect", SQL_CONNECT},
{"connection", SQL_CONNECTION},
{"continue", SQL_CONTINUE}, {"continue", SQL_CONTINUE},
{"disconnect", SQL_DISCONNECT}, {"disconnect", SQL_DISCONNECT},
{"found", SQL_FOUND}, {"found", SQL_FOUND},
{"go", SQL_GO}, {"go", SQL_GO},
{"goto", SQL_GOTO}, {"goto", SQL_GOTO},
{"identified", SQL_IDENTIFIED},
{"immediate", SQL_IMMEDIATE}, {"immediate", SQL_IMMEDIATE},
{"indicator", SQL_INDICATOR}, {"indicator", SQL_INDICATOR},
{"open", SQL_OPEN}, {"open", SQL_OPEN},
......
#include "parser/keywords.h" #include "parser/keywords.h"
#include <errno.h>
/* variables */ /* variables */
...@@ -47,7 +48,8 @@ extern void yyerror(char *); ...@@ -47,7 +48,8 @@ extern void yyerror(char *);
/* return codes */ /* return codes */
#define OK 0 #define OK 0
#define NO_INCLUDE_FILE 1 #define PARSE_ERROR -1
#define PARSE_ERROR 2 #define ILLEGAL_OPTION -2
#define OUT_OF_MEMORY 3
#define ILLEGAL_OPTION 4 #define NO_INCLUDE_FILE ENOENT
#define OUT_OF_MEMORY ENOMEM
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.1 1998/04/21 13:23:06 scrappy Exp $ * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.2 1998/05/18 16:05:00 scrappy Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -189,6 +189,8 @@ static ScanKeyword ScanKeywords[] = { ...@@ -189,6 +189,8 @@ static ScanKeyword ScanKeywords[] = {
{"substring", SUBSTRING}, {"substring", SUBSTRING},
{"table", TABLE}, {"table", TABLE},
{"time", TIME}, {"time", TIME},
{"timezone_hour", TIMEZONE_HOUR},
{"timezone_minute", TIMEZONE_MINUTE},
{"to", TO}, {"to", TO},
{"trailing", TRAILING}, {"trailing", TRAILING},
{"transaction", TRANSACTION}, {"transaction", TRANSACTION},
......
...@@ -139,12 +139,13 @@ self [,()\[\].$\:\+\-\*\/\<\>\=\|] ...@@ -139,12 +139,13 @@ self [,()\[\].$\:\+\-\*\/\<\>\=\|]
op_and_self [\~\!\@\#\%\^\&\|\`\?\$\:\+\-\*\/\<\>\=] op_and_self [\~\!\@\#\%\^\&\|\`\?\$\:\+\-\*\/\<\>\=]
operator {op_and_self}+ operator {op_and_self}+
xminteger {integer}/-
xmreal {real}/{space}*-{digit}
xmstop - xmstop -
integer -?{digit}+ integer [\-]?{digit}+
real -?{digit}+\.{digit}+([Ee][-+]?{digit}+)? /*
real [\-]?{digit}+\.{digit}+([Ee][-+]?{digit}+)?
*/
real [\-]?(((({digit}*\.{digit}+)|({digit}+\.{digit}*))([Ee][-+]?{digit}+)?)|({digit}+[Ee][-+]?{digit}+))
param \${integer} param \${integer}
...@@ -309,7 +310,8 @@ before_comment); ...@@ -309,7 +310,8 @@ before_comment);
<SQL>{typecast} { return TYPECAST; } <SQL>{typecast} { return TYPECAST; }
<SQL>{self}/-[\.0-9] { <SQL>{self}/{space}*-[\.0-9] {
BEGIN(xm);
return (yytext[0]); return (yytext[0]);
} }
<SQL>{self} { return (yytext[0]); } <SQL>{self} { return (yytext[0]); }
......
This diff is collapsed.
...@@ -20,21 +20,6 @@ mm_alloc(size_t size) ...@@ -20,21 +20,6 @@ mm_alloc(size_t size)
return (ptr); return (ptr);
} }
/* realloc + error check */
void *
mm_realloc(void *ptr, size_t size)
{
ptr = realloc(ptr, size);
if (ptr == NULL)
{
fprintf(stderr, "Out of memory\n");
exit(OUT_OF_MEMORY);
}
return (ptr);
}
/* duplicate memberlist */ /* duplicate memberlist */
static struct ECPGstruct_member * static struct ECPGstruct_member *
struct_member_dup(struct ECPGstruct_member * rm) struct_member_dup(struct ECPGstruct_member * rm)
...@@ -43,7 +28,22 @@ struct_member_dup(struct ECPGstruct_member * rm) ...@@ -43,7 +28,22 @@ struct_member_dup(struct ECPGstruct_member * rm)
while (rm) while (rm)
{ {
ECPGmake_struct_member(rm->name, rm->typ, &new); struct ECPGtype *type;
switch(rm->typ->typ)
{
case ECPGt_struct:
type = ECPGmake_struct_type(rm->typ->u.members);
break;
case ECPGt_array:
type = ECPGmake_array_type(ECPGmake_simple_type(rm->typ->u.element->typ, rm->typ->u.element->size), rm->typ->size);
break;
default:
type = ECPGmake_simple_type(rm->typ->typ, rm->typ->size);
break;
}
ECPGmake_struct_member(rm->name, type, &new);
rm = rm->next; rm = rm->next;
} }
...@@ -165,11 +165,11 @@ static const char *get_type(enum ECPGttype typ) ...@@ -165,11 +165,11 @@ static const char *get_type(enum ECPGttype typ)
size is the maxsize in case it is a varchar. Otherwise it is the size of size is the maxsize in case it is a varchar. Otherwise it is the size of
the variable (required to do array fetches of structs). the variable (required to do array fetches of structs).
*/ */
void static void
ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype typ, ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype typ,
long varcharsize, long varcharsize,
long arrsiz, const char *siz, const char *prefix); long arrsiz, const char *siz, const char *prefix);
void static void
ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, long arrsiz, ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, long arrsiz,
struct ECPGtype * typ, struct ECPGtype * ind_typ, const char *offset, const char *prefix, const char * ind_prefix); struct ECPGtype * typ, struct ECPGtype * ind_typ, const char *offset, const char *prefix, const char * ind_prefix);
...@@ -223,7 +223,7 @@ ECPGdump_a_type(FILE *o, const char *name, struct ECPGtype * typ, const char *in ...@@ -223,7 +223,7 @@ ECPGdump_a_type(FILE *o, const char *name, struct ECPGtype * typ, const char *in
/* If siz is NULL, then the offset is 0, if not use siz as a /* If siz is NULL, then the offset is 0, if not use siz as a
string, it represents the offset needed if we are in an array of structs. */ string, it represents the offset needed if we are in an array of structs. */
void static void
ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype typ, ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype typ,
long varcharsize, long varcharsize,
long arrsize, long arrsize,
...@@ -272,7 +272,7 @@ ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype typ, ...@@ -272,7 +272,7 @@ ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype typ,
/* Penetrate a struct and dump the contents. */ /* Penetrate a struct and dump the contents. */
void static void
ECPGdump_a_struct(FILE *o, const char *name, const char * ind_name, long arrsiz, struct ECPGtype * typ, struct ECPGtype * ind_typ, const char *offsetarg, const char *prefix, const char *ind_prefix) ECPGdump_a_struct(FILE *o, const char *name, const char * ind_name, long arrsiz, struct ECPGtype * typ, struct ECPGtype * ind_typ, const char *offsetarg, const char *prefix, const char *ind_prefix)
{ {
...@@ -319,6 +319,7 @@ ECPGfree_struct_member(struct ECPGstruct_member * rm) ...@@ -319,6 +319,7 @@ ECPGfree_struct_member(struct ECPGstruct_member * rm)
rm = rm->next; rm = rm->next;
free(p->name); free(p->name);
free(p->typ);
free(p); free(p);
} }
} }
...@@ -337,7 +338,7 @@ ECPGfree_type(struct ECPGtype * typ) ...@@ -337,7 +338,7 @@ ECPGfree_type(struct ECPGtype * typ)
else if (typ->u.element->typ == ECPGt_struct) else if (typ->u.element->typ == ECPGt_struct)
{ {
/* Array of structs. */ /* Array of structs. */
ECPGfree_struct_member(typ->u.members); ECPGfree_struct_member(typ->u.element->u.members);
free(typ->u.members); free(typ->u.members);
} }
else else
......
...@@ -28,7 +28,7 @@ exec sql begin declare section; ...@@ -28,7 +28,7 @@ exec sql begin declare section;
exec sql end declare section; exec sql end declare section;
struct timeval tvs, tve; struct timeval tvs, tve;
exec sql connect mm; exec sql connect to mm;
exec sql create table perftest1(number int4, ascii char(16)); exec sql create table perftest1(number int4, ascii char(16));
......
...@@ -19,7 +19,7 @@ exec sql end declare section; ...@@ -19,7 +19,7 @@ exec sql end declare section;
ECPGdebug(1, dbgs); ECPGdebug(1, dbgs);
strcpy(msg, "connect"); strcpy(msg, "connect");
exec sql connect mm; exec sql connect to mm;
strcpy(msg, "create"); strcpy(msg, "create");
exec sql create table test(name char(8), amount int); exec sql create table test(name char(8), amount int);
......
...@@ -11,9 +11,9 @@ exec sql begin declare section; ...@@ -11,9 +11,9 @@ exec sql begin declare section;
short age; short age;
} birth; } birth;
} personal; } personal;
struct personal_indicator { short name; struct personal_indicator { short ind_name;
struct birth_indicator { short born; struct birth_indicator { short ind_born;
int age; int ind_age;
} ind_birth; } ind_birth;
} ind_personal; } ind_personal;
long ind_married; long ind_married;
...@@ -26,7 +26,7 @@ exec sql end declare section; ...@@ -26,7 +26,7 @@ exec sql end declare section;
ECPGdebug(1, dbgs); ECPGdebug(1, dbgs);
strcpy(msg, "connect"); strcpy(msg, "connect");
exec sql connect mm; exec sql connect to mm;
strcpy(msg, "create"); strcpy(msg, "create");
exec sql create table meskes(name char(8), born integer, age smallint, married char(8)); exec sql create table meskes(name char(8), born integer, age smallint, married char(8));
......
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