summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2014-01-09 15:41:51 +0100
committerMichael Meskes <meskes@postgresql.org>2014-01-09 15:51:11 +0100
commit9f5b3a1a1eb7f4b3b768654867777e0877bfda04 (patch)
tree2324900a5f9f06350dc7fa3285a5d41fad19e6e5
parent6c6c53d0be66fc9a0ae96a2a5e4be83710962be0 (diff)
Fix descriptor output in ECPG.
While working on most platforms the old way sometimes created alignment problems. This should fix it. Also the regresion tests were updated to test for the reported case. Report and fix by MauMau <maumau307@gmail.com>
-rw-r--r--src/interfaces/ecpg/preproc/type.c2
-rw-r--r--src/interfaces/ecpg/test/expected/compat_informix-describe.c8
-rw-r--r--src/interfaces/ecpg/test/expected/sql-desc.c14
-rw-r--r--src/interfaces/ecpg/test/expected/sql-describe.c8
-rw-r--r--src/interfaces/ecpg/test/expected/sql-dynalloc.c2
-rw-r--r--src/interfaces/ecpg/test/expected/sql-dynalloc2.c2
-rw-r--r--src/interfaces/ecpg/test/expected/sql-dyntest.c2
7 files changed, 19 insertions, 19 deletions
diff --git a/src/interfaces/ecpg/preproc/type.c b/src/interfaces/ecpg/preproc/type.c
index ed5b707b16f..0c3af3f691b 100644
--- a/src/interfaces/ecpg/preproc/type.c
+++ b/src/interfaces/ecpg/preproc/type.c
@@ -368,7 +368,7 @@ ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type,
fprintf(o, "\n\tECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ");
else if (type == ECPGt_descriptor)
/* remember that name here already contains quotes (if needed) */
- fprintf(o, "\n\tECPGt_descriptor, %s, 0L, 0L, 0L, ", name);
+ fprintf(o, "\n\tECPGt_descriptor, %s, 1L, 1L, 1L, ", name);
else if (type == ECPGt_sqlda)
fprintf(o, "\n\tECPGt_sqlda, &%s, 0L, 0L, 0L, ", name);
else
diff --git a/src/interfaces/ecpg/test/expected/compat_informix-describe.c b/src/interfaces/ecpg/test/expected/compat_informix-describe.c
index b4e1b47066a..59002fbde68 100644
--- a/src/interfaces/ecpg/test/expected/compat_informix-describe.c
+++ b/src/interfaces/ecpg/test/expected/compat_informix-describe.c
@@ -174,12 +174,12 @@ if (sqlca.sqlcode < 0) exit (1);}
strcpy(msg, "describe");
{ ECPGdescribe(__LINE__, 1, 0, NULL, "st_id1",
- ECPGt_descriptor, "desc1", 0L, 0L, 0L,
+ ECPGt_descriptor, "desc1", 1L, 1L, 1L,
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
#line 60 "describe.pgc"
{ ECPGdescribe(__LINE__, 1, 0, NULL, "st_id1",
- ECPGt_descriptor, "desc2", 0L, 0L, 0L,
+ ECPGt_descriptor, "desc2", 1L, 1L, 1L,
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
#line 61 "describe.pgc"
@@ -336,12 +336,12 @@ if (sqlca.sqlcode < 0) exit (1);}
strcpy(msg, "describe");
{ ECPGdescribe(__LINE__, 1, 0, NULL, "st_id2",
- ECPGt_descriptor, "desc1", 0L, 0L, 0L,
+ ECPGt_descriptor, "desc1", 1L, 1L, 1L,
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
#line 146 "describe.pgc"
{ ECPGdescribe(__LINE__, 1, 0, NULL, "st_id2",
- ECPGt_descriptor, "desc2", 0L, 0L, 0L,
+ ECPGt_descriptor, "desc2", 1L, 1L, 1L,
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
#line 147 "describe.pgc"
diff --git a/src/interfaces/ecpg/test/expected/sql-desc.c b/src/interfaces/ecpg/test/expected/sql-desc.c
index 8fc527a3647..7a384acd0d0 100644
--- a/src/interfaces/ecpg/test/expected/sql-desc.c
+++ b/src/interfaces/ecpg/test/expected/sql-desc.c
@@ -134,7 +134,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_execute, "foo1",
- ECPGt_descriptor, "indesc", 0L, 0L, 0L,
+ ECPGt_descriptor, "indesc", 1L, 1L, 1L,
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 35 "desc.pgc"
@@ -161,7 +161,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_execute, "foo1",
- ECPGt_descriptor, "indesc", 0L, 0L, 0L,
+ ECPGt_descriptor, "indesc", 1L, 1L, 1L,
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 40 "desc.pgc"
@@ -188,7 +188,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_execute, "Foo-1",
- ECPGt_descriptor, "indesc", 0L, 0L, 0L,
+ ECPGt_descriptor, "indesc", 1L, 1L, 1L,
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 45 "desc.pgc"
@@ -222,9 +222,9 @@ if (sqlca.sqlcode < 0) sqlprint();}
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_execute, "foo2",
- ECPGt_descriptor, "indesc", 0L, 0L, 0L,
+ ECPGt_descriptor, "indesc", 1L, 1L, 1L,
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
- ECPGt_descriptor, "outdesc", 0L, 0L, 0L,
+ ECPGt_descriptor, "outdesc", 1L, 1L, 1L,
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
#line 52 "desc.pgc"
@@ -248,7 +248,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare c1 cursor for $1",
ECPGt_char_variable,(ECPGprepared_statement(NULL, "foo2", __LINE__)),(long)1,(long)1,(1)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
- ECPGt_descriptor, "indesc", 0L, 0L, 0L,
+ ECPGt_descriptor, "indesc", 1L, 1L, 1L,
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 58 "desc.pgc"
@@ -298,7 +298,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare c2 cursor for $1",
ECPGt_char_variable,(ECPGprepared_statement(NULL, "foo3", __LINE__)),(long)1,(long)1,(1)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
- ECPGt_descriptor, "indesc", 0L, 0L, 0L,
+ ECPGt_descriptor, "indesc", 1L, 1L, 1L,
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 70 "desc.pgc"
diff --git a/src/interfaces/ecpg/test/expected/sql-describe.c b/src/interfaces/ecpg/test/expected/sql-describe.c
index fd46a292459..11aadb4e053 100644
--- a/src/interfaces/ecpg/test/expected/sql-describe.c
+++ b/src/interfaces/ecpg/test/expected/sql-describe.c
@@ -172,12 +172,12 @@ if (sqlca.sqlcode < 0) exit (1);}
strcpy(msg, "describe");
{ ECPGdescribe(__LINE__, 0, 0, NULL, "st_id1",
- ECPGt_descriptor, "desc1", 0L, 0L, 0L,
+ ECPGt_descriptor, "desc1", 1L, 1L, 1L,
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
#line 60 "describe.pgc"
{ ECPGdescribe(__LINE__, 0, 0, NULL, "st_id1",
- ECPGt_descriptor, "desc2", 0L, 0L, 0L,
+ ECPGt_descriptor, "desc2", 1L, 1L, 1L,
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
#line 61 "describe.pgc"
@@ -334,12 +334,12 @@ if (sqlca.sqlcode < 0) exit (1);}
strcpy(msg, "describe");
{ ECPGdescribe(__LINE__, 0, 0, NULL, "st_id2",
- ECPGt_descriptor, "desc1", 0L, 0L, 0L,
+ ECPGt_descriptor, "desc1", 1L, 1L, 1L,
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
#line 146 "describe.pgc"
{ ECPGdescribe(__LINE__, 0, 0, NULL, "st_id2",
- ECPGt_descriptor, "desc2", 0L, 0L, 0L,
+ ECPGt_descriptor, "desc2", 1L, 1L, 1L,
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
#line 147 "describe.pgc"
diff --git a/src/interfaces/ecpg/test/expected/sql-dynalloc.c b/src/interfaces/ecpg/test/expected/sql-dynalloc.c
index ff04922fa78..ccc337168e4 100644
--- a/src/interfaces/ecpg/test/expected/sql-dynalloc.c
+++ b/src/interfaces/ecpg/test/expected/sql-dynalloc.c
@@ -210,7 +210,7 @@ if (sqlca.sqlcode < 0) sqlprint ( );
#line 41 "dynalloc.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select a , b , c , d , e , f , g , h , i from test order by a", ECPGt_EOIT,
- ECPGt_descriptor, "mydesc", 0L, 0L, 0L,
+ ECPGt_descriptor, "mydesc", 1L, 1L, 1L,
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
#line 42 "dynalloc.pgc"
diff --git a/src/interfaces/ecpg/test/expected/sql-dynalloc2.c b/src/interfaces/ecpg/test/expected/sql-dynalloc2.c
index 3f200ff6ea4..e85189214bb 100644
--- a/src/interfaces/ecpg/test/expected/sql-dynalloc2.c
+++ b/src/interfaces/ecpg/test/expected/sql-dynalloc2.c
@@ -188,7 +188,7 @@ if (sqlca.sqlcode < 0) sqlprint ( );
#line 32 "dynalloc2.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select * from test", ECPGt_EOIT,
- ECPGt_descriptor, "mydesc", 0L, 0L, 0L,
+ ECPGt_descriptor, "mydesc", 1L, 1L, 1L,
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
#line 33 "dynalloc2.pgc"
diff --git a/src/interfaces/ecpg/test/expected/sql-dyntest.c b/src/interfaces/ecpg/test/expected/sql-dyntest.c
index 1871e1338ff..537d9ff63a8 100644
--- a/src/interfaces/ecpg/test/expected/sql-dyntest.c
+++ b/src/interfaces/ecpg/test/expected/sql-dyntest.c
@@ -273,7 +273,7 @@ if (sqlca.sqlcode < 0) error ( );}
while (1)
{
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch in MYCURS", ECPGt_EOIT,
- ECPGt_descriptor, "MYDESC", 0L, 0L, 0L,
+ ECPGt_descriptor, "MYDESC", 1L, 1L, 1L,
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
#line 64 "dyntest.pgc"