thread test cases work on Windows.
{
int i;
-#ifdef WIN32
- _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
-#endif
-
/* exec sql begin declare section */
-#line 44 "alloc.pgc"
+#line 40 "alloc.pgc"
int value ;
-#line 45 "alloc.pgc"
+#line 41 "alloc.pgc"
char name [ 100 ] ;
-#line 46 "alloc.pgc"
+#line 42 "alloc.pgc"
char ** r = NULL ;
/* exec sql end declare section */
-#line 47 "alloc.pgc"
+#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 52 "alloc.pgc"
+#line 54 "alloc.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 52 "alloc.pgc"
+#line 54 "alloc.pgc"
{ ECPGsetcommit(__LINE__, "on", NULL);
-#line 53 "alloc.pgc"
+#line 55 "alloc.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 53 "alloc.pgc"
+#line 55 "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 56 "alloc.pgc"
+#line 58 "alloc.pgc"
if (sqlca.sqlcode == ECPG_NOT_FOUND) sqlprint();
-#line 56 "alloc.pgc"
+#line 58 "alloc.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 56 "alloc.pgc"
+#line 58 "alloc.pgc"
free(r);
r = NULL;
}
{ ECPGdisconnect(__LINE__, name);
-#line 60 "alloc.pgc"
+#line 62 "alloc.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 60 "alloc.pgc"
+#line 62 "alloc.pgc"
return 0;
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 34 "descriptor.pgc"
+#line 36 "descriptor.pgc"
if (sqlca.sqlcode < 0) sqlprint();
-#line 34 "descriptor.pgc"
+#line 36 "descriptor.pgc"
ECPGdeallocate_desc(__LINE__, "mydesc");
-#line 35 "descriptor.pgc"
+#line 37 "descriptor.pgc"
if (sqlca.sqlcode < 0) sqlprint();
-#line 35 "descriptor.pgc"
+#line 37 "descriptor.pgc"
}
{
int i;
-#ifdef WIN32
- _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
-#endif
-
/* exec sql begin declare section */
-#line 44 "prep.pgc"
+#line 40 "prep.pgc"
int value ;
-#line 45 "prep.pgc"
+#line 41 "prep.pgc"
char name [ 100 ] ;
-#line 46 "prep.pgc"
+#line 42 "prep.pgc"
char query [ 256 ] = "INSERT INTO T VALUES ( ? )" ;
/* exec sql end declare section */
-#line 47 "prep.pgc"
+#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 52 "prep.pgc"
+#line 54 "prep.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 52 "prep.pgc"
+#line 54 "prep.pgc"
{ ECPGsetcommit(__LINE__, "on", NULL);
-#line 53 "prep.pgc"
+#line 55 "prep.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 53 "prep.pgc"
+#line 55 "prep.pgc"
for (i = 1; i <= REPEATS; ++i)
{
{ ECPGprepare(__LINE__, NULL, 0, "i", query);
-#line 56 "prep.pgc"
+#line 58 "prep.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 56 "prep.pgc"
+#line 58 "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 57 "prep.pgc"
+#line 59 "prep.pgc"
if (sqlca.sqlcode == ECPG_NOT_FOUND) sqlprint();
-#line 57 "prep.pgc"
+#line 59 "prep.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 57 "prep.pgc"
+#line 59 "prep.pgc"
}
{ ECPGdeallocate(__LINE__, 0, NULL, "i");
-#line 59 "prep.pgc"
+#line 61 "prep.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 59 "prep.pgc"
+#line 61 "prep.pgc"
{ ECPGdisconnect(__LINE__, name);
-#line 60 "prep.pgc"
+#line 62 "prep.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 60 "prep.pgc"
+#line 62 "prep.pgc"
return 0;
#endif
{ ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0);
-#line 74 "prep.pgc"
+#line 76 "prep.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 74 "prep.pgc"
+#line 76 "prep.pgc"
{ ECPGsetcommit(__LINE__, "on", NULL);
-#line 75 "prep.pgc"
+#line 77 "prep.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 75 "prep.pgc"
+#line 77 "prep.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "drop table if exists T", ECPGt_EOIT, ECPGt_EORT);
-#line 76 "prep.pgc"
+#line 78 "prep.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 76 "prep.pgc"
+#line 78 "prep.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table T ( i int )", ECPGt_EOIT, ECPGt_EORT);
-#line 77 "prep.pgc"
+#line 79 "prep.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 77 "prep.pgc"
+#line 79 "prep.pgc"
{ ECPGdisconnect(__LINE__, "CURRENT");
-#line 78 "prep.pgc"
+#line 80 "prep.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 78 "prep.pgc"
+#line 80 "prep.pgc"
#ifdef WIN32
{
long threadnum = (long)arg;
-#ifdef WIN32
- _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
-#endif
-
/* exec sql begin declare section */
-#line 107 "thread.pgc"
+#line 103 "thread.pgc"
int l_i ;
-#line 108 "thread.pgc"
+#line 104 "thread.pgc"
char l_connection [ 128 ] ;
/* exec sql end declare section */
-#line 109 "thread.pgc"
+#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);
#endif
/* exec sql whenever sqlerror sqlprint ; */
-#line 117 "thread.pgc"
+#line 119 "thread.pgc"
{ ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , l_connection, 0);
-#line 118 "thread.pgc"
+#line 120 "thread.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 118 "thread.pgc"
+#line 120 "thread.pgc"
if( sqlca.sqlcode != 0 )
{
return( NULL );
}
{ ECPGtrans(__LINE__, l_connection, "begin");
-#line 124 "thread.pgc"
+#line 126 "thread.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 124 "thread.pgc"
+#line 126 "thread.pgc"
/* insert into test_thread table */
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 129 "thread.pgc"
+#line 131 "thread.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 129 "thread.pgc"
+#line 131 "thread.pgc"
if( sqlca.sqlcode != 0 )
printf("%s: ERROR: insert failed!\n", l_connection);
/* all done */
{ ECPGtrans(__LINE__, l_connection, "commit");
-#line 135 "thread.pgc"
+#line 137 "thread.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 135 "thread.pgc"
+#line 137 "thread.pgc"
{ ECPGdisconnect(__LINE__, l_connection);
-#line 136 "thread.pgc"
+#line 138 "thread.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 136 "thread.pgc"
+#line 138 "thread.pgc"
return( NULL );
}
{
long threadnum = (long)arg;
-#ifdef WIN32
- _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
-#endif
-
/* exec sql begin declare section */
-#line 108 "thread_implicit.pgc"
+#line 104 "thread_implicit.pgc"
int l_i ;
-#line 109 "thread_implicit.pgc"
+#line 105 "thread_implicit.pgc"
char l_connection [ 128 ] ;
/* exec sql end declare section */
-#line 110 "thread_implicit.pgc"
+#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);
#endif
/* exec sql whenever sqlerror sqlprint ; */
-#line 118 "thread_implicit.pgc"
+#line 120 "thread_implicit.pgc"
{ ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , l_connection, 0);
-#line 119 "thread_implicit.pgc"
+#line 121 "thread_implicit.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 119 "thread_implicit.pgc"
+#line 121 "thread_implicit.pgc"
if( sqlca.sqlcode != 0 )
{
return( NULL );
}
{ ECPGtrans(__LINE__, NULL, "begin");
-#line 125 "thread_implicit.pgc"
+#line 127 "thread_implicit.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 125 "thread_implicit.pgc"
+#line 127 "thread_implicit.pgc"
/* insert into test_thread table */
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 130 "thread_implicit.pgc"
+#line 132 "thread_implicit.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 130 "thread_implicit.pgc"
+#line 132 "thread_implicit.pgc"
if( sqlca.sqlcode != 0 )
printf("%s: ERROR: insert failed!\n", l_connection);
/* all done */
{ ECPGtrans(__LINE__, NULL, "commit");
-#line 136 "thread_implicit.pgc"
+#line 138 "thread_implicit.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 136 "thread_implicit.pgc"
+#line 138 "thread_implicit.pgc"
{ ECPGdisconnect(__LINE__, l_connection);
-#line 137 "thread_implicit.pgc"
+#line 139 "thread_implicit.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
-#line 137 "thread_implicit.pgc"
+#line 139 "thread_implicit.pgc"
return( NULL );
}
{
int i;
-#ifdef WIN32
- _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
-#endif
-
EXEC SQL BEGIN DECLARE SECTION;
int value;
char name[100];
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);
int i;
#ifdef WIN32
+#ifdef _MSC_VER /* requires MSVC */
_configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
+#endif
#endif
for (i = 1; i <= REPEATS; ++i)
{
int i;
-#ifdef WIN32
- _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
-#endif
-
EXEC SQL BEGIN DECLARE SECTION;
int value;
char name[100];
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);
{
long threadnum = (long)arg;
-#ifdef WIN32
- _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
-#endif
-
EXEC SQL BEGIN DECLARE SECTION;
int l_i;
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);
{
long threadnum = (long)arg;
-#ifdef WIN32
- _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
-#endif
-
EXEC SQL BEGIN DECLARE SECTION;
int l_i;
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);