]> 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 14:51:23 +0000 (15:51 +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 bbf7898bbd9cad709f915b7fa977d8c84ac54992..68b3a9280631e87d7655a1991388be0ce0b4b22e 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 6aa534f5d67bebb4733e8a36d2f2f3964f2ac9bc..6d06a967152af877ab451f35ffd5392ae95368fd 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 7a5ab02debf583e633aa315ffb84b30159117573..9b022ec7f9f9bb83291c50db6e99479b2d85d7ee 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 02324803338fe2f0ee21ac75f7e24238f5ab0b32..d95accc99fdba24820f05d5e5afca8c9a48e1456 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 b729d94cb04dca403b650e47ccf090a7308408a0..18634deb7839f646aca69407bde21a0d8364cfcd 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"