Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
3f7e1e4b
Commit
3f7e1e4b
authored
Dec 15, 2008
by
Michael Meskes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not try to change a const variable.
parent
301194f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
32 deletions
+33
-32
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/ChangeLog
+4
-0
src/interfaces/ecpg/ecpglib/misc.c
src/interfaces/ecpg/ecpglib/misc.c
+29
-32
No files found.
src/interfaces/ecpg/ChangeLog
View file @
3f7e1e4b
...
...
@@ -2396,6 +2396,10 @@ Wed, 26 Nov 2008 14:09:08 +0100
- When creating a varchar struct name braces must be discarded.
- Applied patch by Ron Mayer <rm_pg@cheapcomplexdevices.com> to merge
the new interval style into ecpg.
Mon, 15 Dec 2008 16:31:31 +0100
- Do not try to change a const variable in ecpg_log.
- Set pgtypes library version to 3.1.
- Set compat library version to 3.1.
- Set ecpg library version to 6.2.
...
...
src/interfaces/ecpg/ecpglib/misc.c
View file @
3f7e1e4b
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.4
4 2008/12/11 07:34:09 petere
Exp $ */
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.4
5 2008/12/15 15:34:07 meskes
Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
...
...
@@ -241,49 +241,46 @@ void
ecpg_log
(
const
char
*
format
,...)
{
va_list
ap
;
struct
sqlca_t
*
sqlca
=
ECPGget_sqlca
();
/* internationalize the error message string */
format
=
ecpg_gettext
(
format
);
if
(
simple_debug
)
{
int
bufsize
=
strlen
(
format
)
+
100
;
char
*
f
=
(
char
*
)
malloc
(
bufsize
);
struct
sqlca_t
*
sqlca
=
ECPGget_sqlca
();
int
bufsize
=
strlen
(
format
)
+
100
;
char
*
f
=
(
char
*
)
malloc
(
bufsize
),
*
intl_format
;
if
(
f
==
NULL
)
return
;
if
(
!
simple_debug
||
f
==
NULL
)
return
;
/*
* regression tests set this environment variable to get the same
* output for every run.
*/
if
(
ecpg_internal_regression_mode
)
snprintf
(
f
,
bufsize
,
"[NO_PID]: %s"
,
format
);
else
snprintf
(
f
,
bufsize
,
"[%d]: %s"
,
(
int
)
getpid
(),
format
);
/* internationalize the error message string */
intl_format
=
ecpg_gettext
(
format
);
/*
* regression tests set this environment variable to get the same
* output for every run.
*/
if
(
ecpg_internal_regression_mode
)
snprintf
(
f
,
bufsize
,
"[NO_PID]: %s"
,
intl_format
);
else
snprintf
(
f
,
bufsize
,
"[%d]: %s"
,
(
int
)
getpid
(),
intl_format
);
#ifdef ENABLE_THREAD_SAFETY
pthread_mutex_lock
(
&
debug_mutex
);
pthread_mutex_lock
(
&
debug_mutex
);
#endif
va_start
(
ap
,
format
);
vfprintf
(
debugstream
,
f
,
ap
);
va_end
(
ap
);
va_start
(
ap
,
format
);
vfprintf
(
debugstream
,
f
,
ap
);
va_end
(
ap
);
/* dump out internal sqlca variables */
if
(
ecpg_internal_regression_mode
)
fprintf
(
debugstream
,
"[NO_PID]: sqlca: code: %ld, state: %s
\n
"
,
sqlca
->
sqlcode
,
sqlca
->
sqlstate
);
/* dump out internal sqlca variables */
if
(
ecpg_internal_regression_mode
)
fprintf
(
debugstream
,
"[NO_PID]: sqlca: code: %ld, state: %s
\n
"
,
sqlca
->
sqlcode
,
sqlca
->
sqlstate
);
fflush
(
debugstream
);
fflush
(
debugstream
);
#ifdef ENABLE_THREAD_SAFETY
pthread_mutex_unlock
(
&
debug_mutex
);
pthread_mutex_unlock
(
&
debug_mutex
);
#endif
free
(
f
);
}
free
(
f
);
}
void
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment