Hi Ben,

I'm on vacation now so I cannot test it, but from your description it seems
that MySQL starting with 5.5 stopped accepting

truncate 'test_table'

instead of

truncate test_table

since the variant with soci::use() escapes and quotes the string.  I don't
see any way of fixing it since I can hardly stop quoting the all strings
passed to use(), and it would be very hard to parse the queries to decide
whether the string is a table name or something else.

Thanks,

Aleksander


On Wed, Aug 14, 2013 at 12:13 PM, Benedikt Greipl <
[email protected]> wrote:

> Hello Pawel,
>
> I have a question on soci. Sorry for contacting you directly, but I
> didn't find help elsewhere ...
>
> After an update to Ubuntu 13.04 and MySQL 5.5, when I do
>
>         soci::session sql;
>         string table = "test_table"
>         sql << "truncate :table", soci::use(table);
>
> soci throws an error that the SQL-Syntax isn't correct.
> However,
>
>         sql << "truncate " + table;
>
> works fine.
>
> What's going on here? I'd really appreciate any help! Thank you!
>
> Cheers,
>
> Ben
>
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to