Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite3565fd

Browse files
committed
Remove _configthreadlocale() calls in ecpg test suite.
This essentially reverts commitsa772624 and04fbe0e, whichadded "_configthreadlocale(_ENABLE_PER_THREAD_LOCALE)" calls to thethread-related ecpg test programs. That was nothing but a hack,because we shouldn't expect that ecpg-using applications havedone that for us; and now that we've inserted such calls intoecpglib, 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 theback branches.Discussion:https://postgr.es/m/22937.1548307384@sss.pgh.pa.us
1 parentd5a1fde commite3565fd

File tree

10 files changed

+58
-118
lines changed

10 files changed

+58
-118
lines changed

‎src/interfaces/ecpg/test/expected/thread-alloc.c

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -145,48 +145,42 @@ static void* fn(void* arg)
145145
#line 43 "alloc.pgc"
146146

147147

148-
#ifdefWIN32
149-
#ifdef_MSC_VER/* requires MSVC */
150-
_configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
151-
#endif
152-
#endif
153-
154148
value= (long)arg;
155149
sprintf(name,"Connection: %d",value);
156150

157151
{ECPGconnect(__LINE__,0,"ecpg1_regression" ,NULL,NULL ,name,0);
158-
#line54 "alloc.pgc"
152+
#line48 "alloc.pgc"
159153

160154
if (sqlca.sqlcode<0)sqlprint();}
161-
#line54 "alloc.pgc"
155+
#line48 "alloc.pgc"
162156

163157
{ECPGsetcommit(__LINE__,"on",NULL);
164-
#line55 "alloc.pgc"
158+
#line49 "alloc.pgc"
165159

166160
if (sqlca.sqlcode<0)sqlprint();}
167-
#line55 "alloc.pgc"
161+
#line49 "alloc.pgc"
168162

169163
for (i=1;i <=REPEATS;++i)
170164
{
171165
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"select relname from pg_class where relname = 'pg_class'",ECPGt_EOIT,
172166
ECPGt_char,&(r),(long)0,(long)0,(1)*sizeof(char),
173167
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EORT);
174-
#line58 "alloc.pgc"
168+
#line52 "alloc.pgc"
175169

176170
if (sqlca.sqlcode==ECPG_NOT_FOUND)sqlprint();
177-
#line58 "alloc.pgc"
171+
#line52 "alloc.pgc"
178172

179173
if (sqlca.sqlcode<0)sqlprint();}
180-
#line58 "alloc.pgc"
174+
#line52 "alloc.pgc"
181175

182176
free(r);
183177
r=NULL;
184178
}
185179
{ECPGdisconnect(__LINE__,name);
186-
#line62 "alloc.pgc"
180+
#line56 "alloc.pgc"
187181

188182
if (sqlca.sqlcode<0)sqlprint();}
189-
#line62 "alloc.pgc"
183+
#line56 "alloc.pgc"
190184

191185

192186
return0;

‎src/interfaces/ecpg/test/expected/thread-descriptor.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,25 +108,19 @@ static void* fn(void* arg)
108108
{
109109
inti;
110110

111-
#ifdefWIN32
112-
#ifdef_MSC_VER/* requires MSVC */
113-
_configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
114-
#endif
115-
#endif
116-
117111
for (i=1;i <=REPEATS;++i)
118112
{
119113
ECPGallocate_desc(__LINE__,"mydesc");
120-
#line36 "descriptor.pgc"
114+
#line30 "descriptor.pgc"
121115

122116
if (sqlca.sqlcode<0)sqlprint();
123-
#line36 "descriptor.pgc"
117+
#line30 "descriptor.pgc"
124118

125119
ECPGdeallocate_desc(__LINE__,"mydesc");
126-
#line37 "descriptor.pgc"
120+
#line31 "descriptor.pgc"
127121

128122
if (sqlca.sqlcode<0)sqlprint();
129-
#line37 "descriptor.pgc"
123+
#line31 "descriptor.pgc"
130124

131125
}
132126

‎src/interfaces/ecpg/test/expected/thread-prep.c

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -145,58 +145,52 @@ static void* fn(void* arg)
145145
#line 43 "prep.pgc"
146146

147147

148-
#ifdefWIN32
149-
#ifdef_MSC_VER/* requires MSVC */
150-
_configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
151-
#endif
152-
#endif
153-
154148
value= (long)arg;
155149
sprintf(name,"Connection: %d",value);
156150

157151
{ECPGconnect(__LINE__,0,"ecpg1_regression" ,NULL,NULL ,name,0);
158-
#line54 "prep.pgc"
152+
#line48 "prep.pgc"
159153

160154
if (sqlca.sqlcode<0)sqlprint();}
161-
#line54 "prep.pgc"
155+
#line48 "prep.pgc"
162156

163157
{ECPGsetcommit(__LINE__,"on",NULL);
164-
#line55 "prep.pgc"
158+
#line49 "prep.pgc"
165159

166160
if (sqlca.sqlcode<0)sqlprint();}
167-
#line55 "prep.pgc"
161+
#line49 "prep.pgc"
168162

169163
for (i=1;i <=REPEATS;++i)
170164
{
171165
{ECPGprepare(__LINE__,NULL,0,"i",query);
172-
#line58 "prep.pgc"
166+
#line52 "prep.pgc"
173167

174168
if (sqlca.sqlcode<0)sqlprint();}
175-
#line58 "prep.pgc"
169+
#line52 "prep.pgc"
176170

177171
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_execute,"i",
178172
ECPGt_int,&(value),(long)1,(long)1,sizeof(int),
179173
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EOIT,ECPGt_EORT);
180-
#line59 "prep.pgc"
174+
#line53 "prep.pgc"
181175

182176
if (sqlca.sqlcode==ECPG_NOT_FOUND)sqlprint();
183-
#line59 "prep.pgc"
177+
#line53 "prep.pgc"
184178

185179
if (sqlca.sqlcode<0)sqlprint();}
186-
#line59 "prep.pgc"
180+
#line53 "prep.pgc"
187181

188182
}
189183
{ECPGdeallocate(__LINE__,0,NULL,"i");
190-
#line61 "prep.pgc"
184+
#line55 "prep.pgc"
191185

192186
if (sqlca.sqlcode<0)sqlprint();}
193-
#line61 "prep.pgc"
187+
#line55 "prep.pgc"
194188

195189
{ECPGdisconnect(__LINE__,name);
196-
#line62 "prep.pgc"
190+
#line56 "prep.pgc"
197191

198192
if (sqlca.sqlcode<0)sqlprint();}
199-
#line62 "prep.pgc"
193+
#line56 "prep.pgc"
200194

201195

202196
return0;
@@ -212,34 +206,34 @@ int main ()
212206
#endif
213207

214208
{ECPGconnect(__LINE__,0,"ecpg1_regression" ,NULL,NULL ,NULL,0);
215-
#line76 "prep.pgc"
209+
#line70 "prep.pgc"
216210

217211
if (sqlca.sqlcode<0)sqlprint();}
218-
#line76 "prep.pgc"
212+
#line70 "prep.pgc"
219213

220214
{ECPGsetcommit(__LINE__,"on",NULL);
221-
#line77 "prep.pgc"
215+
#line71 "prep.pgc"
222216

223217
if (sqlca.sqlcode<0)sqlprint();}
224-
#line77 "prep.pgc"
218+
#line71 "prep.pgc"
225219

226220
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"drop table if exists T",ECPGt_EOIT,ECPGt_EORT);
227-
#line78 "prep.pgc"
221+
#line72 "prep.pgc"
228222

229223
if (sqlca.sqlcode<0)sqlprint();}
230-
#line78 "prep.pgc"
224+
#line72 "prep.pgc"
231225

232226
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"create table T ( i int )",ECPGt_EOIT,ECPGt_EORT);
233-
#line79 "prep.pgc"
227+
#line73 "prep.pgc"
234228

235229
if (sqlca.sqlcode<0)sqlprint();}
236-
#line79 "prep.pgc"
230+
#line73 "prep.pgc"
237231

238232
{ECPGdisconnect(__LINE__,"CURRENT");
239-
#line80 "prep.pgc"
233+
#line74 "prep.pgc"
240234

241235
if (sqlca.sqlcode<0)sqlprint();}
242-
#line80 "prep.pgc"
236+
#line74 "prep.pgc"
243237

244238

245239
#ifdefWIN32

‎src/interfaces/ecpg/test/expected/thread-thread.c

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -153,37 +153,31 @@ void *test_thread(void *arg)
153153
#line 105 "thread.pgc"
154154

155155

156-
#ifdefWIN32
157-
#ifdef_MSC_VER/* requires MSVC */
158-
_configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
159-
#endif
160-
#endif
161-
162156
/* build up connection name, and connect to database */
163157
#ifndef_MSC_VER
164158
snprintf(l_connection,sizeof(l_connection),"thread_%03ld",threadnum);
165159
#else
166160
_snprintf(l_connection,sizeof(l_connection),"thread_%03ld",threadnum);
167161
#endif
168162
/* exec sql whenever sqlerror sqlprint ; */
169-
#line119 "thread.pgc"
163+
#line113 "thread.pgc"
170164

171165
{ECPGconnect(__LINE__,0,"ecpg1_regression" ,NULL,NULL ,l_connection,0);
172-
#line120 "thread.pgc"
166+
#line114 "thread.pgc"
173167

174168
if (sqlca.sqlcode<0)sqlprint();}
175-
#line120 "thread.pgc"
169+
#line114 "thread.pgc"
176170

177171
if(sqlca.sqlcode!=0 )
178172
{
179173
printf("%s: ERROR: cannot connect to database!\n",l_connection);
180174
returnNULL;
181175
}
182176
{ECPGtrans(__LINE__,l_connection,"begin");
183-
#line126 "thread.pgc"
177+
#line120 "thread.pgc"
184178

185179
if (sqlca.sqlcode<0)sqlprint();}
186-
#line126 "thread.pgc"
180+
#line120 "thread.pgc"
187181

188182

189183
/* insert into test_thread table */
@@ -194,27 +188,27 @@ if (sqlca.sqlcode < 0) sqlprint();}
194188
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,
195189
ECPGt_int,&(l_i),(long)1,(long)1,sizeof(int),
196190
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EOIT,ECPGt_EORT);
197-
#line131 "thread.pgc"
191+
#line125 "thread.pgc"
198192

199193
if (sqlca.sqlcode<0)sqlprint();}
200-
#line131 "thread.pgc"
194+
#line125 "thread.pgc"
201195

202196
if(sqlca.sqlcode!=0 )
203197
printf("%s: ERROR: insert failed!\n",l_connection);
204198
}
205199

206200
/* all done */
207201
{ECPGtrans(__LINE__,l_connection,"commit");
208-
#line137 "thread.pgc"
202+
#line131 "thread.pgc"
209203

210204
if (sqlca.sqlcode<0)sqlprint();}
211-
#line137 "thread.pgc"
205+
#line131 "thread.pgc"
212206

213207
{ECPGdisconnect(__LINE__,l_connection);
214-
#line138 "thread.pgc"
208+
#line132 "thread.pgc"
215209

216210
if (sqlca.sqlcode<0)sqlprint();}
217-
#line138 "thread.pgc"
211+
#line132 "thread.pgc"
218212

219213
returnNULL;
220214
}

‎src/interfaces/ecpg/test/expected/thread-thread_implicit.c

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -154,37 +154,31 @@ void *test_thread(void *arg)
154154
#line 106 "thread_implicit.pgc"
155155

156156

157-
#ifdefWIN32
158-
#ifdef_MSC_VER/* requires MSVC */
159-
_configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
160-
#endif
161-
#endif
162-
163157
/* build up connection name, and connect to database */
164158
#ifndef_MSC_VER
165159
snprintf(l_connection,sizeof(l_connection),"thread_%03ld",threadnum);
166160
#else
167161
_snprintf(l_connection,sizeof(l_connection),"thread_%03ld",threadnum);
168162
#endif
169163
/* exec sql whenever sqlerror sqlprint ; */
170-
#line120 "thread_implicit.pgc"
164+
#line114 "thread_implicit.pgc"
171165

172166
{ECPGconnect(__LINE__,0,"ecpg1_regression" ,NULL,NULL ,l_connection,0);
173-
#line121 "thread_implicit.pgc"
167+
#line115 "thread_implicit.pgc"
174168

175169
if (sqlca.sqlcode<0)sqlprint();}
176-
#line121 "thread_implicit.pgc"
170+
#line115 "thread_implicit.pgc"
177171

178172
if(sqlca.sqlcode!=0 )
179173
{
180174
printf("%s: ERROR: cannot connect to database!\n",l_connection);
181175
returnNULL;
182176
}
183177
{ECPGtrans(__LINE__,NULL,"begin");
184-
#line127 "thread_implicit.pgc"
178+
#line121 "thread_implicit.pgc"
185179

186180
if (sqlca.sqlcode<0)sqlprint();}
187-
#line127 "thread_implicit.pgc"
181+
#line121 "thread_implicit.pgc"
188182

189183

190184
/* insert into test_thread table */
@@ -195,27 +189,27 @@ if (sqlca.sqlcode < 0) sqlprint();}
195189
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,
196190
ECPGt_int,&(l_i),(long)1,(long)1,sizeof(int),
197191
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EOIT,ECPGt_EORT);
198-
#line132 "thread_implicit.pgc"
192+
#line126 "thread_implicit.pgc"
199193

200194
if (sqlca.sqlcode<0)sqlprint();}
201-
#line132 "thread_implicit.pgc"
195+
#line126 "thread_implicit.pgc"
202196

203197
if(sqlca.sqlcode!=0 )
204198
printf("%s: ERROR: insert failed!\n",l_connection);
205199
}
206200

207201
/* all done */
208202
{ECPGtrans(__LINE__,NULL,"commit");
209-
#line138 "thread_implicit.pgc"
203+
#line132 "thread_implicit.pgc"
210204

211205
if (sqlca.sqlcode<0)sqlprint();}
212-
#line138 "thread_implicit.pgc"
206+
#line132 "thread_implicit.pgc"
213207

214208
{ECPGdisconnect(__LINE__,l_connection);
215-
#line139 "thread_implicit.pgc"
209+
#line133 "thread_implicit.pgc"
216210

217211
if (sqlca.sqlcode<0)sqlprint();}
218-
#line139 "thread_implicit.pgc"
212+
#line133 "thread_implicit.pgc"
219213

220214
returnNULL;
221215
}

‎src/interfaces/ecpg/test/thread/alloc.pgc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,6 @@ static void* fn(void* arg)
4242
char **r = NULL;
4343
EXEC SQL END DECLARE SECTION;
4444

45-
#ifdef WIN32
46-
#ifdef _MSC_VER /* requires MSVC */
47-
_configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
48-
#endif
49-
#endif
50-
5145
value = (long)arg;
5246
sprintf(name, "Connection: %d", value);
5347

‎src/interfaces/ecpg/test/thread/descriptor.pgc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ static void* fn(void* arg)
2525
{
2626
int i;
2727

28-
#ifdef WIN32
29-
#ifdef _MSC_VER /* requires MSVC */
30-
_configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
31-
#endif
32-
#endif
33-
3428
for (i = 1; i <= REPEATS; ++i)
3529
{
3630
EXEC SQL ALLOCATE DESCRIPTOR mydesc;

‎src/interfaces/ecpg/test/thread/prep.pgc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,6 @@ static void* fn(void* arg)
4242
char query[256] = "INSERT INTO T VALUES ( ? )";
4343
EXEC SQL END DECLARE SECTION;
4444

45-
#ifdef WIN32
46-
#ifdef _MSC_VER /* requires MSVC */
47-
_configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
48-
#endif
49-
#endif
50-
5145
value = (long)arg;
5246
sprintf(name, "Connection: %d", value);
5347

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp