On Sun, Jun 15, 2003 at 11:06:52AM +1000, Ron Savage wrote:
> Hi Folks
>
> Here's a single error message I've just generated:
> -----><8-----
> [Sun Jun 15 10:39:59 2003] [error] 1516: ModPerl::Registry: [Sun Jun
> 15 10:39:59 2003] -e: Error executing run mode
> 'display_entity_after_search': DBD::mysql::st execute failed: 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
> 'park'%'' at line 1 [for statement ``select entity_id from entity
> where entity_key like '%'park'%''']) at
> C:/Perl/site/lib//MIDS/Database.pm line 333.
> -----><8-----
>
> There are 3 modules contributing to this:
> o ModPerl::Registry
> o CGI::Application
> o DBI
>
> There are 2 changes I'd like to see:
> o One of the modules is inserting a ')' near the end of the message.
> If this is due to DBI, can it be dropped?
Fixed for the next release. Thanks.
> o DBI is inserting 4 gratuitous single-quotes inside the '[]'. My
> feeling is that these don't add clarity, but rather reduce it -
> especially since the SQL itself will often have a number of quotes in
> it, as is the case here. Is it possible these 4 quotes can be
> dropped? I suggest a new ':' and the existing ']' be used as the
> statement delimiters, eg:
> [for statement: select entity_id from entity where entity_key like
> '%'park'%']
Tricky thing here is that with a driver that supports the ParamValues
attribute, and a statement using placeholders then the message may
look like:
[for statement ``select entity_id from entity where entity_key like
'%'park'%' and foo > ?'' with params: 1=42]
I think I'll change the `` and '' to plain double quotes (") as
they are rarely used in standard sql statements... Done.
It'll now look like:
[for Statement "select entity_id from entity where entity_key like
'%'park'%' and foo > ?" with ParamValues: 1=42]
Thanks.
Tim.