[OpenSER-Devel] Date Format in db_time2str / db_str2time [db_ut]

Henning Westerholt henning.westerholt at 1und1.de
Mon Nov 5 13:51:48 UTC 2007


On Monday 05 November 2007, Will Quan wrote:
> Greetings,
> In db_time2str() the date is formatted and wrapped in single-quotes like
> this:
> '2007-10-31 12:00:00'
>
> However the inverse function db_str2time does not contain these
> single-quotes in the format string.
> As if its expecting the date without the single-quotes.
> 2007-10-31 12:00:00
>
> Could we modify the later to include the single ticks in the parse string?
> (Or alternately, modify db_time2str to not wrap the date in single-quotes.)
>
> Currently, the db_berkeley module is invoking db_str2time with the
> surrounding single quotes and this creates a core dump from inside
> strptime.

Hello Will,

good catch. The function db_time2str() should not include the single-quotes. 
I've copied this implementation (in rev 2157) from mysql. The postgresql 
driver does not had this additional quotes. 

In the mysql driver these additional quotes are removed from the parser i 
guess, so there are not returned for queries.

I'll later fix this.

Cheers,

Henning



More information about the Devel mailing list