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

Commitc1c9b7c

Browse files
author
Michael Meskes
committed
First small patches needed for regression tests
1 parent68dfef0 commitc1c9b7c

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

‎src/interfaces/ecpg/ecpglib/misc.c

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.27 2006/06/21 11:38:07 meskes Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.28 2006/07/31 10:15:30 meskes Exp $ */
22

33
#definePOSTGRES_ECPG_INTERNAL
44
#include"postgres_fe.h"
@@ -246,7 +246,8 @@ ECPGlog(const char *format,...)
246246

247247
if (simple_debug)
248248
{
249-
char*f= (char*)malloc(strlen(format)+100);
249+
intbufsize=strlen(format)+100;
250+
char*f= (char*)malloc(bufsize);
250251

251252
if (f==NULL)
252253
{
@@ -256,11 +257,24 @@ ECPGlog(const char *format,...)
256257
return;
257258
}
258259

259-
sprintf(f,"[%d]: %s", (int)getpid(),format);
260+
/*
261+
* regression tests set this environment variable to get the same
262+
* output for every run.
263+
*/
264+
if (getenv("ECPG_DONT_LOG_PID"))
265+
snprintf(f,bufsize,"[NO_PID]: %s",format);
266+
else
267+
snprintf(f,bufsize,"[%d]: %s", (int)getpid(),format);
260268

261269
va_start(ap,format);
262270
vfprintf(debugstream,f,ap);
263271
va_end(ap);
272+
273+
/* dump out internal sqlca variables */
274+
if (getenv("ECPG_DONT_LOG_PID"))
275+
fprintf(debugstream,"[NO_PID]: sqlca: code: %ld, state: %s\n",
276+
sqlca.sqlcode,sqlca.sqlstate);
277+
264278
fflush(debugstream);
265279

266280
ECPGfree(f);

‎src/interfaces/ecpg/include/sqlca.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#endif/* __CYGWIN__ */
1010
#endif/* DLLIMPORT */
1111

12-
#defineSQLERRMC_LEN70
12+
#defineSQLERRMC_LEN150
1313

1414
#ifdef__cplusplus
1515
extern"C"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp