Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3cda980

Browse files
author
Michael Meskes
committed
Fixed error handling in Informix compat str to date conversion.
1 parent34e9ab0 commit3cda980

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

‎src/interfaces/ecpg/ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1675,6 +1675,10 @@ Mon Oct 6 08:41:45 CEST 2003
16751675
- Fixed constant listing in execute using clause.
16761676
- Fixed typo in ecpg for Informix dec_t type.
16771677
- Fixed precision handling in Informix compat funxtions.
1678+
1679+
Tue Oct 7 07:45:09 CEST 2003
1680+
1681+
- Fixed error handling in rstrdate.
16781682
- Set ecpg version to 3.0.0
16791683
- Set ecpg library to 4.0.0
16801684
- Set pgtypes library to 1.0.0

‎src/interfaces/ecpg/compatlib/informix.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ rstrdate(char *str, date * d)
436436
{
437437
datedat=PGTYPESdate_from_asc(str,NULL);
438438

439-
if (errno!=PGTYPES_DATE_BAD_DATE&&dat==0)
439+
if (errno&&errno!=PGTYPES_DATE_BAD_DATE)
440440
returnECPG_INFORMIX_BAD_DATE;
441441

442442
*d=dat;

‎src/interfaces/ecpg/pgtypeslib/datetime.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ PGTYPESdate_from_asc(char *str, char **endptr)
5353
if (strlen(str) >=sizeof(lowstr))
5454
{
5555
errno=PGTYPES_DATE_BAD_DATE;
56-
return0;
56+
returnINT_MIN;
5757
}
5858

5959
if ((ParseDateTime(str,lowstr,field,ftype,MAXDATEFIELDS,&nf,ptr)!=0)
6060
|| (DecodeDateTime(field,ftype,nf,&dtype,tm,&fsec,&tzp,EuroDates)!=0))
6161
{
6262
errno=PGTYPES_DATE_BAD_DATE;
63-
return0;
63+
returnINT_MIN;
6464
}
6565

6666
switch (dtype)
@@ -74,7 +74,7 @@ PGTYPESdate_from_asc(char *str, char **endptr)
7474

7575
default:
7676
errno=PGTYPES_DATE_BAD_DATE;
77-
return-1;
77+
returnINT_MIN;
7878
}
7979

8080
dDate= (date2j(tm->tm_year,tm->tm_mon,tm->tm_mday)-date2j(2000,1,1));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp