7 #define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
18 #line 1 "regression.h"
37 #line 14 "dt_test.pgc"
40 #line 15 "dt_test.pgc"
43 #line 16 "dt_test.pgc"
46 #line 17 "dt_test.pgc"
49 #line 18 "dt_test.pgc"
52 int mdy[3] = { 4, 19, 1998 };
54 char *d1 =
"Mon Jan 17 1966";
55 char *t1 =
"2000-7-12 17:34:29";
60 #line 27 "dt_test.pgc"
62 {
ECPGconnect(__LINE__, 0,
"ecpg1_regression" , NULL, NULL , NULL, 0);
63 #line 28 "dt_test.pgc"
66 #line 28 "dt_test.pgc"
69 #line 29 "dt_test.pgc"
72 #line 29 "dt_test.pgc"
75 #line 30 "dt_test.pgc"
78 #line 30 "dt_test.pgc"
81 #line 31 "dt_test.pgc"
84 #line 31 "dt_test.pgc"
90 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"insert into date_test ( d , ts ) values ( $1 , $2 )",
95 #line 36 "dt_test.pgc"
98 #line 36 "dt_test.pgc"
108 #line 38 "dt_test.pgc"
111 #line 38 "dt_test.pgc"
130 printf(
"m: %d, d: %d, y: %d\n", mdy[0], mdy[1], mdy[2]);
132 mdy[0] = mdy[1] = mdy[2] = 0;
134 printf(
"date seems to get encoded to julian %ld\n", date2);
137 printf(
"m: %d, d: %d, y: %d\n", mdy[0], mdy[1], mdy[2]);
141 fmt =
"(ddd), mmm. dd, yyyy, repeat: (ddd), mmm. dd, yyyy. end";
146 printf(
"Above date in format \"%s\" is \"%s\"\n",
fmt, out);
160 in =
"In the year 1995, the month of December, it is the 25th day";
170 fmt =
"mmmm. dd. yyyy";
187 in =
"1995, December 25th";
195 in =
"This is 25th day of December, 1995";
203 in =
"Dec. 25th, 1995";
210 fmt =
"mmm. dd. yyyy";
211 in =
"dec 25th 1995";
218 fmt =
"mmm. dd. yyyy";
234 fmt =
"yyyy fierj mm dd.";
275 printf(
"timestamp_fmt_asc: %d: %s\n",
i, out);
278 fmt =
"This is a %m/%d/%y %H-%Ml%Stest";
279 in =
"This is a 4/12/80 3-39l12test";
282 printf(
"timestamp_defmt_asc(%s, %s) = %s, error: %d\n", in,
fmt,
text,
i);
285 fmt =
"%a %b %d %H:%M:%S %z %Y";
286 in =
"Tue Jul 22 17:28:44 +0200 2003";
289 printf(
"timestamp_defmt_asc(%s, %s) = %s, error: %d\n", in,
fmt,
text,
i);
292 fmt =
"%a %b %d %H:%M:%S %z %Y";
293 in =
"Tue Feb 29 17:28:44 +0200 2000";
296 printf(
"timestamp_defmt_asc(%s, %s) = %s, error: %d\n", in,
fmt,
text,
i);
299 fmt =
"%a %b %d %H:%M:%S %z %Y";
300 in =
"Tue Feb 29 17:28:44 +0200 1900";
303 printf(
"timestamp_defmt_asc(%s, %s) = %s, error (should be error!): %d\n", in,
fmt,
text,
i);
306 fmt =
"%a %b %d %H:%M:%S %z %Y";
307 in =
"Tue Feb 29 17:28:44 +0200 1996";
310 printf(
"timestamp_defmt_asc(%s, %s) = %s, error: %d\n", in,
fmt,
text,
i);
313 fmt =
"%b %d %H:%M:%S %z %Y";
314 in =
" Jul 31 17:28:44 +0200 1996";
317 printf(
"timestamp_defmt_asc(%s, %s) = %s, error: %d\n", in,
fmt,
text,
i);
320 fmt =
"%b %d %H:%M:%S %z %Y";
321 in =
" Jul 32 17:28:44 +0200 1996";
324 printf(
"timestamp_defmt_asc(%s, %s) = %s, error (should be error!): %d\n", in,
fmt,
text,
i);
327 fmt =
"%a %b %d %H:%M:%S %z %Y";
328 in =
"Tue Feb 29 17:28:44 +0200 1997";
331 printf(
"timestamp_defmt_asc(%s, %s) = %s, error (should be error!): %d\n", in,
fmt,
text,
i);
335 in =
"Tue Jul 22 17:28:44 +0200 2003";
338 printf(
"timestamp_defmt_asc(%s, %s) = %s, error (should be error!): %d\n", in,
fmt,
text,
i);
342 in =
"Tue Jul 22 17:28:44 +0200 2003";
345 printf(
"timestamp_defmt_asc(%s, %s) = %s, error (should be error!): %d\n", in,
fmt,
text,
i);
348 fmt =
"%b, %d %H_%M`%S %z %Y";
349 in =
" Jul, 22 17_28 `44 +0200 2003 ";
352 printf(
"timestamp_defmt_asc(%s, %s) = %s, error: %d\n", in,
fmt,
text,
i);
355 fmt =
"%a %b %%%d %H:%M:%S %Z %Y";
356 in =
"Tue Jul %22 17:28:44 CEST 2003";
359 printf(
"timestamp_defmt_asc(%s, %s) = %s, error: %d\n", in,
fmt,
text,
i);
362 fmt =
"%a %b %%%d %H:%M:%S %Z %Y";
363 in =
"Tue Jul %22 17:28:44 CEST 2003";
366 printf(
"timestamp_defmt_asc(%s, %s) = %s, error: %d\n", in,
fmt,
text,
i);
369 fmt =
"abc%n %C %B %%%d %H:%M:%S %Z %Y";
370 in =
"abc\n 19 October %22 17:28:44 CEST 2003";
373 printf(
"timestamp_defmt_asc(%s, %s) = %s, error: %d\n", in,
fmt,
text,
i);
376 fmt =
"abc%n %C %B %%%d %H:%M:%S %Z %y";
377 in =
"abc\n 18 October %34 17:28:44 CEST 80";
380 printf(
"timestamp_defmt_asc(%s, %s) = %s, error (should be error!): %d\n", in,
fmt,
text,
i);
384 in =
"abc\n 18 October %34 17:28:44 CEST 80";
387 printf(
"timestamp_defmt_asc(%s, %s) = %s, error (should be error!): %d\n", in,
fmt,
text,
i);
391 in =
"1980-04-12 3:49:44 ";
394 printf(
"timestamp_defmt_asc(%s, NULL) = %s, error: %d\n", in,
text,
i);
397 fmt =
"%B %d, %Y. Time: %I:%M%p";
398 in =
"July 14, 1988. Time: 9:15am";
401 printf(
"timestamp_defmt_asc(%s, %s) = %s, error: %d\n", in,
fmt,
text,
i);
404 in =
"September 6 at 01:30 pm in the year 1983";
405 fmt =
"%B %d at %I:%M %p in the year %Y";
408 printf(
"timestamp_defmt_asc(%s, %s) = %s, error: %d\n", in,
fmt,
text,
i);
411 in =
" 1976, July 14. Time: 9:15am";
412 fmt =
"%Y, %B %d. Time: %I:%M %p";
415 printf(
"timestamp_defmt_asc(%s, %s) = %s, error: %d\n", in,
fmt,
text,
i);
418 in =
" 1976, July 14. Time: 9:15 am";
419 fmt =
"%Y, %B %d. Time: %I:%M%p";
422 printf(
"timestamp_defmt_asc(%s, %s) = %s, error: %d\n", in,
fmt,
text,
i);
425 in =
" 1976, P.M. July 14. Time: 9:15";
426 fmt =
"%Y, %P %B %d. Time: %I:%M";
429 printf(
"timestamp_defmt_asc(%s, %s) = %s, error: %d\n", in,
fmt,
text,
i);
436 printf(
"timestamp_defmt_asc(%s, %s) = %s, error: %d\n", in,
fmt,
text,
i);
440 fmt =
"%a %b %d %H:%M:%S %Y";
441 in =
"Mon Dec 30 17:28:44 2019";
444 printf(
"timestamp_defmt_asc(%s, %s) = %s, error: %d\n", in,
fmt, out,
i);
448 fmt =
"%a %b %d %H:%M:%S %Y";
449 in =
"Mon December 30 17:28:44 2019";
452 printf(
"timestamp_defmt_asc(%s, %s) = %s, error: %d\n", in,
fmt, out,
i);
456 #line 381 "dt_test.pgc"
459 #line 381 "dt_test.pgc"
462 #line 382 "dt_test.pgc"
465 #line 382 "dt_test.pgc"
bool ECPGdisconnect(int lineno, const char *connection_name)
bool ECPGconnect(int lineno, int c, const char *name, const char *user, const char *passwd, const char *connection_name, int autocommit)
bool ECPGdo(const int lineno, const int compat, const int force_indicator, const char *connection_name, const bool questionmarks, const int st, const char *query,...)
bool ECPGtrans(int lineno, const char *connection_name, const char *transaction)
static void const char * fmt
void PGTYPESchar_free(char *ptr)
date PGTYPESdate_from_timestamp(timestamp dt)
int PGTYPESdate_dayofweek(date dDate)
date PGTYPESdate_from_asc(char *str, char **endptr)
int PGTYPESdate_fmt_asc(date dDate, const char *fmtstring, char *outbuf)
int PGTYPESdate_defmt_asc(date *d, const char *fmt, const char *str)
void PGTYPESdate_julmdy(date jd, int *mdy)
void PGTYPESdate_mdyjul(int *mdy, date *jdate)
char * PGTYPESdate_to_asc(date dDate)
void PGTYPESinterval_free(interval *intvl)
char * PGTYPESinterval_to_asc(interval *span)
int PGTYPESinterval_copy(interval *intvlsrc, interval *intvldest)
interval * PGTYPESinterval_from_asc(char *str, char **endptr)
timestamp PGTYPEStimestamp_from_asc(char *str, char **endptr)
void PGTYPEStimestamp_current(timestamp *ts)
char * PGTYPEStimestamp_to_asc(timestamp tstamp)
int PGTYPEStimestamp_fmt_asc(timestamp *ts, char *output, int str_len, const char *fmtstr)
int PGTYPEStimestamp_defmt_asc(const char *str, const char *fmt, timestamp *d)