ID: 34784
Comment by: zane dot wright at langley dot af dot mil
Reported By: jwall at webpeak dot com
Status: Assigned
Bug Type: MSSQL related
Operating System: Windows XP
PHP Version: 5CVS-2005-10-08 (snap)
Assigned To: fmk
New Comment:
I also have the problem using 5.0.3 and a combination of PEAR's
LiveUser using DB.
It can be reproduced with a
$db =& DB::connect($dsn, $options);
var_dump($db->query('INSERT INTO liveuser_users_seq (vapor) VALUES
(0)'));
Previous Comments:
------------------------------------------------------------------------
[2006-03-16 03:42:01] mcollard at hotmail dot com
This also happens for me in PHP 4.4.0 build of MSSQL.dll.
------------------------------------------------------------------------
[2005-10-08 14:27:18] [EMAIL PROTECTED]
Frank, can you check this out?
------------------------------------------------------------------------
[2005-10-08 02:32:46] jwall at webpeak dot com
I tried http://snaps.php.net/win32/php5-win32-latest.zip
(5.1.0RC2-dev). This yields the same results.
------------------------------------------------------------------------
[2005-10-08 01:33:47] [EMAIL PROTECTED]
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
------------------------------------------------------------------------
[2005-10-07 22:53:05] jwall at webpeak dot com
Description:
------------
PHP 5.05/Sybase 12.53/php_mssql.dll
When doing a SELECT with > 33 columns, error:
[Native Error: Changed database context to 'my_db'.]
If the SQL is input via isql it works with no errors.
Reproduce code:
---------------
$link=mssql_pconnect('10.37.3.20,11222','sa','');
mssql_select_db('my_db',$link);
// limit of 33 columns allowed in select (so this fails)
$result=mssql_query("SELECT pr_0_6.prRN, pr_0_6.prDO, pr_0_6.prAC,
pr_0_6.prCS, pr_0_6.prUS, pr_0_6.prHN, pr_0_6.prHS, pr_0_6.prSS,
pr_0_6.d22, pr_0_6.d23, pr_0_6.d24, pr_0_6.d53, pr_0_6.l13,
pr_0_5.prRN, pr_0_5.prDO, pr_0_5.prAC, pr_0_5.prCS, pr_0_5.prUS,
pr_0_5.prHN, pr_0_5.prHS, pr_0_5.prSS, pr_0_5.d20, pr_0_5.d21,
pr_0_5.d74, pr_0_5.d177, pr_0_5.d75, pr_0_5.d85, pr_0_5.d37,
pr_0_5.d76, pr_0_5.d173, pr_0_5.d219, pr_0_5.d143, pr_0_5.d40,
pr_0_5.d38, pr_0_5.d39, pr_0_5.d272, pr_0_5.d273, pr_0_5.d302 FROM
pr_0_6, pr_0_5 WHERE pr_0_5.d21 LIKE 'A%' AND
pr_0_6.l13=pr_0_5.prRN");
if (!$result) {
plog('Could not execute query ' . mssql_get_last_message());
}
while($row=mssql_fetch_row($result)) {
plog("row: " . dumpVar($row));
}
mssql_close($link);
Expected result:
----------------
Expected results is a log with each results array for every record
returned. If I reduce the SELECT to < 34 then expected results are
returned.
Actual result:
--------------
A log indicating the error:
Could not execute query Changed database context to 'my_db'.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34784&edit=1