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
an example)
- Set version to 2.3.0
- 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
#define _ECPG_ERROR_H
#include <errno.h>
/* This is a list of all error codes the embedded SQL program can return */
#define ECPG_NO_ERROR 0
#define ECPG_NOT_FOUND 100
#define ECPG_PGSQL -1
#define ECPG_UNSUPPORTED -2
#define ECPG_TOO_MANY_ARGUMENTS -3
#define ECPG_TOO_FEW_ARGUMENTS -4
#define ECPG_TRANS -5
#define ECPG_TOO_MANY_MATCHES -6
#define ECPG_INT_FORMAT -7
#define ECPG_UINT_FORMAT -8
#define ECPG_FLOAT_FORMAT -9
#define ECPG_CONVERT_BOOL -10
#define ECPG_EMPTY -11
#define ECPG_CONNECT -12
#define ECPG_DISCONNECT -13
/* system error codes returned by ecpglib get the correct number,
* but are made negative
*/
#define ECPG_OUT_OF_MEMORY -ENOMEM
/* first we have a set of ecpg messages, they start at 200 */
#define ECPG_UNSUPPORTED -200
#define ECPG_TOO_MANY_ARGUMENTS -201
#define ECPG_TOO_FEW_ARGUMENTS -202
#define ECPG_TOO_MANY_MATCHES -203
#define ECPG_INT_FORMAT -204
#define ECPG_UINT_FORMAT -205
#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 */
......@@ -5,11 +5,11 @@ extern "C" {
#endif
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 ECPGtrans(int, const char *);
bool ECPGfinish(void);
bool ECPGdisconnect(const char *);
bool ECPGdisconnect(int, const char *);
void ECPGlog(const char *format,...);
......
......@@ -4,7 +4,7 @@ include $(SRCDIR)/Makefile.global
PQ_INCLUDE=-I$(SRCDIR)/interfaces/libpq
SO_MAJOR_VERSION=2
SO_MINOR_VERSION=1
SO_MINOR_VERSION=2
PORTNAME=@PORTNAME@
......
This diff is collapsed.
......@@ -3,7 +3,7 @@ include $(SRCDIR)/Makefile.global
MAJOR_VERSION=2
MINOR_VERSION=3
PATCHLEVEL=0
PATCHLEVEL=1
CFLAGS+=-I../include -DMAJOR_VERSION=$(MAJOR_VERSION) \
-DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \
......
......@@ -24,12 +24,14 @@ static ScanKeyword ScanKeywords[] = {
{"break", SQL_BREAK},
{"call", SQL_CALL},
{"connect", SQL_CONNECT},
{"connection", SQL_CONNECTION},
{"continue", SQL_CONTINUE},
{"disconnect", SQL_DISCONNECT},
{"found", SQL_FOUND},
{"go", SQL_GO},
{"goto", SQL_GOTO},
{"immediate", SQL_IMMEDIATE},
{"identified", SQL_IDENTIFIED},
{"immediate", SQL_IMMEDIATE},
{"indicator", SQL_INDICATOR},
{"open", SQL_OPEN},
{"release", SQL_RELEASE},
......
#include "parser/keywords.h"
#include <errno.h>
/* variables */
......@@ -47,7 +48,8 @@ extern void yyerror(char *);
/* return codes */
#define OK 0
#define NO_INCLUDE_FILE 1
#define PARSE_ERROR 2
#define OUT_OF_MEMORY 3
#define ILLEGAL_OPTION 4
#define PARSE_ERROR -1
#define ILLEGAL_OPTION -2
#define NO_INCLUDE_FILE ENOENT
#define OUT_OF_MEMORY ENOMEM
......@@ -7,7 +7,7 @@
*
*
* 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[] = {
{"substring", SUBSTRING},
{"table", TABLE},
{"time", TIME},
{"timezone_hour", TIMEZONE_HOUR},
{"timezone_minute", TIMEZONE_MINUTE},
{"to", TO},
{"trailing", TRAILING},
{"transaction", TRANSACTION},
......
......@@ -139,12 +139,13 @@ self [,()\[\].$\:\+\-\*\/\<\>\=\|]
op_and_self [\~\!\@\#\%\^\&\|\`\?\$\:\+\-\*\/\<\>\=]
operator {op_and_self}+
xminteger {integer}/-
xmreal {real}/{space}*-{digit}
xmstop -
integer -?{digit}+
real -?{digit}+\.{digit}+([Ee][-+]?{digit}+)?
integer [\-]?{digit}+
/*
real [\-]?{digit}+\.{digit}+([Ee][-+]?{digit}+)?
*/
real [\-]?(((({digit}*\.{digit}+)|({digit}+\.{digit}*))([Ee][-+]?{digit}+)?)|({digit}+[Ee][-+]?{digit}+))
param \${integer}
......@@ -309,7 +310,8 @@ before_comment);
<SQL>{typecast} { return TYPECAST; }
<SQL>{self}/-[\.0-9] {
<SQL>{self}/{space}*-[\.0-9] {
BEGIN(xm);
return (yytext[0]);
}
<SQL>{self} { return (yytext[0]); }
......
This diff is collapsed.
......@@ -20,21 +20,6 @@ mm_alloc(size_t size)
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 */
static struct ECPGstruct_member *
struct_member_dup(struct ECPGstruct_member * rm)
......@@ -43,7 +28,22 @@ struct_member_dup(struct ECPGstruct_member * 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;
}
......@@ -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
the variable (required to do array fetches of structs).
*/
void
static void
ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype typ,
long varcharsize,
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,
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
/* 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. */
void
static void
ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype typ,
long varcharsize,
long arrsize,
......@@ -272,7 +272,7 @@ ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype typ,
/* 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)
{
......@@ -319,6 +319,7 @@ ECPGfree_struct_member(struct ECPGstruct_member * rm)
rm = rm->next;
free(p->name);
free(p->typ);
free(p);
}
}
......@@ -337,7 +338,7 @@ ECPGfree_type(struct ECPGtype * typ)
else if (typ->u.element->typ == ECPGt_struct)
{
/* Array of structs. */
ECPGfree_struct_member(typ->u.members);
ECPGfree_struct_member(typ->u.element->u.members);
free(typ->u.members);
}
else
......
......@@ -28,7 +28,7 @@ exec sql begin declare section;
exec sql end declare section;
struct timeval tvs, tve;
exec sql connect mm;
exec sql connect to mm;
exec sql create table perftest1(number int4, ascii char(16));
......
......@@ -19,7 +19,7 @@ exec sql end declare section;
ECPGdebug(1, dbgs);
strcpy(msg, "connect");
exec sql connect mm;
exec sql connect to mm;
strcpy(msg, "create");
exec sql create table test(name char(8), amount int);
......
......@@ -11,9 +11,9 @@ exec sql begin declare section;
short age;
} birth;
} personal;
struct personal_indicator { short name;
struct birth_indicator { short born;
int age;
struct personal_indicator { short ind_name;
struct birth_indicator { short ind_born;
int ind_age;
} ind_birth;
} ind_personal;
long ind_married;
......@@ -26,7 +26,7 @@ exec sql end declare section;
ECPGdebug(1, dbgs);
strcpy(msg, "connect");
exec sql connect mm;
exec sql connect to mm;
strcpy(msg, "create");
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