Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework datetime/date conversion routines.
The former coding was far too careless while converting PostgreSQL temporal values into Informix datum like date or datetime. The biggest problem was that the former coding treated Informix DATE and DATETIME nearly identical during conversion and fails to distinguish their different binary representation at ESQL/C level. This lead to various confusion, including scribbling beyond allocated memory. Fix this by introducing a routine ifxSetDate() which handles Informix DATE only and leave the work for DATETIME target types to setIfxDateTimestamp(), but preserve the possibility to transform PostgreSQL DATE to Informix DATETIME as well. Another issue was the treatment of microseconds during conversion from a PostgreSQL TIMESTAMP to its ISO string representation. PostgreSQL uses a 6 digit microsecond precision, while Informix only accepts 5 digits. This is a problem when passing a converted ISO string into an Informix conversion routine. We always claimed to *not* support fractions when retrieving temporal values, so omit microseconds fractions from a converted timestamp value and just pass up to milliseconds fractions only.
- Loading branch information