List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:July 29 2009 11:46am
Subject:Re: mysqlpp::Time and negative times
View as plain text  
Adrian Cornish wrote:
> I've tried using mysqlpp::Time for negative times but I just get unsigned
> overflow on the hour field.

Are you talking about time time_t ctor or the h,m,s ctor?

> Is there another type I should be using or does mysqlpp::Time need expanding
> for negative times.

The latter.  Patches thoughtfully considered. :)

>>From mysql docs: TIME
> <>values may range
> from
> '-838:59:59' to '838:59:59'.

Wow, that's pretty random.  I wonder where they came up with those numbers?

If you supply a patch to fix this, I'd just make it use signed 
characters for now.  That's not *quite* an ABI breakage, whereas 
switching to a short would be.  Obviously this is only helpful if you 
only need +/- 5ish days of range.  If you need between 5 and 35 days, no 
such support will appear in MySQL++ before v4.

I've added this to the Wishlist.
mysqlpp::Time and negative timesAdrian Cornish28 Jul
  • Re: mysqlpp::Time and negative timesWarren Young29 Jul
    • Re: mysqlpp::Time and negative timesAdrian Cornish30 Jul
      • Re: mysqlpp::Time and negative timesWarren Young30 Jul