[Templates] bug in Template::Plugin::DBI->execute ?

hugh baker hugh@tao.ca
Fri, 01 Mar 2002 09:44:45 -0500


Lyle Brooks <brooks@deseret.com> writes:

> What flavor and version of database are you using?

i'm using a recent mysql.

> The reason I ask is a question came up on this list a short while back
> that involved sorting and the DBI plugin. 

i saw that in between my initial question and the followup.  is there
any reason that statements that work fine in the sql shell would fail
when used with DBI and TT's plugin to it?

> Just going off memory, I seem to recall that for MySQL (at least some
> versions) the field in the order by clause also had to be selected
> in the query.

i think you are right.

> Just from inspection, it would be hard for the DBI plugin to be guilty of
> this type of bug, as plugin is just a thin wrapper around the DBI interface
> and doesn't seem to get into the business of actually writing the SQL.

okay.  i think needing that extra layer of quoting points to a subtle
reference issue.  it helped when i changed

-	return(@_);
+	return((ref(@_) || @_);

to explicitly dereference plugin's execute method.  this might be more
obvious to people familiar with the underlying perl, but 'twas new to me.

> Just a thought.

thanks.