You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@bloodhound.apache.org by Tim Tisdall <ti...@gmail.com> on 2015/03/26 17:56:12 UTC

/products page error

After upgrading from 0.7 to 0.8 my /products page says:

ProgrammingError: (1064, "You have an error in your SQL syntax; check
the manual that corresponds to your MySQL server version for the right
syntax to use near 'option='icon'' at line 3")

After many many many tries on the demo site I managed to get that page
to load with no issue, so I suspect there's something not right with
just my environment.

Unfortunately I'm not sure how to get the whole SQL query but it
starts with "\n SELECT product, value FROM
bloodhound_productconfig\n".

Re: /products page error

Posted by Ryan Ollos <ry...@gmail.com>.
On Thu, Mar 26, 2015 at 10:10 AM, Tim Tisdall <ti...@gmail.com> wrote:

> That didn't seem to have made a difference.  Where would the logging
> messages appear?
>

The messages would appear in trac.log, provided you've set the [logging]
log_level = DEBUG. Sorry about omitting that detail earlier.


> I think I figured it out, though...
>
> mysql> select * from bloodhound_productconfig where option='whut';
> ERROR 1064 (42000): You have an error in your SQL syntax; check the
> manual that corresponds to your MySQL server version for the right
> syntax to use near 'option='whut'' at line 1
> mysql> select * from bloodhound_productconfig where `option`='whut';
> Empty set (0.00 sec)
>
> mysql> select * from bloodhound_productconfig where
> bloodhound_productconfig.option='whut';
> Empty set (0.00 sec)
>
>
> It seems the "option" part is a keyword or something in mysql and
> needs to be properly escaped or qualified.  Seems like an easy
> patch...


Looks like you are correct. Good find. I'll try to push a fix this evening.

https://dev.mysql.com/doc/refman/5.6/en/reserved-words.html

Re: /products page error

Posted by Tim Tisdall <ti...@gmail.com>.
That didn't seem to have made a difference.  Where would the logging
messages appear?

I think I figured it out, though...

mysql> select * from bloodhound_productconfig where option='whut';
ERROR 1064 (42000): You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near 'option='whut'' at line 1
mysql> select * from bloodhound_productconfig where `option`='whut';
Empty set (0.00 sec)

mysql> select * from bloodhound_productconfig where
bloodhound_productconfig.option='whut';
Empty set (0.00 sec)


It seems the "option" part is a keyword or something in mysql and
needs to be properly escaped or qualified.  Seems like an easy
patch...


On Thu, Mar 26, 2015 at 12:58 PM, Ryan J Ollos <rj...@apache.org> wrote:
> On Thu, Mar 26, 2015 at 9:56 AM, Tim Tisdall <ti...@gmail.com> wrote:
>>
>> After upgrading from 0.7 to 0.8 my /products page says:
>>
>> ProgrammingError: (1064, "You have an error in your SQL syntax; check
>> the manual that corresponds to your MySQL server version for the right
>> syntax to use near 'option='icon'' at line 3")
>>
>> After many many many tries on the demo site I managed to get that page
>> to load with no issue, so I suspect there's something not right with
>> just my environment.
>>
>> Unfortunately I'm not sure how to get the whole SQL query but it
>> starts with "\n SELECT product, value FROM
>> bloodhound_productconfig\n".
>
>
> Setting [trac] debug_sql = true might provide more info.
>
> http://trac.edgewall.org/wiki/TracIni#trac-section

Re: /products page error

Posted by Ryan J Ollos <rj...@apache.org>.
On Thu, Mar 26, 2015 at 9:56 AM, Tim Tisdall <ti...@gmail.com> wrote:

> After upgrading from 0.7 to 0.8 my /products page says:
>
> ProgrammingError: (1064, "You have an error in your SQL syntax; check
> the manual that corresponds to your MySQL server version for the right
> syntax to use near 'option='icon'' at line 3")
>
> After many many many tries on the demo site I managed to get that page
> to load with no issue, so I suspect there's something not right with
> just my environment.
>
> Unfortunately I'm not sure how to get the whole SQL query but it
> starts with "\n SELECT product, value FROM
> bloodhound_productconfig\n".
>

Setting [trac] debug_sql = true might provide more info.

http://trac.edgewall.org/wiki/TracIni#trac-section