Re: adding bug info infront of sql query
| From: | Daniel Convissor | Date: | Mon, 12 Jan 2004 18:29:28 +0000 |
| Subject: | Re: adding bug info infront of sql query | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-25010@lists.php.net to get a copy of this message | ||
On Mon, Jan 12, 2004 at 12:22:55PM -0500, Hans Lellelid wrote:
>
> Yes ... well, the regex does get a little messy, but should still be
> possible to do it generically. I guess other valid comments include:
>
> /* for some databases */
> // another comment
> REM apparently this is a comment in some
> -- is also a comment, but in Oracle it can have semantic value
> # is a comment for MySQL, at least
I think it should only handle "--" (the SQL standard) and maybe "#" if and
only if those are at the beginning of the first line. That wouldn't be
too hard to parse.
> I've found it easier to check to see whether a query is a 'SELECT' query
> and otherwise assume that it's a manip query.
But, don't forget about SELECT INTO.
> Of course, I still think the better solution is to let
> developers specify to avoid the regexp.
You mean your proposal to use two different methods -- manipQuery() and
selectQuery()? Or do you mean something else?
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409