aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2019-01-24 17:02:09 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2019-01-24 17:02:09 -0500
commite3565fd61cee16414a682d2be0d44c112a80a30c (patch)
tree4e9cfa01c3ba898b932369b4bac3257e2fc0bbe1
parentd5a1fde397269bd60b99e70a4eb2934b75fd31ec (diff)
downloadpostgresql-e3565fd61cee16414a682d2be0d44c112a80a30c.tar.gz
postgresql-e3565fd61cee16414a682d2be0d44c112a80a30c.zip
Remove _configthreadlocale() calls in ecpg test suite.
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
-rw-r--r--src/interfaces/ecpg/test/expected/thread-alloc.c24
-rw-r--r--src/interfaces/ecpg/test/expected/thread-descriptor.c14
-rw-r--r--src/interfaces/ecpg/test/expected/thread-prep.c52
-rw-r--r--src/interfaces/ecpg/test/expected/thread-thread.c28
-rw-r--r--src/interfaces/ecpg/test/expected/thread-thread_implicit.c28
-rw-r--r--src/interfaces/ecpg/test/thread/alloc.pgc6
-rw-r--r--src/interfaces/ecpg/test/thread/descriptor.pgc6
-rw-r--r--src/interfaces/ecpg/test/thread/prep.pgc6
-rw-r--r--src/interfaces/ecpg/test/thread/thread.pgc6
-rw-r--r--src/interfaces/ecpg/test/thread/thread_implicit.pgc6
10 files changed, 58 insertions, 118 deletions
diff --git a/src/interfaces/ecpg/test/expected/thread-alloc.c b/src/interfaces/ecpg/test/expected/thread-alloc.c
index e7b69b387f7..9678ebe6fd6 100644
--- a/src/interfaces/ecpg/test/expected/thread-alloc.c
+++ b/src/interfaces/ecpg/test/expected/thread-alloc.c
@@ -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;
diff --git a/src/interfaces/ecpg/test/expected/thread-descriptor.c b/src/interfaces/ecpg/test/expected/thread-descriptor.c
index 03cebad603a..f56cc25ab02 100644
--- a/src/interfaces/ecpg/test/expected/thread-descriptor.c
+++ b/src/interfaces/ecpg/test/expected/thread-descriptor.c
@@ -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"
}
diff --git a/src/interfaces/ecpg/test/expected/thread-prep.c b/src/interfaces/ecpg/test/expected/thread-prep.c
index 94e02933cd8..98861d36f02 100644
--- a/src/interfaces/ecpg/test/expected/thread-prep.c
+++ b/src/interfaces/ecpg/test/expected/thread-prep.c
@@ -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
diff --git a/src/interfaces/ecpg/test/expected/thread-thread.c b/src/interfaces/ecpg/test/expected/thread-thread.c
index 420bbf194a8..68f153e57c1 100644
--- a/src/interfaces/ecpg/test/expected/thread-thread.c
+++ b/src/interfaces/ecpg/test/expected/thread-thread.c
@@ -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;
}
diff --git a/src/interfaces/ecpg/test/expected/thread-thread_implicit.c b/src/interfaces/ecpg/test/expected/thread-thread_implicit.c
index 4bddca9fb98..d0352765486 100644
--- a/src/interfaces/ecpg/test/expected/thread-thread_implicit.c
+++ b/src/interfaces/ecpg/test/expected/thread-thread_implicit.c
@@ -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;
}
diff --git a/src/interfaces/ecpg/test/thread/alloc.pgc b/src/interfaces/ecpg/test/thread/alloc.pgc
index b13bcb860b2..c44bc91d78f 100644
--- a/src/interfaces/ecpg/test/thread/alloc.pgc
+++ b/src/interfaces/ecpg/test/thread/alloc.pgc
@@ -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);
diff --git a/src/interfaces/ecpg/test/thread/descriptor.pgc b/src/interfaces/ecpg/test/thread/descriptor.pgc
index 3f28c6d329a..76a7a5dff54 100644
--- a/src/interfaces/ecpg/test/thread/descriptor.pgc
+++ b/src/interfaces/ecpg/test/thread/descriptor.pgc
@@ -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;
diff --git a/src/interfaces/ecpg/test/thread/prep.pgc b/src/interfaces/ecpg/test/thread/prep.pgc
index 3a2467c9abb..bdf27e7d5aa 100644
--- a/src/interfaces/ecpg/test/thread/prep.pgc
+++ b/src/interfaces/ecpg/test/thread/prep.pgc
@@ -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);
diff --git a/src/interfaces/ecpg/test/thread/thread.pgc b/src/interfaces/ecpg/test/thread/thread.pgc
index ae6b229962b..0e3217ce63c 100644
--- a/src/interfaces/ecpg/test/thread/thread.pgc
+++ b/src/interfaces/ecpg/test/thread/thread.pgc
@@ -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);
diff --git a/src/interfaces/ecpg/test/thread/thread_implicit.pgc b/src/interfaces/ecpg/test/thread/thread_implicit.pgc
index 0dfcb7172bc..bbc4d7783c1 100644
--- a/src/interfaces/ecpg/test/thread/thread_implicit.pgc
+++ b/src/interfaces/ecpg/test/thread/thread_implicit.pgc
@@ -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);