Ticket #448 (closed Feature Request: fixed)
MSSQL Driver
| Reported by: | ixmatus | Owned by: | zombor |
|---|---|---|---|
| Priority: | major | Milestone: | 2.2 |
| Component: | Libraries:Database | Version: | SVN HEAD |
| Keywords: | database, mssql, drivers | Cc: |
Description
This is an alpha version of the MSSQL driver ported over from the MySQL driver. Thus far my tests on the features that are present have all been successful. I have not done any thorough unit testing of all the driver's functionality yet.
I had to custom write a character escaping function using addcslashes() as there was no equivalent to the mysql_real_escape_string() function.
The table and column escaping conventions are different - instead of to escape, [] are used.
Line 58 in the MySQL Driver:
$port = isset($port) ? ':'.$port : '';
has been changed in the MSSQL Driver to:
$port = (isset($port) AND is_string($port)) ? ':'.$port : '';
because errors were being produced due to the : being appended to the server name.
There are a number of features that had to be commented out of the driver that were standard in the MySQL driver. is_string() is used because the port designation is given in the DSN as a string of integers; although it could be made more robust to ensure it is an actual number. Would need to type cast it into an int then test it - maybe for another version.
These missing features include:
* REGEX
- no parallel equivalent
* NOT REGEX
- no parallel equivalent
* LIMIT
- equivalent in T-SQL is TOP, but in SQL Server 2000 there is no equivalent to OFFSET
- the offset parameter for the mssql::limit() method is now set to null so it conforms with the database interface class
* MERGE
- no parallel equivalent to MERGE or UPSERT
* SET NAMES
- no parallel equivalent
