[dev] [cvs] commit: turba/lib Driver.php api.php turba/lib/Driver sql.php

Jan Schneider jan at horde.org
Mon Oct 29 17:03:52 UTC 2007


Zitat von Michael Rubinsky <mike at theupstairsroom.com>:

> Quoting Jan Schneider <jan at horde.org>:
>
>> Zitat von Michael Rubinsky <mike at theupstairsroom.com>:
>>
>>> Quoting Jan Schneider <jan at horde.org>:
>>>
>>>> jan         2007-10-29 11:21:28 EDT
>>>>
>>>>   Modified files:
>>>>     lib                  Driver.php api.php
>>>>     lib/Driver           sql.php
>>>>   Log:
>>>>   Catch errors.
>>>>   Fix query generation.
>>>>   Use ANSI SQL (works fine with DATE columns in MySQL too btw).
>>>>   Simplify code.
>>>
>>>
>>> I was under the impression that not all RDBMS actually implemented the
>>> ANSI version of the substring() command.  In particular (at least some
>>> versions of) MS SQL implement it in the (string, from, to) kind of way.
>>
>> That sucks. Does that mean that not all RDMBS implement the ANSI
>> version, but all implement a non-standard version that works
>> everywhere the same? I wonder what standards are for.
>
> Yea, what we need are better standards for implementing standards :)
> Anyway, the substr() version was the only one that I found that works
> the same across the different servers I checked the manual for.  MS
> SQL and Oracle (at least according to the text I have here at home)
> both do not implenet the substring() function. I think MS SQL aliases
> substring() to substr(), but it still only accepts the (string, from,
> to) parameters.  MySQL I believe accepts both versions. PostgreSQL
> accepts the ANSI form, but translates it the substr() function with
> the three parameters...and DB2 takes the three parameters as
> well...but I don't remember if it also take the ANSI version.

Okay, I'm gonna revert this then. Do you know if at least all substr()  
implementations consider the third parameter as the substring length,  
opposed to the substring end? I would feel more confident if we could  
make sure to really compare 5-character substrings against 5-character  
string constants.

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/



More information about the dev mailing list