Skip to content

Commit a4f59da

Browse files
author
Michael Meskes
committed
*** empty log message ***
1 parent 7395d9a commit a4f59da

File tree

9 files changed

+293
-441
lines changed

9 files changed

+293
-441
lines changed

src/interfaces/ecpg/ChangeLog

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
Tue Aug 24 15:53:28 MEST 1999
2-
3-
- made NULL a valid bool value
4-
- check for indicator variables on NULL
5-
61
Wed Feb 11 10:58:13 CET 1998
72

83
- Added '-d' option to turn on debugging.
@@ -653,3 +648,29 @@ Mon Sep 27 07:40:20 CEST 1999
653648
- Synced preproc.y with gram.y.
654649
- Synced keyword.c.
655650
- Set ecpg version to 2.6.5
651+
652+
Tue Sep 28 17:58:37 CEST 1999
653+
654+
- Synced preproc.y with gram.y.
655+
- Synced pgc.l with scan.l.
656+
657+
Fri Oct 1 18:34:30 CEST 1999
658+
659+
- Synced preproc.y with gram.y.
660+
- Synced keyword.c.
661+
- Include patch by Christof Petig <christof.petig@wtal.de>:
662+
- made NULL a valid bool value
663+
- check for indicator variables on NULL
664+
665+
Wed Oct 6 18:28:40 CEST 1999
666+
667+
- Synced preproc.y with gram.y.
668+
669+
Thu Oct 7 15:12:58 CEST 1999
670+
671+
- Fixed bug that caused mixed case relation names to be converted to
672+
upper case.
673+
- Synced preproc.y with gram.y.
674+
- Set ecpg version to 2.6.6
675+
- Set library version to 3.0.4
676+

src/interfaces/ecpg/lib/Makefile.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
# Copyright (c) 1994, Regents of the University of California
77
#
88
# IDENTIFICATION
9-
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.47 1999/09/17 18:28:10 meskes Exp $
9+
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.48 1999/10/08 11:04:59 meskes Exp $
1010
#
1111
#-------------------------------------------------------------------------
1212

1313
NAME= ecpg
1414
SO_MAJOR_VERSION= 3
15-
SO_MINOR_VERSION= 0.3
15+
SO_MINOR_VERSION= 0.4
1616

1717
SRCDIR= @top_srcdir@
1818
include $(SRCDIR)/Makefile.global

src/interfaces/ecpg/lib/ecpglib.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,6 @@ ECPGexecute(struct statement * stmt)
802802
else
803803
res = 0L;
804804

805-
/* Again?! Yes */
806805
switch (var->type)
807806
{
808807
case ECPGt_short:
@@ -837,7 +836,6 @@ ECPGexecute(struct statement * stmt)
837836
else
838837
ures = 0L;
839838

840-
/* Again?! Yes */
841839
switch (var->type)
842840
{
843841
case ECPGt_unsigned_short:
@@ -872,7 +870,6 @@ ECPGexecute(struct statement * stmt)
872870
else
873871
dres = 0.0;
874872

875-
/* Again?! Yes */
876873
switch (var->type)
877874
{
878875
case ECPGt_float:

src/interfaces/ecpg/preproc/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ include $(SRCDIR)/Makefile.global
33

44
MAJOR_VERSION=2
55
MINOR_VERSION=6
6-
PATCHLEVEL=5
6+
PATCHLEVEL=6
77

88
CFLAGS+=-I../include -DMAJOR_VERSION=$(MAJOR_VERSION) \
99
-DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \

src/interfaces/ecpg/preproc/ecpg_keywords.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ static ScanKeyword ScanKeywords[] = {
3535
{"go", SQL_GO},
3636
{"goto", SQL_GOTO},
3737
{"identified", SQL_IDENTIFIED},
38-
{"immediate", SQL_IMMEDIATE},
3938
{"indicator", SQL_INDICATOR},
4039
{"int", SQL_INT},
4140
{"long", SQL_LONG},

src/interfaces/ecpg/preproc/keywords.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.17 1999/09/27 10:41:02 meskes Exp $
10+
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.18 1999/10/08 11:05:02 meskes Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -64,6 +64,7 @@ static ScanKeyword ScanKeywords[] = {
6464
{"commit", COMMIT},
6565
{"committed", COMMITTED},
6666
{"constraint", CONSTRAINT},
67+
{"constraints", CONSTRAINTS},
6768
{"copy", COPY},
6869
{"create", CREATE},
6970
{"createdb", CREATEDB},
@@ -80,6 +81,8 @@ static ScanKeyword ScanKeywords[] = {
8081
{"decimal", DECIMAL},
8182
{"declare", DECLARE},
8283
{"default", DEFAULT},
84+
{"deferrable", DEFERRABLE},
85+
{"deferred", DEFERRED},
8386
{"delete", DELETE},
8487
{"delimiters", DELIMITERS},
8588
{"desc", DESC},
@@ -113,10 +116,12 @@ static ScanKeyword ScanKeywords[] = {
113116
{"handler", HANDLER},
114117
{"having", HAVING},
115118
{"hour", HOUR_P},
119+
{"immediate", IMMEDIATE},
116120
{"in", IN},
117121
{"increment", INCREMENT},
118122
{"index", INDEX},
119123
{"inherits", INHERITS},
124+
{"initially", INITIALLY},
120125
{"inner", INNER_P},
121126
{"insensitive", INSENSITIVE},
122127
{"insert", INSERT},
@@ -178,6 +183,7 @@ static ScanKeyword ScanKeywords[] = {
178183
{"outer", OUTER_P},
179184
{"partial", PARTIAL},
180185
{"password", PASSWORD},
186+
{"pendant", PENDANT},
181187
{"position", POSITION},
182188
{"precision", PRECISION},
183189
{"primary", PRIMARY},
@@ -191,6 +197,7 @@ static ScanKeyword ScanKeywords[] = {
191197
{"relative", RELATIVE},
192198
{"rename", RENAME},
193199
{"reset", RESET},
200+
{"restrict", RESTRICT},
194201
{"returns", RETURNS},
195202
{"revoke", REVOKE},
196203
{"right", RIGHT},

src/interfaces/ecpg/preproc/pgc.l

Lines changed: 8 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ static char *old;
6060
* <xc> extended C-style comments - tgl 1997-07-12
6161
* <xd> delimited identifiers (double-quoted identifiers) - tgl 1997-10-27
6262
* <xh> hexadecimal numeric string - thomas 1997-11-16
63-
* <xm> numeric strings with embedded minus sign - tgl 1997-09-05
6463
* <xq> quoted strings - tgl 1997-07-30
6564
*
6665
* The "extended comment" syntax closely resembles allowable operator syntax.
@@ -75,7 +74,6 @@ static char *old;
7574
%x xd
7675
%x xdc
7776
%x xh
78-
%x xm
7977
%x xq
8078

8179
/* Binary number
@@ -128,7 +126,6 @@ xcinside [^*]*
128126
xcstar [^/]
129127

130128
digit [0-9]
131-
number [-+.0-9Ee]
132129
letter [\200-\377_A-Za-z]
133130
letter_or_digit [\200-\377_A-Za-z0-9]
134131

@@ -140,13 +137,15 @@ self [,()\[\].;$\:\+\-\*\/\%\^\<\>\=\|]
140137
op_and_self [\~\!\@\#\^\&\|\`\?\$\:\+\-\*\/\%\<\>\=]
141138
operator {op_and_self}+
142139

143-
xmstop -
144-
145-
integer [\-]?{digit}+
146-
decimal [\-]?(({digit}*\.{digit}+)|({digit}+\.{digit}*))
147-
real [\-]?((({digit}*\.{digit}+)|({digit}+\.{digit}*)|({digit}+))([Ee][-+]?{digit}+))
140+
/* we do not allow unary minus in numbers.
141+
* instead we pass it verbatim to parser. there it gets
142+
* coerced via doNegate() -- Leon aug 20 1999
143+
*/
144+
integer {digit}+
145+
decimal (({digit}*\.{digit}+)|({digit}+\.{digit}*))
146+
real ((({digit}*\.{digit}+)|({digit}+\.{digit}*)|({digit}+))([Ee][-+]?{digit}+))
148147
/*
149-
real [\-]?(((({digit}*\.{digit}+)|({digit}+\.{digit}*))([Ee][-+]?{digit}+)?)|({digit}+[Ee][-+]?{digit}+))
148+
real (((({digit}*\.{digit}+)|({digit}+\.{digit}*))([Ee][-+]?{digit}+)?)|({digit}+[Ee][-+]?{digit}+))
150149
*/
151150

152151
param \${integer}
@@ -291,18 +290,7 @@ cppline {space}*#.*(\\{space}*\n)*\n*
291290
memcpy(literal+llen, yytext, yyleng+1);
292291
llen += yyleng;
293292
}
294-
<xm>{space}* { /* ignore */ }
295-
<xm>{xmstop} {
296-
BEGIN(SQL);
297-
return yytext[0];
298-
}
299-
300-
301293
<SQL>{typecast} { return TYPECAST; }
302-
<SQL>{self}/{space}*-[\.0-9] {
303-
BEGIN(xm);
304-
return yytext[0];
305-
}
306294
<SQL>{self} { /*
307295
* We may find a ';' inside a structure
308296
* definition in a TYPE or VAR statement.
@@ -312,10 +300,6 @@ cppline {space}*#.*(\\{space}*\n)*\n*
312300
BEGIN C;
313301
return yytext[0];
314302
}
315-
<SQL>{operator}/-[\.0-9] {
316-
yylval.str = mm_strdup((char*)yytext);
317-
return Op;
318-
}
319303
<SQL>{operator} {
320304
if (strcmp((char*)yytext,"!=") == 0)
321305
yylval.str = mm_strdup("<>"); /* compatability */
@@ -327,106 +311,6 @@ cppline {space}*#.*(\\{space}*\n)*\n*
327311
yylval.ival = atoi((char*)&yytext[1]);
328312
return PARAM;
329313
}
330-
<SQL>{identifier}/{space}*-{number} {
331-
int i;
332-
ScanKeyword *keyword;
333-
char lower_text[NAMEDATALEN];
334-
335-
BEGIN(xm);
336-
/* this should leave the last byte set to '\0' */
337-
strncpy(lower_text, yytext, NAMEDATALEN-1);
338-
for(i = 0; lower_text[i]; i++)
339-
if (isascii((unsigned char)lower_text[i]) && isupper(lower_text[i]))
340-
lower_text[i] = tolower(lower_text[i]);
341-
342-
keyword = ScanKeywordLookup((char*)lower_text);
343-
if (keyword != NULL) {
344-
return keyword->value;
345-
}
346-
else
347-
{
348-
keyword = ScanECPGKeywordLookup((char*)lower_text);
349-
if (keyword != NULL) {
350-
return keyword->value;
351-
}
352-
else
353-
{
354-
struct _defines *ptr;
355-
356-
for (ptr = defines; ptr; ptr = ptr->next)
357-
{
358-
if (strcmp(yytext, ptr->old) == 0)
359-
{
360-
struct _yy_buffer *yb;
361-
362-
yb = mm_alloc(sizeof(struct _yy_buffer));
363-
364-
yb->buffer = YY_CURRENT_BUFFER;
365-
yb->lineno = yylineno;
366-
yb->filename = mm_strdup(input_filename);
367-
yb->next = yy_buffer;
368-
369-
yy_buffer = yb;
370-
371-
yy_scan_string(ptr->new);
372-
break;
373-
}
374-
}
375-
if (ptr == NULL)
376-
{
377-
yylval.str = mm_strdup((char*)yytext);
378-
return IDENT;
379-
}
380-
}
381-
}
382-
}
383-
<C,SQL>{integer}/{space}*-{number} {
384-
char* endptr;
385-
386-
BEGIN(xm);
387-
errno = 0;
388-
yylval.ival = strtol((char *)yytext,&endptr,10);
389-
if (*endptr != '\0' || errno == ERANGE)
390-
{
391-
errno = 0;
392-
#if 0
393-
yylval.dval = strtod(((char *)yytext),&endptr);
394-
if (*endptr != '\0' || errno == ERANGE)
395-
yyerror("ERROR: Bad integer input");
396-
yyerror("WARNING: Integer input is out of range; promoted to float");
397-
return FCONST;
398-
#endif
399-
yylval.str = mm_strdup((char*)yytext);
400-
return SCONST;
401-
}
402-
return ICONST;
403-
}
404-
{decimal}/{space}*-{number} {
405-
char* endptr;
406-
407-
BEGIN(xm);
408-
if (strlen((char *)yytext) <= 17)
409-
{
410-
errno = 0;
411-
yylval.dval = strtod(((char *)yytext),&endptr);
412-
if (*endptr != '\0' || errno == ERANGE)
413-
yyerror("ERROR: Bad float8 input");
414-
return FCONST;
415-
}
416-
yylval.str = mm_strdup((char*)yytext);
417-
return SCONST;
418-
}
419-
420-
<C,SQL>{real}/{space}*-{number} {
421-
char* endptr;
422-
423-
BEGIN(xm);
424-
errno = 0;
425-
yylval.dval = strtod(((char *)yytext),&endptr);
426-
if (*endptr != '\0' || errno == ERANGE)
427-
yyerror("ERROR: Bad float8 input");
428-
return FCONST;
429-
}
430314
<C,SQL>{integer} {
431315
char* endptr;
432316

0 commit comments

Comments
 (0)