Remove _configthreadlocale() calls in ecpg test suite.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 24 Jan 2019 22:02:09 +0000 (17:02 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 24 Jan 2019 22:02:09 +0000 (17:02 -0500)
This essentially reverts commits a772624b1 and 04fbe0e45, which
added "_configthreadlocale(_ENABLE_PER_THREAD_LOCALE)" calls to the
thread-related ecpg test programs.  That was nothing but a hack,
because we shouldn't expect that ecpg-using applications have
done that for us; and now that we've inserted such calls into
ecpglib, the tests should still pass without it.

(If they don't, it would be good to know that.)

HEAD only; there seems no big need to change this in the
back branches.

Discussion: https://postgr.es/m/22937.1548307384@sss.pgh.pa.us

src/interfaces/ecpg/test/expected/thread-alloc.c
src/interfaces/ecpg/test/expected/thread-descriptor.c
src/interfaces/ecpg/test/expected/thread-prep.c
src/interfaces/ecpg/test/expected/thread-thread.c
src/interfaces/ecpg/test/expected/thread-thread_implicit.c
src/interfaces/ecpg/test/thread/alloc.pgc
src/interfaces/ecpg/test/thread/descriptor.pgc
src/interfaces/ecpg/test/thread/prep.pgc
src/interfaces/ecpg/test/thread/thread.pgc
src/interfaces/ecpg/test/thread/thread_implicit.pgc

index e7b69b387f71f165ae261b73a6d679d16141c0e1..9678ebe6fd6fbb290b6311fa3a48779718cf105b 100644 (file)
@@ -145,48 +145,42 @@ static void* fn(void* arg)
 #line 43 "alloc.pgc"
 
 
-#ifdef WIN32
-#ifdef _MSC_VER                /* requires MSVC */
-       _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
-#endif
-#endif
-
        value = (long)arg;
        sprintf(name, "Connection: %d", value);
 
        { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , name, 0); 
-#line 54 "alloc.pgc"
+#line 48 "alloc.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
-#line 54 "alloc.pgc"
+#line 48 "alloc.pgc"
 
        { ECPGsetcommit(__LINE__, "on", NULL);
-#line 55 "alloc.pgc"
+#line 49 "alloc.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
-#line 55 "alloc.pgc"
+#line 49 "alloc.pgc"
 
        for (i = 1; i <= REPEATS; ++i)
        {
                { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select relname from pg_class where relname = 'pg_class'", ECPGt_EOIT, 
        ECPGt_char,&(r),(long)0,(long)0,(1)*sizeof(char), 
        ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
-#line 58 "alloc.pgc"
+#line 52 "alloc.pgc"
 
 if (sqlca.sqlcode == ECPG_NOT_FOUND) sqlprint();
-#line 58 "alloc.pgc"
+#line 52 "alloc.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
-#line 58 "alloc.pgc"
+#line 52 "alloc.pgc"
 
                free(r);
                r = NULL;
        }
        { ECPGdisconnect(__LINE__, name);
-#line 62 "alloc.pgc"
+#line 56 "alloc.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
-#line 62 "alloc.pgc"
+#line 56 "alloc.pgc"
 
 
        return 0;
index 03cebad603a98c43e6a629b0c870c8f80ffebd32..f56cc25ab02849344b30fc4fa7decea490bd4ae0 100644 (file)
@@ -108,25 +108,19 @@ static void* fn(void* arg)
 {
        int i;
 
-#ifdef WIN32
-#ifdef _MSC_VER                /* requires MSVC */
-       _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
-#endif
-#endif
-
        for (i = 1; i <= REPEATS; ++i)
        {
                ECPGallocate_desc(__LINE__, "mydesc");
-#line 36 "descriptor.pgc"
+#line 30 "descriptor.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();
-#line 36 "descriptor.pgc"
+#line 30 "descriptor.pgc"
 
                ECPGdeallocate_desc(__LINE__, "mydesc");
-#line 37 "descriptor.pgc"
+#line 31 "descriptor.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();
-#line 37 "descriptor.pgc"
+#line 31 "descriptor.pgc"
 
        }
 
index 94e02933cd84ad60ee4e4164e0a9c8a11df49807..98861d36f0200ebf3fe120b93f25b30f9072233c 100644 (file)
@@ -145,58 +145,52 @@ static void* fn(void* arg)
 #line 43 "prep.pgc"
 
 
-#ifdef WIN32
-#ifdef _MSC_VER                /* requires MSVC */
-       _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
-#endif
-#endif
-
        value = (long)arg;
        sprintf(name, "Connection: %d", value);
 
        { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , name, 0); 
-#line 54 "prep.pgc"
+#line 48 "prep.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
-#line 54 "prep.pgc"
+#line 48 "prep.pgc"
 
        { ECPGsetcommit(__LINE__, "on", NULL);
-#line 55 "prep.pgc"
+#line 49 "prep.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
-#line 55 "prep.pgc"
+#line 49 "prep.pgc"
 
        for (i = 1; i <= REPEATS; ++i)
        {
                { ECPGprepare(__LINE__, NULL, 0, "i", query);
-#line 58 "prep.pgc"
+#line 52 "prep.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
-#line 58 "prep.pgc"
+#line 52 "prep.pgc"
 
                { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_execute, "i", 
        ECPGt_int,&(value),(long)1,(long)1,sizeof(int), 
        ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
-#line 59 "prep.pgc"
+#line 53 "prep.pgc"
 
 if (sqlca.sqlcode == ECPG_NOT_FOUND) sqlprint();
-#line 59 "prep.pgc"
+#line 53 "prep.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
-#line 59 "prep.pgc"
+#line 53 "prep.pgc"
 
        }
        { ECPGdeallocate(__LINE__, 0, NULL, "i");
-#line 61 "prep.pgc"
+#line 55 "prep.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
-#line 61 "prep.pgc"
+#line 55 "prep.pgc"
 
        { ECPGdisconnect(__LINE__, name);
-#line 62 "prep.pgc"
+#line 56 "prep.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
-#line 62 "prep.pgc"
+#line 56 "prep.pgc"
 
 
        return 0;
@@ -212,34 +206,34 @@ int main ()
 #endif
 
        { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0); 
-#line 76 "prep.pgc"
+#line 70 "prep.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
-#line 76 "prep.pgc"
+#line 70 "prep.pgc"
 
        { ECPGsetcommit(__LINE__, "on", NULL);
-#line 77 "prep.pgc"
+#line 71 "prep.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
-#line 77 "prep.pgc"
+#line 71 "prep.pgc"
 
        { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "drop table if exists T", ECPGt_EOIT, ECPGt_EORT);
-#line 78 "prep.pgc"
+#line 72 "prep.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
-#line 78 "prep.pgc"
+#line 72 "prep.pgc"
 
        { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table T ( i int )", ECPGt_EOIT, ECPGt_EORT);
-#line 79 "prep.pgc"
+#line 73 "prep.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
-#line 79 "prep.pgc"
+#line 73 "prep.pgc"
 
        { ECPGdisconnect(__LINE__, "CURRENT");
-#line 80 "prep.pgc"
+#line 74 "prep.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
-#line 80 "prep.pgc"
+#line 74 "prep.pgc"
 
 
 #ifdef WIN32
index 420bbf194a82704af0d2b8eca756a09a39315478..68f153e57c1a39f9dbf495f81847b1755816e571 100644 (file)
@@ -153,12 +153,6 @@ void *test_thread(void *arg)
 #line 105 "thread.pgc"
 
 
-#ifdef WIN32
-#ifdef _MSC_VER                /* requires MSVC */
-       _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
-#endif
-#endif
-
   /* build up connection name, and connect to database */
 #ifndef _MSC_VER
   snprintf(l_connection, sizeof(l_connection), "thread_%03ld", threadnum);
@@ -166,13 +160,13 @@ void *test_thread(void *arg)
   _snprintf(l_connection, sizeof(l_connection), "thread_%03ld", threadnum);
 #endif
   /* exec sql whenever sqlerror  sqlprint ; */
-#line 119 "thread.pgc"
+#line 113 "thread.pgc"
 
   { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , l_connection, 0); 
-#line 120 "thread.pgc"
+#line 114 "thread.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
-#line 120 "thread.pgc"
+#line 114 "thread.pgc"
 
   if( sqlca.sqlcode != 0 )
     {
@@ -180,10 +174,10 @@ if (sqlca.sqlcode < 0) sqlprint();}
       return NULL;
     }
   { ECPGtrans(__LINE__, l_connection, "begin");
-#line 126 "thread.pgc"
+#line 120 "thread.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
-#line 126 "thread.pgc"
+#line 120 "thread.pgc"
 
 
   /* insert into test_thread table */
@@ -194,10 +188,10 @@ if (sqlca.sqlcode < 0) sqlprint();}
        ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
        ECPGt_int,&(l_i),(long)1,(long)1,sizeof(int), 
        ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
-#line 131 "thread.pgc"
+#line 125 "thread.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
-#line 131 "thread.pgc"
+#line 125 "thread.pgc"
 
       if( sqlca.sqlcode != 0 )
        printf("%s: ERROR: insert failed!\n", l_connection);
@@ -205,16 +199,16 @@ if (sqlca.sqlcode < 0) sqlprint();}
 
   /* all done */
   { ECPGtrans(__LINE__, l_connection, "commit");
-#line 137 "thread.pgc"
+#line 131 "thread.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
-#line 137 "thread.pgc"
+#line 131 "thread.pgc"
 
   { ECPGdisconnect(__LINE__, l_connection);
-#line 138 "thread.pgc"
+#line 132 "thread.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
-#line 138 "thread.pgc"
+#line 132 "thread.pgc"
 
   return NULL;
 }
index 4bddca9fb9853e9b5134d3a45bb0ef6ec390df86..d0352765486da3252ab1fda23f05ea79fa055b5c 100644 (file)
@@ -154,12 +154,6 @@ void *test_thread(void *arg)
 #line 106 "thread_implicit.pgc"
 
 
-#ifdef WIN32
-#ifdef _MSC_VER                /* requires MSVC */
-       _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
-#endif
-#endif
-
   /* build up connection name, and connect to database */
 #ifndef _MSC_VER
   snprintf(l_connection, sizeof(l_connection), "thread_%03ld", threadnum);
@@ -167,13 +161,13 @@ void *test_thread(void *arg)
   _snprintf(l_connection, sizeof(l_connection), "thread_%03ld", threadnum);
 #endif
   /* exec sql whenever sqlerror  sqlprint ; */
-#line 120 "thread_implicit.pgc"
+#line 114 "thread_implicit.pgc"
 
   { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , l_connection, 0); 
-#line 121 "thread_implicit.pgc"
+#line 115 "thread_implicit.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
-#line 121 "thread_implicit.pgc"
+#line 115 "thread_implicit.pgc"
 
   if( sqlca.sqlcode != 0 )
     {
@@ -181,10 +175,10 @@ if (sqlca.sqlcode < 0) sqlprint();}
       return NULL;
     }
   { ECPGtrans(__LINE__, NULL, "begin");
-#line 127 "thread_implicit.pgc"
+#line 121 "thread_implicit.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
-#line 127 "thread_implicit.pgc"
+#line 121 "thread_implicit.pgc"
 
 
   /* insert into test_thread table */
@@ -195,10 +189,10 @@ if (sqlca.sqlcode < 0) sqlprint();}
        ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
        ECPGt_int,&(l_i),(long)1,(long)1,sizeof(int), 
        ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
-#line 132 "thread_implicit.pgc"
+#line 126 "thread_implicit.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
-#line 132 "thread_implicit.pgc"
+#line 126 "thread_implicit.pgc"
 
       if( sqlca.sqlcode != 0 )
        printf("%s: ERROR: insert failed!\n", l_connection);
@@ -206,16 +200,16 @@ if (sqlca.sqlcode < 0) sqlprint();}
 
   /* all done */
   { ECPGtrans(__LINE__, NULL, "commit");
-#line 138 "thread_implicit.pgc"
+#line 132 "thread_implicit.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
-#line 138 "thread_implicit.pgc"
+#line 132 "thread_implicit.pgc"
 
   { ECPGdisconnect(__LINE__, l_connection);
-#line 139 "thread_implicit.pgc"
+#line 133 "thread_implicit.pgc"
 
 if (sqlca.sqlcode < 0) sqlprint();}
-#line 139 "thread_implicit.pgc"
+#line 133 "thread_implicit.pgc"
 
   return NULL;
 }
index b13bcb860b23b6978ee6ce14fef7d729de53c5f5..c44bc91d78f7933489cb06578ffa583fcd821859 100644 (file)
@@ -42,12 +42,6 @@ static void* fn(void* arg)
        char **r = NULL;
        EXEC SQL END DECLARE SECTION;
 
-#ifdef WIN32
-#ifdef _MSC_VER                /* requires MSVC */
-       _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
-#endif
-#endif
-
        value = (long)arg;
        sprintf(name, "Connection: %d", value);
 
index 3f28c6d329a703d7b6c9feb7b988e5920b0711a0..76a7a5dff544bccc81351b0cddf02f6a054c53a3 100644 (file)
@@ -25,12 +25,6 @@ static void* fn(void* arg)
 {
        int i;
 
-#ifdef WIN32
-#ifdef _MSC_VER                /* requires MSVC */
-       _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
-#endif
-#endif
-
        for (i = 1; i <= REPEATS; ++i)
        {
                EXEC SQL ALLOCATE DESCRIPTOR mydesc;
index 3a2467c9abbcdd20c38e62506ea0566051779b94..bdf27e7d5aa3439cc2a4b393af61759e32ba36b7 100644 (file)
@@ -42,12 +42,6 @@ static void* fn(void* arg)
        char query[256] = "INSERT INTO T VALUES ( ? )";
        EXEC SQL END DECLARE SECTION;
 
-#ifdef WIN32
-#ifdef _MSC_VER                /* requires MSVC */
-       _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
-#endif
-#endif
-
        value = (long)arg;
        sprintf(name, "Connection: %d", value);
 
index ae6b229962b400a8e3e277f799782cf436679771..0e3217ce63c600e3726951d427eeaa301d34e5e9 100644 (file)
@@ -104,12 +104,6 @@ void *test_thread(void *arg)
   char l_connection[128];
   EXEC SQL END DECLARE SECTION;
 
-#ifdef WIN32
-#ifdef _MSC_VER                /* requires MSVC */
-       _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
-#endif
-#endif
-
   /* build up connection name, and connect to database */
 #ifndef _MSC_VER
   snprintf(l_connection, sizeof(l_connection), "thread_%03ld", threadnum);
index 0dfcb7172bc0bd5cac1d4f03127d3b2ca58b0c66..bbc4d7783c1770641ea70953fe0f07b408b6fb94 100644 (file)
@@ -105,12 +105,6 @@ void *test_thread(void *arg)
   char l_connection[128];
   EXEC SQL END DECLARE SECTION;
 
-#ifdef WIN32
-#ifdef _MSC_VER                /* requires MSVC */
-       _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
-#endif
-#endif
-
   /* build up connection name, and connect to database */
 #ifndef _MSC_VER
   snprintf(l_connection, sizeof(l_connection), "thread_%03ld", threadnum);