From: freetds228 at lewenberg dot com
Operating system: RedHat Enterprise Linux 3
PHP version: 4.4.1
PHP Bug Type: MSSQL related
Bug description: MSSQL query fails when retrieving date field
Description:
------------
When running a simple SELECT select query against an MS SQL server, if the
result set has a field with a non-NULL date, we are getting the following
error (with --enable-debug flag on):
[Sat Nov 5 11:26:07 2005] Script: '/www-s/testfreetds.php'
---------------------------------------
/root/tmp/php-4.4.1/ext/mssql/php_mssql.c(191) : Block 0x093CA2E0 status:
/root/tmp/php-4.4.1/Zend/zend_variables.c(44) : Actual location
(location was relayed)
Beginning: OK (allocated on
/root/tmp/php-4.4.1/ext/mssql/php_mssql.c:904, 19 bytes)
End: Overflown (magic=0x31383A34 instead of 0x2A8FCC84)
At least 4 bytes overflown
---------------------------------------
The query returns only a single row and field (a date). Note that Perl
running the same query using the same freetds libraries has no errors.
We have compiled 4.4.1 against freetds 0.63 using the --with-mssql option.
Reproduce code:
---------------
$db = mssql_connect('mssqlserver', 'user', 'secret') ;
$rs = mssql_query('SELECT DateLastModified FROM Table WHERE rid = 1', $db)
;
Expected result:
----------------
The date should be accessible in the result set.
Actual result:
--------------
[Sat Nov 5 11:26:07 2005] Script: '/www-s/testfreetds.php'
---------------------------------------
/root/tmp/php-4.4.1/ext/mssql/php_mssql.c(191) : Block 0x093CA2E0 status:
/root/tmp/php-4.4.1/Zend/zend_variables.c(44) : Actual location
(location was relayed)
Beginning: OK (allocated on
/root/tmp/php-4.4.1/ext/mssql/php_mssql.c:904, 19 bytes)
End: Overflown (magic=0x31383A34 instead of 0x2A8FCC84)
At least 4 bytes overflown
---------------------------------------
--
Edit bug report at http://bugs.php.net/?id=35115&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=35115&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=35115&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=35115&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=35115&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=35115&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35115&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35115&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35115&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35115&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35115&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=35115&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=35115&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35115&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35115&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35115&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35115&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35115&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35115&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35115&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35115&r=mysqlcfg