[ic] sql query with UNION broken
Bill Carr
bill at worldwideimpact.com
Fri Aug 22 16:43:04 EDT 2003
On Fri, 2003-08-22 at 10:37, Kevin Walsh wrote:
> Jon Jensen [jon at endpoint.com] wrote:
> >
> > Perhaps we should switch the logic of the test, since UPDATE statements
> > will be more homogeneous than SELECTs and also much rarer:
> >
> > $update = 1 if $query =~ /^\s*update\s+/i;
> >
> > But that would mess up DELETE, DROP INDEX/TABLE, CREATE INDEX/TABLE, etc.
> > So maybe just a minor correction would be better:
> >
> > $update = 1 if $query !~ /^\s*\W*\s*select\s+/i;
> >
> The second correction is better, in my opinion. There is only one
> SELECT statement, while there are loads of statements that would need
> $update to be set.
>
> I suggest a minor correction to your second proposal, as follows:
>
> $update = 1 if $query !~ /^[\s\W]*select\s+/i;
>
> That would allow multiple opening parentheses (with or without
> whitespace between) before the SELECT.
This change works me. Thank you very much for the prompt and easy
solution.
--
Bill Carr
Worldwide Impact
bill at worldwideimpact.com
413-253-6700
More information about the interchange-users
mailing list