1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-24 00:23:06 +03:00

*** empty log message ***

This commit is contained in:
Michael Meskes
2000-09-19 11:47:16 +00:00
parent a5a290cab9
commit e9c3f0255f
16 changed files with 585 additions and 334 deletions

View File

@@ -3,8 +3,8 @@ top_builddir = ../../../..
include $(top_builddir)/src/Makefile.global
MAJOR_VERSION=2
MINOR_VERSION=7
PATCHLEVEL=1
MINOR_VERSION=8
PATCHLEVEL=0
CPPFLAGS+=-I../include -DMAJOR_VERSION=$(MAJOR_VERSION) \
-DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \

View File

@@ -46,9 +46,11 @@ ECPGnumeric_lvalue(FILE *f, char *name)
case ECPGt_short:
case ECPGt_int:
case ECPGt_long:
case ECPGt_long_long:
case ECPGt_unsigned_short:
case ECPGt_unsigned_int:
case ECPGt_unsigned_long:
case ECPGt_unsigned_long_long:
fputs(name, yyout);
break;
default:

View File

@@ -50,7 +50,6 @@ static ScanKeyword ScanKeywords[] = {
{"name", SQL_NAME},
{"nullable", SQL_NULLABLE},
{"octet_length", SQL_OCTET_LENGTH},
{"off", SQL_OFF},
{"open", SQL_OPEN},
{"prepare", SQL_PREPARE},
{"reference", SQL_REFERENCE},

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.28 2000/06/12 19:40:55 momjian Exp $
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.29 2000/09/19 11:47:14 meskes Exp $
*
*-------------------------------------------------------------------------
*/
@@ -55,8 +55,10 @@ static ScanKeyword ScanKeywords[] = {
{"cascade", CASCADE},
{"case", CASE},
{"cast", CAST},
{"chain", CHAIN},
{"char", CHAR},
{"character", CHARACTER},
{"characteristics", CHARACTERISTICS},
{"check", CHECK},
{"close", CLOSE},
{"cluster", CLUSTER},
@@ -100,6 +102,7 @@ static ScanKeyword ScanKeywords[] = {
{"else", ELSE},
{"encoding", ENCODING},
{"end", END_TRANS},
{"escape", ESCAPE},
{"except", EXCEPT},
{"exclusive", EXCLUSIVE},
{"execute", EXECUTE},
@@ -123,6 +126,7 @@ static ScanKeyword ScanKeywords[] = {
{"handler", HANDLER},
{"having", HAVING},
{"hour", HOUR_P},
{"ilike", ILIKE},
{"immediate", IMMEDIATE},
{"in", IN},
{"increment", INCREMENT},
@@ -130,6 +134,7 @@ static ScanKeyword ScanKeywords[] = {
{"inherits", INHERITS},
{"initially", INITIALLY},
{"inner", INNER_P},
{"inout", INOUT},
{"insensitive", INSENSITIVE},
{"insert", INSERT},
{"instead", INSTEAD},
@@ -178,6 +183,7 @@ static ScanKeyword ScanKeywords[] = {
{"nullif", NULLIF},
{"numeric", NUMERIC},
{"of", OF},
{"off", OFF},
{"offset", OFFSET},
{"oids", OIDS},
{"old", OLD},
@@ -188,9 +194,11 @@ static ScanKeyword ScanKeywords[] = {
{"overlaps", OVERLAPS},
{"or", OR},
{"order", ORDER},
{"out", OUT},
{"outer", OUTER_P},
{"partial", PARTIAL},
{"password", PASSWORD},
{"path", PATH_P},
{"pendant", PENDANT},
{"position", POSITION},
{"precision", PRECISION},
@@ -213,12 +221,14 @@ static ScanKeyword ScanKeywords[] = {
{"rollback", ROLLBACK},
{"row", ROW},
{"rule", RULE},
{"schema", SCHEMA},
{"scroll", SCROLL},
{"second", SECOND_P},
{"select", SELECT},
{"sequence", SEQUENCE},
{"serial", SERIAL},
{"serializable", SERIALIZABLE},
{"session", SESSION},
{"session_user", SESSION_USER},
{"set", SET},
{"setof", SETOF},
@@ -240,6 +250,7 @@ static ScanKeyword ScanKeywords[] = {
{"timezone_hour", TIMEZONE_HOUR},
{"timezone_minute", TIMEZONE_MINUTE},
{"to", TO},
{"toast", TOAST},
{"trailing", TRAILING},
{"transaction", TRANSACTION},
{"trigger", TRIGGER},
@@ -267,6 +278,7 @@ static ScanKeyword ScanKeywords[] = {
{"when", WHEN},
{"where", WHERE},
{"with", WITH},
{"without", WITHOUT},
{"work", WORK},
{"year", YEAR_P},
{"zone", ZONE},

View File

@@ -12,7 +12,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.60 2000/06/28 18:29:40 petere Exp $
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.61 2000/09/19 11:47:14 meskes Exp $
*
*-------------------------------------------------------------------------
*/
@@ -50,6 +50,8 @@ static char *literalbuf = NULL; /* expandable buffer */
static int literallen; /* actual current length */
static int literalalloc; /* current allocated buffer size */
static int xcdepth = 0;
#define startlit() (literalbuf[0] = '\0', literallen = 0)
static void addlit(char *ytext, int yleng);
@@ -140,6 +142,7 @@ xqcat {quote}{whitespace_with_newline}{quote}
dquote \"
xdstart {dquote}
xdstop {dquote}
xddouble {dquote}{dquote}
xdinside [^"]+
/* special stuff for C strings */
@@ -169,7 +172,7 @@ xdcinside ({xdcqq}|{xdcqdq}|{xdcother})
*/
xcstart \/\*{op_chars}*
xcstop \*+\/
xcinside ([^*]+)|(\*+[^/])
xcinside [^*/]+
digit [0-9]
letter [\200-\377_A-Za-z]
@@ -190,7 +193,7 @@ typecast "::"
* rule for "operator"!
*/
self [,()\[\].;$\:\+\-\*\/\%\^\<\>\=\|]
op_chars [\~\!\@\#\^\&\|\`\?\$\:\+\-\*\/\%\<\>\=]
op_chars [\~\!\@\#\^\&\|\`\?\$\+\-\*\/\%\<\>\=]
operator {op_chars}+
/* we no longer allow unary minus in numbers.
@@ -281,15 +284,30 @@ cppline {space}*#(.*\\{line_end})*.*
{xcstart} {
state_before = YYSTATE;
xcdepth = 0;
BEGIN(xc);
/* Put back any characters past slash-star; see above */
yyless(2);
fputs("/*", yyout);
}
<xc>{xcstop} { ECHO; BEGIN(state_before); }
<xc>{xcstart} {
xcdepth++;
/* Put back any characters past slash-star; see above */
yyless(2);
fputs("/*", yyout);
}
<xc>{xcstop} {
ECHO;
if (xcdepth <= 0)
BEGIN(state_before);
else
xcdepth--;
}
<xc>{xcinside} { ECHO; }
<xc>{op_chars} { ECHO; }
<xc><<EOF>> { mmerror(ET_ERROR, "Unterminated /* comment"); }
@@ -361,11 +379,36 @@ cppline {space}*#(.*\\{line_end})*.*
BEGIN(xd);
startlit();
}
<xd,xdc>{xdstop} {
<xd>{xdstop} {
BEGIN(state_before);
if (strlen(literalbuf) >= NAMEDATALEN)
{
#ifdef MULTIBYTE
int len;
len = pg_mbcliplen(literalbuf,strlen(literalbuf),NAMEDATALEN-1);
sprintf(errortext, "identifier \"%s\" will be truncated to \"%.*s\"",
literalbuf, len, literalbuf);
literalbuf[len] = '\0';
#else
sprintf(errortext, "identifier \"%s\" will be truncated to \"%.*s\"",
literalbuf, NAMEDATALEN-1, literalbuf);
literalbuf[NAMEDATALEN-1] = '\0';
#endif
mmerror(ET_WARN, errortext);
}
yylval.str = mm_strdup(literalbuf);
return CSTRING;
}
<xdc>{xdstop} {
BEGIN(state_before);
yylval.str = mm_strdup(literalbuf);
return CSTRING;
}
<xd>{xddouble} {
addlit(yytext, yyleng-1);
}
<xd>{xdinside} {
addlit(yytext, yyleng);
}
@@ -426,7 +469,7 @@ cppline {space}*#(.*\\{line_end})*.*
for (ic = nchars-2; ic >= 0; ic--)
{
if (strchr("~!@#&`?$:%^|", yytext[ic]))
if (strchr("~!@#^&|`?$%", yytext[ic]))
break;
}
if (ic >= 0)
@@ -498,8 +541,19 @@ cppline {space}*#(.*\\{line_end})*.*
if (i >= NAMEDATALEN)
{
sprintf(errortext, "Identifier \"%s\" will be truncated to \"%.*s\"", yytext, NAMEDATALEN-1, yytext);
mmerror (ET_WARN, errortext);
#ifdef MULTIBYTE
int len;
len = pg_mbcliplen(lower_text,strlen(lower_text),NAMEDATALEN-1);
sprintf(errortext, "identifier \"%s\" will be truncated to \"%.*s\"",
lower_text, len, lower_text);
lower_text[len] = '\0';
#else
sprintf(errortext, "identifier \"%s\" will be truncated to \"%.*s\"",
lower_text, NAMEDATALEN-1, lower_text);
lower_text[NAMEDATALEN-1] = '\0';
#endif
mmerror(ET_WARN, errortext);
yytext[NAMEDATALEN-1] = '\0';
}

File diff suppressed because it is too large Load Diff

View File

@@ -146,7 +146,13 @@ get_type(enum ECPGttype typ)
return ("ECPGt_long");
break;
case ECPGt_unsigned_long:
return ("ECPGt_unsigned_int");
return ("ECPGt_unsigned_long");
break;
case ECPGt_long_long:
return ("ECPGt_long_long");
break;
case ECPGt_unsigned_long_long:
return ("ECPGt_unsigned_long_long");
break;
case ECPGt_float:
return ("ECPGt_float");

View File

@@ -260,9 +260,11 @@ check_indicator(struct ECPGtype * var)
case ECPGt_short:
case ECPGt_int:
case ECPGt_long:
case ECPGt_long_long:
case ECPGt_unsigned_short:
case ECPGt_unsigned_int:
case ECPGt_unsigned_long:
case ECPGt_unsigned_long_long:
break;
case ECPGt_struct: