mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Applied patch by Ron Mayer <rm_pg@cheapcomplexdevices.com> to merge the new
interval style into ecpg.
This commit is contained in:
@ -77,6 +77,12 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
|
||||
if (sqlca.sqlcode < 0) sqlprint ( );}
|
||||
#line 30 "dt_test.pgc"
|
||||
|
||||
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "set intervalstyle to postgres_verbose", ECPGt_EOIT, ECPGt_EORT);
|
||||
#line 31 "dt_test.pgc"
|
||||
|
||||
if (sqlca.sqlcode < 0) sqlprint ( );}
|
||||
#line 31 "dt_test.pgc"
|
||||
|
||||
|
||||
date1 = PGTYPESdate_from_asc(d1, NULL);
|
||||
ts1 = PGTYPEStimestamp_from_asc(t1, NULL);
|
||||
@ -86,10 +92,10 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
|
||||
ECPGt_timestamp,&(ts1),(long)1,(long)1,sizeof(timestamp),
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
|
||||
#line 35 "dt_test.pgc"
|
||||
#line 36 "dt_test.pgc"
|
||||
|
||||
if (sqlca.sqlcode < 0) sqlprint ( );}
|
||||
#line 35 "dt_test.pgc"
|
||||
#line 36 "dt_test.pgc"
|
||||
|
||||
|
||||
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select * from date_test where d = $1 ",
|
||||
@ -99,10 +105,10 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
|
||||
ECPGt_timestamp,&(ts1),(long)1,(long)1,sizeof(timestamp),
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
|
||||
#line 37 "dt_test.pgc"
|
||||
#line 38 "dt_test.pgc"
|
||||
|
||||
if (sqlca.sqlcode < 0) sqlprint ( );}
|
||||
#line 37 "dt_test.pgc"
|
||||
#line 38 "dt_test.pgc"
|
||||
|
||||
|
||||
text = PGTYPESdate_to_asc(date1);
|
||||
@ -417,16 +423,16 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
|
||||
free(text);
|
||||
|
||||
{ ECPGtrans(__LINE__, NULL, "rollback ");
|
||||
#line 350 "dt_test.pgc"
|
||||
#line 351 "dt_test.pgc"
|
||||
|
||||
if (sqlca.sqlcode < 0) sqlprint ( );}
|
||||
#line 350 "dt_test.pgc"
|
||||
#line 351 "dt_test.pgc"
|
||||
|
||||
{ ECPGdisconnect(__LINE__, "CURRENT");
|
||||
#line 351 "dt_test.pgc"
|
||||
#line 352 "dt_test.pgc"
|
||||
|
||||
if (sqlca.sqlcode < 0) sqlprint ( );}
|
||||
#line 351 "dt_test.pgc"
|
||||
#line 352 "dt_test.pgc"
|
||||
|
||||
|
||||
return (0);
|
||||
|
@ -14,29 +14,35 @@
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ecpg_execute on line 30: OK: SET
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ecpg_execute on line 35: query: insert into date_test ( d , ts ) values ( $1 , $2 ) ; with 2 parameter(s) on connection regress1
|
||||
[NO_PID]: ecpg_execute on line 31: query: set intervalstyle to postgres_verbose; with 0 parameter(s) on connection regress1
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ecpg_execute on line 35: using PQexecParams
|
||||
[NO_PID]: ecpg_execute on line 31: using PQexec
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: free_params on line 35: parameter 1 = 1966-01-17
|
||||
[NO_PID]: ecpg_execute on line 31: OK: SET
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: free_params on line 35: parameter 2 = 2000-07-12 17:34:29
|
||||
[NO_PID]: ecpg_execute on line 36: query: insert into date_test ( d , ts ) values ( $1 , $2 ) ; with 2 parameter(s) on connection regress1
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ecpg_execute on line 35: OK: INSERT 0 1
|
||||
[NO_PID]: ecpg_execute on line 36: using PQexecParams
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ecpg_execute on line 37: query: select * from date_test where d = $1 ; with 1 parameter(s) on connection regress1
|
||||
[NO_PID]: free_params on line 36: parameter 1 = 1966-01-17
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ecpg_execute on line 37: using PQexecParams
|
||||
[NO_PID]: free_params on line 36: parameter 2 = 2000-07-12 17:34:29
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: free_params on line 37: parameter 1 = 1966-01-17
|
||||
[NO_PID]: ecpg_execute on line 36: OK: INSERT 0 1
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ecpg_execute on line 37: correctly got 1 tuples with 2 fields
|
||||
[NO_PID]: ecpg_execute on line 38: query: select * from date_test where d = $1 ; with 1 parameter(s) on connection regress1
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ecpg_get_data on line 37: RESULT: 1966-01-17 offset: -1; array: yes
|
||||
[NO_PID]: ecpg_execute on line 38: using PQexecParams
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ecpg_get_data on line 37: RESULT: 2000-07-12 17:34:29 offset: -1; array: yes
|
||||
[NO_PID]: free_params on line 38: parameter 1 = 1966-01-17
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ECPGtrans on line 350: action "rollback "; connection "regress1"
|
||||
[NO_PID]: ecpg_execute on line 38: correctly got 1 tuples with 2 fields
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ecpg_get_data on line 38: RESULT: 1966-01-17 offset: -1; array: yes
|
||||
[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]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ecpg_finish: connection regress1 closed
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
|
@ -28,6 +28,7 @@ main(void)
|
||||
exec sql connect to REGRESSDB1;
|
||||
exec sql create table date_test (d date, ts timestamp);
|
||||
exec sql set datestyle to iso;
|
||||
exec sql set intervalstyle to postgres_verbose;
|
||||
|
||||
date1 = PGTYPESdate_from_asc(d1, NULL);
|
||||
ts1 = PGTYPEStimestamp_from_asc(t1, NULL);
|
||||
|
Reference in New Issue
Block a user