]> granicus.if.org Git - postgresql/commitdiff
Fix descriptor output in ECPG.
authorMichael Meskes <meskes@postgresql.org>
Thu, 9 Jan 2014 14:41:51 +0000 (15:41 +0100)
committerMichael Meskes <meskes@postgresql.org>
Thu, 9 Jan 2014 15:20:19 +0000 (16:20 +0100)
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>

src/interfaces/ecpg/preproc/type.c
src/interfaces/ecpg/test/expected/compat_informix-describe.c
src/interfaces/ecpg/test/expected/sql-desc.c
src/interfaces/ecpg/test/expected/sql-describe.c
src/interfaces/ecpg/test/expected/sql-dynalloc.c
src/interfaces/ecpg/test/expected/sql-dynalloc2.c
src/interfaces/ecpg/test/expected/sql-dyntest.c

index 28184b9f4406c2c40b164642bc6b23e88810a131..c24b4c2fbcd5f05e018d36fd563795226da7d24c 100644 (file)
@@ -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
index b4e1b47066aca75ed5a494a3123bfb5010d7c035..59002fbde68272a5d9010f7af85094bd21c7d9aa 100644 (file)
@@ -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"
 
index 8fc527a3647963d9321c69e158766f5d1b73accb..7a384acd0d0e8747fff8291968668d8506aadda4 100644 (file)
@@ -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"
 
index fd46a2924594dee47ffce23020c1e7646f6f9a7f..11aadb4e053d2083534e60531000a503cf8a82f6 100644 (file)
@@ -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"
 
index ff04922fa787ef735763ce5f63a1c6d8cbe8fa8d..ccc337168e4a2ffffe9b50659ecfdba77dfbc620 100644 (file)
@@ -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"
 
index 3f200ff6ea48baa6512469c36d9114137c6d1a0b..e85189214bb1cc5fd6669e3b61994021b4691457 100644 (file)
@@ -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"
 
index 1871e1338ff443454b764ff0af5e14e2bbb14a78..537d9ff63a8832dc04cd200c71a3023653d24f47 100644 (file)
@@ -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"