[odb-users] Request return different results if executed in command line

Romain Gros grosr.romain at gmail.com
Mon Dec 22 11:50:40 EST 2014


Hi !

I've been doing some tests and I think I found the problem.

AvailableQuestStep_idCharacter was a static thread_local variable. It seems
that, when entering the ODB generated source (the access::view_traits_impl<
::AvailableQuestStep, id_mysql >::query method), my variable changed value
(like if it as an other thread; I think I didn't get something here, but
anyway).
So I changed it to an extern thread_local variable and everything works
fine !

Thanks a lot !!

Best regards,
Romain

2014-12-15 14:41 GMT+01:00 Boris Kolpackov <boris at codesynthesis.com>:

> Hi Romain,
>
> Romain Gros <grosr.romain at gmail.com> writes:
>
> > I am experiencing this problem on MySQL and PostgreSQL.
>
> If you get the same difference in behavior using both databases then
> there is definitely some logical difference between the two queries
> that you are running. It is very unlikely to be a bug in the runtime
> or a configuration issue.
>
> One thing that you can do is to try to simplify the query by going
> back one step at a time and see where the difference disappears (or
> you get the result that you would expect). For example, remove
> aggregation and see if you get the expected number of rows.
>
> If that doesn't help, then I would need a complete working example
> that reproduces the problem. In the fragments that you have provided
> I don't see anything wrong.
>
>
> > PPS: I had another quick question, is it possible to make sub-queries in
> > the where clause using ODB instead of writing pure sql in the query?
>
> There is no direct support yet but you should be able to write them
> using the mixed style (e.g., using C++ identifier for column names,
> etc).
>
> Boris
>


More information about the odb-users mailing list