mshepanski / quince

QUeries IN C++ Expressions
Boost Software License 1.0
31 stars 18 forks source link

Issue when calls "max" function with posix ptime #5

Closed 3t-dev closed 9 years ago

3t-dev commented 9 years ago

Dear @mshepanski,

In the lastest quince version, it work well all of basic CRID operators vs column type timestamp mapping with posix ptime.

Unfortunately, I want to select value in range by min, max function. It work with primary type, eg: int, string, ... but throw exception with posix ptime type. exception msg is: "expected column of type 7, received type was 8"

I guests that result of sql max is timestamp and it not jet convert to string in order to map with posix ptime.

My function call: quince::queryboost::optional maxTimes = table->select(quince::max((*table)->last_update)); maxTimes has 1 item but when call maxTimes.begin() it throw above exception.

Please consider and help me resolve this issue.

Thanks you.

mshepanski commented 9 years ago

Hi trinhthetranh,

This is just a quick reply to say I've seen your email and I will get onto the problem over the next week.

Regards, --- Michael

Michael Shepanski Be a philosopher for a day: visit http://stepbackstepforward.com

On 14 Aug 2015, at 12:47 pm, trinhthethanh notifications@github.com wrote:

Dear @mshepanski,

In the lastest quince version, it work well all of basic CRID operators vs column type timestamp mapping with posix ptime.

Unfortunately, I want to select value in range by min, max function. It work with primary type, eg: int, string, ... but throw exception with posix ptime type. exception msg is: "expected column of type 7, received type was 8"

I guests that result of sql max is timestamp and it not jet convert to string in order to map with posix ptime.

My function call: quince::queryboost::optionalboost::posix_time::ptime maxTimes = table->select(quince::max((*table)->last_update)); maxTimes has 1 item but when call maxTimes.begin() it throw above exception.

Please consider and help me resolve this issue.

Thanks you.

— Reply to this email directly or view it on GitHub.

mshepanski commented 9 years ago

Okay, I have made a fix on the dev branch. Could you please check that it does what you need, and if it does then I will merge to master.

3t-dev commented 9 years ago

thank for quickly resolve, I'll try to test.

mshepanski commented 9 years ago

Forgot to mention: you will need to pull quince_postgresql (dev branch).

Michael Shepanski Be a philosopher for a day: visit http://stepbackstepforward.com

On 21 Aug 2015, at 10:56 pm, trinhthethanh notifications@github.com wrote:

thank for quickly resolve, I'll try to test.

— Reply to this email directly or view it on GitHub.

mshepanski commented 9 years ago

I have merged the fix to the master branch of quince_postgresql, and I'm going to close the issue now. Please reopen it if you disagree.