aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/ecpg')
-rw-r--r--src/interfaces/ecpg/README.dynSQL8
-rw-r--r--src/interfaces/ecpg/preproc/check_rules.pl1
-rw-r--r--src/interfaces/ecpg/preproc/parse.pl6
-rw-r--r--src/interfaces/ecpg/preproc/pgc.l18
-rw-r--r--src/interfaces/ecpg/test/Makefile2
-rw-r--r--src/interfaces/ecpg/test/expected/preproc-autoprep.c4
-rw-r--r--src/interfaces/ecpg/test/expected/preproc-type.c2
-rw-r--r--src/interfaces/ecpg/test/expected/sql-fetch.c4
-rw-r--r--src/interfaces/ecpg/test/expected/sql-insupd.c2
-rw-r--r--src/interfaces/ecpg/test/expected/sql-parser.c4
-rw-r--r--src/interfaces/ecpg/test/expected/sql-quote.c2
-rw-r--r--src/interfaces/ecpg/test/preproc/autoprep.pgc4
-rw-r--r--src/interfaces/ecpg/test/preproc/type.pgc2
-rw-r--r--src/interfaces/ecpg/test/sql/dyntest.pgc4
-rw-r--r--src/interfaces/ecpg/test/sql/fetch.pgc4
-rw-r--r--src/interfaces/ecpg/test/sql/insupd.pgc2
-rw-r--r--src/interfaces/ecpg/test/sql/parser.pgc8
-rw-r--r--src/interfaces/ecpg/test/sql/quote.pgc2
18 files changed, 38 insertions, 41 deletions
diff --git a/src/interfaces/ecpg/README.dynSQL b/src/interfaces/ecpg/README.dynSQL
index e1d1507fd07..b021f4b2d0f 100644
--- a/src/interfaces/ecpg/README.dynSQL
+++ b/src/interfaces/ecpg/README.dynSQL
@@ -5,7 +5,7 @@ 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
- can cover the same functionality with the existing infrastructure
- (using s[n]printf), I'll leave the work to someone else.
+ should change to recognize input parameters.
+ Since this is not likely to happen in the near future and you
+ can cover the same functionality with the existing infrastructure
+ (using s[n]printf), I'll leave the work to someone else.
diff --git a/src/interfaces/ecpg/preproc/check_rules.pl b/src/interfaces/ecpg/preproc/check_rules.pl
index 39b0250690e..b6d4fb51801 100644
--- a/src/interfaces/ecpg/preproc/check_rules.pl
+++ b/src/interfaces/ecpg/preproc/check_rules.pl
@@ -178,4 +178,3 @@ if ($verbose)
}
exit $ret;
-
diff --git a/src/interfaces/ecpg/preproc/parse.pl b/src/interfaces/ecpg/preproc/parse.pl
index 09310b330fe..c10a4d58fc5 100644
--- a/src/interfaces/ecpg/preproc/parse.pl
+++ b/src/interfaces/ecpg/preproc/parse.pl
@@ -6,7 +6,7 @@
# Copyright (c) 2007-2013, PostgreSQL Global Development Group
#
# Written by Mike Aubury <mike.aubury@aubit.com>
-# Michael Meskes <meskes@postgresql.org>
+# Michael Meskes <meskes@postgresql.org>
# Andy Colson <andy@squeakycode.net>
#
# Placed under the same license as PostgreSQL.
@@ -617,7 +617,7 @@ sub dump_line
=top
load addons into cache
- %addons = {
+ %addons = {
stmtClosePortalStmt => { 'type' => 'block', 'lines' => [ "{", "if (INFORMIX_MODE)" ..., "}" ] },
stmtViewStmt => { 'type' => 'rule', 'lines' => [ "| ECPGAllocateDescr", ... ] }
}
@@ -671,5 +671,3 @@ sub preload_addons
}
}
}
-
-
diff --git a/src/interfaces/ecpg/preproc/pgc.l b/src/interfaces/ecpg/preproc/pgc.l
index 5abb74f14e5..55b44ee2869 100644
--- a/src/interfaces/ecpg/preproc/pgc.l
+++ b/src/interfaces/ecpg/preproc/pgc.l
@@ -542,10 +542,10 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})(.*\\{space})*.
else
{
/*
- * When we fail to match $...$ to dolqstart, transfer
- * the $... part to the output, but put back the final
- * $ for rescanning. Consider $delim$...$junk$delim$
- */
+ * When we fail to match $...$ to dolqstart, transfer
+ * the $... part to the output, but put back the final
+ * $ for rescanning. Consider $delim$...$junk$delim$
+ */
addlit(yytext, yyleng-1);
yyless(yyleng-1);
}
@@ -1262,11 +1262,11 @@ static void
addlitchar(unsigned char ychar)
{
/* enlarge buffer if needed */
- if ((literallen+1) >= literalalloc)
- {
- literalalloc *= 2;
- literalbuf = (char *) realloc(literalbuf, literalalloc);
- }
+ if ((literallen+1) >= literalalloc)
+ {
+ literalalloc *= 2;
+ literalbuf = (char *) realloc(literalbuf, literalalloc);
+ }
/* append new data, add trailing null */
literalbuf[literallen] = ychar;
literallen += 1;
diff --git a/src/interfaces/ecpg/test/Makefile b/src/interfaces/ecpg/test/Makefile
index e9944c64859..d359fce7b5c 100644
--- a/src/interfaces/ecpg/test/Makefile
+++ b/src/interfaces/ecpg/test/Makefile
@@ -79,7 +79,7 @@ endif
REGRESS_OPTS = --dbname=regress1,connectdb --create-role=connectuser,connectdb $(EXTRA_REGRESS_OPTS)
check: all
- ./pg_regress $(REGRESS_OPTS) --top-builddir=$(top_builddir) --temp-install=./tmp_check $(pg_regress_locale_flags) $(THREAD) --schedule=$(srcdir)/ecpg_schedule
+ ./pg_regress $(REGRESS_OPTS) --top-builddir=$(top_builddir) --temp-install=./tmp_check $(pg_regress_locale_flags) $(THREAD) --schedule=$(srcdir)/ecpg_schedule
# the same options, but with --listen-on-tcp
checktcp: all
diff --git a/src/interfaces/ecpg/test/expected/preproc-autoprep.c b/src/interfaces/ecpg/test/expected/preproc-autoprep.c
index 430d0710006..cf5c702e065 100644
--- a/src/interfaces/ecpg/test/expected/preproc-autoprep.c
+++ b/src/interfaces/ecpg/test/expected/preproc-autoprep.c
@@ -25,7 +25,7 @@
static void test(void) {
/* exec sql begin declare section */
-
+
@@ -127,7 +127,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
for (i=0; i<4; i++)
- printf("item[%d] = %d\n", i, ind[i] ? -1 : item[i]);
+ printf("item[%d] = %d\n", i, ind[i] ? -1 : item[i]);
/* declare C cursor for select Item1 from T */
#line 35 "autoprep.pgc"
diff --git a/src/interfaces/ecpg/test/expected/preproc-type.c b/src/interfaces/ecpg/test/expected/preproc-type.c
index f913158ff92..540770f049a 100644
--- a/src/interfaces/ecpg/test/expected/preproc-type.c
+++ b/src/interfaces/ecpg/test/expected/preproc-type.c
@@ -79,7 +79,7 @@ main (void)
-
+
diff --git a/src/interfaces/ecpg/test/expected/sql-fetch.c b/src/interfaces/ecpg/test/expected/sql-fetch.c
index 908c0dc6888..db7a0c2aab5 100644
--- a/src/interfaces/ecpg/test/expected/sql-fetch.c
+++ b/src/interfaces/ecpg/test/expected/sql-fetch.c
@@ -113,7 +113,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
#line 30 "fetch.pgc"
while (1) {
- { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch 1 in C", ECPGt_EOIT,
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch 1 in C", ECPGt_EOIT,
ECPGt_int,&(i),(long)1,(long)1,sizeof(int),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_char,(str),(long)25,(long)1,(25)*sizeof(char),
@@ -182,7 +182,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
#line 46 "fetch.pgc"
while (1) {
- { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch 1 in D", ECPGt_EOIT,
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch 1 in D", ECPGt_EOIT,
ECPGt_int,&(i),(long)1,(long)1,sizeof(int),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_char,(str),(long)25,(long)1,(25)*sizeof(char),
diff --git a/src/interfaces/ecpg/test/expected/sql-insupd.c b/src/interfaces/ecpg/test/expected/sql-insupd.c
index ab2f077bcc8..085a0aba9c2 100644
--- a/src/interfaces/ecpg/test/expected/sql-insupd.c
+++ b/src/interfaces/ecpg/test/expected/sql-insupd.c
@@ -24,7 +24,7 @@
int main() {
/* exec sql begin declare section */
-
+
#line 9 "insupd.pgc"
int i1 [ 3 ] , i2 [ 3 ] , i3 [ 3 ] , i4 ;
diff --git a/src/interfaces/ecpg/test/expected/sql-parser.c b/src/interfaces/ecpg/test/expected/sql-parser.c
index a4a6d864bfb..616135dc48b 100644
--- a/src/interfaces/ecpg/test/expected/sql-parser.c
+++ b/src/interfaces/ecpg/test/expected/sql-parser.c
@@ -25,7 +25,7 @@
int main() {
/* exec sql begin declare section */
-
+
#line 10 "parser.pgc"
int item [ 3 ] , ind [ 3 ] , i ;
@@ -81,7 +81,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
for (i=0; i<3; i++)
- printf("item[%d] = %d\n", i, ind[i] ? -1 : item[i]);
+ printf("item[%d] = %d\n", i, ind[i] ? -1 : item[i]);
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "alter table T alter Item1 type bigint", ECPGt_EOIT, ECPGt_EORT);
#line 31 "parser.pgc"
diff --git a/src/interfaces/ecpg/test/expected/sql-quote.c b/src/interfaces/ecpg/test/expected/sql-quote.c
index fd57df2b1f2..43f1eeceb02 100644
--- a/src/interfaces/ecpg/test/expected/sql-quote.c
+++ b/src/interfaces/ecpg/test/expected/sql-quote.c
@@ -178,7 +178,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
while (true)
{
- { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch C", ECPGt_EOIT,
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch C", ECPGt_EOIT,
ECPGt_int,&(i),(long)1,(long)1,sizeof(int),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_char,(var),(long)25,(long)1,(25)*sizeof(char),
diff --git a/src/interfaces/ecpg/test/preproc/autoprep.pgc b/src/interfaces/ecpg/test/preproc/autoprep.pgc
index eeeb879d105..31c3ab7a56e 100644
--- a/src/interfaces/ecpg/test/preproc/autoprep.pgc
+++ b/src/interfaces/ecpg/test/preproc/autoprep.pgc
@@ -7,7 +7,7 @@ EXEC SQL INCLUDE ../regression;
static void test(void) {
EXEC SQL BEGIN DECLARE SECTION;
- int item[4], ind[4], i = 1;
+ int item[4], ind[4], i = 1;
int item1, ind1;
char sqlstr[64] = "SELECT item2 FROM T ORDER BY item2 NULLS LAST";
EXEC SQL END DECLARE SECTION;
@@ -30,7 +30,7 @@ static void test(void) {
EXEC SQL SELECT Item2 INTO :item:ind FROM T ORDER BY Item2 NULLS LAST;
for (i=0; i<4; i++)
- printf("item[%d] = %d\n", i, ind[i] ? -1 : item[i]);
+ printf("item[%d] = %d\n", i, ind[i] ? -1 : item[i]);
EXEC SQL DECLARE C CURSOR FOR SELECT Item1 FROM T;
diff --git a/src/interfaces/ecpg/test/preproc/type.pgc b/src/interfaces/ecpg/test/preproc/type.pgc
index 359a7f49a0c..3200c91dc24 100644
--- a/src/interfaces/ecpg/test/preproc/type.pgc
+++ b/src/interfaces/ecpg/test/preproc/type.pgc
@@ -31,7 +31,7 @@ main (void)
c ptr = NULL;
struct varchar
{
- int len;
+ int len;
char text[10];
} vc;
EXEC SQL END DECLARE SECTION;
diff --git a/src/interfaces/ecpg/test/sql/dyntest.pgc b/src/interfaces/ecpg/test/sql/dyntest.pgc
index 5c615a091f5..5f02fd5dd69 100644
--- a/src/interfaces/ecpg/test/sql/dyntest.pgc
+++ b/src/interfaces/ecpg/test/sql/dyntest.pgc
@@ -113,7 +113,7 @@ main ()
break;
case SQL3_DATE_TIME_TIMESTAMP:
exec sql get descriptor MYDESC value :INDEX
- :DATETIME_INTERVAL_CODE = datetime_interval_code;
+ :DATETIME_INTERVAL_CODE = datetime_interval_code;
switch (DATETIME_INTERVAL_CODE)
{
case SQL3_DDT_DATE:
@@ -174,7 +174,7 @@ main ()
break;
case SQL3_DATE_TIME_TIMESTAMP:
exec sql get descriptor MYDESC value :INDEX
- :DATETIME_INTERVAL_CODE = datetime_interval_code,
+ :DATETIME_INTERVAL_CODE = datetime_interval_code,
:STRINGVAR = data;
printf ("%d \"%s\"\n", DATETIME_INTERVAL_CODE, STRINGVAR);
break;
diff --git a/src/interfaces/ecpg/test/sql/fetch.pgc b/src/interfaces/ecpg/test/sql/fetch.pgc
index 83ed46786da..e280d27f4e5 100644
--- a/src/interfaces/ecpg/test/sql/fetch.pgc
+++ b/src/interfaces/ecpg/test/sql/fetch.pgc
@@ -29,7 +29,7 @@ int main() {
EXEC SQL WHENEVER NOT FOUND DO BREAK;
while (1) {
- EXEC SQL FETCH 1 IN C INTO :i, :str;
+ EXEC SQL FETCH 1 IN C INTO :i, :str;
printf("%d: %s\n", i, str);
}
@@ -45,7 +45,7 @@ int main() {
EXEC SQL WHENEVER NOT FOUND DO BREAK;
while (1) {
- EXEC SQL FETCH 1 IN D INTO :i, :str;
+ EXEC SQL FETCH 1 IN D INTO :i, :str;
printf("%d: %s\n", i, str);
}
EXEC SQL CLOSE D;
diff --git a/src/interfaces/ecpg/test/sql/insupd.pgc b/src/interfaces/ecpg/test/sql/insupd.pgc
index 4db1105eea8..b12f66f791a 100644
--- a/src/interfaces/ecpg/test/sql/insupd.pgc
+++ b/src/interfaces/ecpg/test/sql/insupd.pgc
@@ -6,7 +6,7 @@ EXEC SQL INCLUDE ../regression;
int main() {
EXEC SQL BEGIN DECLARE SECTION;
- int i1[3], i2[3], i3[3], i4;
+ int i1[3], i2[3], i3[3], i4;
EXEC SQL END DECLARE SECTION;
ECPGdebug(1, stderr);
diff --git a/src/interfaces/ecpg/test/sql/parser.pgc b/src/interfaces/ecpg/test/sql/parser.pgc
index f569e43a1d5..6e15f1364d5 100644
--- a/src/interfaces/ecpg/test/sql/parser.pgc
+++ b/src/interfaces/ecpg/test/sql/parser.pgc
@@ -7,7 +7,7 @@ EXEC SQL INCLUDE ../regression;
int main() {
EXEC SQL BEGIN DECLARE SECTION;
- int item[3], ind[3], i;
+ int item[3], ind[3], i;
EXEC SQL END DECLARE SECTION;
ECPGdebug(1, stderr);
@@ -19,14 +19,14 @@ int main() {
EXEC SQL CREATE TABLE T ( Item1 int, Item2 int );
- EXEC SQL INSERT INTO t
- SELECT 1,nullif(y-1,0)
+ EXEC SQL INSERT INTO t
+ SELECT 1,nullif(y-1,0)
FROM generate_series(1,3) WITH ORDINALITY AS series(x,y);
EXEC SQL SELECT Item2 INTO :item:ind FROM T ORDER BY Item2 NULLS LAST;
for (i=0; i<3; i++)
- printf("item[%d] = %d\n", i, ind[i] ? -1 : item[i]);
+ printf("item[%d] = %d\n", i, ind[i] ? -1 : item[i]);
EXEC SQL ALTER TABLE T ALTER Item1 TYPE bigint;
EXEC SQL ALTER TABLE T ALTER COLUMN Item2 SET DATA TYPE smallint;
diff --git a/src/interfaces/ecpg/test/sql/quote.pgc b/src/interfaces/ecpg/test/sql/quote.pgc
index 26cd7ee87f7..9dd997323cc 100644
--- a/src/interfaces/ecpg/test/sql/quote.pgc
+++ b/src/interfaces/ecpg/test/sql/quote.pgc
@@ -48,7 +48,7 @@ int main() {
while (true)
{
- EXEC SQL FETCH C INTO :i, :var;
+ EXEC SQL FETCH C INTO :i, :var;
printf("value: %d %s\n", i, var);
}