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
77ca0453
Commit
77ca0453
authored
Feb 02, 2009
by
Michael Meskes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug in %s handling.
parent
5e21197c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
14 deletions
+29
-14
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/ChangeLog
+4
-0
src/interfaces/ecpg/pgtypeslib/dt_common.c
src/interfaces/ecpg/pgtypeslib/dt_common.c
+5
-9
src/interfaces/ecpg/test/expected/pgtypeslib-dt_test.c
src/interfaces/ecpg/test/expected/pgtypeslib-dt_test.c
+11
-4
src/interfaces/ecpg/test/expected/pgtypeslib-dt_test.stderr
src/interfaces/ecpg/test/expected/pgtypeslib-dt_test.stderr
+1
-1
src/interfaces/ecpg/test/expected/pgtypeslib-dt_test.stdout
src/interfaces/ecpg/test/expected/pgtypeslib-dt_test.stdout
+1
-0
src/interfaces/ecpg/test/pgtypeslib/dt_test.pgc
src/interfaces/ecpg/test/pgtypeslib/dt_test.pgc
+7
-0
No files found.
src/interfaces/ecpg/ChangeLog
View file @
77ca0453
...
...
@@ -2405,6 +2405,10 @@ Wed, 17 Dec 2008 17:49:11 +0100
- Applied patch by ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp> to
fix segfault on non-glibc systems.
Mon, 02 Feb 2009 16:34:53 +0100
- Fixed bug in handling of "%s" pattern in PGTYPEStimestamp_defmt_asc().
- Set pgtypes library version to 3.1.
- Set compat library version to 3.1.
- Set ecpg library version to 6.2.
...
...
src/interfaces/ecpg/pgtypeslib/dt_common.c
View file @
77ca0453
/* $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/dt_common.c,v 1.4
4 2007/11/15 21:14:45 momjian
Exp $ */
/* $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/dt_common.c,v 1.4
5 2009/02/02 15:35:28 meskes
Exp $ */
#include "postgres_fe.h"
...
...
@@ -990,17 +990,13 @@ GetEpochTime(struct tm * tm)
t0
=
gmtime
(
&
epoch
);
tm
->
tm_year
=
t0
->
tm_year
;
tm
->
tm_mon
=
t0
->
tm_mon
;
tm
->
tm_year
=
t0
->
tm_year
+
1900
;
tm
->
tm_mon
=
t0
->
tm_mon
+
1
;
tm
->
tm_mday
=
t0
->
tm_mday
;
tm
->
tm_hour
=
t0
->
tm_hour
;
tm
->
tm_min
=
t0
->
tm_min
;
tm
->
tm_sec
=
t0
->
tm_sec
;
if
(
tm
->
tm_year
<
1900
)
tm
->
tm_year
+=
1900
;
tm
->
tm_mon
++
;
return
;
}
/* GetEpochTime() */
...
...
@@ -2856,8 +2852,8 @@ PGTYPEStimestamp_defmt_scan(char **str, char *fmt, timestamp * d,
time_t
et
=
(
time_t
)
scan_val
.
luint_val
;
tms
=
gmtime
(
&
et
);
*
year
=
tms
->
tm_year
;
*
month
=
tms
->
tm_mon
;
*
year
=
tms
->
tm_year
+
1900
;
*
month
=
tms
->
tm_mon
+
1
;
*
day
=
tms
->
tm_mday
;
*
hour
=
tms
->
tm_hour
;
*
minute
=
tms
->
tm_min
;
...
...
src/interfaces/ecpg/test/expected/pgtypeslib-dt_test.c
View file @
77ca0453
...
...
@@ -422,17 +422,24 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
printf
(
"timestamp_defmt_asc(%s, %s) = %s, error: %d
\n
"
,
in
,
fmt
,
text
,
i
);
free
(
text
);
in
=
"1234567890"
;
fmt
=
"%s"
;
i
=
PGTYPEStimestamp_defmt_asc
(
in
,
fmt
,
&
ts1
);
text
=
PGTYPEStimestamp_to_asc
(
ts1
);
printf
(
"timestamp_defmt_asc(%s, %s) = %s, error: %d
\n
"
,
in
,
fmt
,
text
,
i
);
free
(
text
);
{
ECPGtrans
(
__LINE__
,
NULL
,
"rollback"
);
#line 35
1
"dt_test.pgc"
#line 35
8
"dt_test.pgc"
if
(
sqlca
.
sqlcode
<
0
)
sqlprint
(
);}
#line 35
1
"dt_test.pgc"
#line 35
8
"dt_test.pgc"
{
ECPGdisconnect
(
__LINE__
,
"CURRENT"
);
#line 35
2
"dt_test.pgc"
#line 35
9
"dt_test.pgc"
if
(
sqlca
.
sqlcode
<
0
)
sqlprint
(
);}
#line 35
2
"dt_test.pgc"
#line 35
9
"dt_test.pgc"
return
(
0
);
...
...
src/interfaces/ecpg/test/expected/pgtypeslib-dt_test.stderr
View file @
77ca0453
...
...
@@ -42,7 +42,7 @@
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 38: RESULT: 2000-07-12 17:34:29 offset: -1; array: yes
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGtrans on line 35
1
: action "rollback"; connection "regress1"
[NO_PID]: ECPGtrans on line 35
8
: action "rollback"; connection "regress1"
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection regress1 closed
[NO_PID]: sqlca: code: 0, state: 00000
src/interfaces/ecpg/test/expected/pgtypeslib-dt_test.stdout
View file @
77ca0453
...
...
@@ -46,3 +46,4 @@ timestamp_defmt_asc(September 6 at 01:30 pm in the year 1983, %B %d at %I:%M %p
timestamp_defmt_asc( 1976, July 14. Time: 9:15am, %Y, %B %d. Time: %I:%M %p) = 1976-07-14 09:15:00, error: 0
timestamp_defmt_asc( 1976, July 14. Time: 9:15 am, %Y, %B %d. Time: %I:%M%p) = 1976-07-14 09:15:00, error: 0
timestamp_defmt_asc( 1976, P.M. July 14. Time: 9:15, %Y, %P %B %d. Time: %I:%M) = 1976-07-14 21:15:00, error: 0
timestamp_defmt_asc(1234567890, %s) = 2009-02-13 23:31:30, error: 0
src/interfaces/ecpg/test/pgtypeslib/dt_test.pgc
View file @
77ca0453
...
...
@@ -348,6 +348,13 @@ main(void)
printf("timestamp_defmt_asc(%s, %s) = %s, error: %d\n", in, fmt, text, i);
free(text);
in = "1234567890";
fmt = "%s";
i = PGTYPEStimestamp_defmt_asc(in, fmt, &ts1);
text = PGTYPEStimestamp_to_asc(ts1);
printf("timestamp_defmt_asc(%s, %s) = %s, error: %d\n", in, fmt, text, i);
free(text);
exec sql rollback;
exec sql disconnect;
...
...
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