CodeIgniter Forums
Error in mssql_driver.php 1.6.1 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Error in mssql_driver.php 1.6.1 (/showthread.php?tid=6063)

Pages: 1 2


Error in mssql_driver.php 1.6.1 - El Forum - 02-13-2008

[eluser]senojeel[/eluser]
I was just playing around with the scaffolding and had it going with CI 1.6.0. I just upgraded to 1.6.1 and now I get the error:

Code:
An Error Was Encountered
Error Number:

SELECT COUNT(*) AS "numrows" FROM "Individuals"

I tracked it down to the mssql_driver.php, the new function that was added at line 433. I don't know how to correct it, but that seems to be the problem.

Is any one else seeing that too and any ideas how to fix it?

Thanks!
Shawn


Error in mssql_driver.php 1.6.1 - El Forum - 02-13-2008

[eluser]Late Night Again[/eluser]
Yes I am getting the same error

Code:
SELECT "EventID", "Title" FROM "table" ORDER BY "StartDate"

trying to find what is causing it now.


Error in mssql_driver.php 1.6.1 - El Forum - 02-13-2008

[eluser]Late Night Again[/eluser]
I do not know if this is the correct fix but it has resolved my problem, here is what I have dont.

mssql_driver.php - line 461

Changed
Code:
$item = preg_replace('/(^'.$lbound.')([\w\d\-\_]+?)(\s|\)|$)/iS', '$1"$2"$3', $item);

To
Code:
$item = preg_replace('/(^'.$lbound.')([\w\d\-\_]+?)(\s|\)|$)/iS', '$1$2$3', $item);

AND

line 465

Changed
Code:
return "\"{$item}\"";

To
Code:
return "{$item}";

This may not be a correct fix but hopefully will help you out till there is a bug fix.


Error in mssql_driver.php 1.6.1 - El Forum - 02-14-2008

[eluser]senojeel[/eluser]
Thanks! That seemed to work for me too. We'll see what the higher-ups say about it hopefully.


Error in mssql_driver.php 1.6.1 - El Forum - 02-14-2008

[eluser]kandmcreative[/eluser]
That fixed my problems as well. This should really be rolled out in the next release!


Error in mssql_driver.php 1.6.1 - El Forum - 02-14-2008

[eluser]Derek Allard[/eluser]
Sure thing. Has this been reported in the bug tracker?


Error in mssql_driver.php 1.6.1 - El Forum - 02-14-2008

[eluser]senojeel[/eluser]
I just did. Thanks!


Error in mssql_driver.php 1.6.1 - El Forum - 03-12-2008

[eluser]StevenW721[/eluser]
I doubt I would have caught the error on my own, thanks a lot for sharing this fix!


Error in mssql_driver.php 1.6.1 - El Forum - 03-13-2008

[eluser]senojeel[/eluser]
What version of SQL Server is everyone connecting to?


Error in mssql_driver.php 1.6.1 - El Forum - 05-07-2008

[eluser]Derek Jones[/eluser]
That fix just removes the quotes from the preg_replace and return values, which means that you're neutering the _protect_identifiers() method in that driver entirely. I don't have anything to test on, so are you saying that that is indeed what needs to happen? If that's the case, then just replacing that entire method's code with:

Code:
return $item;

would be the correct solution.