1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-19 13:42:17 +03:00

Remove useless whitespace at end of lines

This commit is contained in:
Peter Eisentraut
2010-11-23 22:27:50 +02:00
parent 44475e782f
commit fc946c39ae
517 changed files with 3463 additions and 3508 deletions

View File

@@ -3,7 +3,7 @@ src/interfaces/ecpg/README.dynSQL
descriptor statements have the following shortcomings
- input descriptors (USING DESCRIPTOR <name>) are not supported
Reason: to fully support dynamic SQL the frontend/backend communication
should change to recognize input parameters.
Since this is not likely to happen in the near future and you

View File

@@ -164,7 +164,7 @@ ECPGprepare(int lineno, const char *connection_name, const bool questionmarks, c
struct prepared_statement *this,
*prev;
(void) questionmarks; /* quiet the compiler */
(void) questionmarks; /* quiet the compiler */
con = ecpg_get_connection(connection_name);
if (!ecpg_init(con, connection_name, lineno))

View File

@@ -58,7 +58,7 @@ else
endif
preproc.y: ../../../backend/parser/gram.y parse.pl ecpg.addons ecpg.header ecpg.tokens ecpg.trailer ecpg.type
$(PERL) $(srcdir)/parse.pl $(srcdir) < $< > $@
$(PERL) $(srcdir)/parse.pl $(srcdir) < $< > $@
$(PERL) $(srcdir)/check_rules.pl $(srcdir) $<
ecpg_keywords.o c_keywords.o keywords.o preproc.o parser.o: preproc.h

View File

@@ -102,7 +102,7 @@ while (<GRAM>) {
$block = $block . $arr[$fieldIndexer];
}
}
}
}
close GRAM;
@@ -113,7 +113,7 @@ line: while (<ECPG>) {
@Fld = split(' ', $_, -1);
if (!/^ECPG:/) {
next line;
next line;
}
if ($found{$Fld[2]} ne 'found') {

View File

@@ -40,7 +40,7 @@ ECPG: stmtPrepareStmt block
{
if ($1.type == NULL || strlen($1.type) == 0)
output_prepare_statement($1.name, $1.stmt);
else
else
output_statement(cat_str(5, make_str("prepare"), $1.name, $1.type, make_str("as"), $1.stmt), 0, ECPGst_normal);
}
ECPG: stmtTransactionStmt block
@@ -109,7 +109,7 @@ ECPG: stmtViewStmt rule
if (!strcmp($1, "all"))
fprintf(yyout, "{ ECPGdeallocate_all(__LINE__, %d, %s);", compat, con);
else if ($1[0] == ':')
else if ($1[0] == ':')
fprintf(yyout, "{ ECPGdeallocate(__LINE__, %d, %s, %s);", compat, con, $1+1);
else
fprintf(yyout, "{ ECPGdeallocate(__LINE__, %d, %s, \"%s\");", compat, con, $1);

View File

@@ -103,7 +103,7 @@ mmerror(int error_code, enum errortype type, const char *error, ...)
fclose(yyin);
if (yyout)
fclose(yyout);
if (strcmp(output_filename, "-") != 0 && unlink(output_filename) != 0)
fprintf(stderr, _("could not remove output file \"%s\"\n"), output_filename);
exit(error_code);

View File

@@ -3,7 +3,7 @@
/* special embedded SQL tokens */
%token SQL_ALLOCATE SQL_AUTOCOMMIT SQL_BOOL SQL_BREAK
SQL_CALL SQL_CARDINALITY SQL_CONNECT
SQL_COUNT
SQL_COUNT
SQL_DATETIME_INTERVAL_CODE
SQL_DATETIME_INTERVAL_PRECISION SQL_DESCRIBE
SQL_DESCRIPTOR SQL_DISCONNECT SQL_FOUND
@@ -23,5 +23,5 @@
S_STATIC S_SUB S_VOLATILE
S_TYPEDEF
%token CSTRING CVARIABLE CPP_LINE IP
%token CSTRING CVARIABLE CPP_LINE IP
%token DOLCONST ECONST NCONST UCONST UIDENT

View File

@@ -70,7 +70,7 @@ connection_target: opt_database_name opt_server opt_port
/* old style: dbname[@server][:port] */
if (strlen($2) > 0 && *($2) != '@')
mmerror(PARSE_ERROR, ET_ERROR, "expected \"@\", found \"%s\"", $2);
/* C strings need to be handled differently */
if ($1[0] == '\"')
$$ = $1;
@@ -241,7 +241,7 @@ opt_options: Op connect_options
| /*EMPTY*/ { $$ = EMPTY; }
;
connect_options: ColId opt_opt_value
connect_options: ColId opt_opt_value
{ $$ = make2_str($1, $2); }
| ColId opt_opt_value Op connect_options
{
@@ -347,7 +347,7 @@ ECPGCursorStmt: DECLARE cursor_name cursor_options CURSOR opt_hold FOR prepared
;
ECPGExecuteImmediateStmt: EXECUTE IMMEDIATE execstring
{
{
/* execute immediate means prepare the statement and
* immediately execute it */
$$ = $3;
@@ -631,7 +631,7 @@ var_type: simple_type
$$.type_index = this->type->type_index;
if (this->type->type_sizeof && strlen(this->type->type_sizeof) != 0)
$$.type_sizeof = this->type->type_sizeof;
else
else
$$.type_sizeof = cat_str(3, make_str("sizeof("), mm_strdup(this->name), make_str(")"));
struct_member_list[struct_level] = ECPGstruct_member_dup(this->struct_member_list);
@@ -862,7 +862,7 @@ variable: opt_pointer ECPGColLabel opt_array_bounds opt_bit_field opt_initialize
type = ECPGmake_simple_type(actual_type[struct_level].type_enum, length, varchar_counter);
else
type = ECPGmake_array_type(ECPGmake_simple_type(actual_type[struct_level].type_enum, length, varchar_counter), dimension);
if (strcmp(dimension, "0") == 0 || abs(atoi(dimension)) == 1)
*dim = '\0';
else
@@ -1037,7 +1037,7 @@ UsingValue: UsingConst
}
| civar { $$ = EMPTY; }
| civarind { $$ = EMPTY; }
;
;
UsingConst: Iconst { $$ = $1; }
| '+' Iconst { $$ = cat_str(2, make_str("+"), $2); }
@@ -1857,7 +1857,7 @@ execute_rest: /* EMPTY */ { $$ = EMPTY; }
| ecpg_into ecpg_using { $$ = EMPTY; }
| ecpg_using { $$ = EMPTY; }
| ecpg_into { $$ = EMPTY; }
;
;
ecpg_into: INTO into_list { $$ = EMPTY; }
| into_descriptor { $$ = $1; }

View File

@@ -113,7 +113,7 @@
%type <str> variable
%type <str> variable_declarations
%type <str> variable_list
%type <str> vt_declarations
%type <str> vt_declarations
%type <str> Op
%type <str> IntConstVar

View File

@@ -93,7 +93,7 @@ line: while (<>) {
chomp; # strip record separator
@Fld = split(' ', $_, -1);
# Dump the action for a rule -
# Dump the action for a rule -
# mode indicates if we are processing the 'stmt:' rule (mode==0 means normal, mode==1 means stmt:)
# flds are the fields to use. These may start with a '$' - in which case they are the result of a previous non-terminal
# if they dont start with a '$' then they are token name
@@ -235,8 +235,8 @@ line: while (<>) {
if ($replace_token{$arr[$fieldIndexer]}) {
$arr[$fieldIndexer] = $replace_token{$arr[$fieldIndexer]};
}
# Are we looking at a declaration of a non-terminal ?
# Are we looking at a declaration of a non-terminal ?
if (($arr[$fieldIndexer] =~ '[A-Za-z0-9]+:') || $arr[$fieldIndexer + 1] eq ':') {
$non_term_id = $arr[$fieldIndexer];
$s = ':', $non_term_id =~ s/$s//g;
@@ -253,7 +253,7 @@ line: while (<>) {
$copymode = 'on';
}
$line = $line . ' ' . $arr[$fieldIndexer];
# Do we have the : attached already ?
# Do we have the : attached already ?
# If yes, we'll have already printed the ':'
if (!($arr[$fieldIndexer] =~ '[A-Za-z0-9]+:')) {
# Consume the ':' which is next...
@@ -261,7 +261,7 @@ line: while (<>) {
$fieldIndexer++;
}
# Special mode?
# Special mode?
if ($non_term_id eq 'stmt') {
$stmt_mode = 1;
}
@@ -380,7 +380,7 @@ sub dump {
sub dump_fields {
local($mode, *flds, $len, $ln) = @_;
if ($mode == 0) {
#Normal
#Normal
&add_to_buffer('rules', $ln);
if ($feature_not_supported == 1) {
# we found an unsupported feature, but we have to
@@ -393,7 +393,7 @@ sub dump_fields {
}
if ($len == 0) {
# We have no fields ?
# We have no fields ?
&add_to_buffer('rules', " \$\$=EMPTY; }");
}
else {
@@ -418,7 +418,7 @@ sub dump_fields {
}
}
# So - how many fields did we end up with ?
# So - how many fields did we end up with ?
if ($cnt == 1) {
# Straight assignement
$str = " \$\$ = " . $flds_new{0} . ';';

View File

@@ -58,8 +58,8 @@ static bool isinformixdefine(void);
char *token_start;
int state_before;
struct _yy_buffer
{
struct _yy_buffer
{
YY_BUFFER_STATE buffer;
long lineno;
char *filename;
@@ -71,7 +71,7 @@ static char *old;
#define MAX_NESTED_IF 128
static short preproc_tos;
static short ifcond;
static struct _if_value
static struct _if_value
{
short condition;
short else_branch;
@@ -87,7 +87,7 @@ static struct _if_value
%option yylineno
%x C SQL incl def def_ident undef
%x C SQL incl def def_ident undef
/*
* OK, here is a short description of lex/flex rules behavior.
@@ -518,7 +518,7 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})(.*\\{space})*.
/* throw back all but the initial "$" */
yyless(1);
/* and treat it as {other} */
return yytext[0];
return yytext[0];
}
<SQL>{dolqdelim} {
token_start = yytext;
@@ -737,7 +737,7 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})(.*\\{space})*.
}
<SQL>{identifier} {
const ScanKeyword *keyword;
if (!isdefine())
{
/* Is it an SQL/ECPG keyword? */
@@ -764,7 +764,7 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})(.*\\{space})*.
}
<SQL>{other} { return yytext[0]; }
<C>{exec_sql} { BEGIN(SQL); return SQL_START; }
<C>{informix_special} {
<C>{informix_special} {
/* are we simulating Informix? */
if (INFORMIX_MODE)
{
@@ -939,7 +939,7 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})(.*\\{space})*.
yyterminate();
}
<C>{exec_sql}{include}{space}* { BEGIN(incl); }
<C>{informix_special}{include}{space}* {
<C>{informix_special}{include}{space}* {
/* are we simulating Informix? */
if (INFORMIX_MODE)
{
@@ -952,7 +952,7 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})(.*\\{space})*.
}
}
<C,xskip>{exec_sql}{ifdef}{space}* { ifcond = TRUE; BEGIN(xcond); }
<C,xskip>{informix_special}{ifdef}{space}* {
<C,xskip>{informix_special}{ifdef}{space}* {
/* are we simulating Informix? */
if (INFORMIX_MODE)
{
@@ -966,7 +966,7 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})(.*\\{space})*.
}
}
<C,xskip>{exec_sql}{ifndef}{space}* { ifcond = FALSE; BEGIN(xcond); }
<C,xskip>{informix_special}{ifndef}{space}* {
<C,xskip>{informix_special}{ifndef}{space}* {
/* are we simulating Informix? */
if (INFORMIX_MODE)
{
@@ -990,7 +990,7 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})(.*\\{space})*.
ifcond = TRUE; BEGIN(xcond);
}
<C,xskip>{informix_special}{elif}{space}* {
<C,xskip>{informix_special}{elif}{space}* {
/* are we simulating Informix? */
if (INFORMIX_MODE)
{
@@ -1089,7 +1089,7 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})(.*\\{space})*.
<xcond>{identifier}{space}*";" {
if (preproc_tos >= MAX_NESTED_IF-1)
mmerror(PARSE_ERROR, ET_FATAL, "too many nested EXEC SQL IFDEF conditions");
else
else
{
struct _defines *defptr;
unsigned int i;
@@ -1132,7 +1132,7 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})(.*\\{space})*.
<def_ident>{other}|\n {
mmerror(PARSE_ERROR, ET_FATAL, "missing identifier in EXEC SQL DEFINE command");
yyterminate();
}
}
<def>{space}*";" {
struct _defines *ptr, *this;
@@ -1170,7 +1170,7 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})(.*\\{space})*.
<<EOF>> {
if (yy_buffer == NULL)
{
if ( preproc_tos > 0 )
if ( preproc_tos > 0 )
{
preproc_tos = 0;
mmerror(PARSE_ERROR, ET_FATAL, "missing \"EXEC SQL ENDIF;\"");
@@ -1189,7 +1189,7 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})(.*\\{space})*.
ptr->used = NULL;
break;
}
if (yyin != NULL)
fclose(yyin);
@@ -1209,7 +1209,7 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})(.*\\{space})*.
if (i != 0)
output_line_number();
}
}
<INITIAL>{other}|\n { mmerror(PARSE_ERROR, ET_FATAL, "internal error: unreachable state; please report this to <pgsql-bugs@postgresql.org>"); }
@@ -1244,7 +1244,7 @@ addlit(char *ytext, int yleng)
/* enlarge buffer if needed */
if ((literallen+yleng) >= literalalloc)
{
do
do
literalalloc *= 2;
while ((literallen+yleng) >= literalalloc);
literalbuf = (char *) realloc(literalbuf, literalalloc);
@@ -1290,7 +1290,7 @@ parse_include(void)
/*
* skip the ";" if there is one and trailing whitespace. Note that
* yytext contains at least one non-space character plus the ";"
* yytext contains at least one non-space character plus the ";"
*/
for (i = strlen(yytext)-2;
i > 0 && ecpg_isspace(yytext[i]);
@@ -1301,7 +1301,7 @@ parse_include(void)
i--;
yytext[i+1] = '\0';
yyin = NULL;
/* If file name is enclosed in '"' remove these and look only in '.' */
@@ -1311,7 +1311,7 @@ parse_include(void)
{
yytext[i] = '\0';
memmove(yytext, yytext+1, strlen(yytext));
strncpy(inc_file, yytext, sizeof(inc_file));
yyin = fopen(inc_file, "r");
if (!yyin)
@@ -1322,7 +1322,7 @@ parse_include(void)
yyin = fopen(inc_file, "r");
}
}
}
else
{
@@ -1331,7 +1331,7 @@ parse_include(void)
yytext[i] = '\0';
memmove(yytext, yytext+1, strlen(yytext));
}
for (ip = include_paths; yyin == NULL && ip != NULL; ip = ip->next)
{
if (strlen(ip->path) + strlen(yytext) + 3 > MAXPGPATH)

View File

@@ -1,6 +1,6 @@
override CPPFLAGS := -I../../include -I$(top_srcdir)/src/interfaces/ecpg/include \
-I$(libpq_srcdir) $(CPPFLAGS)
override CFLAGS += $(PTHREAD_CFLAGS)
-I$(libpq_srcdir) $(CPPFLAGS)
override CFLAGS += $(PTHREAD_CFLAGS)
override LDFLAGS := -L../../ecpglib -L../../pgtypeslib $(filter-out -l%, $(libpq)) $(LDFLAGS)
override LIBS := -lecpg -lpgtypes $(filter -l%, $(libpq)) $(LIBS) $(PTHREAD_LIBS)

View File

@@ -192,7 +192,7 @@ exec sql end declare section;
strcpy(msg, "commit");
exec sql commit;
strcpy(msg, "disconnect");
strcpy(msg, "disconnect");
exec sql disconnect;
return (0);

View File

@@ -106,7 +106,7 @@ exec sql end declare section;
while (1)
{
strcpy(msg, "fetch");
exec sql fetch 1 from mycur1 into descriptor outp_sqlda;
exec sql fetch 1 from mycur1 into descriptor outp_sqlda;
printf("FETCH RECORD %d\n", ++rec);
dump_sqlda(outp_sqlda);

View File

@@ -11,7 +11,7 @@ static void dosqlprint(void) {
int main(void)
{
$int i = 14;
$int i = 14;
$decimal j, m, n;
$string c[10];

View File

@@ -67,8 +67,8 @@ int main(void)
EXEC SQL create table history (customerid integer, timestamp timestamp without time zone, action_taken char(5), narrative varchar(100));
sql_check("main", "create", 0);
EXEC SQL insert into history
EXEC SQL insert into history
(customerid, timestamp, action_taken, narrative)
values(1, '2003-05-07 13:28:34 CEST', 'test', 'test');
sql_check("main", "insert", 0);
@@ -96,7 +96,7 @@ int main(void)
(customerid, timestamp, action_taken, narrative)
values(:c, :e, 'test', 'test');
sql_check("main", "update", 0);
EXEC SQL commit;
EXEC SQL drop table history;

View File

@@ -455,7 +455,7 @@ if (sqlca.sqlcode < 0) exit (1);}
#line 193 "describe.pgc"
strcpy(msg, "disconnect");
strcpy(msg, "disconnect");
{ ECPGdisconnect(__LINE__, "CURRENT");
#line 196 "describe.pgc"

View File

@@ -268,7 +268,7 @@ if (sqlca.sqlcode == ECPG_NOT_FOUND) break;
if (sqlca.sqlcode < 0) exit (1);}
#line 109 "sqlda.pgc"
printf("FETCH RECORD %d\n", ++rec);
dump_sqlda(outp_sqlda);

View File

@@ -36,7 +36,7 @@ int main(void)
int i = 14 ;
#line 14 "test_informix.pgc"
#line 15 "test_informix.pgc"
decimal j , m , n ;

View File

@@ -193,7 +193,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
#line 68 "test_informix2.pgc"
sql_check("main", "create", 0);
{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "insert into history ( customerid , timestamp , action_taken , narrative ) values ( 1 , '2003-05-07 13:28:34 CEST' , 'test' , 'test' )", ECPGt_EOIT, ECPGt_EORT);
#line 73 "test_informix2.pgc"
@@ -244,7 +244,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
#line 97 "test_informix2.pgc"
sql_check("main", "update", 0);
{ ECPGtrans(__LINE__, NULL, "commit");
#line 100 "test_informix2.pgc"

View File

@@ -55,17 +55,17 @@ main(void)
char *t1 = "2000-7-12 17:34:29";
int i;
ECPGdebug(1, stderr);
/* exec sql whenever sqlerror do sqlprint ( ) ; */
ECPGdebug(1, stderr);
/* exec sql whenever sqlerror do sqlprint ( ) ; */
#line 27 "dt_test.pgc"
{ ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0);
{ ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0);
#line 28 "dt_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
#line 28 "dt_test.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table date_test ( d date , ts timestamp )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table date_test ( d date , ts timestamp )", ECPGt_EOIT, ECPGt_EORT);
#line 29 "dt_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
@@ -84,8 +84,8 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
#line 31 "dt_test.pgc"
date1 = PGTYPESdate_from_asc(d1, NULL);
ts1 = PGTYPEStimestamp_from_asc(t1, NULL);
date1 = PGTYPESdate_from_asc(d1, NULL);
ts1 = PGTYPEStimestamp_from_asc(t1, NULL);
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into date_test ( d , ts ) values ( $1 , $2 )",
ECPGt_date,&(date1),(long)1,(long)1,sizeof(date),

View File

@@ -120,7 +120,7 @@ int main()
ECPGdebug(1, stderr);
{ ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0);
#line 50 "array_of_struct.pgc"

View File

@@ -754,7 +754,7 @@ if (sqlca.sqlcode < 0) exit (1);}
#line 239 "cursor.pgc"
strcpy(msg, "disconnect");
strcpy(msg, "disconnect");
{ ECPGdisconnect(__LINE__, "CURRENT");
#line 242 "cursor.pgc"

View File

@@ -146,7 +146,7 @@ int main(void)
/* = 1L */
#line 60 "init.pgc"
@@ -250,7 +250,7 @@ if (sqlca.sqlcode < 0) fe ( ENUM0 );}
/* exec sql whenever sqlerror do sqlnotice ( NULL , 0 ) ; */
#line 97 "init.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select now ( )", ECPGt_EOIT, ECPGt_EORT);
#line 98 "init.pgc"

View File

@@ -363,7 +363,7 @@ if (sqlca.sqlcode < 0) exit (1);}
#line 118 "outofscope.pgc"
strcpy(msg, "disconnect");
strcpy(msg, "disconnect");
{ ECPGdisconnect(__LINE__, "CURRENT");
#line 121 "outofscope.pgc"

View File

@@ -264,7 +264,7 @@ if (sqlca.sqlcode < 0) exit (1);}
#line 95 "variable.pgc"
strcpy(msg, "disconnect");
strcpy(msg, "disconnect");
{ ECPGdisconnect(__LINE__, "CURRENT");
#line 98 "variable.pgc"

View File

@@ -243,4 +243,4 @@ if (sqlca.sqlcode < 0) exit (1);}
#line 65 "whenever.pgc"
exit (0);
}
}

View File

@@ -148,7 +148,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
#line 29 "array.pgc"
{ ECPGtrans(__LINE__, NULL, "begin work");
{ ECPGtrans(__LINE__, NULL, "begin work");
#line 31 "array.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
@@ -205,7 +205,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
if (sqlca.sqlcode < 0) sqlprint();}
#line 43 "array.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select f , text from test where i = 1", ECPGt_EOIT,
ECPGt_double,&(f),(long)1,(long)1,sizeof(double),

View File

@@ -104,7 +104,7 @@ int main()
ECPGdebug(1,stderr);
{ ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0); }
#line 15 "code100.pgc"
@@ -118,7 +118,7 @@ int main()
#line 22 "code100.pgc"
if (sqlca.sqlcode) printf("%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
for (index=0;index<10;++index)
{ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into test ( payload , index ) values ( 0 , $1 )",
ECPGt_int,&(index),(long)1,(long)1,sizeof(int),
@@ -131,12 +131,12 @@ int main()
#line 31 "code100.pgc"
if (sqlca.sqlcode) printf("%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "update test set payload = payload + 1 where index = - 1", ECPGt_EOIT, ECPGt_EORT);}
#line 35 "code100.pgc"
if (sqlca.sqlcode!=100) printf("%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "delete from test where index = - 1", ECPGt_EOIT, ECPGt_EORT);}
#line 38 "code100.pgc"
@@ -155,7 +155,7 @@ int main()
#line 46 "code100.pgc"
if (sqlca.sqlcode) printf("%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
{ ECPGdisconnect(__LINE__, "CURRENT");}
#line 49 "code100.pgc"

View File

@@ -453,7 +453,7 @@ if (sqlca.sqlcode < 0) exit (1);}
#line 193 "describe.pgc"
strcpy(msg, "disconnect");
strcpy(msg, "disconnect");
{ ECPGdisconnect(__LINE__, "CURRENT");
#line 196 "describe.pgc"

View File

@@ -296,28 +296,28 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
for (i=0;i<sqlca.sqlerrd[2];++i)
{
if (i1[i]) printf("NULL, ");
else printf("%d, ",d1[i]);
else printf("%d, ",d1[i]);
if (i2[i]) printf("NULL, ");
else printf("%f, ",d2[i]);
else printf("%f, ",d2[i]);
if (i3[i]) printf("NULL, ");
else printf("'%s', ",d3[i]);
else printf("'%s', ",d3[i]);
if (i4[i]) printf("NULL, ");
else printf("'%s', ",d4[i]);
else printf("'%s', ",d4[i]);
if (i5[i]) printf("NULL, ");
else printf("'%s', ",d5[i]);
else printf("'%s', ",d5[i]);
if (i6[i]) printf("NULL, ");
else printf("'%s', ",d6[i]);
else printf("'%s', ",d6[i]);
if (i7[i]) printf("NULL, ");
else printf("'%s', ",d7[i]);
else printf("'%s', ",d7[i]);
if (i9[i]) printf("NULL, ");
else printf("'%s', ",d9[i]);
else printf("'%s', ",d9[i]);
printf("\n");
}

View File

@@ -225,10 +225,10 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
for (i=0;i < sqlca.sqlerrd[2];++i)
{
if (ipointer1[i]) printf("NULL, ");
else printf("%d, ",ip1[i]);
else printf("%d, ",ip1[i]);
if (ipointer2[i]) printf("NULL, ");
else printf("'%s', ",cp2[i]);
else printf("'%s', ",cp2[i]);
printf("\n");
}
ECPGfree_auto_mem();

View File

@@ -25,7 +25,7 @@
int main() {
/* exec sql begin declare section */
#line 9 "fetch.pgc"
char str [ 25 ] ;

View File

@@ -278,7 +278,7 @@ if (sqlca.sqlcode == ECPG_NOT_FOUND) break;
if (sqlca.sqlcode < 0) exit (1);}
#line 111 "sqlda.pgc"
printf("FETCH RECORD %d\n", ++rec);
dump_sqlda(outp_sqlda);

View File

@@ -23,15 +23,15 @@ main(void)
char *t1 = "2000-7-12 17:34:29";
int i;
ECPGdebug(1, stderr);
exec sql whenever sqlerror do sqlprint();
exec sql connect to REGRESSDB1;
exec sql create table date_test (d date, ts timestamp);
ECPGdebug(1, stderr);
exec sql whenever sqlerror do sqlprint();
exec sql connect to REGRESSDB1;
exec sql create table date_test (d date, ts timestamp);
exec sql set datestyle to iso;
exec sql set intervalstyle to postgres_verbose;
date1 = PGTYPESdate_from_asc(d1, NULL);
ts1 = PGTYPEStimestamp_from_asc(t1, NULL);
date1 = PGTYPESdate_from_asc(d1, NULL);
ts1 = PGTYPEStimestamp_from_asc(t1, NULL);
exec sql insert into date_test(d, ts) values (:date1, :ts1);

View File

@@ -46,7 +46,7 @@ int main()
EXEC SQL end declare section;
ECPGdebug(1, stderr);
EXEC SQL connect to REGRESSDB1;
EXEC SQL create table customers (c varchar(50), p int);

View File

@@ -238,7 +238,7 @@ exec sql end declare section;
strcpy(msg, "commit");
exec sql commit;
strcpy(msg, "disconnect");
strcpy(msg, "disconnect");
exec sql disconnect;
return (0);

View File

@@ -67,7 +67,7 @@ int main(void)
int e=y->member;
int c=10>>2;
bool h=2||1;
bool h=2||1;
long iay /* = 1L */ ;
exec sql end declare section;
@@ -94,7 +94,7 @@ int main(void)
exec sql select now();
exec sql whenever sqlerror do fe(ENUM0);
exec sql select now();
exec sql whenever sqlerror do sqlnotice(NULL, NONO);
exec sql whenever sqlerror do sqlnotice(NULL, NONO);
exec sql select now();
return 0;
}

View File

@@ -117,7 +117,7 @@ main (void)
strcpy(msg, "commit");
exec sql commit;
strcpy(msg, "disconnect");
strcpy(msg, "disconnect");
exec sql disconnect;
return (0);

View File

@@ -94,7 +94,7 @@ exec sql end declare section;
strcpy(msg, "commit");
exec sql commit;
strcpy(msg, "disconnect");
strcpy(msg, "disconnect");
exec sql disconnect;
return (0);

View File

@@ -64,4 +64,4 @@ int main(void)
exec sql select 1 into :i;
exec sql rollback;
exit (0);
}
}

View File

@@ -22,7 +22,7 @@ TESTS = array array.c \
parser parser.c \
quote quote.c \
show show.c \
insupd insupd.c
insupd insupd.c
all: $(TESTS)

View File

@@ -28,7 +28,7 @@ EXEC SQL END DECLARE SECTION;
EXEC SQL SET AUTOCOMMIT = ON;
EXEC SQL BEGIN WORK;
EXEC SQL BEGIN WORK;
EXEC SQL CREATE TABLE test (f float, i int, a int[10], text char(10));
@@ -40,7 +40,7 @@ EXEC SQL END DECLARE SECTION;
EXEC SQL COMMIT;
EXEC SQL BEGIN WORK;
EXEC SQL BEGIN WORK;
EXEC SQL SELECT f,text
INTO :f,:text

View File

@@ -11,7 +11,7 @@ int main()
ECPGdebug(1,stderr);
exec sql connect to REGRESSDB1;
if (sqlca.sqlcode) printf("%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
@@ -21,7 +21,7 @@ int main()
if (sqlca.sqlcode) printf("%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
exec sql commit work;
if (sqlca.sqlcode) printf("%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
for (index=0;index<10;++index)
{ exec sql insert into test
(payload, index)
@@ -30,11 +30,11 @@ int main()
}
exec sql commit work;
if (sqlca.sqlcode) printf("%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
exec sql update test
set payload=payload+1 where index=-1;
set payload=payload+1 where index=-1;
if (sqlca.sqlcode!=100) printf("%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
exec sql delete from test where index=-1;
if (sqlca.sqlcode!=100) printf("%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
@@ -45,7 +45,7 @@ int main()
if (sqlca.sqlcode) printf("%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
exec sql commit work;
if (sqlca.sqlcode) printf("%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
exec sql disconnect;
if (sqlca.sqlcode) printf("%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
return 0;

View File

@@ -192,7 +192,7 @@ exec sql end declare section;
strcpy(msg, "commit");
exec sql commit;
strcpy(msg, "disconnect");
strcpy(msg, "disconnect");
exec sql disconnect;
return (0);

View File

@@ -55,28 +55,28 @@ int main(void)
for (i=0;i<sqlca.sqlerrd[2];++i)
{
if (i1[i]) printf("NULL, ");
else printf("%d, ",d1[i]);
else printf("%d, ",d1[i]);
if (i2[i]) printf("NULL, ");
else printf("%f, ",d2[i]);
else printf("%f, ",d2[i]);
if (i3[i]) printf("NULL, ");
else printf("'%s', ",d3[i]);
else printf("'%s', ",d3[i]);
if (i4[i]) printf("NULL, ");
else printf("'%s', ",d4[i]);
else printf("'%s', ",d4[i]);
if (i5[i]) printf("NULL, ");
else printf("'%s', ",d5[i]);
else printf("'%s', ",d5[i]);
if (i6[i]) printf("NULL, ");
else printf("'%s', ",d6[i]);
else printf("'%s', ",d6[i]);
if (i7[i]) printf("NULL, ");
else printf("'%s', ",d7[i]);
else printf("'%s', ",d7[i]);
if (i9[i]) printf("NULL, ");
else printf("'%s', ",d9[i]);
else printf("'%s', ",d9[i]);
printf("\n");
}

View File

@@ -39,10 +39,10 @@ int main(void)
for (i=0;i < sqlca.sqlerrd[2];++i)
{
if (ipointer1[i]) printf("NULL, ");
else printf("%d, ",ip1[i]);
else printf("%d, ",ip1[i]);
if (ipointer2[i]) printf("NULL, ");
else printf("'%s', ",cp2[i]);
else printf("'%s', ",cp2[i]);
printf("\n");
}
ECPGfree_auto_mem();

View File

@@ -7,7 +7,7 @@ EXEC SQL INCLUDE ../regression;
int main() {
EXEC SQL BEGIN DECLARE SECTION;
char str[25];
int i, count=1;
int i, count=1;
EXEC SQL END DECLARE SECTION;
ECPGdebug(1, stderr);

View File

@@ -108,7 +108,7 @@ exec sql end declare section;
while (1)
{
strcpy(msg, "fetch");
exec sql fetch 1 from mycur1 into descriptor outp_sqlda;
exec sql fetch 1 from mycur1 into descriptor outp_sqlda;
printf("FETCH RECORD %d\n", ++rec);
dump_sqlda(outp_sqlda);

View File

@@ -44,9 +44,9 @@ CFG=Release
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
!ELSE
NULL=nul
!ENDIF
!ENDIF
!IF "$(CFG)" == "Debug"
DEBUG=1
@@ -114,7 +114,7 @@ CLEAN :
LIB32=tlib.exe
LIB32_FLAGS=
LIB32_FLAGS=
LIB32_OBJS= \
"$(INTDIR)\win32.obj" \
"$(INTDIR)\getaddrinfo.obj" \
@@ -172,7 +172,7 @@ LINK32_FLAGS = -Gn -L$(BCB)\lib;$(INTDIR); -x -Tpd -v
# @<< is a Response file, http://www.opussoftware.com/tutorial/TutMakefile.htm
"$(OUTDIR)\blibpq.dll": "$(OUTDIR)\blibpq.lib" "$(INTDIR)\libpq.res" blibpqdll.def
"$(OUTDIR)\blibpq.dll": "$(OUTDIR)\blibpq.lib" "$(INTDIR)\libpq.res" blibpqdll.def
$(LINK32) @<<
$(LINK32_FLAGS) +
c0d32.obj , +

View File

@@ -2,10 +2,10 @@
# Connection configuration file
#
# A service is a set of named connection parameters. You may specify
# multiple services in this file. Each starts with a service name in
# multiple services in this file. Each starts with a service name in
# brackets. Subsequent lines have connection configuration parameters of
# the pattern "param=value" or LDAP URLs starting with "ldap://"
# to look up such parameters. A sample configuration for postgres is
# to look up such parameters. A sample configuration for postgres is
# included in this file. Lines beginning with '#' are comments.
#
# Copy this to your sysconf directory (typically /usr/local/pgsql/etc) and

View File

@@ -38,7 +38,7 @@ DEBUGDEF=/D NDEBUG
OUTFILENAME=libpq
!ENDIF
!IF "$(SSL_INC)" == ""
!IF "$(SSL_INC)" == ""
SSL_INC=C:\OpenSSL\include
!MESSAGE Using default OpenSSL Include directory: $(SSL_INC)
!ENDIF
@@ -48,7 +48,7 @@ SSL_LIB_PATH=C:\OpenSSL\lib\VC
!MESSAGE Using default OpenSSL Library directory: $(SSL_LIB_PATH)
!ENDIF
!IF "$(KFW_INC)" == ""
!IF "$(KFW_INC)" == ""
KFW_INC=C:\kfw-2.6.5\inc
!MESSAGE Using default Kerberos Include directory: $(KFW_INC)
!ENDIF
@@ -60,9 +60,9 @@ KFW_LIB_PATH=C:\kfw-2.6.5\lib\$(CPU)
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
!ELSE
NULL=nul
!ENDIF
!ENDIF
CPP=cl.exe
RSC=rc.exe
@@ -123,7 +123,7 @@ CLEAN :
LIB32=link.exe -lib
LIB32_FLAGS=$(LOPT) /nologo /out:"$(OUTDIR)\$(OUTFILENAME).lib"
LIB32_FLAGS=$(LOPT) /nologo /out:"$(OUTDIR)\$(OUTFILENAME).lib"
LIB32_OBJS= \
"$(INTDIR)\win32.obj" \
"$(INTDIR)\getaddrinfo.obj" \