On 25-Jan-02 Jeff Zucker wrote:
> Tim Bunce wrote:
>>
>> p.s. Of course the SQL standards team should be ashamed of creating
>> a syntax that risks breakage with things like:
>> "update foo set bar=bar-$value"
>> (If you can't see it, consider what happens if $value is negative."
>
> Good point. How will the preparser handle this? It will presumably have
> to turn double minus style comments into C-style comments
-- It will turn them into what is acceptable. The driver will tell DBI
what to translate or leave as a comment style. There is 2 styles for
'--', '--' & '-- '(dash dash white space).
and therefore
> will have to decide if any given double minus sign occuring in a string
> is a comment or a minus operator applied to a negative number. I would
> guess the best way is to treat "--X", where X is a positive number, as
> part of a statement and all other double minuses as comment introducers.
I did bring this idea up, Tim thought it was an interesting one
yet somehow it was not...wait let me look for his email.....
okay found it,
> Would it be to far fetched to parse '--(digits) ' as not a comment?
Interesting but still a fudge. The right fix is to support both DBIpp_cm_dd &
DBIpp_cm_dw.
...I don't know what to think. If you are using Oracle(for example)
the user has to know that if they have an expression that is
'6--5' the '5' will be treated as a comment. I personally would
always write the expressions with space in them, 6 - -5, beacause
I know Oracle treats -- as a comment. Mysql only allows '-- ' for
dash-dash style comments. But to answer your question, currently
the preparser will treat '--' as comment and it will return what
ever the driver indicates is acceptable.
STH
----------------------------------
E-Mail: Scott T. Hildreth <[EMAIL PROTECTED]>
Date: 25-Jan-02
Time: 12:59:39
----------------------------------