Commit e9c3f025 authored by Michael Meskes's avatar Michael Meskes

*** empty log message ***

parent a5a290ca
...@@ -925,3 +925,13 @@ Wed May 17 07:52:59 CEST 2000 ...@@ -925,3 +925,13 @@ Wed May 17 07:52:59 CEST 2000
handling. handling.
- Set library version to 3.1.1. - Set library version to 3.1.1.
Mon Sep 4 14:10:38 PDT 2000
- Synced preproc.y with gram.y.
- Synced keyword.c.
Mon Sep 18 13:55:11 PDT 2000
- Added int8 support based on a patch by Martijn Schoemaker <martijn@osp.nl>
- Set ecpg version to 2.8.0.
- Set library version to 3.2.0.
...@@ -26,5 +26,6 @@ instead of libpq so we can write backend functions using ecpg. ...@@ -26,5 +26,6 @@ instead of libpq so we can write backend functions using ecpg.
remove space_or_nl and line_end from pgc.l remove space_or_nl and line_end from pgc.l
Missing statements: Missing features:
- SQLSTATE - SQLSTATE
- LONG LONG datatype
...@@ -47,13 +47,14 @@ extern "C" ...@@ -47,13 +47,14 @@ extern "C"
ECPGt_char_variable, ECPGt_char_variable,
ECPGt_EOIT, /* End of insert types. */ ECPGt_EOIT, /* End of insert types. */
ECPGt_EORT, /* End of result types. */ ECPGt_EORT, /* End of result types. */
ECPGt_NO_INDICATOR /* no indicator */ ECPGt_NO_INDICATOR, /* no indicator */
ECPGt_long_long, ECPGt_unsigned_long_long
}; };
/* descriptor items */ /* descriptor items */
enum ECPGdtype enum ECPGdtype
{ {
ECPGd_count, ECPGd_count = 1,
ECPGd_data, ECPGd_data,
ECPGd_di_code, ECPGd_di_code,
ECPGd_di_precision, ECPGd_di_precision,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# #
# Copyright (c) 1994, Regents of the University of California # Copyright (c) 1994, Regents of the University of California
# #
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile,v 1.8 2000/09/17 13:02:46 petere Exp $ # $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile,v 1.9 2000/09/19 11:47:13 meskes Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -14,7 +14,7 @@ include $(top_builddir)/src/Makefile.global ...@@ -14,7 +14,7 @@ include $(top_builddir)/src/Makefile.global
NAME= ecpg NAME= ecpg
SO_MAJOR_VERSION= 3 SO_MAJOR_VERSION= 3
SO_MINOR_VERSION= 1.1 SO_MINOR_VERSION= 2.0
CPPFLAGS += -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir) CPPFLAGS += -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir)
......
...@@ -60,6 +60,12 @@ get_data(PGresult *results, int act_tuple, int act_field, int lineno, ...@@ -60,6 +60,12 @@ get_data(PGresult *results, int act_tuple, int act_field, int lineno,
case ECPGt_unsigned_long: case ECPGt_unsigned_long:
((long *) ind)[act_tuple] = -PQgetisnull(results, act_tuple, act_field); ((long *) ind)[act_tuple] = -PQgetisnull(results, act_tuple, act_field);
break; break;
case ECPGt_long_long:
((long long int*) ind)[act_tuple] = -PQgetisnull(results, act_tuple, act_field);
break;
case ECPGt_unsigned_long_long:
((unsigned long long int*) ind)[act_tuple] = -PQgetisnull(results, act_tuple, act_field);
break;
case ECPGt_NO_INDICATOR: case ECPGt_NO_INDICATOR:
if (PQgetisnull(results, act_tuple, act_field)) if (PQgetisnull(results, act_tuple, act_field))
{ {
...@@ -93,7 +99,6 @@ get_data(PGresult *results, int act_tuple, int act_field, int lineno, ...@@ -93,7 +99,6 @@ get_data(PGresult *results, int act_tuple, int act_field, int lineno,
{ {
ECPGraise(lineno, ECPG_INT_FORMAT, pval); ECPGraise(lineno, ECPG_INT_FORMAT, pval);
return (false); return (false);
res = 0L;
} }
} }
else else
...@@ -127,7 +132,6 @@ get_data(PGresult *results, int act_tuple, int act_field, int lineno, ...@@ -127,7 +132,6 @@ get_data(PGresult *results, int act_tuple, int act_field, int lineno,
{ {
ECPGraise(lineno, ECPG_UINT_FORMAT, pval); ECPGraise(lineno, ECPG_UINT_FORMAT, pval);
return (false); return (false);
ures = 0L;
} }
} }
else else
...@@ -150,7 +154,38 @@ get_data(PGresult *results, int act_tuple, int act_field, int lineno, ...@@ -150,7 +154,38 @@ get_data(PGresult *results, int act_tuple, int act_field, int lineno,
} }
break; break;
case ECPGt_long_long:
if (pval)
{
((long long int *) var)[act_tuple] = strtoull(pval, &scan_length, 10);
if ((isarray && *scan_length != ',' && *scan_length != '}')
|| (!isarray && *scan_length != '\0')) /* Garbage left */
{
ECPGraise(lineno, ECPG_INT_FORMAT, pval);
return (false);
}
}
else
((long long int *) var)[act_tuple] = 0LL;
break;
case ECPGt_unsigned_long_long:
if (pval)
{
((unsigned long long int *) var)[act_tuple] = strtoull(pval, &scan_length, 10);
if ((isarray && *scan_length != ',' && *scan_length != '}')
|| (!isarray && *scan_length != '\0')) /* Garbage left */
{
ECPGraise(lineno, ECPG_UINT_FORMAT, pval);
return (false);
}
}
else
((unsigned long long int *) var)[act_tuple] = 0LL;
break;
case ECPGt_float: case ECPGt_float:
case ECPGt_double: case ECPGt_double:
if (pval) if (pval)
......
...@@ -63,29 +63,35 @@ get_int_item(int lineno, void *var, enum ECPGdtype vartype, int value) ...@@ -63,29 +63,35 @@ get_int_item(int lineno, void *var, enum ECPGdtype vartype, int value)
{ {
switch (vartype) switch (vartype)
{ {
case ECPGt_short: case ECPGt_short:
*(short *) var = value; *(short *) var = (short) value;
break; break;
case ECPGt_int: case ECPGt_int:
*(int *) var = value; *(int *) var = (int) value;
break; break;
case ECPGt_long: case ECPGt_long:
*(long *) var = value; *(long *) var = (long) value;
break; break;
case ECPGt_unsigned_short: case ECPGt_unsigned_short:
*(unsigned short *) var = value; *(unsigned short *) var = (unsigned short) value;
break; break;
case ECPGt_unsigned_int: case ECPGt_unsigned_int:
*(unsigned int *) var = value; *(unsigned int *) var = (unsigned int) value;
break; break;
case ECPGt_unsigned_long: case ECPGt_unsigned_long:
*(unsigned long *) var = value; *(unsigned long *) var = (unsigned long) value;
break;
case ECPGt_long_long:
*(long long int *) var = (long long int) value;
break;
case ECPGt_unsigned_long_long:
*(unsigned long long int *) var = (unsigned long long int) value;
break; break;
case ECPGt_float: case ECPGt_float:
*(float *) var = value; *(float *) var = (float) value;
break; break;
case ECPGt_double: case ECPGt_double:
*(double *) var = value; *(double *) var = (double) value;
break; break;
default: default:
ECPGraise(lineno, ECPG_VAR_NOT_NUMERIC, NULL); ECPGraise(lineno, ECPG_VAR_NOT_NUMERIC, NULL);
......
...@@ -305,6 +305,11 @@ ECPGexecute(struct statement * stmt) ...@@ -305,6 +305,11 @@ ECPGexecute(struct statement * stmt)
if (*(long *) var->ind_value < 0L) if (*(long *) var->ind_value < 0L)
strcpy(buff, "null"); strcpy(buff, "null");
break; break;
case ECPGt_long_long:
case ECPGt_unsigned_long_long:
if (*(long long int*) var->ind_value < 0LL)
strcpy(buff, "null");
break;
default: default:
break; break;
} }
...@@ -428,6 +433,44 @@ ECPGexecute(struct statement * stmt) ...@@ -428,6 +433,44 @@ ECPGexecute(struct statement * stmt)
tobeinserted = mallocedval; tobeinserted = mallocedval;
break; break;
case ECPGt_long_long:
if (!(mallocedval = ecpg_alloc(var->arrsize * 25, stmt->lineno)))
return false;
if (var->arrsize > 1)
{
strncpy(mallocedval, "'{", sizeof("'{"));
for (element = 0; element < var->arrsize; element++)
sprintf(mallocedval + strlen(mallocedval), "%lld,", ((long long *) var->value)[element]);
strncpy(mallocedval + strlen(mallocedval) - 1, "}'", sizeof("}'"));
}
else
sprintf(mallocedval, "%lld", *((long long *) var->value));
tobeinserted = mallocedval;
break;
case ECPGt_unsigned_long_long:
if (!(mallocedval = ecpg_alloc(var->arrsize * 25, stmt->lineno)))
return false;
if (var->arrsize > 1)
{
strncpy(mallocedval, "'{", sizeof("'{"));
for (element = 0; element < var->arrsize; element++)
sprintf(mallocedval + strlen(mallocedval), "%llu,", ((unsigned long long *) var->value)[element]);
strncpy(mallocedval + strlen(mallocedval) - 1, "}'", sizeof("}'"));
}
else
sprintf(mallocedval, "%llu", *((unsigned long long*) var->value));
tobeinserted = mallocedval;
break;
case ECPGt_float: case ECPGt_float:
if (!(mallocedval = ecpg_alloc(var->arrsize * 20, stmt->lineno))) if (!(mallocedval = ecpg_alloc(var->arrsize * 20, stmt->lineno)))
...@@ -868,7 +911,7 @@ ECPGdo(int lineno, const char *connection_name, char *query,...) ...@@ -868,7 +911,7 @@ ECPGdo(int lineno, const char *connection_name, char *query,...)
* *
* Copyright (c) 2000, Christof Petig <christof.petig@wtal.de> * Copyright (c) 2000, Christof Petig <christof.petig@wtal.de>
* *
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/execute.c,v 1.7 2000/05/29 21:25:00 momjian Exp $ * $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/execute.c,v 1.8 2000/09/19 11:47:13 meskes Exp $
*/ */
PGconn *ECPG_internal_get_connection(char *name); PGconn *ECPG_internal_get_connection(char *name);
......
...@@ -28,6 +28,10 @@ ECPGtype_name(enum ECPGttype typ) ...@@ -28,6 +28,10 @@ ECPGtype_name(enum ECPGttype typ)
return "long"; return "long";
case ECPGt_unsigned_long: case ECPGt_unsigned_long:
return "unsigned long"; return "unsigned long";
case ECPGt_long_long:
return "long long";
case ECPGt_unsigned_long_long:
return "unsigned long long";
case ECPGt_float: case ECPGt_float:
return "float"; return "float";
case ECPGt_double: case ECPGt_double:
......
...@@ -3,8 +3,8 @@ top_builddir = ../../../.. ...@@ -3,8 +3,8 @@ top_builddir = ../../../..
include $(top_builddir)/src/Makefile.global include $(top_builddir)/src/Makefile.global
MAJOR_VERSION=2 MAJOR_VERSION=2
MINOR_VERSION=7 MINOR_VERSION=8
PATCHLEVEL=1 PATCHLEVEL=0
CPPFLAGS+=-I../include -DMAJOR_VERSION=$(MAJOR_VERSION) \ CPPFLAGS+=-I../include -DMAJOR_VERSION=$(MAJOR_VERSION) \
-DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \ -DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \
......
...@@ -46,9 +46,11 @@ ECPGnumeric_lvalue(FILE *f, char *name) ...@@ -46,9 +46,11 @@ ECPGnumeric_lvalue(FILE *f, char *name)
case ECPGt_short: case ECPGt_short:
case ECPGt_int: case ECPGt_int:
case ECPGt_long: case ECPGt_long:
case ECPGt_long_long:
case ECPGt_unsigned_short: case ECPGt_unsigned_short:
case ECPGt_unsigned_int: case ECPGt_unsigned_int:
case ECPGt_unsigned_long: case ECPGt_unsigned_long:
case ECPGt_unsigned_long_long:
fputs(name, yyout); fputs(name, yyout);
break; break;
default: default:
......
...@@ -50,7 +50,6 @@ static ScanKeyword ScanKeywords[] = { ...@@ -50,7 +50,6 @@ static ScanKeyword ScanKeywords[] = {
{"name", SQL_NAME}, {"name", SQL_NAME},
{"nullable", SQL_NULLABLE}, {"nullable", SQL_NULLABLE},
{"octet_length", SQL_OCTET_LENGTH}, {"octet_length", SQL_OCTET_LENGTH},
{"off", SQL_OFF},
{"open", SQL_OPEN}, {"open", SQL_OPEN},
{"prepare", SQL_PREPARE}, {"prepare", SQL_PREPARE},
{"reference", SQL_REFERENCE}, {"reference", SQL_REFERENCE},
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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[] = { ...@@ -55,8 +55,10 @@ static ScanKeyword ScanKeywords[] = {
{"cascade", CASCADE}, {"cascade", CASCADE},
{"case", CASE}, {"case", CASE},
{"cast", CAST}, {"cast", CAST},
{"chain", CHAIN},
{"char", CHAR}, {"char", CHAR},
{"character", CHARACTER}, {"character", CHARACTER},
{"characteristics", CHARACTERISTICS},
{"check", CHECK}, {"check", CHECK},
{"close", CLOSE}, {"close", CLOSE},
{"cluster", CLUSTER}, {"cluster", CLUSTER},
...@@ -100,6 +102,7 @@ static ScanKeyword ScanKeywords[] = { ...@@ -100,6 +102,7 @@ static ScanKeyword ScanKeywords[] = {
{"else", ELSE}, {"else", ELSE},
{"encoding", ENCODING}, {"encoding", ENCODING},
{"end", END_TRANS}, {"end", END_TRANS},
{"escape", ESCAPE},
{"except", EXCEPT}, {"except", EXCEPT},
{"exclusive", EXCLUSIVE}, {"exclusive", EXCLUSIVE},
{"execute", EXECUTE}, {"execute", EXECUTE},
...@@ -123,6 +126,7 @@ static ScanKeyword ScanKeywords[] = { ...@@ -123,6 +126,7 @@ static ScanKeyword ScanKeywords[] = {
{"handler", HANDLER}, {"handler", HANDLER},
{"having", HAVING}, {"having", HAVING},
{"hour", HOUR_P}, {"hour", HOUR_P},
{"ilike", ILIKE},
{"immediate", IMMEDIATE}, {"immediate", IMMEDIATE},
{"in", IN}, {"in", IN},
{"increment", INCREMENT}, {"increment", INCREMENT},
...@@ -130,6 +134,7 @@ static ScanKeyword ScanKeywords[] = { ...@@ -130,6 +134,7 @@ static ScanKeyword ScanKeywords[] = {
{"inherits", INHERITS}, {"inherits", INHERITS},
{"initially", INITIALLY}, {"initially", INITIALLY},
{"inner", INNER_P}, {"inner", INNER_P},
{"inout", INOUT},
{"insensitive", INSENSITIVE}, {"insensitive", INSENSITIVE},
{"insert", INSERT}, {"insert", INSERT},
{"instead", INSTEAD}, {"instead", INSTEAD},
...@@ -178,6 +183,7 @@ static ScanKeyword ScanKeywords[] = { ...@@ -178,6 +183,7 @@ static ScanKeyword ScanKeywords[] = {
{"nullif", NULLIF}, {"nullif", NULLIF},
{"numeric", NUMERIC}, {"numeric", NUMERIC},
{"of", OF}, {"of", OF},
{"off", OFF},
{"offset", OFFSET}, {"offset", OFFSET},
{"oids", OIDS}, {"oids", OIDS},
{"old", OLD}, {"old", OLD},
...@@ -188,9 +194,11 @@ static ScanKeyword ScanKeywords[] = { ...@@ -188,9 +194,11 @@ static ScanKeyword ScanKeywords[] = {
{"overlaps", OVERLAPS}, {"overlaps", OVERLAPS},
{"or", OR}, {"or", OR},
{"order", ORDER}, {"order", ORDER},
{"out", OUT},
{"outer", OUTER_P}, {"outer", OUTER_P},
{"partial", PARTIAL}, {"partial", PARTIAL},
{"password", PASSWORD}, {"password", PASSWORD},
{"path", PATH_P},
{"pendant", PENDANT}, {"pendant", PENDANT},
{"position", POSITION}, {"position", POSITION},
{"precision", PRECISION}, {"precision", PRECISION},
...@@ -213,12 +221,14 @@ static ScanKeyword ScanKeywords[] = { ...@@ -213,12 +221,14 @@ static ScanKeyword ScanKeywords[] = {
{"rollback", ROLLBACK}, {"rollback", ROLLBACK},
{"row", ROW}, {"row", ROW},
{"rule", RULE}, {"rule", RULE},
{"schema", SCHEMA},
{"scroll", SCROLL}, {"scroll", SCROLL},
{"second", SECOND_P}, {"second", SECOND_P},
{"select", SELECT}, {"select", SELECT},
{"sequence", SEQUENCE}, {"sequence", SEQUENCE},
{"serial", SERIAL}, {"serial", SERIAL},
{"serializable", SERIALIZABLE}, {"serializable", SERIALIZABLE},
{"session", SESSION},
{"session_user", SESSION_USER}, {"session_user", SESSION_USER},
{"set", SET}, {"set", SET},
{"setof", SETOF}, {"setof", SETOF},
...@@ -240,6 +250,7 @@ static ScanKeyword ScanKeywords[] = { ...@@ -240,6 +250,7 @@ static ScanKeyword ScanKeywords[] = {
{"timezone_hour", TIMEZONE_HOUR}, {"timezone_hour", TIMEZONE_HOUR},
{"timezone_minute", TIMEZONE_MINUTE}, {"timezone_minute", TIMEZONE_MINUTE},
{"to", TO}, {"to", TO},
{"toast", TOAST},
{"trailing", TRAILING}, {"trailing", TRAILING},
{"transaction", TRANSACTION}, {"transaction", TRANSACTION},
{"trigger", TRIGGER}, {"trigger", TRIGGER},
...@@ -267,6 +278,7 @@ static ScanKeyword ScanKeywords[] = { ...@@ -267,6 +278,7 @@ static ScanKeyword ScanKeywords[] = {
{"when", WHEN}, {"when", WHEN},
{"where", WHERE}, {"where", WHERE},
{"with", WITH}, {"with", WITH},
{"without", WITHOUT},
{"work", WORK}, {"work", WORK},
{"year", YEAR_P}, {"year", YEAR_P},
{"zone", ZONE}, {"zone", ZONE},
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* *
* *
* IDENTIFICATION * 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 */ ...@@ -50,6 +50,8 @@ static char *literalbuf = NULL; /* expandable buffer */
static int literallen; /* actual current length */ static int literallen; /* actual current length */
static int literalalloc; /* current allocated buffer size */ static int literalalloc; /* current allocated buffer size */
static int xcdepth = 0;
#define startlit() (literalbuf[0] = '\0', literallen = 0) #define startlit() (literalbuf[0] = '\0', literallen = 0)
static void addlit(char *ytext, int yleng); static void addlit(char *ytext, int yleng);
...@@ -140,6 +142,7 @@ xqcat {quote}{whitespace_with_newline}{quote} ...@@ -140,6 +142,7 @@ xqcat {quote}{whitespace_with_newline}{quote}
dquote \" dquote \"
xdstart {dquote} xdstart {dquote}
xdstop {dquote} xdstop {dquote}
xddouble {dquote}{dquote}
xdinside [^"]+ xdinside [^"]+
/* special stuff for C strings */ /* special stuff for C strings */
...@@ -169,7 +172,7 @@ xdcinside ({xdcqq}|{xdcqdq}|{xdcother}) ...@@ -169,7 +172,7 @@ xdcinside ({xdcqq}|{xdcqdq}|{xdcother})
*/ */
xcstart \/\*{op_chars}* xcstart \/\*{op_chars}*
xcstop \*+\/ xcstop \*+\/
xcinside ([^*]+)|(\*+[^/]) xcinside [^*/]+
digit [0-9] digit [0-9]
letter [\200-\377_A-Za-z] letter [\200-\377_A-Za-z]
...@@ -190,7 +193,7 @@ typecast "::" ...@@ -190,7 +193,7 @@ typecast "::"
* rule for "operator"! * rule for "operator"!
*/ */
self [,()\[\].;$\:\+\-\*\/\%\^\<\>\=\|] self [,()\[\].;$\:\+\-\*\/\%\^\<\>\=\|]
op_chars [\~\!\@\#\^\&\|\`\?\$\:\+\-\*\/\%\<\>\=] op_chars [\~\!\@\#\^\&\|\`\?\$\+\-\*\/\%\<\>\=]
operator {op_chars}+ operator {op_chars}+
/* we no longer allow unary minus in numbers. /* we no longer allow unary minus in numbers.
...@@ -281,15 +284,30 @@ cppline {space}*#(.*\\{line_end})*.* ...@@ -281,15 +284,30 @@ cppline {space}*#(.*\\{line_end})*.*
{xcstart} { {xcstart} {
state_before = YYSTATE; state_before = YYSTATE;
xcdepth = 0;
BEGIN(xc); BEGIN(xc);
/* Put back any characters past slash-star; see above */ /* Put back any characters past slash-star; see above */
yyless(2); yyless(2);
fputs("/*", yyout); 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>{xcinside} { ECHO; }
<xc>{op_chars} { ECHO; }
<xc><<EOF>> { mmerror(ET_ERROR, "Unterminated /* comment"); } <xc><<EOF>> { mmerror(ET_ERROR, "Unterminated /* comment"); }
...@@ -361,11 +379,36 @@ cppline {space}*#(.*\\{line_end})*.* ...@@ -361,11 +379,36 @@ cppline {space}*#(.*\\{line_end})*.*
BEGIN(xd); BEGIN(xd);
startlit(); startlit();
} }
<xd,xdc>{xdstop} { <xd>{xdstop} {
BEGIN(state_before); 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); yylval.str = mm_strdup(literalbuf);
return CSTRING; return CSTRING;
} }
<xd>{xddouble} {
addlit(yytext, yyleng-1);
}
<xd>{xdinside} { <xd>{xdinside} {
addlit(yytext, yyleng); addlit(yytext, yyleng);
} }
...@@ -426,7 +469,7 @@ cppline {space}*#(.*\\{line_end})*.* ...@@ -426,7 +469,7 @@ cppline {space}*#(.*\\{line_end})*.*
for (ic = nchars-2; ic >= 0; ic--) for (ic = nchars-2; ic >= 0; ic--)
{ {
if (strchr("~!@#&`?$:%^|", yytext[ic])) if (strchr("~!@#^&|`?$%", yytext[ic]))
break; break;
} }
if (ic >= 0) if (ic >= 0)
...@@ -498,8 +541,19 @@ cppline {space}*#(.*\\{line_end})*.* ...@@ -498,8 +541,19 @@ cppline {space}*#(.*\\{line_end})*.*
if (i >= NAMEDATALEN) if (i >= NAMEDATALEN)
{ {
sprintf(errortext, "Identifier \"%s\" will be truncated to \"%.*s\"", yytext, NAMEDATALEN-1, yytext); #ifdef MULTIBYTE
mmerror (ET_WARN, errortext); 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'; yytext[NAMEDATALEN-1] = '\0';
} }
......
This diff is collapsed.
...@@ -146,7 +146,13 @@ get_type(enum ECPGttype typ) ...@@ -146,7 +146,13 @@ get_type(enum ECPGttype typ)
return ("ECPGt_long"); return ("ECPGt_long");
break; break;
case ECPGt_unsigned_long: 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; break;
case ECPGt_float: case ECPGt_float:
return ("ECPGt_float"); return ("ECPGt_float");
......
...@@ -260,9 +260,11 @@ check_indicator(struct ECPGtype * var) ...@@ -260,9 +260,11 @@ check_indicator(struct ECPGtype * var)
case ECPGt_short: case ECPGt_short:
case ECPGt_int: case ECPGt_int:
case ECPGt_long: case ECPGt_long:
case ECPGt_long_long:
case ECPGt_unsigned_short: case ECPGt_unsigned_short:
case ECPGt_unsigned_int: case ECPGt_unsigned_int:
case ECPGt_unsigned_long: case ECPGt_unsigned_long:
case ECPGt_unsigned_long_long:
break; break;
case ECPGt_struct: case ECPGt_struct:
......
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