CodeIgniter Forums

Full Version: Error in mssql_driver.php 1.6.1
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2

El Forum

[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

El Forum

[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.

El Forum

[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.

El Forum

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

El Forum

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

El Forum

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

El Forum

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

El Forum

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

El Forum

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

El Forum

[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.
Pages: 1 2