MSSQL, Blank Pages, and Smalldatetime |
[eluser]Kyle Johnson[/eluser]
Hi everyone, I'm hoping someone else can verify this, I'm not sure if there are confounding factors or not because the query I was running it with was pretty complicated (like 30 joins... ewww) However, In trying to figure out what was causing the issue, I finally stumbled upon one of the SELECT columns was causing it. I did a binary search, and just kept cutting it in half until I found the troubled area. Turns out the cause was a 'smalldatetime' column. I deleted it, and the query worked and the page displayed. Magic, right? Well to go a step further, since I'm just on a test database, I changed the column type to datetime on SQL Server, and put it back in the query. It worked again, so I changed it back. Broken. I'm running Ubuntu 10.04 with Apache 2.2.14 PHP 5.3.2-1ubuntu4.13, mssql. I tried with and without eaccelerator (on a second identical ubuntu box [did a fresh install to make sure I wasn't crazy]). The database is MS SQL Server 2008 R2. I'm not sure if this is a driver bug, mssql(sybase?) driver bug, or just something else. I'm not sure where to begin with blank pages, because the actual log says the page is being output correctly, the database analyzer says the query completes successfully... It's just bizarre.
[eluser]CroNiX[/eluser]
There are several bugs in the current MSSQL driver. I know a lot of fixes have been implemented into github, but they aren't in the current 2.1 version. You might try the version from github, although, it's a work in progress until it's released.
[eluser]Kyle Johnson[/eluser]
I feel like I have all those changes, but I think I may have just helped out with some of the sqlsrv changes, not the mssql stuff. I'll grab the drivers from the mssql driver fork I saw on there and see how it performs and let you know.
[eluser]Kyle Johnson[/eluser]
I downloaded the MSSQL drivers from github, but no difference. Logs from a page that doesn't load (IS NOT NULL smalldatetime) - blank page Code: DEBUG - 2012-02-10 21:59:44 --> Config Class Initialized Logs for a page that loads (NULL smalldatetime) - page displays Code: DEBUG - 2012-02-10 22:00:36 --> Config Class Initialized
[eluser]Kyle Johnson[/eluser]
So, I put in some logging to see what exactly is happening... Or at least where to start looking. The query seems to run successfully, and after it runs I can get $query->num_rows(). And actually... I tried using mssql_connect and mssql_query to bypass the codeigniter code, and it still returns a blank page. So it looks like the CI drivers aren't the problem. mssql_driver + smalldatetime field = blank page / empty response. So I did some more digging, turns out this is specific to smalldatetime. Easiest fix is just converting the column in the SELECT and dealing with it there. Second option is turning off mssql.convertdatetime in php.ini (https://bugs.php.net/bug.php?id=48908) Code: vi /etc/php5/apache2/php.ini
[eluser]Unknown[/eluser]
Thanks for the datetime fix, this was driving me crazy. I had several servers which would work with older versions of SQL Server, but not with SQL Server 2008. For some reason, the first server I had set up, I had set this already, but on all the others, I was getting the aforementioned empty pages after the SQL servers were upgraded. |
Welcome Guest, Not a member yet? Register Sign In |