mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
Fixed bug in %s handling.
This commit is contained in:
@ -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 351 "dt_test.pgc"
|
||||
#line 358 "dt_test.pgc"
|
||||
|
||||
if (sqlca.sqlcode < 0) sqlprint ( );}
|
||||
#line 351 "dt_test.pgc"
|
||||
#line 358 "dt_test.pgc"
|
||||
|
||||
{ ECPGdisconnect(__LINE__, "CURRENT");
|
||||
#line 352 "dt_test.pgc"
|
||||
#line 359 "dt_test.pgc"
|
||||
|
||||
if (sqlca.sqlcode < 0) sqlprint ( );}
|
||||
#line 352 "dt_test.pgc"
|
||||
#line 359 "dt_test.pgc"
|
||||
|
||||
|
||||
return (0);
|
||||
|
@ -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 351: action "rollback"; connection "regress1"
|
||||
[NO_PID]: ECPGtrans on line 358: 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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user