#45551 [Fbk-Bgs]: Wrong result when selecting from varchar field
ID: 45551 Updated by: [EMAIL PROTECTED] Reported By: brack at wjp dot de -Status: Feedback +Status: Bogus Bug Type: MSSQL related Operating System: Windows Vista Business PHP Version: 5.2.6 New Comment: Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. The Microsoft library used to connect to MSSQL databases does not support varchar columns longer than 255 bytes. Use the freetds version of the extension (php_dblib.dll) instead. Previous Comments: [2008-10-06 22:07:11] [EMAIL PROTECTED] Your example looks wrong then, because the first output is produced by: echo strlen($string). [2008-07-18 08:23:22] brack at wjp dot de Same problem occurs on MS SQL Server 2000! [2008-07-18 06:33:58] brack at wjp dot de Description: On SQL Server 2005 when I execute a SELECT query to retrieve the content of a VARCHAR field with a specified length greater than 255 and less than MAX, the resulting value is truncated at a length of 255 characters. Reproduce code: --- For testing purposes, I used a table created by the following SQL code: CREATE TABLE [TESTTABLE]( [id] [int] NOT NULL, [testvalue] [varchar](1000) NULL, CONSTRAINT [PK_TESTTABLE] PRIMARY KEY CLUSTERED ( [id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] PHP test script code: $conn = mssql_connect('localhost', 'testuser', 'testpassword'); mssql_select_db('testdb'); $string = ' aaa'; echo strlen($string) . 'br'; mssql_query('INSERT INTO TESTTABLE (id, testvalue) VALUES (1, \'' . $string . '\')'); $result = mssql_query('SELECT testvalue FROM TESTTABLE WHERE id=1'); echo(strlen(mssql_result($result, 0, testvalue'))); Expected result: Expected output of the PHP test script: 396 396 Actual result: -- Actual output of the PHP test script: 255 396 -- Edit this bug report at http://bugs.php.net/?id=45551edit=1
#45219 [Opn]: mssql_connect() fails to connect to server
ID: 45219 Updated by: [EMAIL PROTECTED] Reported By: dhf2 at buffalo dot edu Status: Open Bug Type: MSSQL related Operating System: Linux/Windows XP Pro PHP Version: 5.2.6 New Comment: The first parameter should not be a host name but the name of the configuration form the freetds.conf file. Did you configure this? Previous Comments: [2008-06-09 16:51:34] dhf2 at buffalo dot edu Description: I've been having some issues with mssql_connect. I'm trying to connect to an MS-SQL 2000 database from PHP on a Linux server running PHP 5.1.6, but the mssql_connect() function always gives me the same error message saying it can't connect to the server. I also tried connecting to the same server from my local machine (Windows XP Pro, PHP 5.2.5) with the same results. However, I wrote a quick python script using pymssql and that worked fine from this machine. I also set up an ODBC connection on this machine and connected from PHP via odbc_connect(), which also worked fine. The mssql_connect() problems are the same whether mssql.secure_connection is set to Off or On in the php.ini Reproduce code: --- $db = mssql_connect('hostname', 'username', 'password'); if(!$db) { die('h2Massive failure/h2'); } Expected result: Should connect to database not print any errors Actual result: -- Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: host.name.of.server in /var/www/html/filename.php on line 28 -- Edit this bug report at http://bugs.php.net/?id=45219edit=1
#43645 [Opn-Bgs]: PHP 5.2.5 + php_mssql OR FreeTDS does not work
ID: 43645 Updated by: [EMAIL PROTECTED] Reported By: earnest dot berry at gmail dot com -Status: Open +Status: Bogus Bug Type: MSSQL related Operating System: Windows/Linux PHP Version: 5.2.5 New Comment: the native mssql_connect() function does not support the use of a port number as part of the first parameter, and if I recall correct that's not supported with FreeTDS either. If you are using ntwdblib you should install and use the 'Network CLient Library' and configure an alias. The alias will have parameters like protocol, IP address and port number. The alias should be used for the first parameter of mssql_connect() if you are using FreeTDS you need to configure freetds.conf. In there you can create sections like this [host_name] host = localhost port = 1433 tds version = 7.0 ; try domain login = yes ; try server login = no ; nt domain = MYDOMAIN Use the name in the brackets as the first parameter to mssql_connect. Previous Comments: [2007-12-20 22:28:00] pcorbe81 at maine dot edu I have the same setup and once I upgraded to 5.2.5, I received the same error. When I downgraded back to 5.2.3, it worked fine. I also used the same php.ini as I had in 5.2.3 and also tried modifying the new php-dist.ini with no avail. I am using the php_mssql.dll driver in conjuction with ntwlib.dll (same as the one described by above). I would agree that there seems to be something different in 5.2.5 that is causing this, although I can't tell what either. [2007-12-20 18:18:38] earnest dot berry at gmail dot com I also forgot to add that this issue has been verified by another independent developer. He had the same issue when trying to move to 5.2.5. [2007-12-20 18:16:43] earnest dot berry at gmail dot com Description: I've tried using FreeTDS on Windows. With build 5.2.5, the php_mssql driver does not work. I haven't had a chance to investigate what changed in 5.2.5 to make this happen. I had an application running perfectly using PHP+MSSQL but upon upgrading to 5.2.5 all failed. When I down-graded, the application worked again. Also, if anyone is wondering, yes, I am using the updated ntwlib, no the default one that comes with PHP. Also, if I use the microsoft SQL Driver ( http://www.microsoft.com/sql/technologies/php/default.mspx ) using 5.2.5, I can connect to SQL Server just fine, so this leads me to believe it's a problem with 5.2.5 in particular. Also, I am not using the default port of 1433, but I have tried this connection using bot hthe default port of 1433 and the port I set to no avail. But the SQL Driver from MSFT will connect on either port, and when I downgrade it connects on either port fine. Reproduce code: --- $server = localhost; $port = 5356; $username = 'webapp'; $password = '**'; $db = 'drupal5'; $con = mssql_connect($server,$port, $username, $password); if($con) { print h2We have a connection!/h2; } else { print h1NO CONNECTION TO |$server,$port| $username, $password! ERROR!/h2; } Expected result: A screen that says: We have a connection! Actual result: -- A screen that says: NO CONNECTION with connection information. -- Edit this bug report at http://bugs.php.net/?id=43645edit=1
#43711 [Opn-Bgs]: Can't load php_mssql.dll
ID: 43711 Updated by: [EMAIL PROTECTED] Reported By: vlad275 at ya dot ru -Status: Open +Status: Bogus Bug Type: MSSQL related Operating System: Windows 2003 PHP Version: 5.3CVS-2007-12-30 (snap) New Comment: Step 2 indicates your are loading msql instead of mssql. Those are two different extensions. If that's just a typo in your submission you are most likely missing the ntwdblib.dll in \windows\system32. This file is required for the mssql extension to load. You can copy this file from the server or you can install the client tools on your PHP server box. Previous Comments: [2007-12-30 04:13:03] vlad275 at ya dot ru Description: Windows2003+IIS+PHP5.3.0+MS SQL Server 2005 Can't load php_mssql.dll 1. Installed under IIS php-5.2.5-win32-installer.msi as ISAPI for .php 2. Uncommented at php.ini extension=msql.dll 3. Added at php.ini extension=php_mssql.dll 4. Copied all extentions into C:\WINDOWS\system32\ 5. Copied ntwdblib.dll version 8.x into c:\php and c:\windows\system32. 6. Reooted Fatal error: Call to undefined function mssql_connect() What do I have to do?!!! Reproduce code: --- if (function_exists('mssql_connect')) echo Okay, fn is there; else echo Not found\n; echo phpinfo(); print_r (get_loaded_extensions()); $mssql_server='195.42.181.173'; $mssql_user=''; $mssql_pass=''; mssql_connect($mssql_server,$mssql_user,$mssql_pass); Expected result: 'Okay, fn is there' I wanna use 'mssql_connect'!!! I cannot! Help me!!! Actual result: -- Not found 1Array ( [0] = bcmath [1] = calendar [2] = com_dotnet [3] = ctype [4] = session [5] = ereg [6] = filter [7] = ftp [8] = hash [9] = iconv [10] = json [11] = mysqlnd [12] = odbc [13] = pcre [14] = Reflection [15] = date [16] = libxml [17] = standard [18] = tokenizer [19] = zlib [20] = SimpleXML [21] = dom [22] = SPL [23] = wddx [24] = xml [25] = xmlreader [26] = xmlwriter [27] = ISAPI ) Fatal error: Call to undefined function mssql_connect() in C:\Inetpub\wwwroot\administrator\vt_example.php on line 52 -- Edit this bug report at http://bugs.php.net/?id=43711edit=1
#42544 [Opn]: mssql_select_db changes all open connections OR new_link boolean doesn't work
ID: 42544 Updated by: [EMAIL PROTECTED] Reported By: walter at wjd dot nu Status: Open Bug Type: Sybase-ct (ctlib) related Operating System: linux/debian, linux/ubuntu PHP Version: 4.4.7 New Comment: When you use the mssql_* functions from the sybase-ct extension, you should also use the documentation for the sybase_* functions. In this case the mssql_* functions are aliases for the same functions. If you want to have all the functions documented (and implemented) for the mssql extension you should compile PHP using --with-mssql. Previous Comments: [2007-09-05 11:25:45] walter at wjd dot nu So.. I think I've figured it out (I untarred php4-STABLE-200709041230 to have a look). It's a documentation problem and a lacking feature. I'm to be using the sybase(_ct) package (on debian and ubuntu). According to apt-cache, this is the standard package for mssql php support. This sybase module PHP_FALIAS'es mssql_connect to sybase_connect. sybase_connect does not take the 'new_link' boolean but a 'charset' string. Which leaves me with the two following problems; one documentation bug and one RFE: - When looking at the mssql_connect manual, I'd like to be informed that I should be looking at sybase_connect if I'm using sybase_ct.so. - I'd like a new_link boolean added to sybase_connect :) Greetings, Walter Doekes [2007-09-04 14:31:29] walter at wjd dot nu Description: The new_link boolean in mssql_connect does not do what its supposed to do for me. When select_db'ing the second open link, the first link gets affected. var_dump tells me that both connections are the same. When I'm using mssql_pconnect instead of connect, I do get another resource number for the second connection, but the bug that selects the wrong database, still remains. Is this a wrong version thing? Does mssql_select_db/mssql_query use the wrong database handle? Does the new_link boolean not work as it should? I'm lying about the PHP version in the select box; I don't have that exact version lying around. But I've seen that this bug was dismissed in March 2006 (http://bugs.php.net/bug.php?id=36639) when there was no 4.4.7. Latest version I've tested it on, is (I've tested on 4.4.4 as well): $ php5 -v PHP 5.1.6 (cli) (built: Jul 17 2007 17:45:52) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies $ dpkg -l *sybase | grep syb ii php5-sybase5.1.6-1ubuntu2.6 Sybase / MS SQL Server module for php5 Reproduce code: --- ?php // call me as: // php5 test.php server user pass database_right database_wrong // or: // php5 test.php server user pass database_right database_wrong bug // when calling with 'bug' you get success for the wrong reason. $users = mssql_connect($argv[1], $argv[2], $argv[3], true); mssql_select_db($argv[4], $users); $management = mssql_connect($argv[1], $argv[2], $argv[3], true); mssql_select_db($argv[5], $management); if (@$argv[6] == 'bug') mssql_select_db($argv[4], $management); echo '$users: '; var_dump($users); echo '$management: '; var_dump($management); if (($q = mssql_query(SELECT TOP 1 LDN_id FROM LEDEN, $users))) echo \nSuccess!\n; else echo \nFailed!\n; ? Expected result: $users: resource(4) of type (sybase-ct link) $management: resource(5) of type (sybase-ct link) Success! Actual result: -- $users: resource(4) of type (sybase-ct link) $management: resource(4) of type (sybase-ct link) Warning: mssql_query(): Sybase: Server message: Invalid object name 'LEDEN'. (severity 16, procedure N/A) in /tmp/test.php on line 14 Failed! -- Edit this bug report at http://bugs.php.net/?id=42544edit=1
#42474 [Opn-Asn]: mssql_fetch_* returns 0 instead of NULL when a bit field is NULL
ID: 42474 Updated by: [EMAIL PROTECTED] Reported By: jpittman2 at gmail dot com -Status: Open +Status: Assigned Bug Type: MSSQL related Operating System: Windows 2003 (5.2) PHP Version: 5.2.3 -Assigned To: +Assigned To: fmk Previous Comments: [2007-08-29 17:47:58] jpittman2 at gmail dot com Description: mssql_fetch_* returns 0 instead of NULL when the datatype is bit. Reproduce code: --- ?php $conn = mssql_connect($src, $uid, $pwd); mssql_select_db($db_name); $sql = SELECT Cast (Null as Bit) As Should_Be_Null, .Cast (0 as Bit)AS Should_Be_Int_0, .Cast (1 as Bit)As Should_Be_Int_1; $result = mssql_query($sql); return mssql_fetch_array($result); ? Expected result: Should return (NULL, 0, 1) Actual result: -- returns (0, 0, 1) -- Edit this bug report at http://bugs.php.net/?id=42474edit=1
#42309 [Asn-Bgs]: select of nvarchar() delivers only the first 250 letters
ID: 42309 Updated by: [EMAIL PROTECTED] Reported By: bc at ringwald dot name -Status: Assigned +Status: Bogus Bug Type: MSSQL related Operating System: Windows PHP Version: 5.2.3 Assigned To: fmk New Comment: (n)char and (n)varchar columns has a limit of 256 bytes. This is a limitation in ntwdblib.dll from Microsoft and can't be fixed in the PHP extension. Workaround: use php_dblib.dll as a drop in replacement for php_mssql.dll. This extension is build on the FreeTDS version of dblib and does not have the same limitations. Previous Comments: [2007-08-15 15:43:48] [EMAIL PROTECTED] Assigned to the maintainer. [2007-08-15 12:58:56] bc at ringwald dot name Description: select of nvarchar() delivers only the first 250 letters workaround: convert(text, attribut) -- Edit this bug report at http://bugs.php.net/?id=42309edit=1
#41393 [Asn]: affected can't return
ID: 41393 Updated by: [EMAIL PROTECTED] Reported By: hack988 at gmail dot com Status: Assigned Bug Type: MSSQL related Operating System: windows 2003 PHP Version: 4.4.7 Assigned To: fmk New Comment: The MSSQL server returns two result sets. The first one for the status of the IF statement and the second for the insert. The current implementation will not allow you to access the second result set (the first one must contain columns for the system to establish multiple result sets). Workaround: Use transactions and two querie. One to check if the row exists and one to insert the row. Previous Comments: [2007-05-15 04:13:50] hack988 at gmail dot com Description: after executed sql query like that IF NOT EXISTS (SELECT * FROM NumberGroup WHERE (GroupName = 'rrgrrg')) INSERT INTO NumberGroup(GroupName, AddTime) VALUES ('rrgrrg', 1); an executed mssql_rows_affected alway return 0 either GroupName= 'rrgrrg' not in database Reproduce code: --- i have no idea to deal with this problem by myself Expected result: mssql_query(IF NOT EXISTS (SELECT * FROM NumberGroup WHERE (GroupName = 'rrgrrg')) INSERT INTO NumberGroup(GroupName, AddTime) VALUES ('rrgrrg', 1);); var_dump(mssql_affected_rows($dblink); -- Edit this bug report at http://bugs.php.net/?id=41393edit=1
#41688 [Opn-Fbk]: mssql_connect() Segmentation fault (11)
ID: 41688 Updated by: [EMAIL PROTECTED] Reported By: gdegoulet at sdv dot fr -Status: Open +Status: Feedback Bug Type: MSSQL related Operating System: Linux 2.6.10 #3 S PHP Version: 5.2.3 New Comment: A couple of things to try. 1) Compile php using --with-mssql instead of --with-sybase. This will give you all the mssql_functions and you will be using the mssql extension and not the sybase extension. 2) Get the latest version of freeTDS. Previous Comments: [2007-06-14 14:03:38] gdegoulet at sdv dot fr Description: cat a.php ?php $db_name=azerty; $db_user=azerty; $db_pass=azerty; $db_host=azerty.sdv.fr; $link = mssql_connect($db_host, $db_user, $db_pass) or die('Could not connect: ' . mssql_get_last_message()); mssql_close($link); ? Reproduce code: --- php 5.2.3 / freetds-0.62.4 Configure Command = './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-config-file-path=/etc' '--enable-safe-mode' '--enable-memory-limit' '--with-xml' '--with-zlib' '--enable-inline-optimization' '--with-curl' '--with-mysql=/usr' '--with-freetype-dir=/usr' '--with-jpeg-dir' '--with-png-dir' '--with-gd' '--enable-gd-native-ttf' '--with-sybase=/usr' [EMAIL PROTECTED] php-5.2.3]# gdb /usr/local/bin/php GNU gdb Red Hat Linux (6.0post-0.20040223.19rh) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type show copying to see the conditions. There is absolutely no warranty for GDB. Type show warranty for details. This GDB was configured as i386-redhat-linux-gnu...Using host libthread_db library /lib/tls/libthread_db.so.1. (gdb) run ./a.php Starting program: /usr/local/bin/php ./a.php Error while mapping shared library sections: : Success. Error while reading shared library symbols: : No such file or directory. [Thread debugging using libthread_db enabled] [New Thread -1214368352 (LWP 14909)] Error while reading shared library symbols: : No such file or directory. Error while reading shared library symbols: : No such file or directory. Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1214368352 (LWP 14909)] 0x0824c627 in zend_inline_hash_func (arKey=0xb7fe3000 Address 0xb7fe3000 out of bounds, nKeyLength=3073856464) at zend_hash.h:260 260 hash = ((hash 5) + hash) + *arKey++; (gdb) where #0 0x0824c627 in zend_inline_hash_func (arKey=0xb7fe3000 Address 0xb7fe3000 out of bounds, nKeyLength=3073856464) at zend_hash.h:260 #1 0x0824bab7 in zend_hash_find (ht=0x839ab20, arKey=0xb79ad0b8 sybase_azerty.sdv.fr_azerty_azerty__, nKeyLength=3080368920, pData=0x8f26c2a1) at /usr/local/src/php-5.2.3/Zend/zend_hash.c:870 #2 0x08202da9 in php_sybase_do_connect (ht=-1893285215, return_value=0xb79ad0a0, return_value_ptr=0x0, this_ptr=0x0, return_value_used=1, persistent=0) at /usr/local/src/php-5.2.3/ext/sybase/php_sybase_db.c:495 #3 0x082039cc in zif_sybase_connect (ht=3, return_value=0xb79ad0a0, return_value_ptr=0x0, this_ptr=0x0, return_value_used=1) at /usr/local/src/php-5.2.3/ext/sybase/php_sybase_db.c:570 #4 0x0825b49e in zend_do_fcall_common_helper_SPEC (execute_data=0xbfffd640) at zend_vm_execute.h:200 #5 0x0825ad6d in execute (op_array=0xb79ac874) at zend_vm_execute.h:92 #6 0x08244415 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/local/src/php-5.2.3/Zend/zend.c:1134 #7 0x08211255 in php_execute_script (primary_file=0xb9c0) at /usr/local/src/php-5.2.3/main/main.c:1794 #8 0x0829e07a in main (argc=2, argv=0xba94) at /usr/local/src/php-5.2.3/sapi/cli/php_cli.c:1138 (gdb) quit Expected result: simply open - close database connection or die Actual result: -- [EMAIL PROTECTED] php-5.2.3]# php a.php Segmentation fault -- Edit this bug report at http://bugs.php.net/?id=41688edit=1
#34647 [NoF]: mssql.timeout has no affect
ID: 34647 Updated by: [EMAIL PROTECTED] Reported By: j dot geusebroek at intellit dot nl Status: No Feedback Bug Type: MSSQL related Operating System: Suse 9.3 PHP Version: 5.0.5 Assigned To: fmk New Comment: The two time out parameters is used during request startup and it will not have any effect to change the value at runtime. I'll look at a way to move these to the connect/query functions, but until then you should specify these in your php.ini file. Previous Comments: [2007-06-13 11:30:52] sarstrom at gmail dot com I can still reproduce this problem as of 2007-06-13. I've tried with PHP 5.2.1 and 5.2.3, And FreeTDS is at 0.64 on a FreeBSD 6.1 install. This code always waits the 20 seconds and tells me that everything went according to plan $dbLink = mssql_connect('sqldmz','sosuser','123456'); ini_set('mssql.timeout','1'); $query = WAITFOR DELAY '000:00:20' SELECT TOP 1 * FROM tbl_serviceorder; $res = mssql_query($query,$dbLink); if(!$res) { echo 'No, error, warning, timeout!'; } else { $row = mssql_fetch_assoc($res); echo 'Everything is OK: '.$row['OrderNumber']; } /hps [2005-11-14 01:00:03] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to Open. [2005-11-06 23:19:58] [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-09-26 18:51:57] j dot geusebroek at intellit dot nl Description: mssql.timeout has no affect, a query will wait an infinite time and the scripts hangs. I'm using the FreeTDS library, version 6.3 but i also tried latest FreeTDS CVS. FreeTDS debug file shows that a timeout has occured (i also set the timeout in the FreeTDS client) but PHP keeps running. (dblib.c:4010:in dbsqlok() net.c:327:exceeded query timeout: 10 net.c:327:exceeded query timeout: 10 net.c:327:exceeded query timeout: 10 net.c:327:exceeded query timeout: 10 net.c:327:exceeded query timeout: 10 net.c:327:exceeded query timeout: 10 ) Reproduce code: --- Perform any query that outlasts your mssql.timeout setting. Expected result: PHP exiting with a fatal error. Actual result: -- Infinite wait. -- Edit this bug report at http://bugs.php.net/?id=34647edit=1
#41244 [Opn-Bgs]: Multiple Queries in MSSQL Kills Connection and Prevents New Connections
ID: 41244 Updated by: [EMAIL PROTECTED] Reported By: mallinger at tc dot edu -Status: Open +Status: Bogus Bug Type: MSSQL related Operating System: Windows 2003 Server PHP Version: 5.2.1 New Comment: MS SQL server does not allow new queries on the same connection as long as there are results pending the clients actions. Either fetch all data or release the result before sending new queries. Another solution is to have multiple connections. mssql_connect() supports an optional parameter to force the creation of a new connection even if host, user and password is the same as for an existing connection. Previous Comments: [2007-04-30 17:58:34] mallinger at tc dot edu Description: When executing multiple queries from a single mssql_query call, the connection is lost and subsequent connections cannot be created. There are similar problems documented for PHP4, but it seems that (a) this is not documented for PHP5; and (b) the inability to create subsequent connections is not documented. In particular, it seems the mssql_select_db is what is failing in the second connection. Reproduce code: --- $conn = mssql_connect('host', 'user', 'pass'); mssql_select_db(db, $conn); mssql_query(QUERY 1, $conn); mssql_query(QUERY 2; QUERY 3; QUERY 4;, $conn); // this will fail: mssql_query(QUERY 5, $conn); // this is ok mssql_close($conn); // everything below will fail too: $conn2 = mssql_connect('host', 'user', 'pass'); mssql_select_db(db, $conn2); mssql_query(QUERY 6, $conn2); Expected result: The queries should execute with no problems. Actual result: -- Everything after the multiple query mssql_query call (QUERY 2; QUERY 3; QUERY 4; will fail. New connections fail when trying to select a database (mssql_select_db() [function.mssql-select-db]: Unable to select database:...) and the existing connection cannot be used anymore (mssql_query() [function.mssql-query]: Query failed in...) . -- Edit this bug report at http://bugs.php.net/?id=41244edit=1
#26315 [Bgs]: mssql_fectch_* functions are returning a space char on empty fields
ID: 26315 Updated by: [EMAIL PROTECTED] Reported By: webmaster at cbre dot fr Status: Bogus Bug Type: MSSQL related Operating System: Windows 2000/2003 Server PHP Version: 4.3.4 / 4.4.6 New Comment: The bug is in the Microsoft library not in the PHP extension. Use the php_dblib.dll version of the extension. It does not have the problem, though it will require that you update to version 5 of PHP. Previous Comments: [2007-04-06 08:48:39] webmaster at cbre dot fr More than 3 years later (version 4.4.6 tested today) the bug seems to be still present. Please, if you don't wan't to consider this issue as a bug, would it be possible to add a mssql.trimemptystringspace option to the mssql module in order to let developpers choose to activate or not this feature via init_set() or the php.ini file ? It would be more efficient than triming all returned row in the PHP code. Thanks in advance. Clement [2004-08-18 22:33:23] jwhatcher at hotmail dot com '' = ' '. Politely, this is a bug. In transact sql and query analyzer '' is seen as '' but in php '' is seen as ' '. I am using varchar fields. This surely breaks several lines of code for the empty function is now useless when selecting '' out of the database. Please reconsider and look into this item. Add autotrim to the ini file if this would fix the problem. [2004-06-20 02:49:52] spam2 at rhsoft dot net hmm this is a bug i developed a cms first for mysql and the port for postgre with select database-type works very fine the last two days i try to get it running with mssql/msde an nothing works with this damned spaces if (!empty($image)) echo img src=\ . $image . \ /; for example makes a big shit :-( [2004-05-24 21:23:07] hagen at woecht dot de If you must make from a space to '' in your PHP script, how can you distinguish between a true space or faked space? All '' and space in the DB are then '' (:-((() [2004-04-23 10:25:51] tomasz at biznespolska dot pl In my opinion this is bug, and is still present on version 4.3.6. This is not only problem with CHAR, and NCHAR columns but also empty VARCHAR columns returns space. Example: $re = mssql_fetch_row(mssql_query(SELECT CAST('' AS VARCHAR(10; print('--'.$re[0].'--'); // the result is: -- -- // and should be: Because of that I still use PHP4.3.3. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/26315 -- Edit this bug report at http://bugs.php.net/?id=26315edit=1
#39497 [Asn-WFx]: Re 34096
ID: 39497 Updated by: [EMAIL PROTECTED] Reported By: charlesk at netgaintechnology dot com -Status: Assigned +Status: Wont fix Bug Type: MSSQL related Operating System: Windows 2003 Standard PHP Version: 4.4.4 Assigned To: fmk New Comment: There is a bug in the MSSQL library used for this extension. In older versions we used to right trim the content of string values, but that gives problems when the value actualy has spaces at the end of thie string. It was decided to return the data as thery are provided by the library. A fix for this problem is to use the php_dblib.dll version of the extension. This is created with the FreeTDS library (no microsoft components needed). Unfortunately this is only available in PHP 5.x versions. Previous Comments: [2007-04-04 13:45:03] charlesk at netgaintechnology dot com I am dissappointed, I paid software would not go unanswered for 4 months. [2006-11-13 14:26:38] charlesk at netgaintechnology dot com Description: php_mssql.dll from version 4.3.1 works without a problem. php_mssql.dll from version 4.4.4 does not. This is a change in PHP not in Microsoft. How is this a Microsoft problem? What changed in this DLL to make it not work? My environment is set up that if I put the new version of the DLL in place, it starts throwing spaces everywhere. If I put the 4.3.1 version dll back it stops throwing spaces everywhere. Reproduce code: --- Copy the new php_mssql.dll in place Expected result: Nulls and empty strings returned as nulls and empty strings. Actual result: -- nulls as nulls, Empty strings as a single space -- Edit this bug report at http://bugs.php.net/?id=39497edit=1
#40985 [Fbk]: CLI version crashes while trying to shutdown, using tsrm_shutdown()
ID: 40985 Updated by: [EMAIL PROTECTED] Reported By: charlie at lemurconsulting dot com Status: Feedback Bug Type: Reproducible crash Operating System: Windows XP PHP Version: 5.2.1 New Comment: This seams to me like a problem outside of PHP. The xapian extension create module globals but does not do any cleanup. Looks to me like it can be solved with code like this: PHP_MSHUTDOWN_FUNCTION(printer) { #ifdef ZTS ts_free_id(printer_globals_id); #else php_printer_shutdown(printer_globals TSRMLS_CC); #endif UNREGISTER_INI_ENTRIES(); return SUCCESS; } I have not tested anything, but just remembering the same type of problem with the printer (and other) exntension in the past. Previous Comments: [2007-04-03 18:40:33] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.2-win32-latest.zip [2007-04-03 15:00:21] daniel dot menard at bdsp dot tm dot fr The same bug appear with the cgi version. The only known workaround for now is to patch php_cgi.c in the same way, removing any call to tsrm_shutdown() [2007-04-03 14:00:47] charlie at lemurconsulting dot com Description: While trying to make the Xapian (www.xapian.org) PHP bindings work on Windows using Visual C++, we found that the CLI version of PHP would crash when unloading the bindings. The bindings are written using SWIG. PHP appears to be trying to unload resources when the crash occurs. The crash does not occur on earlier versions of PHP i.e. 4.4.6 Reproduce code: --- The following patch fixes the problem and has been used as a workaround: Patch php_cli.c as follows by commenting out line 1283: #ifdef ZTS /*tsrm_shutdown(); */ #endif Expected result: No crash :) Actual result: -- n/a -- Edit this bug report at http://bugs.php.net/?id=40985edit=1
#40986 [Opn-Bgs]: mssql_field_name() retrieves only first 30 characters
ID: 40986 Updated by: [EMAIL PROTECTED] Reported By: Arne dot Heizmann at csr dot com -Status: Open +Status: Bogus Bug Type: MSSQL related Operating System: Windows 2000 PHP Version: 5.2.1 New Comment: This is a limit in the MSSQL library (ntwdblib.dll) used to build the extension. Use the php_dblib.dll version of the extension. This version is build with FreeTDS and does not have these limitations. This has been reported many times before. Please search the archives before posting the same bugs over and over. Previous Comments: [2007-04-03 17:43:05] Arne dot Heizmann at csr dot com Description: The function mssql_field_name() appears to return only the first 30 characters of the field name. Reproduce code: --- ? $sql = 'select 1 as [This is a field name that is longer than 30 characters]'; $mssqlh = mssql_pconnect ('server', 'username', 'password');// change as appropriate mssql_select_db ('databasename', $mssqlh); // change as appropriate $result = mssql_query ($sql, $mssqlh); $fieldname = mssql_field_name ($result, 0); var_export ($fieldname); ? Expected result: 'This is a field name that is longer than 30 characters' Actual result: -- 'This is a field name that is l' -- Edit this bug report at http://bugs.php.net/?id=40986edit=1
#40970 [Opn-Bgs]: filemtime slower on PHP5 vs PHP4
ID: 40970 Updated by: [EMAIL PROTECTED] Reported By: php at edwardk dot info -Status: Open +Status: Bogus Bug Type: Performance problem Operating System: Windows 2003 PHP Version: 5.2.1 New Comment: This is only the case when stat() fails. If you change stat('.'); to stat('some file'); you will se that PHP5 is faster than php4. Almost 2x. Previous Comments: [2007-04-01 00:16:16] php at edwardk dot info Description: filemtime and other related functions are slower on php5 vs php4 Using PHP 5.2.1 and PHP 4.4.6 on Athlon X2 3800+, Windows 2003 the speed difference is about 50-100x slower. Reproduce code: --- ? header('Content-type: text/plain'); function microtime_float() { list($usec, $sec) = explode( , microtime()); return ((float)$usec + (float)$sec); } $time_start = microtime_float(); for ($i = 1; $i = 1000; $i++) { $blah = stat('.'); } $time_end = microtime_float(); $time = $time_end - $time_start; echo 'Took '.round(($time*100),3).'ms'; ? Expected result: Speeds should be similar Actual result: -- On PHP 4.4.6, it took about 1.6ms On PHP 5.2.1 it took about 130ms -- Edit this bug report at http://bugs.php.net/?id=40970edit=1
#40901 [Asn-Fbk]: mssql_execute errror
ID: 40901 Updated by: [EMAIL PROTECTED] Reported By: lh at moranti dot com -Status: Assigned +Status: Feedback Bug Type: MSSQL related Operating System: ubuntu PHP Version: 5.2.1 Assigned To: fmk New Comment: I've tested your sample code and it works just fine om my system. I did modify it to get the return value back though: $int=10; $sp = mssql_init(test, $con); // stored proc name mssql_bind($sp, @sval, $int, SQLINT4); mssql_bind($sp, RETVAL, $ret, SQLINT4); $query = mssql_execute($sp) or die(oops); echo $ret\n; mssql_close($con); Previous Comments: [2007-03-23 11:20:07] lh at moranti dot com Sorry the code schould look like this ? $conn = mssql_connect(host,user,pass); mssql_select_db(dbscheme, $conn); $int=10; $sp = mssql_init(test, $conn); // stored proc name mssql_bind($sp, @sval ,$int,SQLINT4); $query = mssql_execute($sp) or die(oops); ? [2007-03-23 11:15:14] lh at moranti dot com The storedprocedure looks like this: set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go CREATE PROCEDURE [dbo].[test] ( @sval int ) AS return @sval+10 And the php code looks like this ? $conn = mssql_connect(host,user,pass); mssql_select_db(dbscheme, $conn); $sp = mssql_init(test, $conn); // stored proc name $query = mssql_execute($sp) or die(oops); ? is fails in this line $query = mssql_execute($sp) or die(oops); [2007-03-23 10:56:53] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with ?php and ends with ?, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. [2007-03-23 10:29:27] lh at moranti dot com Description: I have a problem executing a stored procedure. It fails on my ubuntu installation with php 5.2.1 but when i run it with php 5.1.6 no problem. Reproduce code: --- mssql_select_db(dbname, $conn); $sp = mssql_init(procedurename, $conn); // stored proc name $compId=1000; $SessionId = substr(session_id(),0,8); mssql_bind($sp, @CompID,$compId,SQLVARCHAR); mssql_bind($sp, @SessionID,$SessionId,SQLVARCHAR); mssql_bind($sp, @BasketAmount,$BasketAmount,SQLVARCHAR,TRUE); mssql_bind($sp, @BasketTotalItem,$BasketTotalItem,SQLVARCHAR,TRUE); $query = mssql_execute($sp) or die(could not perform insert); Actual result: -- Warning: mssql_execute() [function.mssql-execute]: stored procedure execution failed in /home/www/sitename/test_init.php on line 14 -- Edit this bug report at http://bugs.php.net/?id=40901edit=1
#40746 [Asn]: PHP = 4.4.6 mssql_connect() mssql_pconnect() local buffer overflow
ID: 40746 Updated by: [EMAIL PROTECTED] Reported By: youza at post dot cz Status: Assigned Bug Type: MSSQL related Operating System: Windows PHP Version: 4.4.6 Assigned To: fmk New Comment: This is a problem with the dbopen() function in Microsofts ntdblib library, and not a problem within the PHP extension. I'll add some length checks to the host parameter for mssql_connect() and mssql_pconnect() to prevent this from happening. The problem does not exists in php_dblib.dll (the same extension compiled with FreeTDS version of the dblib library). Previous Comments: [2007-03-07 09:45:54] youza at post dot cz Description: PHP = 4.4.6 mssql_connect() mssql_pconnect() local buffer overflow and safe_mode bypass Reproduce code: --- See http://www.securityfocus.com/archive/1/462010/30/0/threaded or original url: http://retrogod.altervista.org/php_446_mssql_connect_bof.html -- Edit this bug report at http://bugs.php.net/?id=40746edit=1
#40687 [Opn-Bgs]: ODBC+PHP+MSSQL generate error while executing multi query in one transaction
ID: 40687 Updated by: [EMAIL PROTECTED] Reported By: scottsdev at gmail dot com -Status: Open +Status: Bogus Bug Type: ODBC related Operating System: Linux PHP Version: 5.2.1 New Comment: Your query returns multiple results. The first is for the insert statement and the second for the select. Take a look at http://us3.php.net/odbc_next_result to see how to move to the second result. Previous Comments: [2007-03-02 00:43:53] scottsdev at gmail dot com Description: Hello, I used DSN to established connection with MSSQL using following Cursor. Code is $conn = odbc_pconnect($dsn,$username,$password, SQL_CUR_USE_ODBC) or die(ERROR OCCUR WHILE CONNECTING TO THE SERVER); I am getting following error when i tried to execute query like ... $sql = insert into TBL_NAME (col_1, col_2, col_3) values (val_1, val_2, val_3); select SCOPE_IDENTITY() as LastInsertedID; $results = odbc_exec($conn, $sql) or die(brpreQuery fail: $query/pre); // if(!$results) { $this-error(H2No results!/H2\n); return false; }else { $data = array(); while ( $row = odbc_fetch_array($results)) { $data = $row; } odbc_free_result($results); $last_Id = $data['LastInsertedID']; } == So errors occurs on this line: while ( $row = odbc_fetch_array($results)) Error is : Warning: odbc_fetch_array() [function.odbc-fetch-array]: No tuples available at this result index in D:\inetpub\wwwroot\php\xyz\lib\.php on line 1 So I really don't understand how to remove this error, and what to do so that such two query can be run at once and return the result. J. Scott [scottsdev at gmail dot com] -- Edit this bug report at http://bugs.php.net/?id=40687edit=1
#40687 [Opn-Bgs]: ODBC+PHP+MSSQL generate error while executing multi query in one transaction
ID: 40687 Updated by: [EMAIL PROTECTED] Reported By: scottsdev at gmail dot com -Status: Open +Status: Bogus Bug Type: ODBC related Operating System: Windows Server PHP Version: 5.2.1 New Comment: There is no bug here. odbc_next_result() sjould be called with a odbc result resource as the parameter. That's the only way it can advnance the internal result pointer to the next result. You code should look like this: if (odbc_next_result($results)){ while ($row = odbc_fetch_array($results)) { // Do your stuff } } or // Move to the last result while (odbc_next_result($results)); while ($row = odbc_fetch_array($results)) { // Do your stuff } Previous Comments: [2007-03-02 21:10:54] scottsdev at gmail dot com No Sir, Still it don't work. I put the if condition which check whether Next Result is found or not, and it come inside that clause and show error in fetch_array line. == $query = END_SQL $query; select SCOPE_IDENTITY(); END_SQL; $results = odbc_exec($conn, $query) or die(brpreQuery fail: $query/pre); // if(!$results) { $this-error(H2No results!/H2\n); return false; }else { $data = array(); if (odbc_next_result){ while ( $row = odbc_fetch_array($results)) { = It still showing same error at == while ( $row = odbc_fetch_array($results)) Error: Warning: odbc_fetch_array() [function.odbc-fetch-array]: No tuples available at this result index in D:\inetpub\wwwroot\php\xyz\aaa.php on line 111 [2007-03-02 18:19:47] [EMAIL PROTECTED] Your query returns multiple results. The first is for the insert statement and the second for the select. Take a look at http://us3.php.net/odbc_next_result to see how to move to the second result. [2007-03-02 00:43:53] scottsdev at gmail dot com Description: Hello, I used DSN to established connection with MSSQL using following Cursor. Code is $conn = odbc_pconnect($dsn,$username,$password, SQL_CUR_USE_ODBC) or die(ERROR OCCUR WHILE CONNECTING TO THE SERVER); I am getting following error when i tried to execute query like ... $sql = insert into TBL_NAME (col_1, col_2, col_3) values (val_1, val_2, val_3); select SCOPE_IDENTITY() as LastInsertedID; $results = odbc_exec($conn, $sql) or die(brpreQuery fail: $query/pre); // if(!$results) { $this-error(H2No results!/H2\n); return false; }else { $data = array(); while ( $row = odbc_fetch_array($results)) { $data = $row; } odbc_free_result($results); $last_Id = $data['LastInsertedID']; } == So errors occurs on this line: while ( $row = odbc_fetch_array($results)) Error is : Warning: odbc_fetch_array() [function.odbc-fetch-array]: No tuples available at this result index in D:\inetpub\wwwroot\php\xyz\lib\.php on line 1 So I really don't understand how to remove this error, and what to do so that such two query can be run at once and return the result. J. Scott [scottsdev at gmail dot com] -- Edit this bug report at http://bugs.php.net/?id=40687edit=1
#40607 [Opn-Bgs]: mssql_fetch_array concatinates spaces in middle of data
ID: 40607 Updated by: [EMAIL PROTECTED] Reported By: Joe at sofusion dot com -Status: Open +Status: Bogus Bug Type: MSSQL related Operating System: FREE BSD 6.0 PHP Version: 5.2.1 New Comment: I'm unable to reproduce this (on Linux and WIndows with FreeTDS). Try viewing the result outside the browser, use pre/pre or get the length of the column to verify that you are getting the right results. Previous Comments: [2007-02-23 16:18:14] Joe at sofusion dot com Sorry, dont use # in TBL Name. USE THIS DB CODE AND PHP CODE TO TEST: CREATE TABLE T1( Name varchar(255), Number int ) INSERT INTO T1 VALUES('Two Spaces',1) INSERT INTO T1 VALUES('One Spaces',2) $sql = SELECT Name FROM T1 WHERE Number = '1'; $rs = mssql_query($sql); while ($RT = mssql_fetch_array($rs)) {$Name= $RT['Name']; //This should have 2 spaces in it like the DB //But it only has one echo ' pName = '.$Name . '/p'; } [2007-02-23 15:59:40] Joe at sofusion dot com Description: When using mssql_fetch_arry and mssql_fetch_row, data returned that contains 2 spaces has been concatinated to one space. Example: Data returned should be Two' '' 'Spaces (without quotes Two Spaces) But is returned as Two' 'Spaces (without quotes -Two Spaces with one space between) FreeBSD WEBSERVER1.SOFUSION.local 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Thu Nov 3 09:36:13 UTC 2005 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/GENERIC i386 Build Date Feb 22 2007 19:36:38 Configure Command './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--enable-versioning' '--with-mssql=/usr/local' '--enable-libxml' Library version FreeTDS Reproduce code: --- --MSSQL TABLE CREATE TABLE #T1( Name varchar(255), Number int ) INSERT INTO #T1 VALUES('Two Spaces',1) INSERT INTO #T1 VALUES('One Spaces',2) --PHP CODE $sql = select Name FROM Name_TBL WHERE Number = '1'; $rs = mssql_query($sql); $RT = mssql_fetch_array($rs); $Name= $RT[Name']; --This should have 2 spaces in it like the DB --But it only has one echo $Name Expected result: Two Spaces --This has 2 spaces between the words. Actual result: -- Two Spaces --This only hase 1 space between the words -- Edit this bug report at http://bugs.php.net/?id=40607edit=1
#40596 [Csd-Fbk]: Running two PHP scripts causes Apache freeze
ID: 40596 Updated by: [EMAIL PROTECTED] Reported By: karldray at interchange dot ubc dot ca -Status: Closed +Status: Feedback Bug Type: Apache2 related Operating System: Windows XP SP2 PHP Version: 5.2.1 New Comment: I Think this is an IE problem and has nothing to do with PHP or Apache. Try the same thing in Firefox and you will not see this problem. IE seams to have a limit of two connections to the same server at any time. Previous Comments: [2007-02-22 22:36:49] karldray at interchange dot ubc dot ca Bug closed: I just noticed that while the first two scripts are running, Apache still responds fine to requests coming from other clients. There must simply be a limit of two simultaneous requests per client that Apache is enforcing. Now I just need to figure out how to change this. [2007-02-22 22:31:21] [EMAIL PROTECTED] Please make sure you have a clean system. I.e. no firewalls, no third-party applications that might affect it. It would be good if try it on another machine. Personally I do not believe an issue like this might come unnoticed, so it looks like your local problem. [2007-02-22 22:20:50] karldray at interchange dot ubc dot ca Description: While two PHP scripts (or two instances of the same script) are running, Apache (2.2.4) stops responding to any new requests (even for non-php pages) until one of them finishes. It doesn't seem to matter what the scripts are actually doing; the same problem occurs when they're doing any of the following: -performing calculations (e.g. counting from 1 to 1000) -blocking on socket functions -sleep() ing Reproduce code: --- wait.php: ?php sleep(15); ? 1. Open two browser windows and point them both to wait.php so that they're running at the same time. 2. Before they finish, open a third browser window and point it to any other URI on the server (even a non-php page). Expected result: The third window should load immediately. Actual result: -- The third window does not load until one of the two PHP scripts finshes. Note: If the third request is for a PHP page containing an error_log() at the very beginning, then the logfile output is not generated as long as the first two pages are running (suggesting that Apache isn't getting around to starting PHP during this time). -- Edit this bug report at http://bugs.php.net/?id=40596edit=1
#39213 [Asn-Csd]: NULL == '' in mssql extention
ID: 39213 Updated by: [EMAIL PROTECTED] Reported By: frediano dot ziglio at vodafone dot com -Status: Assigned +Status: Closed Bug Type: MSSQL related Operating System: Linux PHP Version: 5.1.6 Assigned To: fmk New Comment: This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Microsofts libraries will return a length of 1 for the empty string. WHen the MSSQL extension is compiled with the FreeTDS library the returned values are correct for both empty string and null values. Previous Comments: [2007-02-01 15:08:07] frode at coretrek dot com We're running into the same issue. Is the patch that was provided by the bug reporter planned for inclusion in a future release? [2006-10-20 19:13:54] frediano dot ziglio at vodafone dot com Mmm... perhaps a less invasive change is to add if (data == 0) { ZVAL_NULL(result); return; } after char *data = charcol(offset); line on the same function. [2006-10-20 19:08:15] frediano dot ziglio at vodafone dot com Here you are a simplified version. It require a db but it create the only table it needs and delete it. Expected result: got -- ?php $conn = mssql_connect(server,user,pass) or die(opps); mssql_query(CREATE TABLE #tmp(c VARCHAR(10) NULL), $conn) or die(error querying); mssql_query(INSERT INTO #tmp VALUES(''), $conn) or die(error querying); $res = mssql_query(SELECT * FROM #tmp, $conn) or die(query); $row = mssql_fetch_assoc($res); $s = is_null($row['c']) ? 'NULL' : $row['c']; echo got -$s-\n; ? In http://cvs.php.net/viewvc.cgi/php-src/ext/mssql/php_mssql.c?view=markup you have if (dbdatlen(mssql_ptr-link,offset) == 0) { however in order to fix the problem should be if (dbdatlen(mssql_ptr-link,offset) == 0 dbdata(mssql_ptr-link,offset) == NULL) { note that under Windows Microsoft dblib use only older wire protocol version which do not support empty string so it returns them as a single space. [2006-10-20 15:25:38] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with ?php and ends with ?, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. [2006-10-20 15:16:45] frediano dot ziglio at vodafone dot com Description: when you get data you assume NULL if dbdatlen == 0 however is possible that data is just an empty string (''), in this case you should check that dbdatlen == 0 and dbdata == NULL. Reproduce code: --- I use this test script (pwd.inc define just variable to connect) ?php // $Id: null.php,v 1.2 2006/10/20 14:38:22 freddy77 Exp $ require_once(pwd.inc); $conn = mssql_connect($server,$user,$pass) or die(opps); mssql_query(CREATE TABLE #MyTable ( myfield VARCHAR(10) NULL, n INT ), $conn) or die(error querying); mssql_query(INSERT INTO #MyTable VALUES('',1) INSERT INTO #MyTable VALUES(NULL,2) INSERT INTO #MyTable VALUES(' ',3) INSERT INTO #MyTable VALUES('a',4), $conn) or die(error querying); $result = 0; function test($sql, $expected) { global $conn, $result; $res = mssql_query($sql, $conn) or die(query); $row = mssql_fetch_assoc($res); $s = $row['myfield']; if (is_null($s)) $s = '(NULL)'; else if ($s == '') $s = '(Empty String)'; else $s = '.str_replace(', '', $s).'; echo $sql - $s\n; if ($s != $expected) { echo error!\n; $result = 1; } } test(SELECT top 1 * FROM #MyTable WHERE n = 1 -- '', (Empty String)); test(SELECT top 1 * FROM #MyTable WHERE n = 2 -- NULL, (NULL)); test(SELECT top 1 * FROM #MyTable WHERE n = 3 -- ' ', ' '); test(SELECT top 1 * FROM #MyTable WHERE n = 4 -- 'a', 'a'); exit($result); ? Expected result: SELECT top 1 * FROM #MyTable WHERE n = 1 -- '' - (Empty String) SELECT top 1 * FROM #MyTable WHERE n = 2 -- NULL - (NULL) SELECT top 1 * FROM #MyTable WHERE n = 3 -- ' ' - ' ' SELECT top 1 * FROM #MyTable WHERE n = 4 -- 'a' - 'a' Actual result: -- SELECT top
#40034 [Asn]: mssql_connect(): Unable to connect to server
ID: 40034 Updated by: [EMAIL PROTECTED] Reported By: chris dot clos at lmcu dot org Status: Assigned Bug Type: MSSQL related Operating System: Windows Server 2003 PHP Version: 5.2.0 Assigned To: fmk New Comment: But you are packing the dll's :-) As far as I know different versions of ntwdblib.dll will default to either tcpip or netbios for the default protocol. There might also be a registry setting for this (I'll look for that tonight when I get home). Just copying the dll to the system does not give you access to the client configuration tools that allow you to change the defaults or create server aliases that should be used as the host parameter for mssql_connect(). If the newer version of ntwdblib.dll solves the problem I'd say we should bundle it. Previous Comments: [2007-01-12 14:11:43] [EMAIL PROTECTED] Sorry, I'm not the MSSQL intiated :) Frank, could you take a look please? [2007-01-05 15:23:46] chris dot clos at lmcu dot org Description: I have PHP 5.1.4 and upgraded to php 5.2.0. Copied my php.ini file over. I use IIS in Server 2003 (Standard) SP1, connecting to SQL Server 2005 (Standard). I can no longer do mssql_connects, instead I get an error. Once I did this I get an error: PHP Warning: mssql_connect(): Unable to connect to server: x.x.x.x in C:\db-test.php on line 3 This is the same thing that happens when using it via IIS (using php5isapi) or the php command line. This does work on a Windows XP SP2 machine just fine. I can reproduce this other Windows Server 2003 machines. I read from bug Id 39313, and I have tried loading the client tools, however I do not see anywhere that there is a NETBIOS or a TCP/IP type setting in SQL Server Management Studio. After looking long and deep, I found that its the version of ntwdblib.dll that is provided with php package. I found one that is version 2000.80.194.0 that fixes it, but the one included is 2000.2.8.0 Same problem appears to happen with 5.1.4 and this version of dll, I think this file needs to be updated in the distribution. Reproduce code: --- ?php $dbh = mssql_connect('x.x.x.x','user','password'); if($dbh) { echo true\r\n; } else { echo fubar\r\n; } ? Expected result: I should get true printed out. Actual result: -- Using 5.2.0: Warning: mssql_connect(): Unable to connect to server: x.x.x.x in C:\db-test.php on line 3 fubar Using 5.1.4: true -- Edit this bug report at http://bugs.php.net/?id=40034edit=1
#40106 [Opn-Fbk]: Runtime - Unable to load dynamic library
ID: 40106 Updated by: [EMAIL PROTECTED] Reported By: delontan at yahoo dot com -Status: Open +Status: Feedback Bug Type: Unknown/Other Function Operating System: windows 2003 PHP Version: 5.2.0 New Comment: Sounds like you are using the dl() function to load the extensions. That will not work with multithreaded SAPI's. You can load the extensions with the extension=... directive in your php.ini file. Previous Comments: [2007-01-11 23:28:13] delontan at yahoo dot com Description: I've installed php 5.2 and update all related modules for oci8, odbtp. Everything is working. I use remote desktop to access the machine where i installed php and apach 2.0.59. i installed php as modules instead of cgi/fast cgi. during my development of php pages, unable to load dynamic library for oci8, odbtp all came up from nowhere. i didn't see anything in error log. i remembered when there was (using cgi/fast cgi as parser last time) memory leak or ?? reason, there will be php-cgi.exe stayed in windows Task Manager's process list forever. i had to kill it manually before it crashed my system. so, is this the effect of using modules as parser and when seomthing went wrong, the dynamic window pop/show up? i just have to close the window, everything is still working and running fine. plz advise. I've read all the similar post but it's different. thanks! Lee -- Edit this bug report at http://bugs.php.net/?id=40106edit=1
#37879 [Asn-Bgs]: Wrong Character Encoding, Loses Characters
ID: 37879 Updated by: [EMAIL PROTECTED] Reported By: captainqwark at gmail dot com -Status: Assigned +Status: Bogus Bug Type: MSSQL related Operating System: Windows XP PHP Version: 5.1.4 Assigned To: fmk New Comment: Use the MSSQL Client library settings to specify the convertion (ANSI to OEM). The PHP extension does not perform any encoding of the data it's all done in the client library. Previous Comments: [2006-06-21 22:31:21] captainqwark at gmail dot com Description: Retrieving data from a mssql database using ISO-8859-1 internaly returns wrong characters for french characters. Reproduce code: --- $mssql = mssql_connect(-,-,-); if(!$mssql){ echo connect failed\r\n; } else { echo connect successful\r\n; } mssql_select_db(contacts,$mssql); $selectSQL = SELECT first_name FROM contacts ORDER BY username; $result = mssql_query($selectSQL, $mssql); while ($row = mssql_fetch_array($result)) { echo $row['first_name']; } Expected result: Josée Actual result: -- Jos -- Edit this bug report at http://bugs.php.net/?id=37879edit=1
#39960 [Opn-Fbk]: dllhost.exe application error
ID: 39960 Updated by: [EMAIL PROTECTED] Reported By: chv at cverdow dot com -Status: Open +Status: Feedback Bug Type: IIS related Operating System: Windows XP SP2 PHP Version: 6CVS-2006-12-27 (CVS) New Comment: Could you try the same test with a script without a call to phpinfo(); A simple echo Hello World; or something simple like that. Previous Comments: [2006-12-29 00:57:02] chv at cverdow dot com Thank you, Tony. I tried it. I'm still getting the same result -- but the memory address that's trying to write to itself is different. Should it help you to track this down, I am noticing that each time it aborts, the memory location is different, but it's always some location trying to write to itself that is failing. In my initial report, I was mistaked about where the error occurs. It is in the very last phase, after Windows is shutting down is displayed on the screen. Sorry. I was exploring the registry, and noticed two things I thought I'd bring to your attention. I've never been a registry expert. But, these two struck me as curious: HKEY_LOCAL_MACHINE SYSTEM ControlSet001 Control Nls MUILanguages RCV2 This contains a rather long list of .dlls and .exes, but php5isapi.dll is not in the list. HKEY_LOCAL_MACHINE SYSTEM ControlSet001 Services W3SVC Parameters Script Map .php = [PUT PATH HERE]\php5isapi.dll That is the exact text for the value. It has to be finding the API, or phpinfo.php wouldn't be running, right? But, put path here when I specifically browsed out to it when I entered it into IIS? That doesn't seem right. Honestly, neither does the fact that I have to put php.ini in C:\WINDOWS when C:\PHP5 is in my path in environment variables. Thank you again for your efforts. Please let me know if there is anything else I can try. [2006-12-27 09:37:13] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.2-win32-latest.zip [2006-12-27 00:45:08] chv at cverdow dot com IIS version is 5.1. [2006-12-27 00:39:14] chv at cverdow dot com Description: I'm basically opening this to let you know that the problem still exists. This references both what appears to be the latest production version (5.2.0 dated 02-Nov-2006), and 6CVS-2006-12-27 (17:30 GMT). I don't have MSVC6 or any other C dev environment on this machine, so I am unable to provide the backtrace you prefer. I have been unable to capture this in any of the dumps and logs that are available to me, possibly due to the place in the shutdown process this occurs. The problem is repeatable. I get it every time I load a local PHP page. I never get it when I only access any page on the Internet. DLL: php6isapi.dll INI: php.ini-recommended, modified as follows: - doc_root = C:\Inetpub\wwwroot; - extension_dir = C:\PHP5\ext I have not, however enabled any extensions. I had to place php.ini in C:\WINDOWS for it to be read. Steps to repeat: - Reboot machine - Open browser (IE 7.0.5730.11) - Load http://myserver/phpinfo.php - Close browser - Restart computer (Start - Turn off computer - Restart) Steps that do not produce the error: - Reboot machine - Open browser (IE 7.0.5730.11) - Load http://www.anysite.com - Close browser - Restart computer (Start - Turn off computer - Restart) Reproduce code: --- It's simply a standard shell to call phpinfo() -- it's probably the standard phpinfo.php that's floating around the Net. Expected result: The PHP code runs as expected. The browser closes as expected. But, when the machine is restarted or shut down, the symptom appears. I expect the machine to shut down without producting an error. Actual result: -- After Windows displays the shutdown page, after it enters the Saving your settings phase, the following window is displayed: dllhost.exe - Application Error The instruction at 0x010a5b81 referenced memory at 0x010a5b81. The memory could not be written. Click on OK to terminate the program Click on CANCEL to debug the program Clicking on Cancel shows the same information, with a single button: Click on OK to terminate the program. Clickin on OK completes the shutdown process, the screen goes black for the expected duration, and the startup process begins. -- Edit this bug report at http://bugs.php.net/?id=39960edit=1
#39429 [Asn-Csd]: Updated API support
ID: 39429 Updated by: [EMAIL PROTECTED] Reported By: anderson at netsweng dot com -Status: Assigned +Status: Closed Bug Type: Feature/Change Request Operating System: any PHP Version: 5.2.0 Assigned To: fmk New Comment: Patch added to 5.2 and 6.0 Branches. Previous Comments: [2006-11-08 13:55:06] anderson at netsweng dot com Description: The ming project has just resynchronized its code w/ the code currently in PHP5. A patch that contains some updates for the PHP version of the module can be found at http://www.netsweng.com/~anderson/php_ming.diff. This adds a couple of new APIs and aligns a few things with the current 0.3 and later version of libming. Note that there are a two chunks in the patch which is used to allow the module to be built for PHP4 (useful when building packages for a distro), but that may not be appropriate for inclusion in PHP5. -- Edit this bug report at http://bugs.php.net/?id=39429edit=1
#39472 [Csd-Bgs]: CLI has encountered a problem : ModName:php5ts.dll
ID: 39472 Updated by: [EMAIL PROTECTED] Reported By: jitudavda at hotmail dot com -Status: Closed +Status: Bogus Bug Type: IIS related Operating System: WinXP SP2 PHP Version: 5.2.0 New Comment: Not a PHP problem in the first place. Previous Comments: [2006-11-16 15:42:34] jitudavda at hotmail dot com Yes, it works with ext modules. I installed on mysql, mssql, pop and smtp. It works fine right now. Threads module is not installed. [2006-11-16 15:14:58] jitudavda at hotmail dot com -Uninstalled PHP. -Removed configuration from IIS -Installed PHP -Added configuration for ISAPI dll. -IIS reset 1] Done request for php page. 2] Got the output as expected. I feel the wrong configuration of IIS is the issue here. But see correct configuration was done by me and I'd the same issue. Check the second post at [11 Nov 4:58pm UTC] Now I will install the ext modules and perform the same test. May be the problem caused by ext modules only. I will reply here after testing with ext modules. Please give me the ext module bug reporting url. Thank you for all help. [2006-11-16 14:56:09] jitudavda at hotmail dot com I've not done any configuration of php with IIS. It's done by the installer itself. I'm now testing with the IIS configuration as noted above. - Use ISAPI version. Though it had the similar issue earler. I will get back soon with the results. Thanks [2006-11-16 14:44:25] [EMAIL PROTECTED] How did you configure IIS to use php.exe instead of php-cgi.exe and why? [2006-11-16 14:42:21] jitudavda at hotmail dot com ==1] == - php.ini files from windows folder and D drive are removed. - uninstalled php - remove all the folders and files from the folder D:\PHP - reinstalled the php with only two options selected. - IIS Restarted. Output of the commands you asked to execute. --- D:\PHPphp -v PHP 5.2.0 (cli) (built: Nov 2 2006 11:57:36) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies D:\PHPphp -m [PHP Modules] bcmath calendar com_dotnet ctype date dom filter ftp hash iconv json libxml odbc pcre Reflection session SimpleXML SPL standard tokenizer wddx xml xmlreader xmlwriter zlib [Zend Modules] D:\PHP -- == ==2] = 1] Request php page from browser. 2] wait for sometime for any output. 3] Open TaskList. 4] Right click Php.exe and Debug. 5] In MSVC, Break the execution. OUTPUT: Debug display disassembled code and following items in stack. -- NTDLL! 7c90eb94() PHP5TS! 10095a48() BELOW IS DISASSEMBLY CODE 7C90EB89 nop 7C90EB8A nop 7C90EB8B mov edx,esp 7C90EB8D sysenter 7C90EB8F nop 7C90EB90 nop 7C90EB91 nop 7C90EB92 nop 7C90EB93 nop 7C90EB94 ret 7C90EB95 lea esp,[esp] 7C90EB9C lea esp,[esp] 7C90EBA0 nop 7C90EBA1 nop 7C90EBA2 nop 7C90EBA3 nop 7C90EBA4 nop 7C90EBA5 lea edx,[esp+8] 7C90EBA9 int 2Eh ==3] = - Copied the php build versions to the D:\php\ - Following files copied php.exe php5ts.dll php.pdb php5ts.pdb - IIS Reset done. 1] Request php page from browser. 2] wait for sometime for any output. 3] Open TaskList. 4] Right click Php.exe and Debug. 5] In MSVC, Break the execution. -- NTDLL! 7c90eb94() MSVCRT! 77c2f941() MSVCRT! 77c2fafa() MSVCRT! 77c411a0() MSVCRT! 77c41225() zend_stream_stdio_reader(void * 0x77c5fc80, char * 0x01162858, unsigned int 8192, void * * * 0x00283c80) line 28 + 23 bytes zend_stream_read(_zend_file_handle * 0x100a0587, char * 0x00283c80, unsigned int 2636928, void * * * 0x004e) line 121 + 22 bytes lex_scan(_zval_struct * 0x1009cc7a, void * * * 0x00c0e51c) line 5249 + 6 bytes zendparse(void * 0x1009fd40) line 2975 + 11 bytes compile_file(_zend_file_handle * 0x10002d85, int 12648140, void * * * 0x0008) line 3084 zend_execute_scripts(int 269185869, void * * * 0x0008, _zval_struct * * 0x00283c80, int 0) line 1090 + 16 bytes php_execute_script(_zend_file_handle * 0x00285050, void * * * 0x00fa7ce8) line 1758 + 18 bytes _efree(void * 0x00fa7ce8) line 1660 + 24 bytes _zval_ptr_dtor(_zval_struct * * 0x00fa7d0c) line 415 +
#39472 [Fbk]: CLI has encountered a problem : ModName:php5ts.dll
ID: 39472 Updated by: [EMAIL PROTECTED] Reported By: jitudavda at hotmail dot com Status: Feedback Bug Type: Unknown/Other Function Operating System: WinXP SP2 PHP Version: 5.2.0 New Comment: If php.exe hangs when you request a page through ISS you are configuring IIS wrong! php.exe = CLI version of PHP php-cgi.exe = CGI/FastCGI version php5isapi.dll = ISAPI version. php.exe should only be used for command line execution of PHP scripts. Previous Comments: [2006-11-16 13:09:24] [EMAIL PROTECTED] Please find delete all php.ini's in your system. After that make sure you don't have any .dlls from the previous PHP version installed, delete them if you find any. Then grab the latest snapshot, install it and run `php.exe -v` and `php.exe -m`. If you're still able to reproduce the problem with this two simple commands - please post *REAL* backtrace (the one that doesn't mention modules which are not installed). Thank in advance. [2006-11-16 12:56:37] jitudavda at hotmail dot com CHANDING THE STATUS TO BOGUS HURTS. PHP version has bug with WinXp, this is a fact. I expect the bug manager/moderators to help in finding the place, instead of making the issue as bogus. If you need further help, please write here for the step you need me to perform. Below is the current installation of php on WinXP. OS: WinXP PHP: php 5.2.0 INSTALLATION OPTIONS: 1] \PHP\Program\CLI Executable 2] \PHP\Web Server Setup\IIS 4+ ISAPI module Note: All other options are not installed or marked donot install PERMISSION: IUSER_DEV has Read/Execute permision on all object of D:\PHP -installed folder. PROBLEM: Request to any php page hangs the php.exe Goodluck. [2006-11-16 12:40:58] jitudavda at hotmail dot com The above reply at [16 Nov 12:14pm UTC] jitudavda at hotmail dot com is done after chanding installation without any extension extras. [2006-11-16 12:15:22] [EMAIL PROTECTED] Oh, yes you do: + name0x01b22100 threads - functions 0x01b23010 + fname 0x01b22188 thread_start This is PECL/threads, which has never been officially released. [2006-11-16 12:14:56] jitudavda at hotmail dot com 1] Request php page from browser. 2] wait for sometime for any output. 3] Open TaskList. 4] Right click Php.exe and Debug. 5] In MSVC, Break the execution. Above are the steps to get the output as below in the call stack. == NTDLL! 7c90eb94() MSVCRT! 77c2f941() MSVCRT! 77c2fafa() MSVCRT! 77c411a0() MSVCRT! 77c41225() zend_stream_stdio_reader(void * 0x77c5fc80, char * 0x011638a0, unsigned int 8192, void * * * 0x00283c80) line 28 + 23 bytes zend_stream_read(_zend_file_handle * 0x100a0587, char * 0x00283c80, unsigned int 2636928, void * * * 0x004e) line 121 + 22 bytes lex_scan(_zval_struct * 0x1009cc7a, void * * * 0x00c0e51c) line 5249 + 6 bytes zendparse(void * 0x1009fd40) line 2975 + 11 bytes compile_file(_zend_file_handle * 0x10002d85, int 12648140, void * * * 0x0008) line 3084 zend_execute_scripts(int 269185869, void * * * 0x0008, _zval_struct * * 0x00283c80, int 0) line 1090 + 16 bytes php_execute_script(_zend_file_handle * 0x00285050, void * * * 0x00fa7ce8) line 1758 + 18 bytes _efree(void * 0x00fa7ce8) line 1660 + 24 bytes _zval_ptr_dtor(_zval_struct * * 0x00fa7d0c) line 415 + 37 bytes _zend_hash_add_or_update(_hashtable * 0x100bc77f, char * 0x00fa7278, unsigned int 4207956, void * 0x000e, unsigned int 12647804, void * * 0x0004, int 13) line 229 + 6 bytes php_register_variable_ex(char * 0x1000a501, _zval_struct * 0x00c0fe14, _zval_struct * 0x, void * * * 0x) line 208 + 128 bytes _emalloc(unsigned int 43) line 1647 + 24 bytes _zend_hash_add_or_update(_hashtable * 0x0040214d, char * 0x00c0fecc, unsigned int 2636928, void * 0x009bffdc, unsigned int 2009291924, void * * 0x7ffd7000, int 12648268) line 242 + 9 bytes main(int 0, char * * 0x) line 1109 002850ec() == The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/39472 -- Edit this bug report at http://bugs.php.net/?id=39472edit=1
#39319 [Bgs]: Problem to connect to SQLSERVER 2005
ID: 39319 Updated by: [EMAIL PROTECTED] Reported By: luiscervantesjane at hotmail dot com Status: Bogus Bug Type: MSSQL related Operating System: WINDOWS 2003 PHP Version: 5.1.6 New Comment: The client tools are installed on the MSSQL server by default. If the Web server and MSSQL server are running on the same box there is no need for special actions. If the web server is running on another box you can install the client tools from the CD on the web server. Previous Comments: [2006-11-02 09:34:45] luiscervantesjane at hotmail dot com Hi. Who can I configure this? Have I to install Client Network Tools in the server web o reconfigure the Client Network Tools has is installed in the MSSQL. I have runnig other web server (XP Pro) and move the code in the other PC and the connection is right. Do you know why.. Thanks [2006-10-31 15:45:15] [EMAIL PROTECTED] The MSSQL extension uses ntwdblib to connect to the server. This Microsoft library can be configured with Netbios or TCP/IP as the default library. Use the Client Network Tools to specify the default protocol and to create server aliases. A server alias can be defined to use a specific host name and port numbr and you can use the alias as the first parameter to mssql_connect(). [2006-10-31 11:03:36] luiscervantesjane at hotmail dot com Description: The web server are running in windows 2003, Version Apache/2.0.55 (Win32) PHP/5.1.6. And when I try to connect to MSSQL 2005 over windows2003, I can`t. If the code move to another server windows 2000, with the same Apache Version, PHP 5.1.6. The connection is OK. I belive that there are a problem the connection with SO windows2003 where are running php. Thanks Reproduce code: --- $SERVER=SATURNO\SATURNO; $USER=USER; $PASSWD=PASSWORD; $link = mssql_connect($SERVER, $USER, $PASSWD) or die (Could not connect MSSQL); mssql_select_db($DATABASE,$link) or die (Could not select database . $DATABASE. in MSSQL); $query = Select * form TABLA; $result = mssql_query($link,$query); while ($row = mssql_fetch_array($result)){ print $row['ALU_NOMBRE'] . bR; } Expected result: Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: SATURNO\SATURNO in C:\WEB\PRUEBAS\SQL2005\index2.php on line 5 Could not connect MSSQL -- Edit this bug report at http://bugs.php.net/?id=39319edit=1
#39134 [Opn-Fbk]: PHP + FreeTDS 0.64 crashes when TEXT field with empty string encountered
ID: 39134 Updated by: [EMAIL PROTECTED] Reported By: jr-phpbugs at cedric dot unob dot cz -Status: Open +Status: Feedback Bug Type: MSSQL related Operating System: linux (irrelevant) PHP Version: 4.4.4 New Comment: try using --with-mssql instead of --with-sybase-ct. When you are compiling with the sybase option you are not using the MSSQL extension but the sybase extension that happens to have aliasses so you can use mssql_* when you call the functions. - Frank Previous Comments: [2006-10-31 05:22:07] cameron dot mcshane at csiro dot au I have also experienced this problem. Details: SuSE SLES 9 php 4.4.2 ('./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--prefix=/usr/local/php' '--with-sybase-ct=/usr/local/freetds') FreeTDS 0.64 MS MSL 2000 Have tested code as provided in original bug report. CLI version: - crash with segmentation fault message libphp4.so version: - affected thread produces a line [notice] child pid X exit signal Segmentation fault (11) in Apache's error log. backtrace included below: Program received signal SIGSEGV, Segmentation fault. 0x4014c40c in memcpy () from /lib/tls/libc.so.6 (gdb) bt #0 0x4014c40c in memcpy () from /lib/tls/libc.so.6 #1 0x0811d82b in _estrndup (s=0x820522c , length=136454143) at /usr/src/php-4.4.2/Zend/zend_alloc.c:387 #2 0x080e6c18 in php_sybase_fetch_result_row (result=0x81e825f, numrows=-1) at /usr/src/php-4.4.2/ext/sybase_ct/php_sybase_ct.c:1185 #3 0x080e8586 in php_sybase_fetch_result_set (sybase_ptr=0x81caf7c, buffered=0, store=value optimized out) at /usr/src/php-4.4.2/ext/sybase_ct/php_sybase_ct.c:1333 #4 0x080e8bbb in php_sybase_query (ht=value optimized out, return_value=0x81cdb1c, this_ptr=value optimized out, return_value_used=1, buffered=0) at /usr/src/php-4.4.2/ext/sybase_ct/php_sybase_ct.c:1497 #5 0x0813ad3c in execute (op_array=0x81caf14) at /usr/src/php-4.4.2/Zend/zend_execute.c:1675 #6 0x08129623 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/src/php-4.4.2/Zend/zend.c:934 #7 0x0810181e in php_execute_script (primary_file=0xb3c0) at /usr/src/php-4.4.2/main/main.c:1753 #8 0x0813bda2 in main (argc=2, argv=0xb484) at /usr/src/php-4.4.2/sapi/cli/php_cli.c:830 (gdb) frame 5 #5 0x0813ad3c in execute (op_array=0x81caf14) at /usr/src/php-4.4.2/Zend/zend_execute.c:1675 1675 ((zend_internal_function *) EX(function_state).function)-handler(EX(opline)-extended_value, EX(Ts)[EX(opline)-result.u.var].var.ptr, EX(object).ptr, return_value_used TSRMLS_CC); (gdb) print (char *)(executor_globals.function_state_ptr-function)-common.function_name $1 = 0x8150075 mssql_query (gdb) print (char *)executor_globals.active_op_array-function_name $2 = 0x0 (gdb) print (char *)executor_globals.active_op_array-filename $3 = 0x81cefdc (gdb) [2006-10-12 10:32:07] jr-phpbugs at cedric dot unob dot cz (gdb) bt #0 0x003e830f in memcpy () from /lib/libc.so.6 #1 0x0816d0ca in _estrndup (s=0x838a4ac , length=137940992, __zend_filename=0x8235d40 /usr/local/src/php/php-4.4.4/ext/sybase_ct/php_sybase_ct.c, __zend_lineno=1185, __zend_orig_filename=0x0, __zend_orig_lineno=0) at /usr/local/src/php/php-4.4.4/Zend/zend_alloc.c:409 #2 0x0813627c in php_sybase_fetch_result_row (result=0x838b450, numrows=-1) at /usr/local/src/php/php-4.4.4/ext/sybase_ct/php_sybase_ct.c:1185 #3 0x08136857 in php_sybase_fetch_result_set (sybase_ptr=0x8352334, buffered=0, store=-1) at /usr/local/src/php/php-4.4.4/ext/sybase_ct/php_sybase_ct.c:1333 #4 0x08136ed3 in php_sybase_query (ht=-1, return_value=0x8389c14, this_ptr=0x0, return_value_used=1, buffered=0) at /usr/local/src/php/php-4.4.4/ext/sybase_ct/php_sybase_ct.c:1497 #5 0x081371e9 in zif_sybase_query (ht=2, return_value=0x8389c14, this_ptr=0x0, return_value_used=1) at /usr/local/src/php/php-4.4.4/ext/sybase_ct/php_sybase_ct.c:1626 #6 0x0818819c in execute (op_array=0x83522ac) at /usr/local/src/php/php-4.4.4/Zend/zend_execute.c:1675 #7 0x0817a183 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/local/src/php/php-4.4.4/Zend/zend.c:934 #8 0x0815336b in php_execute_script (primary_file=0xbfffdbe0) at /usr/local/src/php/php-4.4.4/main/main.c:1752 #9 0x0818c938 in main (argc=4, argv=0xbfffdc74) at /usr/local/src/php/php-4.4.4/sapi/cli/php_cli.c:832 #10 0x00381bb4 in __libc_start_main () from /lib/libc.so.6 (gdb) frame 6 #6 0x0818819c in execute (op_array=0x83522ac) at /usr/local/src/php/php-4.4.4/Zend/zend_execute.c:1675 1675 ((zend_internal_function *) EX(function_state).function)-handler(EX(opline)-extended_value, EX(Ts)[EX(opline)-result.u.var].var.ptr, EX(object).ptr,
#39319 [Opn-Bgs]: Problem to connect to SQLSERVER 2005
ID: 39319 Updated by: [EMAIL PROTECTED] Reported By: luiscervantesjane at hotmail dot com -Status: Open +Status: Bogus Bug Type: MSSQL related Operating System: WINDOWS 2003 PHP Version: 5.1.6 New Comment: The MSSQL extension uses ntwdblib to connect to the server. This Microsoft library can be configured with Netbios or TCP/IP as the default library. Use the Client Network Tools to specify the default protocol and to create server aliases. A server alias can be defined to use a specific host name and port numbr and you can use the alias as the first parameter to mssql_connect(). Previous Comments: [2006-10-31 11:03:36] luiscervantesjane at hotmail dot com Description: The web server are running in windows 2003, Version Apache/2.0.55 (Win32) PHP/5.1.6. And when I try to connect to MSSQL 2005 over windows2003, I can`t. If the code move to another server windows 2000, with the same Apache Version, PHP 5.1.6. The connection is OK. I belive that there are a problem the connection with SO windows2003 where are running php. Thanks Reproduce code: --- $SERVER=SATURNO\SATURNO; $USER=USER; $PASSWD=PASSWORD; $link = mssql_connect($SERVER, $USER, $PASSWD) or die (Could not connect MSSQL); mssql_select_db($DATABASE,$link) or die (Could not select database . $DATABASE. in MSSQL); $query = Select * form TABLA; $result = mssql_query($link,$query); while ($row = mssql_fetch_array($result)){ print $row['ALU_NOMBRE'] . bR; } Expected result: Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: SATURNO\SATURNO in C:\WEB\PRUEBAS\SQL2005\index2.php on line 5 Could not connect MSSQL -- Edit this bug report at http://bugs.php.net/?id=39319edit=1
#39165 [Asn-Bgs]: Segmentation fault in ext/ming when adding text without setting size before
ID: 39165 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Assigned +Status: Bogus Bug Type: Ming related Operating System: Linux 2.6.18 PHP Version: 5.2.0RC5 Assigned To: fmk New Comment: This is a problem in libming. I have a patch that should be included in the next version of libming. Previous Comments: [2006-10-16 12:13:38] [EMAIL PROTECTED] Description: Calling addString on a SWFText object without setting height or font before causes a segmentation fault in libming.so. If only the height is set, the expected error occurs. Backtrace: (gdb) bt #0 0xb7e124dc in SWFText_addWideString () from /usr/lib/libming.so.0 #1 0xb7e12678 in SWFText_addString () from /usr/lib/libming.so.0 #2 0x08189f23 in zim_swftext_addString (ht=1, return_value=0x875c140, return_value_ptr=0x0, this_ptr=0x0, return_value_used=0) at /home/kore/bin/php/php-5.2-stable/php-src/ext/ming/ming.c:3541 ... (Complete backtrace on request) Tested with PHP 5.1.6, ming 0.3 PHP 5.2-RC5 ming 0.3 Reproduce code: --- ?php $text = 'Teststring'; $size = 60; $t = new SWFText(); //$t-setHeight( $size ); //$t-setFont( new SWFFont( 'fdb_font.fdb' ) ); $t-addString( $text ); Expected result: Error message like this: Catchable fatal error: SWFText::addString(): font must be set before calling addString in /home/kore/devel/ezcomponents/trunk/test.php on line 9 Actual result: -- Segmentation fault. -- Edit this bug report at http://bugs.php.net/?id=39165edit=1
#38988 [Fbk-Bgs]: Chaning mssql.datetimeconvert has no effect
ID: 38988 Updated by: [EMAIL PROTECTED] Reported By: wiggum24 at gmail dot com -Status: Feedback +Status: Bogus Bug Type: MSSQL related Operating System: Redhat Enterprise Linux PHP Version: 5.1.6 New Comment: Works fine here. Did you remove ; in front of the line? Previous Comments: [2006-09-29 09:09:28] [EMAIL PROTECTED] Trying to set mssql.datetimeconvert to Off in php.ini doesn't work. phpinfo() reports it as On, and the behaviour of the recordset reflects the same. Which php.ini is used by PHP according to phpinfo()? Which php.ini did you change? Did you restart the web-server? [2006-09-29 06:47:39] wiggum24 at gmail dot com Description: Trying to set mssql.datetimeconvert to Off in php.ini doesn't work. phpinfo() reports it as On, and the behaviour of the recordset reflects the same. I've confirmed php is picking up the correct php.ini, and my php.ini contains no errors. Calling ini_set(mssql.datetimeconvert,Off); before I do the query will set the value and the queries will return correctly. Reproduce code: --- No errors, the setting just doesn't apply. Expected result: datetimes should appear as: 2006-07-20 16:32:00 Actual result: -- datetimes appear as: Jul 20 2006 04:32PM -- Edit this bug report at http://bugs.php.net/?id=38988edit=1
#38965 [Opn-Bgs]: mssql_connect doesn't use TCP 1433 for external SQL Server
ID: 38965 Updated by: [EMAIL PROTECTED] Reported By: aren at cambre dot biz -Status: Open +Status: Bogus Bug Type: MSSQL related Operating System: Windows 2003 (for both servers) PHP Version: 4.4.4 Assigned To: fmk New Comment: The MSSQL Extension for PHP uses ntwdblib as the library to connect to teh server. The configuration of this library is done with MS SQL Server Client Tools. These tools are installed from the CD and can be installed without the rest of the server to allow remote connections to the server. If ntwdblib.dll is copied to the server one way or the other, there is no way (except for registry hacks) to configure the library. PHP is not responsible for installation of a Microsoft tool or any other 3rd party libraries, but we expect them to be installed correct. There is no bugs in PHP here. Previous Comments: [2006-09-26 19:15:13] aren at cambre dot biz Lemme add some more info: The IIS (web) server is a really vanilla Windows Server 2003 box. All that is installed, per Add or Remove Programs, is McAfee VirusScan Enterprise, Microsoft .NET Framework 2.0, PHP 4.4.4, and WMware Tools (it's virtual). I also installed Wireshark 0.99.3 and WinPcap 3.1, but they were installed afte the fact and did not affect the issue. If PHP's SQL Server connect script doesn't work right on a vanilla box, I can't believe this is bogus. SQL Server or SQL Server Client Tools has never been installed on this box. Programs should adhere to industry standard behaviors on vanilla Windows boxes, and industry standard for talking to SQL Server is TCP 1433. If PHP is not doing it, it needs to be fixed or properly documented. It may be as simply as classifying this as a documentation bug and adding documentation that addresses the issue, if that is the proper solution. [2006-09-26 18:23:45] aren at cambre dot biz This ntwdblib was on a default installation of Windows Server 2003. [2006-09-26 17:35:43] [EMAIL PROTECTED] No PHP uses ntwdblib and if you install the Client tools from MSSQL server you can define the default protocol. Older versions of ntwdblib (or combinations of other MS tools installed) uses named pipes as the default. The best way is to install the Client Tools and us the Clinet Network utility to set default protocol as well as create aliases for different servers. Each alias can be defined with the prefered protocol. [2006-09-26 17:25:21] [EMAIL PROTECTED] Frank, is this really a PHP problem? [2006-09-26 17:16:54] aren at cambre dot biz Description: When using mssql_connect to connect to a SQL Server database on a remote server, PHP attemtps to connect using named pipes. This is a terribly outdated behavior; SQL Server connections these days are almost always done with TCP 1433. I figured this out with a difficult phpBB installation and using Wireshark (formerly Ethereal) to watch network traffic. There is a registry hack that can force the SQL Server Client program to use TCP 1433, but this hack's effects on other software is unknown. For more info, see http://people.smu.edu/acambre/blog/2006/09/22/Buggy+PHP.aspx and http://www.phpbb.com/phpBB/viewtopic.php?t=446662postdays=0postorder=ascstart=0 Reproduce code: --- Just use mssql_connect to connect to an external database. Expected result: The database should open just as if the database is on localhost. Actual result: -- Usually a cannot connect error. -- Edit this bug report at http://bugs.php.net/?id=38965edit=1
#38965 [Asn-Bgs]: mssql_connect doesn't use TCP 1433 for external SQL Server
ID: 38965 Updated by: [EMAIL PROTECTED] Reported By: aren at cambre dot biz -Status: Assigned +Status: Bogus Bug Type: MSSQL related Operating System: Windows 2003 (for both servers) PHP Version: 4.4.4 Assigned To: fmk New Comment: No PHP uses ntwdblib and if you install the Client tools from MSSQL server you can define the default protocol. Older versions of ntwdblib (or combinations of other MS tools installed) uses named pipes as the default. The best way is to install the Client Tools and us the Clinet Network utility to set default protocol as well as create aliases for different servers. Each alias can be defined with the prefered protocol. Previous Comments: [2006-09-26 17:25:21] [EMAIL PROTECTED] Frank, is this really a PHP problem? [2006-09-26 17:16:54] aren at cambre dot biz Description: When using mssql_connect to connect to a SQL Server database on a remote server, PHP attemtps to connect using named pipes. This is a terribly outdated behavior; SQL Server connections these days are almost always done with TCP 1433. I figured this out with a difficult phpBB installation and using Wireshark (formerly Ethereal) to watch network traffic. There is a registry hack that can force the SQL Server Client program to use TCP 1433, but this hack's effects on other software is unknown. For more info, see http://people.smu.edu/acambre/blog/2006/09/22/Buggy+PHP.aspx and http://www.phpbb.com/phpBB/viewtopic.php?t=446662postdays=0postorder=ascstart=0 Reproduce code: --- Just use mssql_connect to connect to an external database. Expected result: The database should open just as if the database is on localhost. Actual result: -- Usually a cannot connect error. -- Edit this bug report at http://bugs.php.net/?id=38965edit=1
#38924 [Opn-Bgs]: mssql_next_result returns FALSE on multiple Resultsets
ID: 38924 Updated by: [EMAIL PROTECTED] Reported By: info at benjamin-wilger dot de -Status: Open +Status: Bogus Bug Type: MSSQL related Operating System: Windows PHP Version: 4.4.4 New Comment: You should always release the result when you are done with it or use a new variable name for each result if you want to keep multiple results open. Two ways to make your code work: ?php $con = mssql_connect(localhost, sa, s2sihaviv); $result = mssql_query('SELECT 1', $con); while($row = mssql_fetch_array($result)) { $rows_first_query[] = $row; } $result2 = mssql_query('SELECT 13; SELECT 2; SELECT 3', $con); // Would return three rows do { while($row = mssql_fetch_array($result2)) { $rows_first_query[] = $row; } } while ($next_result = mssql_next_result($result2)); // Will return FALSE print_r($rows_first_query); ? ?php $con = mssql_connect(localhost, sa, s2sihaviv); $result = mssql_query('SELECT 1', $con); while($row = mssql_fetch_array($result)) { $rows_first_query[] = $row; } mssql_free_result($result); $result = mssql_query('SELECT 13; SELECT 2; SELECT 3', $con); // Would return three rows do { while($row = mssql_fetch_array($result)) { $rows_first_query[] = $row; } } while ($next_result = mssql_next_result($result)); // Will return FALSE print_r($rows_first_query); ? Previous Comments: [2006-09-22 11:16:53] info at benjamin-wilger dot de Description: mssql_next_result returns FALSE on multiple Resultsets if a simple select has been executed and the data is fetched before. If one doesn't run a query before running a multiple query batch (e.g. Stored Procedure) it works fine. Look at the reproduce code to completly understand the problem. Tested on PHP 4.3.11 (*not* buggy), 4.4.1 (*not* buggy), 4.4.2 (buggy), 4.4.3 (buggy), 4.4.4 (buggy), 5.1.4 (buggy). Reproduce code: --- ?php mssql_connect(...); mssql_select_db(...); $result = mssql_query('SELECT 1'); while($row = mssql_fetch_array($result)) { $rows_first_query[] = $row; } $result = mssql_query('SELECT 1 SELECT 2 SELECT 3'); // Would return three rows do { while($row = mssql_fetch_array($result)) { $rows_first_query[] = $row; } } while ($next_result = mssql_next_result($result)); // Will return FALSE in any version after 4.4.1 in this case Expected result: On systems with PHP 4.4.1 or lower it will run fine $rows_first_query has one row $rows_second_query has *three* rows Actual result: -- Any version above (including 5.1.x branch) will return just one row in $rows_second_query. WORKAROUND to get it running: Run mssql_free_result() after the every fetching of data. -- Edit this bug report at http://bugs.php.net/?id=38924edit=1
#38849 [Fbk-Opn]: ntwdblib.dll that comes with PHP5 does not work
ID: 38849 Updated by: [EMAIL PROTECTED] Reported By: dan dot mashal at gmail dot com -Status: Feedback +Status: Open Bug Type: MSSQL related Operating System: Windows PHP Version: 5.1.6 New Comment: Copying the ntwdblib.dll is never a good option. Use the install process on the MSSQL Server to install the Client Tools. That will install the correct version of ntwdblib.dll and other tools that makes it possible to use all features and gives acces to the configuration tools. Installing Client Tools will not install the server. Previous Comments: [2006-09-18 17:56:10] [EMAIL PROTECTED] Do you get any error messages? [2006-09-18 17:30:06] dan dot mashal at gmail dot com And by does not work I mean PHP is unable to connect to MSSQL databases. [2006-09-18 17:29:21] dan dot mashal at gmail dot com I mean that you have to copy the ntwdblib.dll that is on the MSSQL2000 CD. Otherwise it doesnt work. [2006-09-15 23:06:51] [EMAIL PROTECTED] What do you mean by corrupted, does not work and broken ? [2006-09-15 19:16:39] dan dot mashal at gmail dot com Description: The ntwdblib.dll that comes with PHP5 is corrupted. You must copy ntwdblib.dll from MSSQL 2000 to the C:\windows\system32 folder or C:\PHP folder. Otherwise MSSQL functionality is broken in PHP. -- Edit this bug report at http://bugs.php.net/?id=38849edit=1
#38849 [Opn-Fbk]: ntwdblib.dll that comes with PHP5 does not work
ID: 38849 Updated by: [EMAIL PROTECTED] Reported By: dan dot mashal at gmail dot com -Status: Open +Status: Feedback Bug Type: MSSQL related Operating System: Windows PHP Version: 5.1.6 New Comment: This sounds odd to me. the SQL Server Client tools is only a conectivity pack and it installs fine on the full version of Windows Server 2003 (I'm using that combination). What kind of errors do you get when you try to install? Previous Comments: [2006-09-18 18:29:25] dan dot mashal at gmail dot com To Tony: You just get a generic mssql_connect failed error. This is a known bug. From http://www.php.net/mssql_connect damartman (tradestudios.com) 23-Aug-2006 12:29 I am running MS SQL Server 2005 Workgroup Edition on Windows 2003 with PHP 5. I could not connect to a MS SQL database using mssql_pconnect(); until I read a post from ashraf (aat) ametry.com on 01-May-2006 01:25. However, my fix was simply to: 1. Replace the ntwdblib.dll with the one from http://webzila.com/dll/1/ntwdblib.zip in my c:\php5 folder. 2. Restart IIS REASON: The ntwdblib.dll should be version 2000.80.194.0, and not version 2000.2.8.0 that PHP 5 ships with. Thank you ashraf for posting your note, however, changing the php.ini file value mssql.secure_connection = On did not work. I left it mssql.secure_connection = Off and that worked (the default to connect through NT/Windows Authentication) This zip is basically the same ntwdblib.dll that ships with the MSSQL2000 CD. [2006-09-18 18:25:48] dan dot mashal at gmail dot com This does not solve the problem. You cannot install MSSQL 2000 Client tools on Windows 2003 web edition. [2006-09-18 17:57:28] [EMAIL PROTECTED] Copying the ntwdblib.dll is never a good option. Use the install process on the MSSQL Server to install the Client Tools. That will install the correct version of ntwdblib.dll and other tools that makes it possible to use all features and gives acces to the configuration tools. Installing Client Tools will not install the server. [2006-09-18 17:56:10] [EMAIL PROTECTED] Do you get any error messages? [2006-09-18 17:30:06] dan dot mashal at gmail dot com And by does not work I mean PHP is unable to connect to MSSQL databases. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/38849 -- Edit this bug report at http://bugs.php.net/?id=38849edit=1
#38849 [Opn-Fbk]: ntwdblib.dll that comes with PHP5 does not work
ID: 38849 Updated by: [EMAIL PROTECTED] Reported By: dan dot mashal at gmail dot com -Status: Open +Status: Feedback Bug Type: MSSQL related Operating System: Windows PHP Version: 5.1.6 New Comment: I do not have access to the web edition, so I asked what kind of errors you are getting when you try to install the client tools? One of the features of the client tools is the ability to set the default protocol used to communicate with SQL server. If the dll is copied you rely on the default setting in the dll you are using and that changes from version to version. The default used to be netbios but was changed to tcp/ip at some point. Previous Comments: [2006-09-18 18:46:58] dan dot mashal at gmail dot com You are using standard edition. Try web edition. :) [2006-09-18 18:30:16] [EMAIL PROTECTED] This sounds odd to me. the SQL Server Client tools is only a conectivity pack and it installs fine on the full version of Windows Server 2003 (I'm using that combination). What kind of errors do you get when you try to install? [2006-09-18 18:29:25] dan dot mashal at gmail dot com To Tony: You just get a generic mssql_connect failed error. This is a known bug. From http://www.php.net/mssql_connect damartman (tradestudios.com) 23-Aug-2006 12:29 I am running MS SQL Server 2005 Workgroup Edition on Windows 2003 with PHP 5. I could not connect to a MS SQL database using mssql_pconnect(); until I read a post from ashraf (aat) ametry.com on 01-May-2006 01:25. However, my fix was simply to: 1. Replace the ntwdblib.dll with the one from http://webzila.com/dll/1/ntwdblib.zip in my c:\php5 folder. 2. Restart IIS REASON: The ntwdblib.dll should be version 2000.80.194.0, and not version 2000.2.8.0 that PHP 5 ships with. Thank you ashraf for posting your note, however, changing the php.ini file value mssql.secure_connection = On did not work. I left it mssql.secure_connection = Off and that worked (the default to connect through NT/Windows Authentication) This zip is basically the same ntwdblib.dll that ships with the MSSQL2000 CD. [2006-09-18 18:25:48] dan dot mashal at gmail dot com This does not solve the problem. You cannot install MSSQL 2000 Client tools on Windows 2003 web edition. [2006-09-18 17:57:28] [EMAIL PROTECTED] Copying the ntwdblib.dll is never a good option. Use the install process on the MSSQL Server to install the Client Tools. That will install the correct version of ntwdblib.dll and other tools that makes it possible to use all features and gives acces to the configuration tools. Installing Client Tools will not install the server. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/38849 -- Edit this bug report at http://bugs.php.net/?id=38849edit=1
#13722 [NoF]: mssql text type returns only 255 char
ID: 13722 Updated by: [EMAIL PROTECTED] Reported By: brendan at msu dot edu Status: No Feedback Bug Type: Sybase-ct (ctlib) related Operating System: Solaris 2.7 PHP Version: 4.2.1 New Comment: Make sure you set TDS Version to 7 or 8. You can do this in freetds.conf where you define your server connection. Previous Comments: [2006-09-05 09:21:36] hostmak at gmail dot com problem still existsideas ? :| [2002-09-14 01:00:01] php-bugs at lists dot php dot net No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to Open. [2002-08-13 23:41:55] [EMAIL PROTECTED] updating version as well. [2002-08-13 23:41:36] [EMAIL PROTECTED] try doing a SET TEXTSIZE some really large number here in an exec command. [2002-07-26 23:42:43] systematic11 at comcast dot net As of version 4.2.1, this issue has still not been corrected. Perhaps the problem lies with FreeTDS. Apparently neither the CT-Lib and DB-Lib for Sybase have no use for this property (MSSQL TEXT SIZE). If you must connect to MS SQL Server from PHP, I would suggest creating an include file that is included at the top of any PHP script that needs to access the MS SQL Server. Let the include file open a connection and call a query to set textsize 65536 or to whatever limit you want. e.g. ?php // include file for MS SQL server $HOSTNAME = SQLServer70; $USERNAME = sa; $PASSWORD = ??; $conn = mssql_pconnect($HOSTNAME, $USERNAME, $PASSWORD); if ($conn) { mssql_query(SET TEXTSIZE 65536); mssql_select_db(whatever, $conn); } ? Kelly Akins The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/13722 -- Edit this bug report at http://bugs.php.net/?id=13722edit=1
#38502 [Opn-NoF]: mssql_fetch_Assoc result error (date type field)
ID: 38502 Updated by: [EMAIL PROTECTED] Reported By: kecso at i-trade dot hu -Status: Open +Status: No Feedback Bug Type: MSSQL related Operating System: debian PHP Version: 5.1.5 New Comment: This sounds more like a configuration problem with freetds. Please reconfigure using --enable-msdblib. Previous Comments: [2006-08-18 15:28:54] kecso at i-trade dot hu Description: Hi! MYSQL version: MySQL 5.0.22-Debian_1.dotdeb.1-log PHP version: PHP Version 5.0.5-Debian-0.8~sarge1 (Debian GNU/Linux) After fetching data, the date was 1 month lesser than the current system date. Tested with SQL Query Analyzer the date was correct. If converted the date, was correct... SELECT convert(varchar(50), getdate(), 102) Best regards: Kecso Reproduce code: --- $r = mssql_query(SELECT getDate();); print_r(mssql_fetch_Assoc($r)); Expected result: Array ( [computed] = 2006-08-18 17:07:05 ) Actual result: -- Array ( [computed] = 2006-07-18 17:07:05 ) -- Edit this bug report at http://bugs.php.net/?id=38502edit=1
#38502 [NoF-Fbk]: mssql_fetch_Assoc result error (date type field)
ID: 38502 Updated by: [EMAIL PROTECTED] Reported By: kecso at i-trade dot hu -Status: No Feedback +Status: Feedback Bug Type: MSSQL related Operating System: debian PHP Version: 5.1.5 New Comment: oops wrong status. Previous Comments: [2006-08-21 14:30:20] [EMAIL PROTECTED] This sounds more like a configuration problem with freetds. Please reconfigure using --enable-msdblib. [2006-08-18 15:28:54] kecso at i-trade dot hu Description: Hi! MYSQL version: MySQL 5.0.22-Debian_1.dotdeb.1-log PHP version: PHP Version 5.0.5-Debian-0.8~sarge1 (Debian GNU/Linux) After fetching data, the date was 1 month lesser than the current system date. Tested with SQL Query Analyzer the date was correct. If converted the date, was correct... SELECT convert(varchar(50), getdate(), 102) Best regards: Kecso Reproduce code: --- $r = mssql_query(SELECT getDate();); print_r(mssql_fetch_Assoc($r)); Expected result: Array ( [computed] = 2006-08-18 17:07:05 ) Actual result: -- Array ( [computed] = 2006-07-18 17:07:05 ) -- Edit this bug report at http://bugs.php.net/?id=38502edit=1
#38488 [Opn]: Access to php://stdin and faily crashes PHP on win32
ID: 38488 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Streams related Operating System: win32 PHP Version: 5CVS-2006-08-18 (CVS) New Comment: I'm unable to get my system to crash (CGI and CLI). What SAPI are you using? Previous Comments: [2006-08-18 02:31:47] [EMAIL PROTECTED] Description: Access to standard streams using php://stdin and family names produces crash. The reason probably is in a buggy _get_osfhandle() function that doesn't return proper HANDLES for standard system streams. We need find out a workaround for this problem. the bug is probably related to bug #7960 Reproduce code: --- ?php $f = fopen(php://stdout, w+); fwrite($f, Hello\n); ? Expected result: Hello Actual result: -- Crash with the following stack trace NTDLL! 7c90eb74() NTDLL! 7c90eb94() _php_stream_fopen_from_fd(int 0, const char * 0x00416fb0 `string', const char * 0x, int 0, char * 0x1070a25c `string', unsigned int 246, char * 0x, unsigned int 0, void * * * 0x02714fe0) line 200 + 24 bytes php_stream_url_wrap_php(_php_stream_wrapper * 0x108a5d28 _php_stream_php_wrapper, char * 0x00416fa6, char * 0x00416fb0 `string', int 8, char * * 0x, _php_stream_context * 0x, int 1, char * 0x106dd51c `string', unsigned int 1774, char * 0x004165c8 `string', unsigned int 498, void * * * 0x02714fe0) line 246 + 41 bytes _php_stream_open_wrapper_ex(char * 0x00416fa0 `string', char * 0x00416fb0 `string', int 0, char * * 0x, _php_stream_context * 0x, int 0, char * 0x004165c8 `string', unsigned int 498, char * 0x, unsigned int 0, void * * * 0x02714fe0) line 1774 + 111 bytes cli_register_file_handles(void * * * 0x02714fe0) line 498 + 52 bytes main(int 2, char * * 0x026f8fc0) line 1030 + 12 bytes -- Edit this bug report at http://bugs.php.net/?id=38488edit=1
#28227 [Asn]: PHP CGI depends upon non-standard SCRIPT_FILENAME
ID: 28227 Updated by: [EMAIL PROTECTED] Reported By: lukem at NetBSD dot org Status: Assigned Bug Type: CGI related Operating System: * PHP Version: 5CVS, 4CVS (2005-02-04) Assigned To: fmk New Comment: The patch broke CGI on other web servers (IIS on Win32). That was the reason it was reverted. So far I have not been able to come up with a way to apply your patch so it will work in all cases (not breaking existing installed systems). Previous Comments: [2006-08-10 00:04:42] lukem at NetBSD dot org If I recall correctly, PHP4 as a CGI _did_ rely upon SCRIPT_FILENAME being set by the web server, at least in the default build of PHP4. My original workaround was to modify the non-Apache web server I was using to set SCRIPT_FILENAME before invoking php-as-cgi. IMHO, it not an acceptable long-term solution to modify the _web server_ because the _CGI application_ (php) relies upon a non-standard CGI variable. Which is why I developed the patch, which worked at the time for the release of PHP I was using (4.3.6). Based on the replies I've seen to my bug report patch, other people are also seeing this problem, even in newer releases of PHP. Not everyone uses PHP as an Apache module, and not everyone uses Apache as a web server. People that want to use php as a CGI on other minimal web servers (e.g, embedded systems) may run into this problem, spend time trying to fix it, get pushback from the PHP developer community about this not being a problem (c.f. the way various bug reports documenting a similar problem with the no input file found being closed as configuration problem, when I show that it's PHP-as-CGI barfing because SCRIPT_FILENAME isn't set), and in the end punt and use another solution. I strongly suggest that the PHP developers set up a test environment where PHP runs as a CGI from one of the many minimal (Open Source) web servers available that don't implement SCRIPT_FILENAME to attempt to reproduce this issue that numerous people have observerd (based on followups to this ticket, and other tickets that I've read). [2006-08-09 18:30:05] [EMAIL PROTECTED] because the patch is not correct and this is an incredibly fragile mechanism due to the wide variety of web servers out there. And despite what the bug report says, PHP does not rely on SCRIPT_FILENAME being present, it simply uses it if it is there. As far as I can tell using ./configure --enable-discard-path should take care of this problem. [2006-05-26 20:52:04] wink15 at hotmail dot com This is getting retarded...Why is this STILL not fixed? Seriously...WTF? [2006-03-15 17:00:13] mike dot scarborough at yahoo dot com I tried using Luke's changes within the php-5.1.2 source under netBSD, so that I could use the same bozohttpd server. Those changes didn't seem to help the problem under 5.1.2. I'd like to look into it further, but it would be very helpful if this could get fixed. Lots of times apache and iis are not options for a project. [2006-03-04 15:42:59] steve at suzail dot org Still present in php-5.1.2-Win32 What's the big deal with fixing this problem? It's such a major problem but needs so little to fix it. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/28227 -- Edit this bug report at http://bugs.php.net/?id=28227edit=1
#38288 [Opn-Bgs]: msvcrt dependency problem in VC++ 8.0
ID: 38288 Updated by: [EMAIL PROTECTED] Reported By: rafaelhfaria at terra dot com dot br -Status: Open +Status: Bogus Bug Type: Compile Failure Operating System: Windows XP Pro PHP Version: 5.1.4 New Comment: Compiling PHP on Windows alsways requires some Microsoft DLL's. If you are using VC 6 these DLL's are most likely installed on the system by default. If you are using VC 7 or VC8 you need to install these DLL's on the system. This can be done by copying the DLL's to the PHP folder or by installing/upgrading the .NET framework. Previous Comments: [2006-08-01 20:02:37] rafaelhfaria at terra dot com dot br Description: I'm compiling PHP 5.4.1 with Microsoft Visual Studio 2005. But with msvcrt I get an unwanted dependency of msvcr80.dll. I tried compile with static link option: /MT in place of /MD (using libcmt). But without success... --- Error Log (with libcmt and without msvcrt): Microsoft (R) Program Maintenance Utility Version 8.00.50727.42 Copyright (C) Microsoft Corporation. All rights reserved. Creating library Release_TS\php5ts.lib and object Release_TS\php5ts.exp zend_strtod.obj : error LNK2019: unresolved external symbol __HUGE referenced in function _zend_strtod math.obj : error LNK2001: unresolved external symbol __HUGE php_variables.obj : error LNK2019: unresolved external symbol __environ referenced in function __php_import_environment_variables basic_functions.obj : error LNK2001: unresolved external symbol __environinfo.obj : error LNK2001: unresolved external symbol __environ Release_TS\php5ts.dll : fatal error LNK1120: 2 unresolved externals NMAKE : fatal error U1077: 'C:\Arquivos de programas\Microsoft Visual Studio 8\VC\BIN\link.exe' : return code '0x460' Stop. --- Peace of code from configure.js: ADD_FLAG(CFLAGS, /LD /MD /W3 /Ox /D NDebug /D NDEBUG /D ZEND_WIN32_FORCE_INLINE /GF /D ZEND_DEBUG=0); ... // we want msvcrt in the PHP DLL ADD_FLAG(PHP_LDFLAGS, /nodefaultlib:libcmt); - What will be done with msvcrt dependecy of msvcr80.dll ? PHP can't be compiled with static linked library, and with dynamic library is got dependecy of a external dll (Need to install .NET Framework on machines that will run theses compiled PHP). How do I compile a stand alone php5ts.dll in VC++ 8.0. -- Edit this bug report at http://bugs.php.net/?id=38288edit=1
#37893 [Bgs]: Uncomment any extension in the ini file on windows load warning about module
ID: 37893 Updated by: [EMAIL PROTECTED] Reported By: baaron13 at hotmail dot com Status: Bogus Bug Type: *Compile Issues Operating System: Windows 2003 PHP Version: 5.1.4 New Comment: Make sure you don't have any PHP files in folders included in your path. If the HP application installed files in \windoww or any other folders these can me moved to the same directory as the rest of the application. This will allow you to run multiple versions of PHP on the same box. You might want to do the same with php.ini. Previous Comments: [2006-06-22 21:52:42] baaron13 at hotmail dot com I found out what was wrong. I'm running this on a HP Proliant box and they have a configuration app in another directory that is using some form of php 4. I think I know what the problem is but I don't know the solution and I know this isn't the place for this type of question Please delete and shoot me an email if you know a solution :) [2006-06-22 21:23:41] baaron13 at hotmail dot com I don't think you understand I installed a fresh windows 2003 I installed PHP 5.1.4. THATS IT period, no php 4 nothing No one else has touched the box. So if that is it tell me if this is a bug or an installation problem. Because if what I said above is true... and it is... then how did I get old dlls? or how do I update the one I need? [2006-06-22 21:12:49] [EMAIL PROTECTED] Ask those who installed PHP 4.3.0 there. PHP compiled with module API 20020429, debug=0, thread-saftey=1 ^this number means it's 4.3.0 or 4.3.1. [2006-06-22 21:07:02] baaron13 at hotmail dot com This a brand new install of php on a brand new install of windows using the windows binary from php.net 5.1.4. So how am I getting old dll's ??? [2006-06-22 18:55:15] [EMAIL PROTECTED] Apparently you forgot to update php5ts.dll or some other DLL, which came with older PHP version. Not PHP problem. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/37893 -- Edit this bug report at http://bugs.php.net/?id=37893edit=1
#37757 [Opn-Bgs]: Result fetched from MSSQL is truncated to 255 characters
ID: 37757 Updated by: [EMAIL PROTECTED] Reported By: nguyenhoang at vnideadesign dot com -Status: Open +Status: Bogus Bug Type: MSSQL related Operating System: XP sp2 PHP Version: 5.1.4 New Comment: This is a limitation in Microsofts DBLIB, used to build the extension. You can switch to php_dblib.dll This is a drop in replacement for mssql_* functions build with FreeTDS Previous Comments: [2006-06-09 07:16:35] nguyenhoang at vnideadesign dot com Description: Problem on: PHP 5.1.2 and 5.1.4 OS: Windows XP sp2 Server: Apache ( apache2triad 1.5.4/1.4.4 and WAMP5 with PHP 5.1.4 i was un/installing each of these server to test) I'm sure that I connected to MSSQL server 2000 and ran a stored procedure ( after enable mssql extention ) but i only got the first 255 characters from the remote MSSQL server. From PHP version 5.1.2, I upgraded it to PHP 5.1.4 but the result is as it was on PHP 5.1.2. Read the note from other PHP user, i got these way to fix this problem: -in php file: mssql_query(set textsize 4000, $s); // ini_set('mssql.textsize', '4000'); ini_set('mssql.textlimit', '4000'); -in php.ini mssql.textlimit = 4096 mssql.textsize = 4096 After the fix, the result has no changed, always is the first 255 chars appeared. Reproduce code: --- Here is the code. //Connect: $s = @mssql_connect($myServer, $myUser, $myPass) or die(He Thong dang ban. Xin ban thu lai trong giay lat. Chung toi rat tiec vi su co nay. Rat mong ban thong cam..); $d = @mssql_select_db($myDB, $s) or die(He Thong dang ban. Xin ban thu lai trong giay lat. Chung toi rat tiec vi su co nay. Rat mong ban thong cam..); //...other code here, then the line to got row Text from MSSQL database /* #GOT INFO - QUERY DATABASE!!! */ $datetime = $d . / . $m . / . $y; if ($smstxt[1] == SAT) { // Bind datetime $rs = mssql_query(TG_SAT '$datetime','$enableU2Text'); } else { $rs = mssql_query(TG_CAT '$datetime','$enableU2Text'); } $row = mssql_fetch_array($rs); // Display the result GoKannel($row['Text']); // Expected result: I have no idea to expect what problem with my code. It run perfectly with other part of the scipt. I wish that the text on MSSQL was not more than 255 chars, If so this should not be a problem. Maybe there was a problem with php_mssql.dll extention or maybe I am a stupid PHP coder :( Hope u can give me an answer. Thanks -- Edit this bug report at http://bugs.php.net/?id=37757edit=1
#37594 [Opn-Fbk]: mssql fails under load
ID: 37594 Updated by: [EMAIL PROTECTED] Reported By: mzamora at meritlending dot com -Status: Open +Status: Feedback Bug Type: MSSQL related Operating System: windows 2000 sp4 PHP Version: 5.1.4 Assigned To: fmk New Comment: Both the DBLIB and MSSQL versions of this extension uses the exact same C code. The difference between the two versions is the library used. The Library supplied by Microsoft and used in php_mssql.dll is not thread safe. Microsoft has not updated this library since SQL Server 6.5. The extension named php_dblib.dll uses FreeTDS and there are ways to improve performance as this is an open source project. In both cases it's the same server the performs the queries and it's the same C code that handles the output from the library, so the only differences I see is the transport protocols. If you have some examples of quieries that acts slower I'll take a look at those and see if tehre is anything that can be done. Previous Comments: [2006-06-05 22:34:40] mzamora at meritlending dot com We have been running with php_dblib.dll for a little over a week now and have not noticed any instability issues. Is there any additional information that we can provide to assist in isolating the issue within mssql.dll? We are very interested in getting a stable version of mssql.dll as running with php_dblib.dll has caused a sizable increase in our query times. [2006-05-30 15:44:19] mzamora at meritlending dot com We have the server running with the php_dblib.dll, but because of the long holiday weekend the server has not been under the load level that causes the failure. [2006-05-26 06:24:02] [EMAIL PROTECTED] Let's leave at feedback until then then. [2006-05-26 00:13:40] mzamora at meritlending dot com we are using php5apache2.dll. It will be some time tomorrow before I get a chance to do any testing with php_dblib.dll. [2006-05-25 23:54:13] [EMAIL PROTECTED] Are you using CGI or php5apache2.dll? The library used by the mssql extension is not thread safe. You might want to try php_dblib.dll. It's the same mssql_*() functions but it's compiled against FreeTDS. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/37594 -- Edit this bug report at http://bugs.php.net/?id=37594edit=1
#37594 [Opn-Fbk]: mssql fails under load
ID: 37594 Updated by: [EMAIL PROTECTED] Reported By: mzamora at meritlending dot com -Status: Open +Status: Feedback Bug Type: MSSQL related Operating System: windows 2000 sp4 PHP Version: 5.1.4 -Assigned To: +Assigned To: fmk New Comment: Are you using CGI or php5apache2.dll? The library used by the mssql extension is not thread safe. You might want to try php_dblib.dll. It's the same mssql_*() functions but it's compiled against FreeTDS. Previous Comments: [2006-05-25 23:42:43] mzamora at meritlending dot com Description: Under heavy load the server responds with the following: Warning: mssql_pconnect() [function.mssql-pconnect]: Unable to connect to server: servername We see the same type issue with the connect function. Our configuration is as follows: OS - Windows 2000 SP4 Apache - 2.0.0.58 PHP - 5.1.4 Changes to the PHP.ini include Enabling the following extensions extension=php_curl.dll extension=php_mime_magic.dll extension=php_mssql.dll extension=php_openssl.dll extension=php_printer.dll All mssql relevant settings have been not been changed from php.ini-dist Please let me know what we can do to help find a resolution to this issue. As a note the issue we are encountering is exactly like the one reported in bug #32854 -- Edit this bug report at http://bugs.php.net/?id=37594edit=1
#37241 [Opn-Csd]: ncompatible type for argument 3 of `_php_stream_get_line'
ID: 37241 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Closed Bug Type: Compile Failure Operating System: Linux PHP Version: 6CVS-2006-04-29 (CVS) New Comment: This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: [2006-04-29 04:14:34] [EMAIL PROTECTED] Description: modifiedfmk /php-src/ext/spl/spl_directory.c04/28/2006 21:03:58Remove ZSTR() from stream macros. Calling function must apply this macro modifiedfmk /php-src/main/php_streams.h 04/28/2006 21:03:58 Remove ZSTR() from stream macros. Calling function must apply this macro modifiedfmk /php-src/ext/standard/file.c04/28/2006 21:03:57 Remove ZSTR() from stream macros. Calling function must apply this macro modifiedfmk /php-src/ext/standard/http_fopen_wrapper.c 04/28/2006 21:03:57Remove ZSTR() from stream macros. Calling function must apply this macro modifiedfmk /php-src/ext/standard/image.c 04/28/2006 21:03:57 Remove ZSTR() from stream macros. Calling function must apply this macro This one broke compiling: /opt/cruisecontrol/projects/PHP_HEAD/php-src/ext/zlib/zlib.c: In function `zif_gzfile': /opt/cruisecontrol/projects/PHP_HEAD/php-src/ext/zlib/zlib.c:308: incompatible type for argument 3 of `_php_stream_get_line' make: *** [ext/zlib/zlib.lo] Error 1 -- Edit this bug report at http://bugs.php.net/?id=37241edit=1
#37232 [Asn-Bgs]: mssql_connect and mssql_pconnect do not accept password longer than 30 chars
ID: 37232 Updated by: [EMAIL PROTECTED] Reported By: rriehle at gmail dot com -Status: Assigned +Status: Bogus Bug Type: MSSQL related Operating System: XP SP2 PHP Version: 5.1.2 Assigned To: fmk New Comment: This is due to limmitations in ntwdblib from Microsoft. This library has not been updated since SQL server 6.5 where 30 was the max length of passwords etc. Use the php_dblib.dll extension. This is a dropin replacement build with FreeTDS. Previous Comments: [2006-04-28 06:03:00] rriehle at gmail dot com Description: Using SQL Server 2005 (SP1). Unable to connect with logins that have passwords greater than 30 characters long using mssql_connect or mssql_pconnect. The logins work fine from the server client tools; I spent hours troubleshooting this. sigh. The reason the passwords I was trying to use were 32 characters is becuase I was using MD5 hashes of plain passwords for my server logins. Reproduce code: --- $dbh = mssql_pconnect(MyHost, testlogin, passwordpasswordpasswordpassword); OR $dbh = mssql_connect(BUILDWAY-NET, testlogin, passwordpasswordpasswordpassword); Expected result: Expect $dbh to hold a link identifier to a mssql connection. I expected that the statements would connect with passwords that have a length as long as the server can accept. Actual result: -- Returns false with these messages: Debug Warning: c:\Inetpub\wwwroot\includes\ez_sql-ms.php line 71 - mssql_pconnect() [a href='file:///C:\Program Files\Zend\ZendStudioClient-5.1.0\docs\PHPmanual/function.mssql-pconnect'function.mssql-pconnect/a]: message: Login failed for user 'testlogin'. (severity 14) Debug Warning: c:\Inetpub\wwwroot\includes\ez_sql-ms.php line 71 - mssql_pconnect() [a href='file:///C:\Program Files\Zend\ZendStudioClient-5.1.0\docs\PHPmanual/function.mssql-pconnect'function.mssql-pconnect/a]: Unable to connect to server: BUILDWAY-NET Errors are the same for mssql_connect (except that the p in mssql_pconnect is left out). -- Edit this bug report at http://bugs.php.net/?id=37232edit=1
#37209 [Asn-Fbk]: mssql_execute with non fatal errors
ID: 37209 Updated by: [EMAIL PROTECTED] Reported By: netvbonline at yahoo dot co dot uk -Status: Assigned +Status: Feedback Bug Type: MSSQL related Operating System: Win XP Pro PHP Version: 5.1.2 Assigned To: fmk New Comment: Please provide a short example of the procedure used to generate this. The current implementation will handle multiple results from a storred procedure and it will skip all results without column. Previous Comments: [2006-04-26 14:34:02] netvbonline at yahoo dot co dot uk SORRY, BIG TYPO The mssql_execute method SHOULD NOT fail on execution (but in anycase should still have populated output parameters). [2006-04-26 14:32:23] netvbonline at yahoo dot co dot uk Description: Using the extension php_mssql.dll and mssql_execute method to execute a stored procedure within SQL Server 2000. Basically, if the stored procedure generates a non-fatal message, for example trying to insert a duplicate value into a table before doing a big seek then output parameters are still available to Query analyser. However when using the mssql_execute method, the execution fails.. even though stored procedure is returning a successful execution value of 0. Its possible to have a stored procedure with 10 statements, and 5 legitamately may fail with a non fatal message, which is handled internally by the stored procedure. The mssql_execute method should fail on execution (any in anycase should still have populated output parameters). Cheers. Reproduce code: --- $hStmt = mssql_init(usp_fetch_or_insert_forename, $hCon); mssql_bind($hStmt, @Forename, $name, SQLVARCHAR); // Output mssql_bind($hStmt, @ForenameID, $ForenameID, SQLINT4, TRUE); $result=mssql_execute($hStmt,true); if (!$result) { echo ERROR HAS OCCURRED; } else { echo NO ERROR; } if ($ForenameID==0) { // error must have occurred echo There was an error trying to get forename pk and forenameid is .$ForenameID; } else { echo everything is fine and forenameid is .$ForenameID; } Expected result: $ForenameID=Value Returned From Stored Procedure Actual result: -- $ForenameID=0 -- Edit this bug report at http://bugs.php.net/?id=37209edit=1
#36968 [Fbk-Bgs]: Single space is returned from MSSQL 2000 when actually a emtpy string is stored
ID: 36968 Updated by: [EMAIL PROTECTED] Reported By: mathew dot lhf at gmail dot com -Status: Feedback +Status: Bogus Bug Type: MSSQL related Operating System: Windows 2003 Server PHP Version: 4.4.2 New Comment: This is a bug in the DB library used in the extension. The only workarround is to trim the value and that would be wrong if the data storred actually was a space. Previous Comments: [2006-04-04 18:51:22] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with ?php and ends with ?, is max. 10-20 lines long and does not require any external resources such as databases, etc. If possible, make the script source available online and provide an URL to it here. Try to avoid embedding huge scripts into the report. [2006-04-04 15:54:22] mathew dot lhf at gmail dot com Description: A single space character is returned from MSSQL 2000 running on Windows server 2003 when actually a emtpy string is stored. -- Edit this bug report at http://bugs.php.net/?id=36968edit=1
#36496 [Asn]: SSL support in [EMAIL PROTECTED] not working
ID: 36496 Updated by: [EMAIL PROTECTED] Reported By: krejci at ped dot muni dot cz Status: Assigned Bug Type: IMAP related Operating System: WinXP, Win2003 PHP Version: 5.1.2 Assigned To: iliaa New Comment: I think openssl must be static linked to PHP for this to work. The functions in on extension would not know how or where to call functions in another extension when they both are linked dynamic. Previous Comments: [2006-03-17 20:10:38] stanciu dot ionut at gmail dot com I have the same problem ... i try everything but nothing :( [2006-02-23 22:05:38] [EMAIL PROTECTED] Ilia, please check it out. [2006-02-23 21:59:52] krejci at ped dot muni dot cz Tried PHP Version 5.1.3-dev Build Date: Feb 20 2006 00:19:29 no change, no luck, still not working. [2006-02-23 17:46:59] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5.1-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.1-win32-latest.zip [2006-02-23 10:17:50] krejci at ped dot muni dot cz Description: tested on WinXPSP2+IIS5.1 and Win2003StdSP1+IIS6 loaded modules: extension=php_mbstring.dll extension=php_gd2.dll extension=php_imap.dll ;php_imap.dll md5: 29f661116b793acad732b3feb404a406 extension=php_mysql.dll extension=php_mysqli.dll extension=php_openssl.dll phpinfo shows: IMAP c-Client Version: 2004 SSL Support: enabled Reproduce code: --- ?php $connection = imap_open({pop.gmail.com:995/pop3/ssl/novalidate-cert}, username, password); if ($connection) { imap_close($connection); echo(OK); } else { echo(ERROR); } ? Expected result: I expect that a ssl-connection to pop.gmail.com would be established OR that at least a Warning about missing SSL support would show up. Actual result: -- Warning: imap_open() [function.imap-open]: Couldn't open stream {pop.gmail.com:995/pop3/ssl/novalidate-cert} in c:\Inetpub\wwwroot\test\pop-real-ssl.bugrep.php on line 2 ERROR Notice: Unknown: Can't open mailbox {pop.gmail.com:995/pop3/ssl/novalidate-cert}: invalid remote specification (errflg=2) in Unknown on line 0 No packet is actually sent. If I omit the /ssl/novalidate-cert part, everything works fine. It seems that the SSL support is not compiled in the windows binaries, despite of what the phpinfo says. -- Edit this bug report at http://bugs.php.net/?id=36496edit=1
#36639 [Opn-Bgs]: mssql_select_db(); didnt work for multiple connection
ID: 36639 Updated by: [EMAIL PROTECTED] Reported By: Satria at dreamweb dot co dot id -Status: Open +Status: Bogus Bug Type: MSSQL related Operating System: NT2K PHP Version: 5.1.2 New Comment: This is a bug in the documentation and I'll update it. The forth parameter does exist and it does work. From the code: proto int mssql_connect([string servername [, string username [, string password [, bool new_link]]]) Previous Comments: [2006-03-09 02:03:40] Satria at dreamweb dot co dot id Description resource mssql_connect ( [string servername [, string username [, string password]]] ) There is no 4th Parameter [2006-03-08 21:06:43] [EMAIL PROTECTED] The MSSQL Extension shares the internal connection as long as host, user and password are the same. To avoid this you can use an optional 4th parameter (new_link = true|false). Setting this to true will force the system to create a new link internaly. [2006-03-07 14:23:32] Satria at dreamweb dot co dot id there is another solutions for this (if this were MySQL Function) force mysql_connect to open newLink but http://php.net/mssql_connect didnt have that parameter on the connect Option [2006-03-07 06:59:11] Satria at dreamweb dot co dot id Description: mssql_select_db() also override Used Database on the another Connection Reproduce code: --- $sqlLink1=mssql_connect($host,$user,$pass); $SecondLINK=mssql_connect($host,$user,$pass); /*Yes, both connection on same Machine*/ mssql_select_db('db1',$sqlLink1); /*Until here, still no problem*/ mssql_select_db('db2', $SecondLINK); //Second time DB Select also will override $sqlLink1, is this Bugs? or... its what should it be ? Expected result: mssql_select_db() only affected on the $param2 connection Actual result: -- - [2006-03-07 05:10:18] Satria at dreamweb dot co dot id Description: mssql_select_db() also override Used Database on the another Connection Reproduce code: --- $sqlLink1=mssql_connect($host,$user,$pass); $SecondLINK=mssql_connect($host,$user,$pass); /*Yes, both connection on same Machine*/ mssql_select_db('db1',$sqlLink1); /*Until here, still no problem*/ mssql_select_db('db2', $SecondLINK); //Second time DB Select also will override $sqlLink1, is this Bugs? or... its what should it be ? Expected result: mssql_select_db() only affected on the $param2 connection Actual result: -- - -- Edit this bug report at http://bugs.php.net/?id=36639edit=1
#36639 [Opn-Bgs]: mssql_select_db(); didnt work for multiple connection
ID: 36639 Updated by: [EMAIL PROTECTED] Reported By: Satria at dreamweb dot co dot id -Status: Open +Status: Bogus Bug Type: MSSQL related Operating System: NT2K PHP Version: 5.1.2 New Comment: The MSSQL Extension shares the internal connection as long as host, user and password are the same. To avoid this you can use an optional 4th parameter (new_link = true|false). Setting this to true will force the system to create a new link internaly. Previous Comments: [2006-03-07 14:23:32] Satria at dreamweb dot co dot id there is another solutions for this (if this were MySQL Function) force mysql_connect to open newLink but http://php.net/mssql_connect didnt have that parameter on the connect Option [2006-03-07 06:59:11] Satria at dreamweb dot co dot id Description: mssql_select_db() also override Used Database on the another Connection Reproduce code: --- $sqlLink1=mssql_connect($host,$user,$pass); $SecondLINK=mssql_connect($host,$user,$pass); /*Yes, both connection on same Machine*/ mssql_select_db('db1',$sqlLink1); /*Until here, still no problem*/ mssql_select_db('db2', $SecondLINK); //Second time DB Select also will override $sqlLink1, is this Bugs? or... its what should it be ? Expected result: mssql_select_db() only affected on the $param2 connection Actual result: -- - [2006-03-07 05:10:18] Satria at dreamweb dot co dot id Description: mssql_select_db() also override Used Database on the another Connection Reproduce code: --- $sqlLink1=mssql_connect($host,$user,$pass); $SecondLINK=mssql_connect($host,$user,$pass); /*Yes, both connection on same Machine*/ mssql_select_db('db1',$sqlLink1); /*Until here, still no problem*/ mssql_select_db('db2', $SecondLINK); //Second time DB Select also will override $sqlLink1, is this Bugs? or... its what should it be ? Expected result: mssql_select_db() only affected on the $param2 connection Actual result: -- - -- Edit this bug report at http://bugs.php.net/?id=36639edit=1
#35920 [Asn-Bgs]: mssql_bind(): Unable to set parameter
ID: 35920 Updated by: [EMAIL PROTECTED] Reported By: eaboyle at gemstonewd dot com -Status: Assigned +Status: Bogus Bug Type: MSSQL related Operating System: window XP pro PHP Version: 5CVS, 4CVS (2006-01-07) (snap) Assigned To: fmk New Comment: The name of the returnvalue is RETVAL and not RTNVAL. mssql_bind will fail if it can't find the parameter or return value. Previous Comments: [2006-01-14 15:45:11] none at none dot com won't $result ccontain the response object from the stored proc ? i.e. your passing in two params, where your procedure expects one, hence your unable to set the invalid parameter. for example, do you just need to use mssql_next_result / mssql_fetch_row on $result to get the output? Paul [2006-01-07 00:22:59] [EMAIL PROTECTED] Assigned to the maintainer. [2006-01-06 23:58:05] eaboyle at gemstonewd dot com I upgraded to 5.1.latest and still get the same result. [2006-01-06 16:48:20] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5.1-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.1-win32-latest.zip [2006-01-06 16:19:06] eaboyle at gemstonewd dot com Description: I'm trying to get output from an mssql stored procedure. I get mssql_bind(): Unable to set parameter warning on line 6. I have allow_call_time_pass_reference = On in my php.ini. Reproduce code: --- 1 $db = new clsDBsqlRags(); 2 $db-connect(); 3 $stmt=mssql_init(sp_NEXT_ACT_NUM ,$db-Link_ID); 4 $act_base = 1; 5 mssql_bind($stmt,@ACT_BASE, $act_base, SQLINT4); 6 mssql_bind($stmt, RTNVAL, $act_num, SQLINT4); 7 8 $result=mssql_execute($stmt, FALSE); Stored procedure: CREATE PROCEDURE sp_NEXT_ACT_NUM @ACT_BASE int AS DECLARE @Act int --FETCHED CLIENT.ACCOUNT VALUE --GET SET OF ACCOUTS FROM CLIENT TABLE DECLARE Crsr_Act CURSOR FOR SELECT C.ACCOUNT FROM CLIENT C WHERE C.ACCOUNT = @ACT_BASE ORDER BY ACCOUNT OPEN Crsr_Act FETCH Crsr_Act INTO @Act --TRAVERSE Crsr_Act WHILE (@@FETCH_STATUS = 0) BEGIN IF @ACT_BASE @Act BREAK ELSE IF @ACT_BASE = @Act SELECT @ACT_BASE = @ACT_BASE + 1 FETCH Crsr_Act INTO @Act END CLOSE Crsr_Act DEALLOCATE Crsr_Act RETURN @ACT_BASE GO Expected result: expect $act_num to be set to the return value of the mssql stored procedure. Actual result: -- mssql_bind(): Unable to set parameter warning on line 6. -- Edit this bug report at http://bugs.php.net/?id=35920edit=1
#35884 [Asn-Fbk]: mssql connection is lost after mssql_query (with bigint)
ID: 35884 Updated by: [EMAIL PROTECTED] Reported By: muratyaman at gmail dot com -Status: Assigned +Status: Feedback Bug Type: MSSQL related Operating System: Win XP Pro SP2 PHP Version: 5.1.2RC1 Assigned To: fmk New Comment: 1) BIGINT is not a known data type for MS SQL Server 6.5. Microsoft has not updated the API (used for the mssql extension) since this version of the server. You can use the php_dblib.dll extension this is build using FreeTDS and is more up to date. 2) You should use msql_init(), mssql_bind() and mssql_execute() functions when working with storrd procedures. mssql_query() can handle multiple results but it can not return output parameters or return values. Please make sure to use mssql_next_result() to process additional result sets. Previous Comments: [2006-01-03 16:25:26] muratyaman at gmail dot com Sorry, my comments in PHP code before running the 1st query might be misleading (forgot to modify during submission to here). Discard them and please refer to the explanation. Thanks. [2006-01-03 16:19:55] [EMAIL PROTECTED] Assigned to the maintainer. [2006-01-03 16:17:39] muratyaman at gmail dot com Description: Hi, I am disappointed about the way PHP communicates with MS SQL Server and handles queries. I costed me more than a week to find out this. Basically, it is related to BIGINT data types, I guess. Here is the test case: Have a simple table including a field of type bigint. Have a procedure reading data from it, returning an output field of type bigint and a resultset on the fly. Have a simple SQL statement to declare a temp variable of type bigint, calling this procedure and getting the output. Use this through mssql_query() function. Have another simle select query. I expect 2 resultsets from the 1st query (2 values output) and another from the 2nd query. But I have 1 resultset from the 1st query (1 value) and a failure for a correct SQL statement. Because it is understood that connection is lost somehow during the 1st query without any error message. If you change every BIGINT to INT it works fine. However, I do NOT think this is the solution. Reproduce code: --- --sql statements to prepare database CREATE TABLE [T1] ( [id] bigint NOT NULL, [name] nvarchar(50) NOT NULL, PRIMARY KEY CLUSTERED ([id]) ) GO INSERT INTO [T1] ([id], [name]) VALUES (1, 'abc') GO INSERT INTO [T1] ([id], [name]) VALUES (2, 'def') GO CREATE PROCEDURE my_proc @output1 bigint output AS BEGIN --set the value select top 1 @output1 = id from t1 --return recordset for php select @output1 as MY_BIG_INT_output1 END GO --end of sql ?php //PHP file: if($dbh = mssql_connect('host\sqlserver', 'dba', 'pwd')){ echo 'Host connectedbr'; if(mssql_select_db('mydb')){ echo 'Database selected!br'; $input1=2; $sql = DECLARE @o BIGINT EXECUTE my_proc @o output SELECT @o as output2 ; echo 'Running SQL:brpre'.$sql.'/pre'; //if there is an emp record // there will be 3 result sets: emp, return_value, output1 //else // there will be 2 result sets: return_value, output1 if($rs = mssql_query($sql)){ do{ while($row = mssql_fetch_assoc($rs)){ echo 'pre'.print_r($row,true).'/pre'; } } while(mssql_next_result($rs)); mssql_free_result($rs); }else{ echo 'Error: '.mssql_get_last_message().'br'; } //try another query $sql2='SELECT TOP 1 * FROM t1'; echo 'Running SQL:brpre'.$sql2.'/pre'; if($rs2 = mssql_query($sql2)){ while($row2 = mssql_fetch_assoc($rs2)){ echo 'pre'.print_r($row2,true).'/pre'; } mssql_free_result($rs2); }else{ echo 'Error: '.mssql_get_last_message().'br'; } }else{ echo 'Database selection failed!'; }//end if select db mssql_close($dbh); }else{ echo 'Host connection failed!'; }//end if connection //end of PHP file ? Expected result: Host connected Database selected! Running SQL: DECLARE @o bigint EXECUTE my_proc @o output SELECT @o as output2 Array ( [MY_BIG_INT_output1] = 1 ) Array ( [output2] = 1 ) Running SQL: SELECT TOP 1 * FROM t1 Array ( [id] = 1 [name] = abc ) or an error message/warning if a particular datatype is not supported, etc. Actual result: -- Host connected Database selected! Running SQL: DECLARE @o bigint EXECUTE my_proc @o output SELECT @o as output2 Array ( [MY_BIG_INT_output1] = 1 ) Running SQL: SELECT TOP 1 * FROM t1
#35839 [Fbk]: mssql_query(): Possible network error: Bad token from SQL Server..
ID: 35839 Updated by: [EMAIL PROTECTED] Reported By: muratyaman at gmail dot com Status: Feedback Bug Type: MSSQL related Operating System: Win XP Pro SP2 PHP Version: 5.1.1 New Comment: Can you reproduce the error with out the DB abstraction layer you are using? The data send to the server contains garbage, and this could be an indication that you are getting this error in a multithreaded environment. The standard MSSQL extension is not thread safe du to the msdblib library used to build the extension. You could replace php_mssql.dll with php_dblib.dll. It provides the same functions but uses FreeTDS to create conenctions. Previous Comments: [2005-12-29 16:37:20] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5.1-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.1-win32-latest.zip [2005-12-29 16:33:49] muratyaman at gmail dot com Description: Error message is: mssql_query() [function.mssql-query]: Possible network error: Bad token from SQL Server: Datastream processing out of sync. (severity 9) in file ... line ... I have a WinXP, Apache2, PHP5, MSDE2000 app and many pages inserting, updating, deleting records.. Pages for inserts include code to return on error and not lose entered data. Reproduce code: --- (Every page opens connection, queries database multiple times, closes the connection.) Create a form with a few textboxes and a combobox. I create a combobox with: ? $selected_option = 0; echo db_combo('field1', 'select field1 from tbl1', $selected_option); ? db_combo simply uses mssql_query to select records from a table, fill with options, create HTML code of a combobox with select option/option /select I use a global $dbh to handle database connection, also use mssql_connect, mssql_select_db functions. Expected result: 1. load page: tbl2_new.php combobox FULL with records read from the table 2. post to : tbl2_insert.php may not insert record because of normal reasons 3. return to: tbl2_new.php any entered data is post back combobox FULL with records read from the table 4. post to : tbl2_insert.php insert record Actual result: -- 1. load page: tbl2_new.php with EMPTY combobox and ERROR connection is lost every call afterwards to mssql_query fails 2. post to : tbl2_insert.php may or may not insert record 3. return to: tbl2_new.php any entered data is post back combobox FULL with records read from the table no problem at all Briefly, new and edit pages are very much similar with comboboxes etc. But on new pages, combobox cannot get any records on 1st run. I could not figure out the problem. But I think there is a communication problem when SQL server tries to send the records from a table. Thanks in advance. -- Edit this bug report at http://bugs.php.net/?id=35839edit=1
#35839 [Asn-Fbk]: mssql_query(): Possible network error: Bad token from SQL Server..
ID: 35839 Updated by: [EMAIL PROTECTED] Reported By: muratyaman at gmail dot com -Status: Assigned +Status: Feedback Bug Type: MSSQL related Operating System: Win XP Pro SP2 PHP Version: 5CVS-2005-12-29 (snap) Assigned To: fmk New Comment: bigint is not known on my mssql server 7 but it works fine on mssql server 2000. I have tested your code on both servers using PHP 5.1.2-dev and I do not get any errors. I don't think there is any errors here. I have also tested with both local and remote server and with php_mssql.dll and php_dblib.dll. Previous Comments: [2005-12-30 00:21:51] muratyaman at gmail dot com Hi again :) I changed my function to this: function db_get_next_id($mygenid=''){ $id = 0; $ret_val=0; $stmt = mssql_init(SPMY_GET_NEXT_ID); mssql_bind($stmt, @GEN_ID_NAME, $mygenid, SQLVARCHAR, FALSE,FALSE);//input, not null mssql_bind($stmt, @ID, $id, SQLINT4, TRUE,TRUE);//output,null mssql_bind($stmt,RETVAL,$ret_val,SQLINT4); $result = mssql_execute($stmt); while($row=mssql_fetch_row($result)){ //read id $id=$row[0];//but it should get from the output variable!? } mssql_free_statement($stmt); unset($stmt); // ---VERY important return $id; } Anyway, this solved my problem. But will I not be able to use arbitrary SQL statements with mssql_query, including execution of procedures, etc. ?! Kind regards [2005-12-29 23:54:16] muratyaman at gmail dot com Basically, my procedure inserts a dummy record into a special table and gets inserted id. (int8 is a udt for 'bigint', i'm changing it for you below to bigint). I have dummy tables to simulate sequence generators for different tables, here is a pair of them: CREATE TABLE TBL_GEN_ABC_ID ( ID bigint IDENTITY(1, 1) NOT NULL, DUMMY bit, CONSTRAINT PK_TBL_GEN_ABC_ID PRIMARY KEY CLUSTERED (ID) ) GO CREATE TABLE TBL_ABC ( ABC_ID INT NOT NULL, ABC_NAME] VARCHAR(100) NOT NULL, CONSTRAINT PK_TBL_ABC PRIMARY KEY CLUSTERED (ABC_ID) ) GO Procedure is like this: CREATE PROCEDURE spmy_get_next_id( @GEN_ID_NAME VARCHAR(100)='#NO TABLE', @ID bigint OUTPUT ) AS BEGIN SET @ID=NULL; DECLARE @GEN_ID bigint; SET @GEN_ID=0; IF (UPPER(@GEN_ID_NAME)='ABC_ID') BEGIN WHILE (1=1) BEGIN --generate id INSERT INTO TBL_GEN_ABC_ID (DUMMY) VALUES(0); SET @GEN_ID=@@IDENTITY; --get generated id IF(NOT EXISTS( --make sure it was not used SELECT ABC_ID FROM TBL_ABC WHERE [EMAIL PROTECTED]) ) BREAK; END END SET @[EMAIL PROTECTED]; SELECT @ID AS ID;--for PHP to read resultset and value RETURN @ID; --return value, not crucial END GO so in PHP you can use modifed version of my function: function db_get_next_id($mygenid=''){ $i=0; $sql= DECLARE @MY_ID bigint, @r bigint EXECUTE @r=SPMY_GET_NEXT_ID \$mygenid\, @MY_ID OUTPUT ; if($qry=db_query($sql)){ while($row=db_fetch_row($qry)){ $i=$row[0]; break; } db_free_result($qry); } return $i; }//end fun get next id $new_id=db_get_next_id('ABC_ID'); (As I mentioned earlier, e.g. db_fetch_row is just using mssql_fetch_row.. all of my db_xyz functions are like this.) This works fine but subsequent mssql_query functions fail. This may not be the ideal way of doing it, but it should not cause any harm. Everything else is working fine. Maybe I should just change the way I use my procedures.. Thank you. [2005-12-29 22:37:33] [EMAIL PROTECTED] Frank, can you make any sense to this? :) [2005-12-29 22:35:42] muratyaman at gmail dot com Thank you. I could not integrate php_dblib.dll :( I tried to compile FreeTDS using Dev-C++ but could not get it working with PHP.. I am stuck. I was investigating the problem. I have a function as follows: function db_get_next_id($mygenid=''){ $i=0; $sql= DECLARE @MY_ID INT8, @r int8 EXECUTE @r= SPMY_GET_NEXT_ID \$mygenid\, @MY_ID OUTPUT ; if($qry=db_query($sql)){ while($row=db_fetch_row($qry)){ $i=$row[0]; break; } db_free_result($qry); } return $i; }//end fun get next id $new_id=db_get_next_id('keyfield'); This just works fine, I found that after this, calls to the db fails and produces the error. Because when I comment out the line calling this function, I don't get any error message. Any ideas? Regards [2005-12-29 22:15:50] [EMAIL PROTECTED] Does using php_dblib.dll work any better
#35839 [Fbk-Bgs]: mssql_query(): Possible network error: Bad token from SQL Server..
ID: 35839 Updated by: [EMAIL PROTECTED] Reported By: muratyaman at gmail dot com -Status: Feedback +Status: Bogus Bug Type: MSSQL related Operating System: Win XP Pro SP2 PHP Version: 5CVS-2005-12-29 (snap) Assigned To: fmk New Comment: using mssql_qyery() to execute storred procedures is usefull, but it can only be used to retreive result sets. output parameters and return values are not handled with this method. In that case you must use the mssql_init(), mssql_bind() and mssql_execute() functions. Previous Comments: [2005-12-30 00:46:25] [EMAIL PROTECTED] bigint is not known on my mssql server 7 but it works fine on mssql server 2000. I have tested your code on both servers using PHP 5.1.2-dev and I do not get any errors. I don't think there is any errors here. I have also tested with both local and remote server and with php_mssql.dll and php_dblib.dll. [2005-12-30 00:21:51] muratyaman at gmail dot com Hi again :) I changed my function to this: function db_get_next_id($mygenid=''){ $id = 0; $ret_val=0; $stmt = mssql_init(SPMY_GET_NEXT_ID); mssql_bind($stmt, @GEN_ID_NAME, $mygenid, SQLVARCHAR, FALSE,FALSE);//input, not null mssql_bind($stmt, @ID, $id, SQLINT4, TRUE,TRUE);//output,null mssql_bind($stmt,RETVAL,$ret_val,SQLINT4); $result = mssql_execute($stmt); while($row=mssql_fetch_row($result)){ //read id $id=$row[0];//but it should get from the output variable!? } mssql_free_statement($stmt); unset($stmt); // ---VERY important return $id; } Anyway, this solved my problem. But will I not be able to use arbitrary SQL statements with mssql_query, including execution of procedures, etc. ?! Kind regards [2005-12-29 23:54:16] muratyaman at gmail dot com Basically, my procedure inserts a dummy record into a special table and gets inserted id. (int8 is a udt for 'bigint', i'm changing it for you below to bigint). I have dummy tables to simulate sequence generators for different tables, here is a pair of them: CREATE TABLE TBL_GEN_ABC_ID ( ID bigint IDENTITY(1, 1) NOT NULL, DUMMY bit, CONSTRAINT PK_TBL_GEN_ABC_ID PRIMARY KEY CLUSTERED (ID) ) GO CREATE TABLE TBL_ABC ( ABC_ID INT NOT NULL, ABC_NAME] VARCHAR(100) NOT NULL, CONSTRAINT PK_TBL_ABC PRIMARY KEY CLUSTERED (ABC_ID) ) GO Procedure is like this: CREATE PROCEDURE spmy_get_next_id( @GEN_ID_NAME VARCHAR(100)='#NO TABLE', @ID bigint OUTPUT ) AS BEGIN SET @ID=NULL; DECLARE @GEN_ID bigint; SET @GEN_ID=0; IF (UPPER(@GEN_ID_NAME)='ABC_ID') BEGIN WHILE (1=1) BEGIN --generate id INSERT INTO TBL_GEN_ABC_ID (DUMMY) VALUES(0); SET @GEN_ID=@@IDENTITY; --get generated id IF(NOT EXISTS( --make sure it was not used SELECT ABC_ID FROM TBL_ABC WHERE [EMAIL PROTECTED]) ) BREAK; END END SET @[EMAIL PROTECTED]; SELECT @ID AS ID;--for PHP to read resultset and value RETURN @ID; --return value, not crucial END GO so in PHP you can use modifed version of my function: function db_get_next_id($mygenid=''){ $i=0; $sql= DECLARE @MY_ID bigint, @r bigint EXECUTE @r=SPMY_GET_NEXT_ID \$mygenid\, @MY_ID OUTPUT ; if($qry=db_query($sql)){ while($row=db_fetch_row($qry)){ $i=$row[0]; break; } db_free_result($qry); } return $i; }//end fun get next id $new_id=db_get_next_id('ABC_ID'); (As I mentioned earlier, e.g. db_fetch_row is just using mssql_fetch_row.. all of my db_xyz functions are like this.) This works fine but subsequent mssql_query functions fail. This may not be the ideal way of doing it, but it should not cause any harm. Everything else is working fine. Maybe I should just change the way I use my procedures.. Thank you. [2005-12-29 22:37:33] [EMAIL PROTECTED] Frank, can you make any sense to this? :) [2005-12-29 22:35:42] muratyaman at gmail dot com Thank you. I could not integrate php_dblib.dll :( I tried to compile FreeTDS using Dev-C++ but could not get it working with PHP.. I am stuck. I was investigating the problem. I have a function as follows: function db_get_next_id($mygenid=''){ $i=0; $sql= DECLARE @MY_ID INT8, @r int8 EXECUTE @r= SPMY_GET_NEXT_ID \$mygenid\, @MY_ID OUTPUT ; if($qry=db_query($sql)){ while($row=db_fetch_row($qry)){ $i=$row[0]; break; } db_free_result($qry); } return $i; }//end fun get next id $new_id=db_get_next_id('keyfield'); This just works fine, I found that after this, calls
#35839 [Bgs]: mssql_query(): Possible network error: Bad token from SQL Server..
ID: 35839 Updated by: [EMAIL PROTECTED] Reported By: muratyaman at gmail dot com Status: Bogus Bug Type: MSSQL related Operating System: Win XP Pro SP2 PHP Version: 5CVS-2005-12-29 (snap) Assigned To: fmk New Comment: I already closed it, but I do not get any errors with your original code using mssql_query(). I think this is caused by something else. Perhaps your version of ntwdblib.dll is different than mine. Previous Comments: [2005-12-30 01:54:39] muratyaman at gmail dot com Thank you very much indeed, at least you directed me to a solution.. Previous version of my function was already using mssql_query and fetch functions to get the row returned from my procedure (since inside procedure I have: select @id as ID it returns a resultset), not the output or return code: DECLARE @MY_ID INT8, @r int8 EXECUTE @r= SPMY_GET_NEXT_ID \$mygenid\, @MY_ID OUTPUT and it was doing it all right, but subsequent calls to the db was causing the error I mentioned, because the connection is somehow lost after running this sql. If you think this is not a bug you can close it. Your prompt replies are much appreciated. Kind regards [2005-12-30 00:49:20] [EMAIL PROTECTED] using mssql_qyery() to execute storred procedures is usefull, but it can only be used to retreive result sets. output parameters and return values are not handled with this method. In that case you must use the mssql_init(), mssql_bind() and mssql_execute() functions. [2005-12-30 00:46:25] [EMAIL PROTECTED] bigint is not known on my mssql server 7 but it works fine on mssql server 2000. I have tested your code on both servers using PHP 5.1.2-dev and I do not get any errors. I don't think there is any errors here. I have also tested with both local and remote server and with php_mssql.dll and php_dblib.dll. [2005-12-30 00:21:51] muratyaman at gmail dot com Hi again :) I changed my function to this: function db_get_next_id($mygenid=''){ $id = 0; $ret_val=0; $stmt = mssql_init(SPMY_GET_NEXT_ID); mssql_bind($stmt, @GEN_ID_NAME, $mygenid, SQLVARCHAR, FALSE,FALSE);//input, not null mssql_bind($stmt, @ID, $id, SQLINT4, TRUE,TRUE);//output,null mssql_bind($stmt,RETVAL,$ret_val,SQLINT4); $result = mssql_execute($stmt); while($row=mssql_fetch_row($result)){ //read id $id=$row[0];//but it should get from the output variable!? } mssql_free_statement($stmt); unset($stmt); // ---VERY important return $id; } Anyway, this solved my problem. But will I not be able to use arbitrary SQL statements with mssql_query, including execution of procedures, etc. ?! Kind regards [2005-12-29 23:54:16] muratyaman at gmail dot com Basically, my procedure inserts a dummy record into a special table and gets inserted id. (int8 is a udt for 'bigint', i'm changing it for you below to bigint). I have dummy tables to simulate sequence generators for different tables, here is a pair of them: CREATE TABLE TBL_GEN_ABC_ID ( ID bigint IDENTITY(1, 1) NOT NULL, DUMMY bit, CONSTRAINT PK_TBL_GEN_ABC_ID PRIMARY KEY CLUSTERED (ID) ) GO CREATE TABLE TBL_ABC ( ABC_ID INT NOT NULL, ABC_NAME] VARCHAR(100) NOT NULL, CONSTRAINT PK_TBL_ABC PRIMARY KEY CLUSTERED (ABC_ID) ) GO Procedure is like this: CREATE PROCEDURE spmy_get_next_id( @GEN_ID_NAME VARCHAR(100)='#NO TABLE', @ID bigint OUTPUT ) AS BEGIN SET @ID=NULL; DECLARE @GEN_ID bigint; SET @GEN_ID=0; IF (UPPER(@GEN_ID_NAME)='ABC_ID') BEGIN WHILE (1=1) BEGIN --generate id INSERT INTO TBL_GEN_ABC_ID (DUMMY) VALUES(0); SET @GEN_ID=@@IDENTITY; --get generated id IF(NOT EXISTS( --make sure it was not used SELECT ABC_ID FROM TBL_ABC WHERE [EMAIL PROTECTED]) ) BREAK; END END SET @[EMAIL PROTECTED]; SELECT @ID AS ID;--for PHP to read resultset and value RETURN @ID; --return value, not crucial END GO so in PHP you can use modifed version of my function: function db_get_next_id($mygenid=''){ $i=0; $sql= DECLARE @MY_ID bigint, @r bigint EXECUTE @r=SPMY_GET_NEXT_ID \$mygenid\, @MY_ID OUTPUT ; if($qry=db_query($sql)){ while($row=db_fetch_row($qry)){ $i=$row[0]; break; } db_free_result($qry); } return $i; }//end fun get next id $new_id=db_get_next_id('ABC_ID'); (As I mentioned earlier, e.g. db_fetch_row is just using mssql_fetch_row.. all of my db_xyz functions are like this.) This works fine but subsequent mssql_query functions fail. This may not be the ideal way of doing
#35730 [Fbk-Csd]: mssql didn't use the right character encoding in freetds.conf
ID: 35730 Updated by: [EMAIL PROTECTED] Reported By: liang at saga-city dot com -Status: Feedback +Status: Closed Bug Type: MSSQL related Operating System: FreeBSD PHP Version: 5.1.1 Assigned To: fmk New Comment: This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. I was wrong, sorry. The extension code for PHP 5.1 and 6.0 included a hardcoded character set. This is now changed so it will use the character set specified in freetds.conf or allow the script to overwrite this value. Previous Comments: [2005-12-21 11:01:05] boonkit at gmail dot com I also facing the same problem. If using PHP4, PHP5.0.4 or PHP5.0.5, the non-western character from MSSQL can display correctly. If using PHP5.1.1, all character become ??? FreeTDS version is 0.63 [2005-12-20 10:57:40] [EMAIL PROTECTED] How about a short reproducing script too? [2005-12-20 09:43:48] liang at saga-city dot com new FreeTDS(0.64)CVS makes no difference. Both PHP4/PHP5.1.1 call to the same Shared object libsybdb.so.5 and using the same freetds.conf. It's obvious PHP5.1.1 behaves different. Sorry, I have some production machines to take care for the time being. Will not get back on this issuses shortly. Hopefully the problem will be solved soon. Cheers, [2005-12-20 02:41:46] [EMAIL PROTECTED] Please try to upgrade to the latest CVS version of FreeTDS. As I mentioned before all the encoding stuff is handled by FreeTDS. There is no encoding handling in the code for the PHP extension and the code differences between version 4, 5.0, 5.1 and 6.0 of PHP are only related to internal PHP stuff and has nothing to do with how the library is used. [2005-12-20 01:37:48] liang at saga-city dot com We have some production machines with PHP5.0.3/FreeBSD5.4/FreeTDS0.62.4 installed, All works great. Now we are setting a clean and new FreeBSD 6.0 system box with only freetds-0.63 mysql5.0-client and apache22 installed. It's obvious testing PHP4/PHP5 installation link to the same freetds library. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/35730 -- Edit this bug report at http://bugs.php.net/?id=35730edit=1
#35730 [Opn-Fbk]: mssql didn't use the right character encoding in freetds.conf
ID: 35730 Updated by: [EMAIL PROTECTED] Reported By: liang at saga-city dot com -Status: Open +Status: Feedback Bug Type: MSSQL related Operating System: FreeBSD PHP Version: 5.1.1 Assigned To: fmk New Comment: Please try to upgrade to the latest CVS version of FreeTDS. As I mentioned before all the encoding stuff is handled by FreeTDS. There is no encoding handling in the code for the PHP extension and the code differences between version 4, 5.0, 5.1 and 6.0 of PHP are only related to internal PHP stuff and has nothing to do with how the library is used. Previous Comments: [2005-12-20 01:37:48] liang at saga-city dot com We have some production machines with PHP5.0.3/FreeBSD5.4/FreeTDS0.62.4 installed, All works great. Now we are setting a clean and new FreeBSD 6.0 system box with only freetds-0.63 mysql5.0-client and apache22 installed. It's obvious testing PHP4/PHP5 installation link to the same freetds library. [2005-12-19 18:12:27] [EMAIL PROTECTED] Are you absolutely sure you're linking PHP with the same freetds library as you did with PHP 4? [2005-12-19 05:48:08] liang at saga-city dot com we have been testing the mssql extension both in PHP4 and PHP5.1.1, with the same freetds.conf tds version = 8.0 client charset = BIG-5 In php4, it works fine, but not in php5.1.1 ( our old system uses php5.0.3 also work fine in the same freetds.conf ) [2005-12-19 03:27:06] [EMAIL PROTECTED] All encoding is handled by freetds in both PHP4 and PHP5. Execpt for internal PHP stuff the mssql extension is the same for PHP4 and PHP5. You need to change the encoding in freetds.conf. [2005-12-19 02:29:00] liang at saga-city dot com Description: php5 mssql didn't use character encoding specify in freetds.conf ( alwasy use ISO-8559-1 , seen in freetds.log ) switch to php4 , everythings works fine -- Edit this bug report at http://bugs.php.net/?id=35730edit=1
#35730 [Opn-Bgs]: mssql didn't use the right character encoding in freetds.conf
ID: 35730 Updated by: [EMAIL PROTECTED] Reported By: liang at saga-city dot com -Status: Open +Status: Bogus Bug Type: ICONV related Operating System: FreeBSD PHP Version: 5.1.1 New Comment: All encoding is handled by freetds in both PHP4 and PHP5. Execpt for internal PHP stuff the mssql extension is the same for PHP4 and PHP5. You need to change the encoding in freetds.conf. Previous Comments: [2005-12-19 02:29:00] liang at saga-city dot com Description: php5 mssql didn't use character encoding specify in freetds.conf ( alwasy use ISO-8559-1 , seen in freetds.log ) switch to php4 , everythings works fine -- Edit this bug report at http://bugs.php.net/?id=35730edit=1
#35662 [Opn-Bgs]: The 'rand()' function returns only few different values
ID: 35662 Updated by: [EMAIL PROTECTED] Reported By: jullrich at sans dot org -Status: Open +Status: Bogus Bug Type: *Math Functions Operating System: Linux 2.6 (RedHat) PHP Version: 4.4.1 New Comment: The rand functions takes to integers as arguments when the second argument 99 is cast to an integer it results in 1410065407. This is why you only get values starting with 10, 11, 12, 13 and 14 Previous Comments: [2005-12-13 22:29:29] jullrich at sans dot org 'rand' works fine up to 9 digits. I just did more tests and the bug only shows up for = 10 digits. [2005-12-13 22:20:09] jullrich at sans dot org Getting the same problem with the php 5.1-latest. Code used to test: ?= #1234567890 1234567890 rand(10,99); ? Wrapper to generate 100 numbers: for b in `seq 1 100`; do php -e x.php numbers; done Quick summary of first two digits: 10... 21 times 11... 21 times 12... 13 times 13... 24 times 14... 3 times so still the same problem. Only numbers from 10... to 14... are generated. [2005-12-13 20:58:11] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5.1-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.1-win32-latest.zip [2005-12-13 20:53:53] jullrich at sans dot org Description: The 'rand' function is far from random. For example, the following code: ?= rand(100,999); ? only generates values that start with '12','13' or '14'. Out of 1500 times the function is called, only approx. 1000 different values are generated. Reproduce code: --- ?= rand(100,999); ? Expected result: somewhat random numbers between 100 and 999. Actual result: -- all numbers are in the range from 1200 to 1500 and frequently repeat (about 25% of the numbers are repeats). Sample: 1379409636 1275750426 1248288483 1398136354 1404047798 1292410973 1405794269 1278267510 1225653649 -- Edit this bug report at http://bugs.php.net/?id=35662edit=1
#35493 [Opn-Fbk]: mssql_query return values varies from version to version (works with PHP 5.1)
ID: 35493 Updated by: [EMAIL PROTECTED] Reported By: martin at malditainternet dot com -Status: Open +Status: Feedback Bug Type: MSSQL related Operating System: linux PHP Version: 4.4.1 New Comment: Please check that you are using the same version (and protocol) of FreeTDS on all the different systems. This is the output with the latest CVS version of both FreeTDS and PHP: PHP: 5.1.0RC5-dev Query (select * from sysobjects where name='nonexistant') ret: Resource id #5 Previous Comments: [2005-11-30 16:53:09] martin at malditainternet dot com Description: The return value of mssql_query is different from version to version when there aren't rows to return. For example: PHP: 4.4.2RC2-dev (from snap) Query (select * from sysobjects where name='nonexistant') ret: 5 PHP: 5.0.5-3 (Debian) Query (select * from sysobjects where name='nonexistant') ret: Resource id #5 PHP: 4.4.1-0.dotdeb.3 (Debian - Dotdeb) Query (select * from sysobjects where name='nonexistant') ret: 1 PHP: 4.4.0-4 (Debian) Query (select * from sysobjects where name='nonexistant') ret: Resource id #5 Reproduce code: --- ? mssql_connect('HOST','USER','password'); mssql_select_db('TNS_1_3_SPIDER'); $q=select * from sysobjects where name='nonexistant'; print 'PHP: '.phpversion().\n.Query ($q) ret: .mssql_query($q).\n; ? Expected result: I would love to get 'Resources' instead of integers -- Edit this bug report at http://bugs.php.net/?id=35493edit=1
#26820 [Asn-Csd]: mssql_fetch_row BIT field problem
ID: 26820 Updated by: [EMAIL PROTECTED] Reported By: subspace at wanadoo dot nl -Status: Assigned +Status: Closed Bug Type: MSSQL related Operating System: Debian Linux 2.4.21 PHP Version: 4CVS-2004-02-06 Assigned To: fmk New Comment: This problem has been fixed in FreeTDS. Works on both Windows and Linux. Previous Comments: [2004-10-18 20:39:06] freddyz77 at tin dot it dblib use by default TDS protocol 4.2. This protocol do not support null bits so it return 0 instead. Use protocol 7.0 or more (8.0 for mssql2k). This can be configured using FreeTDS (but not using MS dblib). [2004-02-25 14:53:26] [EMAIL PROTECTED] On Win32 this is caused by a bug in dblib (the Microsoft library used to build the extension). [2004-02-21 05:45:07] egarcia at egm dot as I have the same problem in Windows XP, Windows 2000, using MSSQL 2000. I call a store procedure that returns data using rollup over a bit field. In the sumarized data MSSQL return NULL in the bit field but PHP give me a zero (0). The expected result is to get the NULL value data. The example in the posted message is TOTALLY replicable in my system. [2004-02-06 13:44:31] subspace at wanadoo dot nl ./configure --with-mssql --without-mysql The mysql option is irrelevant though. FreeTDS package installed: freetds-dev0.61-5 X-Powered-By: PHP/4.3.5RC2 bit: int(0) tiny: int(0) bit: int(1) tiny: int(1) bit: int(0) tiny: NULL [2004-02-06 11:35:33] [EMAIL PROTECTED] One more information is needed: what was the configure line used to configure PHP? The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/26820 -- Edit this bug report at http://bugs.php.net/?id=26820edit=1
#30351 [Asn-Csd]: PHP crashes on the REAL data type in a MSSQL query
ID: 30351 Updated by: [EMAIL PROTECTED] Reported By: davidifre at yahoo dot com -Status: Assigned +Status: Closed Bug Type: MSSQL related Operating System: solaris 5.8 PHP Version: 4.3.9 Assigned To: fmk New Comment: There is no longer a problem with the latest version of FreeTDS Previous Comments: [2005-08-09 09:05:51] freddyz77 at tin dot it Well, which processor are you using? Try with FLOAT type instead of REAL. freddy77 [2005-05-30 10:34:41] freddyz77 at tin dot it What operation system are you using? Have you tried to update FreeTDS version? freddy77 (FreeTDS developer) [2004-10-19 14:34:45] davidifre at yahoo dot com Hi, do you know if this is a bug? Am I alone to experience this problem? thx [2004-10-07 11:01:58] davidifre at yahoo dot com Description: I use freetds 0.62.4. I have a table with rows of different data type (binary, datetime, int, bit, smallint, tinyint, varbinary, varchar and real). A query with a request on the real data row (name is value) will crash php whereas other requests are ok: here is what i have in my apache logs [Thu Oct 7 09:11:16 2004] [notice] child pid 3045 exit signal Bus Error (10) It is not browser dependent but with Netscape7 I have a message this document contains no data. any idea? compiled (I removed every path): --with-apache --with-ldap --with-mysql --with-pgsql --with-sybase --with-oracle --with-oci8 --with-mssql --with-gd --with-zlib-dir --with-zip --with-jpeg-dir --with-png-dir --with-tiff-dir --with-pdflib --with-imap --with-snmp --with-mcrypt --with-sablot --with-expat-dir --with-gettext --enable-sysvsem --enable-sysvshm --enable-yp --enable-ftp --enable-calendar --enable-mbstring=all --without-pear --disable-cli Reproduce code: --- $req_SQL=SELECT value from table_name; $id_con=mssql_connect(host:port,username,pwd) or die (Could not connect to database: .mssql_get_last_message()); $msdb=mssql_select_db(base_name,$id_con); $result=mssql_query($req_SQL,$id_con); -- Edit this bug report at http://bugs.php.net/?id=30351edit=1
#33153 [Asn-Csd]: segfaults when calling mssql_next_result
ID: 33153 Updated by: [EMAIL PROTECTED] Reported By: erudd at netfor dot com -Status: Assigned +Status: Closed Bug Type: MSSQL related Operating System: FC3/FC4/MDK 10.2 x86 x86_64 PHP Version: 4.3.11 Assigned To: fmk New Comment: This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: [2005-10-17 21:56:55] erudd at netfor dot com Patch based on PHP_5_0 head branch applies to php 5.0.4 and php 4.3.10. tested and works with every I could throw at it (32 bit and 64 bit) Index: php_mssql.c === RCS file: /repository/php-src/ext/mssql/php_mssql.c,v retrieving revision 1.137.2.9 diff -u -r1.137.2.9 php_mssql.c --- php_mssql.c 12 Apr 2005 17:46:06 - 1.137.2.9 +++ php_mssql.c 14 Oct 2005 23:02:42 - @@ -1829,10 +1829,15 @@ WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(result, mssql_result *, mssql_result_index, -1, MS SQL-result, le_result); mssql_ptr = result-mssql_ptr; retvalue = dbresults(mssql_ptr-link); + + while (dbnumcols(mssql_ptr-link) = 0 retvalue == SUCCEED) { + retvalue = dbresults(mssql_ptr-link); + } + if (retvalue == FAIL) { RETURN_FALSE; } [2005-08-09 16:17:35] freddyz77 at tin dot it Problem here is that in mssql_next_result PHP do not ignore recordset without columns in mssql_query /* Skip results not returning any columns */ while ((num_fields = dbnumcols(mssql_ptr-link)) = 0 retvalue == SUCCEED) { retvalue = dbresults(mssql_ptr-link); } in mssql_execute /* Skip results not returning any columns */ while ((num_fields = dbnumcols(mssql_ptr-link)) = 0 retval_results == SUCCEED) { retval_results = dbresults(mssql_ptr-link); } but there is no such loop in mssql_next_result freddy77 [2005-08-03 18:56:54] erudd at netfor dot com Any updates on this issue? (Mandrake Bug #) http://qa.mandriva.com/show_bug.cgi?id=17272 [2005-06-28 18:54:00] erudd at netfor dot com I have tried the latest CVS code for the php-mssql extension and the same results occur.. I updated to the lastest on the 0.63 branch of freetds and apache/php no longer segfault, but PHP never advances to the next result set. [2005-05-30 10:31:51] freddyz77 at tin dot it dblastrow should not fail, this is certainly a FreeTDS bug. Fixed in CVS, expect a new 0.63.1 release. However I don't understand why PHP calls dblastrow (related to dblib buffering). freddy77 (FreeTDS developer) The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/33153 -- Edit this bug report at http://bugs.php.net/?id=33153edit=1
#35158 [Asn-Csd]: binding of stored proc input parameters is not working
ID: 35158 Updated by: [EMAIL PROTECTED] Reported By: vladik_g at mail dot ru -Status: Assigned +Status: Closed Bug Type: MSSQL related Operating System: Linux RedHat 9 PHP Version: 5CVS-2005-11-08 (snap) Assigned To: fmk New Comment: This is fixed in freetds v0.63.dev (the CVS version). Previous Comments: [2005-11-14 15:09:04] vladik_g at mail dot ru Frank, is there any chance to get it working shortly? [2005-11-09 12:55:01] [EMAIL PROTECTED] Frank, check this out please. [2005-11-09 11:14:28] vladik_g at mail dot ru Nothing more. With php 4.4 on same machine with same other soft all works ok. [2005-11-08 20:29:45] [EMAIL PROTECTED] What else have changed for you except for PHP version? [2005-11-08 20:09:47] vladik_g at mail dot ru Description: binding input parameters is not really working. This mechanism was working well in 4-th family of php. Reproduce code: --- php code here: mssql_bind($Proc,'@Param1',$Param1,SQLVARCHAR,false,false,30); mssql_execute($Proc,FALSE) || print(mssql_get_last_message()); MSSQL code here: CREATE PROCEDURE [dbo].[test] ( @Param1 VARCHAR(30) ) AS RETURN 0 GO Expected result: successfull execution Actual result: -- Procedure 'test' expects parameter '@Param1', which was not supplied. -- Edit this bug report at http://bugs.php.net/?id=35158edit=1
#32009 [Asn-Csd]: mssql_bind() causes buffer overruns memleaks
ID: 32009 Updated by: [EMAIL PROTECTED] Reported By: tony2001 at phpclub dot net -Status: Assigned +Status: Closed Bug Type: MSSQL related Operating System: Linux PHP Version: 5CVS-2005-02-17 Assigned To: fmk New Comment: This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: [2005-02-17 15:01:37] tony2001 at phpclub dot net Description: mssql_bind() causes some buffer overruns memleaks if you try to bind the same parameter *several times*. Reproduce code: --- ?php $c = mssql_connect($host, $user, $passwd); mssql_select_db($dbase); $r = mssql_init('nonex_stored_proc'); // that doesn't mean mssql_bind($r, param, $param, SQLTEXT, 0, 0, 10); mssql_bind($r, param, $param, SQLTEXT, 0, 0, 10); echo Done\n; ? Expected result: Done Actual result: -- [Thu Feb 17 16:18:27 2005] Script: '/www/index.php' --- /home/dev/php-src/Zend/zend_execute.h(127) : Block 0x082C2FF0 status: /home/dev/php-src/Zend/zend_execute.h(64) : Actual location (location was relayed) Beginning: OK (allocated on /home/dev/php-src/Zend/zend_vm_execute.h:157, 16 bytes) End: Overflown (magic=0x082C3764 instead of 0x2A8FCC84) At least 4 bytes overflown --- Done /home/dev/php-src/Zend/zend_vm_execute.h(157) : Freeing 0x082BF87C (16 bytes), script=/www/qa/tests/ext/mssql/030.php Last leak repeated 1 time /home/dev/php-src/Zend/zend_vm_execute.h(17922) : Freeing 0x082C3764 (16 bytes), script=/www/qa/tests/ext/mssql/030.php === Total 3 memory leaks detected === -- Edit this bug report at http://bugs.php.net/?id=32009edit=1
#33963 [Asn-Csd]: [PATCH] Binding some stored procedure parameters fails
ID: 33963 Updated by: [EMAIL PROTECTED] Reported By: paul dot robinson at groupbc dot com -Status: Assigned +Status: Closed Bug Type: MSSQL related Operating System: Linux (RHEL 4) PHP Version: 5CVS-2005-08-06 Assigned To: fmk New Comment: This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: [2005-09-01 20:47:56] akim at freedom dot com The problem with invalid values of maxlen for input parameters still exists in 5.1RC1. Previously these published specs were quoted: - maxlen For variable-length return parameters (when type is SQLCHAR, SQLBINARY, SQLTEXT, or SQLIMAGE), maxlen is the maximum desired byte length for the value parameter returned from a stored procedure. Set maxlen to -1 in any of these cases: For fixed-length return parameters (such as when type is SQLINT4). To pass a NULL fixed-length parameter value (such as when type is SQLINT4) to the stored procedure. *** For parameters that are not designated as return parameters. *** (my emphasis) Set maxlen to 0 to pass a NULL variable-length parameter value (when type is SQLCHAR, SQLBINARY, SQLTEXT, or SQLIMAGE) to the stored procedure. - The specific problem is that maxlen should be set to -1 for parameters that are not designated as return parameters which is a very roundabout way of saying input parameters. As currently written mssql_bind() sets maxlen = 0 for *all* parameters of variable-length type, including input parameters (see lines 2033-2043). This poses a problem with FreeTDS = 0.63 because an error will be returned if invalid values of maxlen are passed to dbrpcparam(). Previous versions of FreeTDS didn't perform much in the way of validation. There were multiple problems with SP parameters in FreeTDS 0.63 discussed on the FreeTDS listserv around the same time. Some were bona fide FreeTDS bugs and were fixed; when Freddy noted fixed in CVS I think he referred to a FreeTDS bug in handling NULL value parameters, which was fixed in CVS for dblib/rpc.c on Aug. 8. This particular maxlen problem with variable-length input parameters seems to be a bug in php_mssql.c, complicated by certain default settings in ADODB. Sorry if this seems repetitive but there have been no updates in weeks and I was afraid earlier comments might not have been worded clearly. [2005-08-09 19:54:57] akim at freedom dot com I've tried this patch to php_mssql.c with good results (so far): *** 2016,2021 --- 2016,2033 mssql_ptr=statement-link; /* modify datalen and maxlen according to dbrpcparam documentation */ + + /* handle maxlen for input parameters */ + + if (!is_output) { + if (is_null) { + maxlen=0; + } + else { + maxlen=-1; + } + } + if ( (type==SQLVARCHAR) || (type==SQLCHAR) || (type==SQLTEXT) ) { /* variable-length type */ if (is_null) { maxlen=0; [2005-08-09 18:56:35] akim at freedom dot com Part of the problem is that ADODB passes maxlen=4000 by default when binding parameters (see adodb-mssql.inc.php line 580). This conflicts with the published specs, which state that input parameters should have maxlen = -1. You can get away with that using FreeTDS 0.63, but it looks like the 0.63 release of FreeTDS added extensive sanity checking and input verification to dbrpcparam(), all in accordance with the published specs. The end result is that one can't bind a string value to an input parameter. Since this involves FreeTDS, core PHP and ADODB I'd say the best fix is the one that breaks the fewest existing installations ... I'd think that Freddy77's patch, which sets maxlen = -1 for all input parameters, will work with both FreeTDS 0.63 and 0.62 without breaking any existing ADODB code. If I get a chance I'll try to test this on a Windows box (all of my tests have been done on Solaris 9 with SQL Server 2000 so far). [2005-08-09 09:01:46] freddyz77 at tin dot it Fixed in CVS. Note however that if you call mssql_bind passing 7 parameters with maxlen = XXX and is_output = false you call dbrpcparam with status == 0 and maxlen = XXX, this is not correct, you should pass maxlen == -1 or maxlen == 0 (for NULL variable types... bad specifications but is what MS specify). Change these lines case 7: { zval **yyis_output, **yyis_null, **yymaxlen
#33201 [Asn-Csd]: segfault in _emalloc called from php_mssql_get_column_content_with_type
ID: 33201 Updated by: [EMAIL PROTECTED] Reported By: skissane at iips dot mq dot edu dot au -Status: Assigned +Status: Closed Bug Type: MSSQL related Operating System: Linux PHP Version: 5CVS-2005-11-07 (snap) Assigned To: fmk New Comment: This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: [2005-11-07 15:55:32] [EMAIL PROTECTED] Frank, fix please? :) [2005-11-07 02:24:08] skissane at iips dot mq dot edu dot au With latest snapshot the segfault is no longer happening... but malloc corruption is still occuring, which makes me wonder whether it really has been fixed or just changed in some way which makes this testcase no longer trigger the bug... ./configure --with-mssql --disable-cgi --enable-cli --disable-debug make clean make sapi/cli/php bug33201.php *** glibc detected *** sapi/cli/php: malloc(): memory corruption: 0x09546be0 *** === Backtrace: = /lib/libc.so.6[0xc800ea] /lib/libc.so.6(malloc+0x74)[0xc81492] sapi/cli/php(_emalloc+0x2f)[0x81ccde3] sapi/cli/php[0x80a5a7d] sapi/cli/php[0x80a989c] sapi/cli/php(zif_mssql_query+0x2eb)[0x80a9e47] sapi/cli/php[0x8200588] sapi/cli/php(execute+0xf5)[0x81ffd89] sapi/cli/php(zend_execute_scripts+0x1f3)[0x81e09c3] sapi/cli/php(php_execute_script+0x21a)[0x81ad776] sapi/cli/php(main+0xd60)[0x8262160] /lib/libc.so.6(__libc_start_main+0xdf)[0xc30d5f] sapi/cli/php[0x807bc29] === Memory map: ommitted... ./configure --with-mssql --disable-cgi --enable-cli --enable-debug make clean make sapi/cli/php bug33201.php [Mon Nov 7 12:12:37 2005] Script: 'bug33201.php' --- /home/skissane/unpacked/php5-200511062130/Zend/zend_variables.h(35) : Block 0x090E9980 status: /home/skissane/unpacked/php5-200511062130/Zend/zend_variables.c(36) : Actual location (location was relayed) Beginning: OK (allocated on /home/skissane/unpacked/php5-200511062130/ext/mssql/php_mssql.c:907, 19 bytes) End: Overflown (magic=0x2A8FCC00 instead of 0x2A8FCC84) 1 byte(s) overflown --- [Mon Nov 7 12:12:37 2005] Script: 'bug33201.php' --- /home/skissane/unpacked/php5-200511062130/Zend/zend_variables.h(35) : Block 0x090E9DB0 status: /home/skissane/unpacked/php5-200511062130/Zend/zend_variables.c(36) : Actual location (location was relayed) Beginning: OK (allocated on /home/skissane/unpacked/php5-200511062130/ext/mssql/php_mssql.c:907, 19 bytes) End: Overflown (magic=0x2A8FCC00 instead of 0x2A8FCC84) 1 byte(s) overflown --- [Mon Nov 7 12:12:37 2005] Script: 'bug33201.php' --- /home/skissane/unpacked/php5-200511062130/Zend/zend_variables.h(35) : Block 0x090EA268 status: /home/skissane/unpacked/php5-200511062130/Zend/zend_variables.c(36) : Actual location (location was relayed) Beginning: OK (allocated on /home/skissane/unpacked/php5-200511062130/ext/mssql/php_mssql.c:907, 19 bytes) End: Overflown (magic=0x2A8FCC00 instead of 0x2A8FCC84) 1 byte(s) overflown --- [Mon Nov 7 12:12:37 2005] Script: 'bug33201.php' --- /home/skissane/unpacked/php5-200511062130/Zend/zend_variables.h(35) : Block 0x090EA2B0 status: /home/skissane/unpacked/php5-200511062130/Zend/zend_variables.c(36) : Actual location (location was relayed) Beginning: OK (allocated on /home/skissane/unpacked/php5-200511062130/ext/mssql/php_mssql.c:907, 9 bytes) End: Overflown (magic=0x35373232 instead of 0x2A8FCC84) At least 4 bytes overflown --- [Mon Nov 7 12:12:37 2005] Script: 'bug33201.php' --- /home/skissane/unpacked/php5-200511062130/Zend/zend_variables.h(35) : Block 0x090EA828 status: /home/skissane/unpacked/php5-200511062130/Zend/zend_variables.c(36) : Actual location (location was relayed) Beginning: OK (allocated on /home/skissane/unpacked/php5-200511062130/ext/mssql/php_mssql.c:907, 19 bytes) End: Overflown (magic=0x2A8FCC00 instead of 0x2A8FCC84) 1 byte(s) overflown --- [Mon Nov 7 12:12:37 2005] Script: 'bug33201.php' --- /home/skissane/unpacked/php5-200511062130/Zend/zend_variables.h(35) : Block 0x090EAF18 status: /home/skissane/unpacked/php5-200511062130/Zend/zend_variables.c(36) : Actual location (location
#29316 [Asn-Csd]: Executing Stored Procedure with more than one Resultset
ID: 29316 Updated by: [EMAIL PROTECTED] Reported By: patrick dot schutte at gmx dot de -Status: Assigned +Status: Closed Bug Type: MSSQL related Operating System: Suse8.2 PHP Version: 5CVS-2005-03-08 Assigned To: fmk New Comment: This works with the development version of FreeTDS Previous Comments: [2005-08-09 11:23:49] freddyz77 at tin dot it Using FreeTDS 0.63 with post fix and current version works correctly. Tried also 0.64 (current developing version) freddy77 [2005-03-08 13:51:30] patrick dot schutte at gmx dot de nope, Im using php 5.1.0-dev 200508030930 with freetds 0.62.4. The stored procedure executes 2 Select-Statements. The frist with no result, the second with 5 lines. On tsql-console from freetds: 1 use php 2 go 1 exec dbo.dt_mehrfach 2 go id produktname tagesbedarf kvnr id produktname tagesbedarf kvnr 17 Schnecken 1 Tüten / Tag 2135860009 18 Colorado1 Tüte / Monat NULL 19 Gummibärchen2 Tüten / tgl. NULL 20 TestNULL 16 Phantasia 12 Tüten / WocheNULL (return status = 0) the first line id produktname tagesbedarf kvnr show no matches for the first select. PHP: echo Select1: .mssql_num_rows($rs); mssql_next_result($rs); echo Select2: .mssql_num_rows($rs); Returns 5 5 instead 0,5 still after updating php with latetst snap. The Problem still exists. [2005-03-06 20:51:38] [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 [2004-07-22 10:35:13] patrick dot schutte at gmx dot de Description: I've written stored Procedures that returns 2 and more Resultsets (Select-Querys). If one of theese Results doesn't have any Matches I get the next one instead. System: Suse8.2, freetds 0.62.3 ./configure ... --with-mssql freetds with TDS-Version 7.0 and MSSQL-Server2000. Same Code works fine with WindowsNT4.0 Reproduce code: --- CREATE PROCEDURE [dbo].[dt_mehrfach] AS -- first Query: no match SELECT * FROM tbl_haribo WHERE id=1 -- second Query: 15 matches SELECT * FROM tbl_haribo PHP: $p=mssql_init(dt_mehrfach); $result=mssql_execute($p); echo mssql_num_rows($result).br /\n; mssql_next_result($result); echo mssql_num_rows($result); Expected result: 0 15 would be ok Actual result: -- but I get 15 15 -- Edit this bug report at http://bugs.php.net/?id=29316edit=1
#35217 [Fbk-Bgs]: mssql.max_procs strange behaviour
ID: 35217 Updated by: [EMAIL PROTECTED] Reported By: vovik at getart dot ru -Status: Feedback +Status: Bogus Bug Type: MSSQL related Operating System: RHEL 4 PHP Version: 4.4.1 New Comment: I've just tested this with the FreeTDS 0.64 and it works as expected. If you are running PHP under Apache yoy need to restart the server when you make changes to the php.ini file. Previous Comments: [2005-11-14 20:36:31] [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-11-14 16:34:47] vovik at getart dot ru Description: When I try to limit maximum number of MS SQL open connections via php.ini it doesn't work properly. It doesn't work at all. Instead of this, connections actually established, but some error messages (from FreeTDS ?) appeared on every mssql_connect() above mssql.max_procs. I've added sleep() to end of script for checking number of connections on SQL server side and in example above it is 30. Reproduce code: --- ?php // mssql.max_procs set to 26 in php.ini $links = array(); for ($k = 0; $k 30; ++$k) { $link = mssql_connect(mssqlserver, xxx, yyy, true); if (!$link) { exit(Connect failed.); } $links[] = $link; } sleep(20); ? Expected result: PHP warning: Too many open links (26) Connect failed. Actual result: -- (on stderr) Max connections reached, increase value of TDS_MAX_CONN Max connections reached, increase value of TDS_MAX_CONN Max connections reached, increase value of TDS_MAX_CONN Max connections reached, increase value of TDS_MAX_CONN -- Edit this bug report at http://bugs.php.net/?id=35217edit=1
#35037 [Asn-Csd]: unknown data type (36)
ID: 35037 Updated by: [EMAIL PROTECTED] Reported By: spooky at int13h dot com -Status: Assigned +Status: Closed Bug Type: MSSQL related Operating System: FreeBSD 5.4 PHP Version: 5CVS-2005-10-31 (snap) Assigned To: fmk New Comment: This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: [2005-11-01 11:38:06] [EMAIL PROTECTED] Frank, can you check this out please? [2005-10-31 18:11:49] spooky at int13h dot com Description: For php5-200510311530 (Also 5.0.5 stable release) ./configure --prefix=/usr/local --with-apxs=/usr/local/apache/bin/apxs --with-libxml-dir=/usr/local --with-zlib --with-curl --with-gd --with-ldap --with-mssql --with-pear For FreeTDS 0.63 ./configure --prefix=/usr/local --with-tdsver=8.0 --enable-msdblib When I fire an SQL Query that returns a uniqueidentifier I get the error 'Warning: mssql_query() [function.mssql-query]: column 1 has unknown data type (36) in /usr/websites/dev/testies.php on line 12' Reproduce code: --- function connect_sql () { $mssql_link = mssql_connect('IP', 'USER','PASSWORD') or die (Server Connection Error); $mssql_db = mssql_select_db('Websites',$mssql_link) or die(Database Error); } connect_sql(); $query = 'select newid() as test'; echo $query . 'br/'; mssql_query($query); mssql_close(); Expected result: No result should be returned. It should generate a new id. Actual result: -- 'Warning: mssql_query() [function.mssql-query]: column 1 has unknown data type (36) in /usr/websites/dev/testies.php on line 12' -- Edit this bug report at http://bugs.php.net/?id=35037edit=1
#34659 [Opn-Fbk]: mssql_query fails if you have triggers that return resultsets
ID: 34659 Updated by: [EMAIL PROTECTED] Reported By: elite at programmer dot net -Status: Open +Status: Feedback Bug Type: MSSQL related Operating System: Windows XP/2003 PHP Version: 5CVS-2005-09-27 (snap) New Comment: Changed database context to '...' is not generated by PHP but by the database server. It's not an error but a message returned when the current database context was changed. Your example does not show how the function is failing. Please provide an example that shows the trigger and the full PHP code so we can reproduce the problem and fix the bug, if any. Previous Comments: [2005-09-27 16:06:55] elite at programmer dot net Description: When you execute a query, e.g. delete a row in a table that has triggers AFTER DELETE and those triggers return resultsets (eg. SELECT id FROM DELETED) PHP will report Changed database context to '...' Reproduce code: --- mssql_query(DELETE row FROM table1); -- Edit this bug report at http://bugs.php.net/?id=34659edit=1
#34655 [Opn-Bgs]: mssql_fetch_array returns blank for empty fields
ID: 34655 Updated by: [EMAIL PROTECTED] Reported By: os at bong dot de -Status: Open +Status: Bogus Bug Type: MSSQL related Operating System: Win2k PHP Version: 5.0.5 New Comment: This is still a bug in the ntwdblib.dll library used to build the PHP extension. Please search the bug database before submitting issues that have already been reported and commented on. Previous Comments: [2005-09-27 11:42:09] os at bong dot de Description: When fetching a row from a query using the function mssql_fetch_array, all fields that are empty in db, i.e. with a value of '' (NOT NULL), are returned as one blank (' '). -- Edit this bug report at http://bugs.php.net/?id=34655edit=1
#34647 [Opn-Asn]: mssql.timeout has no affect
ID: 34647 Updated by: [EMAIL PROTECTED] Reported By: j dot geusebroek at intellit dot nl -Status: Open +Status: Assigned Bug Type: MSSQL related Operating System: Suse 9.3 PHP Version: 5.0.5 -Assigned To: +Assigned To: fmk Previous Comments: [2005-09-26 18:51:57] j dot geusebroek at intellit dot nl Description: mssql.timeout has no affect, a query will wait an infinite time and the scripts hangs. I'm using the FreeTDS library, version 6.3 but i also tried latest FreeTDS CVS. FreeTDS debug file shows that a timeout has occured (i also set the timeout in the FreeTDS client) but PHP keeps running. (dblib.c:4010:in dbsqlok() net.c:327:exceeded query timeout: 10 net.c:327:exceeded query timeout: 10 net.c:327:exceeded query timeout: 10 net.c:327:exceeded query timeout: 10 net.c:327:exceeded query timeout: 10 net.c:327:exceeded query timeout: 10 ) Reproduce code: --- Perform any query that outlasts your mssql.timeout setting. Expected result: PHP exiting with a fatal error. Actual result: -- Infinite wait. -- Edit this bug report at http://bugs.php.net/?id=34647edit=1
#34369 [Asn]: mssql_query() does not use link identifier
ID: 34369 Updated by: [EMAIL PROTECTED] Reported By: qlogix at gmail dot com Status: Assigned Bug Type: Feature/Change Request Operating System: * PHP Version: 6CVS, 5CVS, 4CVS (2005-09-05) Assigned To: fmk New Comment: If the same host, usr and password is used for both connections the driver will not create a new connection. To get arround this problem you need to create two aliases for the SQL Server host name like this: $conn1 = mssql_connect(CONN1,dbuser,dbpass); mssql_select_db(db1,$conn1); $conn2 = mssql_connect(CONN2,dbuser,dbpass); mssql_select_db(db2,$conn2); The two host names should point to the same server, but it forces the extension to create a new connection each time. Previous Comments: [2005-09-04 23:56:40] [EMAIL PROTECTED] This is not a bug, just missing feature. See mysql_connect() prototype: resource mysql_connect ([string server [, string username [, string password [, bool new_link [, int client_flags]) mssql_query() misses the 'new_link' parameter. [2005-09-04 23:43:49] qlogix at gmail dot com Description: mssql_query() does not use the link identifier your specify. If you open two database connections using mssql_connect then specify which one of those connections to use in mssql_query(), the mssql_query() function will just use the last connection opened, no matter what. CONN1 is the address to my local mssql server. Table donations exists in database db1, not in db2 Table tbl_admin_user exists in database db2, not in db1 If I switch the order of connections, the first query works and the second one fails, and of course vice versa. In my case, yes, I am opening two connections to the same server, just changing the name of the database I want to use, however this application can be configured to connect to to different servers. Reproduce code: --- $conn1 = mssql_connect(CONN1,dbuser,dbpass); mssql_select_db(db1,$conn1); $conn2 = mssql_connect(CONN1,dbuser,dbpass); mssql_select_db(db2,$conn2); $sq = mssql_query(SELECT * FROM donations,$conn1); $sq2 = mssql_query(SELECT * FROM tbl_admin_user,$conn2); Expected result: No errors. Actual result: -- Warning: mssql_query(): message: Invalid object name 'donations'. (severity 16) in C:\htdocs\noname2.php on line 8 Warning: mssql_query(): Query failed in C:\htdocs\noname2.php on line 8 -- Edit this bug report at http://bugs.php.net/?id=34369edit=1
#34369 [Asn-Csd]: mssql_query() does not use link identifier
ID: 34369 Updated by: [EMAIL PROTECTED] Reported By: qlogix at gmail dot com -Status: Assigned +Status: Closed Bug Type: Feature/Change Request Operating System: * PHP Version: 6CVS, 5CVS, 4CVS (2005-09-05) Assigned To: fmk New Comment: This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. A new parameter to mssql_connect makes it possible to force the creation of a new link. Previous Comments: [2005-09-05 00:28:06] [EMAIL PROTECTED] If the same host, usr and password is used for both connections the driver will not create a new connection. To get arround this problem you need to create two aliases for the SQL Server host name like this: $conn1 = mssql_connect(CONN1,dbuser,dbpass); mssql_select_db(db1,$conn1); $conn2 = mssql_connect(CONN2,dbuser,dbpass); mssql_select_db(db2,$conn2); The two host names should point to the same server, but it forces the extension to create a new connection each time. [2005-09-04 23:56:40] [EMAIL PROTECTED] This is not a bug, just missing feature. See mysql_connect() prototype: resource mysql_connect ([string server [, string username [, string password [, bool new_link [, int client_flags]) mssql_query() misses the 'new_link' parameter. [2005-09-04 23:43:49] qlogix at gmail dot com Description: mssql_query() does not use the link identifier your specify. If you open two database connections using mssql_connect then specify which one of those connections to use in mssql_query(), the mssql_query() function will just use the last connection opened, no matter what. CONN1 is the address to my local mssql server. Table donations exists in database db1, not in db2 Table tbl_admin_user exists in database db2, not in db1 If I switch the order of connections, the first query works and the second one fails, and of course vice versa. In my case, yes, I am opening two connections to the same server, just changing the name of the database I want to use, however this application can be configured to connect to to different servers. Reproduce code: --- $conn1 = mssql_connect(CONN1,dbuser,dbpass); mssql_select_db(db1,$conn1); $conn2 = mssql_connect(CONN1,dbuser,dbpass); mssql_select_db(db2,$conn2); $sq = mssql_query(SELECT * FROM donations,$conn1); $sq2 = mssql_query(SELECT * FROM tbl_admin_user,$conn2); Expected result: No errors. Actual result: -- Warning: mssql_query(): message: Invalid object name 'donations'. (severity 16) in C:\htdocs\noname2.php on line 8 Warning: mssql_query(): Query failed in C:\htdocs\noname2.php on line 8 -- Edit this bug report at http://bugs.php.net/?id=34369edit=1
#32010 [Fbk-Csd]: memleaks in mssql_fetch_batch()
ID: 32010 Updated by: [EMAIL PROTECTED] Reported By: tony2001 at phpclub dot net -Status: Feedback +Status: Closed Bug Type: MSSQL related Operating System: Linux PHP Version: 5CVS-2005-02-17 Assigned To: fmk New Comment: This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: [2005-08-08 18:13:11] [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-02-17 15:07:24] tony2001 at phpclub dot net Description: mssql_fetch_batch() leaks in several places. Reproduce code: --- ?php $c = mssql_connect($host, $user, $passwd); mssql_select_db($dbase); $r = mssql_query(SELECT * FROM test_table); mssql_fetch_batch($r); echo Done\n; ? Expected result: Done Actual result: -- /home/dev/php-src/ext/mssql/php_mssql.c(1065) : Freeing 0x082C0BE4 (3 bytes), script=/www/index.php /home/dev/php-src/ext/mssql/php_mssql.c(1052) : Freeing 0x082C0BAC (3 bytes), script=/www/index.php -- Edit this bug report at http://bugs.php.net/?id=32010edit=1
#33963 [Asn]: [PATCH] Binding some stored procedure parameters fails
ID: 33963 Updated by: [EMAIL PROTECTED] Reported By: paul dot robinson at groupbc dot com Status: Assigned Bug Type: MSSQL related Operating System: Linux (RHEL 4) PHP Version: 5CVS-2005-08-06 Assigned To: fmk New Comment: As far as I can read, the current code is following Microsofts definitions here: maxlen For variable-length return parameters (when type is SQLCHAR, SQLBINARY, SQLTEXT, or SQLIMAGE), maxlen is the maximum desired byte length for the value parameter returned from a stored procedure. Set maxlen to -1 in any of these cases: For fixed-length return parameters (such as when type is SQLINT4). To pass a NULL fixed-length parameter value (such as when type is SQLINT4) to the stored procedure. For parameters that are not designated as return parameters. Set maxlen to 0 to pass a NULL variable-length parameter value (when type is SQLCHAR, SQLBINARY, SQLTEXT, or SQLIMAGE) to the stored procedure. datalen For variable-length return parameters (where type is SQLCHAR, SQLBINARY, SQLTEXT, or SQLIMAGE), datalen is the actual byte length of the value parameter sent to the stored procedure. The byte length should not count any null terminator. Set datalen to - 1 for non-NULL fixed-length parameters (such as when type is SQLINT4). Set datalen to 0 to pass a NULL parameter value (fixed or variable length) to the stored procedure I think this should be fixed in FreeTDS Previous Comments: [2005-08-06 01:31:45] [EMAIL PROTECTED] Frank, check this out too.. [2005-08-05 16:52:00] paul dot robinson at groupbc dot com Patch against php_mssql.c CVS version 1.149 can be found here: http://cobweb.businesscollaborator.com/pdr/33963.patch The values of maxlen and datalen set here have been verified to work with FreeTDS 0.63 and the latest CVS code as of 5/8/2005. [2005-08-02 19:13:45] [EMAIL PROTECTED] Provide patches in unified diff format (diff -u) and against PHP CVS HEAD (we're not likely to release any 5.0.x versions anymore). Put the diffs somewhere were people can download it and put the URLs here. [2005-08-02 18:51:03] paul dot robinson at groupbc dot com Patches suggested are against Snapshot: php5-STABLE-200508021038.tar.gz Although I haven't actually built an example using that snapshot today I have looked at the code which since it is unchanged would seem to exhibit the same problem. [2005-08-02 18:34:32] [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 The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/33963 -- Edit this bug report at http://bugs.php.net/?id=33963edit=1
#32531 [Asn-Csd]: Sybase extension contains aliases to mssql functions that can never be used
ID: 32531 Updated by: [EMAIL PROTECTED] Reported By: daniel dot beet at accuratesoftware dot com -Status: Assigned +Status: Closed Bug Type: Sybase-ct (ctlib) related Operating System: Windows PHP Version: 5.0.4, 4.3.11 Assigned To: fmk New Comment: This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: [2005-08-06 01:36:32] [EMAIL PROTECTED] Frank, do you have any opinions about this? (just make ext/mssql shared ext in windows maybe? :) [2005-04-20 16:38:47] frodelangvik at hotmail dot com Removed the current ALIAS handling and insert the following, and the compile the file again. #ifdef PHP_WIN32 function_entry sybase_functions[] = { PHP_FE(sybase_connect, NULL) PHP_FE(sybase_pconnect, NULL) PHP_FE(sybase_close, NULL) PHP_FE(sybase_select_db, NULL) PHP_FE(sybase_query, NULL) PHP_FE(sybase_unbuffered_query, NULL) PHP_FE(sybase_free_result, NULL) PHP_FE(sybase_get_last_message, NULL) PHP_FE(sybase_num_rows, NULL) PHP_FE(sybase_num_fields, NULL) PHP_FE(sybase_fetch_row, NULL) PHP_FE(sybase_fetch_array, NULL) PHP_FE(sybase_fetch_assoc, NULL) PHP_FE(sybase_fetch_object, NULL) PHP_FE(sybase_data_seek, NULL) PHP_FE(sybase_fetch_field, NULL) PHP_FE(sybase_field_seek, NULL) PHP_FE(sybase_result, NULL) PHP_FE(sybase_affected_rows, NULL) PHP_FE(sybase_min_client_severity, NULL) PHP_FE(sybase_min_server_severity, NULL) PHP_FE(sybase_set_message_handler, NULL) PHP_FE(sybase_deadlock_retry_count, NULL) {NULL, NULL, NULL} }; #else function_entry sybase_functions[] = { PHP_FE(sybase_connect, NULL) PHP_FE(sybase_pconnect, NULL) PHP_FE(sybase_close, NULL) PHP_FE(sybase_select_db, NULL) PHP_FE(sybase_query, NULL) PHP_FE(sybase_unbuffered_query, NULL) PHP_FE(sybase_free_result, NULL) PHP_FE(sybase_get_last_message, NULL) PHP_FE(sybase_num_rows, NULL) PHP_FE(sybase_num_fields, NULL) PHP_FE(sybase_fetch_row, NULL) PHP_FE(sybase_fetch_array, NULL) PHP_FE(sybase_fetch_assoc, NULL) PHP_FE(sybase_fetch_object, NULL) PHP_FE(sybase_data_seek, NULL) PHP_FE(sybase_fetch_field, NULL) PHP_FE(sybase_field_seek, NULL) PHP_FE(sybase_result, NULL) PHP_FE(sybase_affected_rows, NULL) PHP_FE(sybase_min_client_severity, NULL) PHP_FE(sybase_min_server_severity, NULL) PHP_FE(sybase_set_message_handler, NULL) PHP_FE(sybase_deadlock_retry_count, NULL) PHP_FALIAS(mssql_connect, sybase_connect, NULL) PHP_FALIAS(mssql_pconnect, sybase_pconnect, NULL) PHP_FALIAS(mssql_close, sybase_close, NULL) PHP_FALIAS(mssql_select_db, sybase_select_db, NULL) PHP_FALIAS(mssql_query, sybase_query, NULL) PHP_FALIAS(mssql_unbuffered_query, sybase_unbuffered_query, NULL) PHP_FALIAS(mssql_free_result, sybase_free_result, NULL) PHP_FALIAS(mssql_get_last_message, sybase_get_last_message, NULL) PHP_FALIAS(mssql_num_rows, sybase_num_rows, NULL) PHP_FALIAS(mssql_num_fields, sybase_num_fields, NULL) PHP_FALIAS(mssql_fetch_row, sybase_fetch_row, NULL) PHP_FALIAS(mssql_fetch_array, sybase_fetch_array, NULL) PHP_FALIAS(mssql_fetch_assoc, sybase_fetch_assoc, NULL) PHP_FALIAS(mssql_fetch_object, sybase_fetch_object, NULL) PHP_FALIAS(mssql_data_seek, sybase_data_seek, NULL) PHP_FALIAS(mssql_fetch_field, sybase_fetch_field, NULL) PHP_FALIAS(mssql_field_seek, sybase_field_seek, NULL) PHP_FALIAS(mssql_result, sybase_result, NULL) PHP_FALIAS(mssql_affected_rows, sybase_affected_rows, NULL) PHP_FALIAS(mssql_min_client_severity, sybase_min_client_severity, NULL) PHP_FALIAS(mssql_min_server_severity, sybase_min_server_severity, NULL
#33965 [Asn-Csd]: [PATCH] NULL valued output parameter from stored procedures contain corrupt data
ID: 33965 Updated by: [EMAIL PROTECTED] Reported By: paul dot robinson at groupbc dot com -Status: Assigned +Status: Closed Bug Type: MSSQL related Operating System: Linux (RHEL 4) PHP Version: 5CVS-2005-08-06 Assigned To: fmk New Comment: This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: [2005-08-06 01:30:57] [EMAIL PROTECTED] Frank, can you check this out? [2005-08-05 16:57:19] paul dot robinson at groupbc dot com Patch against php_mssql.c CVS version 1.149 can be found here: http://cobweb.businesscollaborator.com/pdr/33965.patch Rationale behind the patch was discussed here: http://lists.ibiblio.org/pipermail/freetds/2005q3/018851.html This has been verified to work with FreeTDS releases _after_ 0.63. Without this patch output parameters that should be null will simply read random data. [2005-08-02 19:12:53] [EMAIL PROTECTED] Provide patches in unified diff format (diff -u) and against PHP CVS HEAD (we're not likely to release any 5.0.x versions anymore). Put the diffs somewhere were people can download it and put the URLs here. [2005-08-02 18:50:33] paul dot robinson at groupbc dot com Patches suggested are against Snapshot: php5-STABLE-200508021038.tar.gz Although I haven't actually built an example using that snapshot today I have looked at the code which since it is unchanged would seem to exhibit the same problem. [2005-08-02 18:34:21] [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 The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/33965 -- Edit this bug report at http://bugs.php.net/?id=33965edit=1
#33877 [Opn-Bgs]: When multiple result sets are not freed subsequent queries fail
ID: 33877 Updated by: [EMAIL PROTECTED] Reported By: Jeffrey dot Rodriguez at gmail dot com -Status: Open +Status: Bogus Bug Type: MSSQL related Operating System: Windows XP / 2000 PHP Version: 5.0.4 Assigned To: fmk New Comment: SQL Server does not allow new queries when results are pending. The client must fetch all results or free unwanted results before new queries can be executed. Previous Comments: [2005-07-27 17:46:57] Jeffrey dot Rodriguez at gmail dot com Issue still occurs with the latest CVS snapshot. [2005-07-27 13:52:45] [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-07-27 01:16:38] Jeffrey dot Rodriguez at gmail dot com Typo: Failure to do so will cause subsequent mssql_next_query() or mssql_select_db() calls to fail. Should read: Failure to do so will cause subsequent mssql_query() or mssql_select_db() calls to fail. [2005-07-27 00:53:09] Jeffrey dot Rodriguez at gmail dot com Description: NOTE: This issue seems to occur in versions (atleast) 4.3.4 - 5.0.4 WORKAROUND: Be sure to call mssql_free_result() on every result that has the potential to return multiple result sets. PROBLEM: When a query (stored procedure for example) returns multiple result sets, you have to call mssql_next_result() OR mssql_free_result() on the result of an mssql_query(). Failure to do so will cause subsequent mssql_next_query() or mssql_select_db() calls to fail. ADDITIONAL NOTES: The docs should be updated if this functionality is intended. Sorry about the 'excessive' length of code, I figure you can handle 8 extra lines. Reproduce code: --- ?php /* -- Stored procedure CREATE PROCEDURE bug_proofOfConcept_sp AS SELECT 'Result set one' AS 'Result Set'; SELECT 'Result set two' AS 'Result Set'; GO */ $link = mssql_connect(server, user, pass); mssql_select_db(database, $link); $rs = mssql_query(EXECUTE bug_proofOfConcept_sp); /* Note, it doesn't matter if you fetch from $rs */ /* This is where things bomb out */ if (!mssql_select_db(database, $link)) { echo Broken, as expected.\n; } /* If we free the result things work fine again. Alternatively, you could call mssql_next_result($rs) */ mssql_free_result($rs); // Select the database (3rd, and last time) if (!mssql_select_db(database, $link)) { echo Everything should be working here; wtf?\n; } ? Expected result: No output Actual result: -- Warning: mssql_select_db(): Unable to select database: database in H:\proofOfConcept.php on line 16 Broken, as expected. -- Edit this bug report at http://bugs.php.net/?id=33877edit=1
#32241 [Bgs]: Why not have mssql_insert_id function when use Microsoft sql server database!
ID: 32241 Updated by: [EMAIL PROTECTED] Reported By: kangtk at 163 dot com Status: Bogus Bug Type: Feature/Change Request Operating System: Windows2000 Server PHP Version: 4.3.10 New Comment: It is possible to obtain this value from the server with an explicit sql statement: INSERT INTO jobs (job_desc,min_lvl,max_lvl) VALUES ('Accountant',12,125) SELECT @@IDENTITY AS 'Identity' Previous Comments: [2005-07-27 11:12:48] [EMAIL PROTECTED] The underlying library doesn't provide something like that, so PHP doesn't provide a wrapper. There is nothing we can do, ask MS about it. [2005-07-27 04:05:48] Daniel dot Spada at det dot wa dot edu dot au To expand on the previous poster. I have found that there is no such function mssql_insert_id() when using MS-SQL server. I am using PHP 4.3.10-15, with SQL server 2000. A mssql_insert_id function would be REALLY handy to assist in error checking etc. [2005-03-09 03:10:31] kangtk at 163 dot com Description: I can use this function mysql_insert_id to get the insert id when I connect with mysql database. But I cann't use the mssql_insert_id when I change the code to Microsoft Sql server databse. Can you explain something to me? Thanks. -- Edit this bug report at http://bugs.php.net/?id=32241edit=1
#33694 [Opn-Asn]: IIS needs restart when invalid MSSQL statement run
ID: 33694 Updated by: [EMAIL PROTECTED] Reported By: spam at meyrick dot co dot nz -Status: Open +Status: Assigned Bug Type: MSSQL related Operating System: Windows 2003 Server Enterprise PHP Version: 4.4.0 -Assigned To: +Assigned To: fmk Previous Comments: [2005-07-14 11:03:03] spam at meyrick dot co dot nz Description: I am using IIS6 (Win2k3 Server, SQL Server 2000, PHP 4.3.4 DLL) I am connecting to MSSQL using username/pwd and pconnect no probs there. My problem is that if I execute a horribly incorrect SQL statement one of the perminant connections to MSSQL is disabled giving 'unable to connec to database' (pconnect() == false) errors 50% of the time.. For example: Table: [Stock Items]: StockItemID int no nulls identity SupplierID int no nulls --** test varchar(50) allow null ... $sql = INSERT INTO [Stock Items] (test) VALUES ('this should fail'); $result = mssql_query($sql); Warning: mssql_query(): message: Cannot insert the value NULL into column 'SupplierID', table 'Database Name.dbo.Stock Items'; column does not allow nulls. INSERT fails. (severity 16) in C:\Inetpub\websites\sitename\public_html\acweb\includes\functions\database.php on line 49 Warning: mssql_query(): message: The statement has been terminated. (severity 0) in C:\Inetpub\websites\sitename\public_html\acweb\includes\functions\database.php on line 49 Warning: mssql_query(): General SQL Server error: Check messages from the SQL Server. (severity 5) in C:\Inetpub\websites\sitename\public_html\acweb\includes\functions\database.php on line 49 Warning: mssql_query(): Query failed in C:\Inetpub\websites\sitename\public_html\acweb\includes\functions\database.php on line 49 Warning: mssql_query(): Attempt to initiate a new SQL Server operation with results pending. (severity 7) in C:\Inetpub\websites\sitename\public_html\acweb\includes\functions\database.php on line 186 The last error is the one that is the kick in the guts as now EVERY sql statement until the page finishes loading will fail. When the page is refreshed pconnect() will work 50% of the time (if they get a valid connection it works, if they get the dead connection it fails). The only way I can fix this problem is restarting IIS which is a pain. I can replicate the problem by killing the process from MSSQL Enterprise manager. Any help would be great. ps. an answer of just fix your sql statement is not what I'm looking for as it is not allways related to invalid sql statements, running large querieis using ODBC over the www seems to cause the exact same problem, so does re/syncronizing a large replicated sql database. Thanks. Reproduce code: --- Table: [Stock Items]: StockItemID int no nulls identity SupplierID int no nulls --** test varchar(50) allow null ... $sql = INSERT INTO [Stock Items] (test) VALUES ('this should fail'); $result = mssql_query($sql); Expected result: $result == valid mssql result Actual result: -- Warning: mssql_query(): message: Cannot insert the value NULL into column 'SupplierID', table 'Database Name.dbo.Stock Items'; column does not allow nulls. INSERT fails. (severity 16) in C:\Inetpub\websites\sitename\public_html\acweb\includes\functions\database.php on line 49 Warning: mssql_query(): message: The statement has been terminated. (severity 0) in C:\Inetpub\websites\sitename\public_html\acweb\includes\functions\database.php on line 49 Warning: mssql_query(): General SQL Server error: Check messages from the SQL Server. (severity 5) in C:\Inetpub\websites\sitename\public_html\acweb\includes\functions\database.php on line 49 Warning: mssql_query(): Query failed in C:\Inetpub\websites\sitename\public_html\acweb\includes\functions\database.php on line 49 Warning: mssql_query(): Attempt to initiate a new SQL Server operation with results pending. (severity 7) in C:\Inetpub\websites\sitename\public_html\acweb\includes\functions\database.php on line 186 + dead pconnection to MSSQL server until IIS (php dll) is restarted -- Edit this bug report at http://bugs.php.net/?id=33694edit=1
#33309 [Fbk]: mssql_query crashes php
ID: 33309 Updated by: [EMAIL PROTECTED] Reported By: alexander dot merz at gmail dot com Status: Feedback Bug Type: MSSQL related Operating System: Windows XP Home PHP Version: 5.0.4 New Comment: The same code works fine with previous versions of MS SQL Server. MS SQL Server 2005 Beta is not a stable target to test against. Previous Comments: [2005-06-11 15:25:05] [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-06-11 14:14:06] alexander dot merz at gmail dot com Description: Running the current PEAR::MDB2 testsuite in CVS against MS SQLServer 2005 Beta causes a crash of php. The source causing the crash reduced to a minimum is given in the Reproduced code section. The crash does also happend if you list the field names directly: 'SELECT user_name, user_password, subscribed, user_id, quota, weight, access_date, access_time, approved FROM users' It does crash too, if the statment above contains only the first two fields (user_name, user_password) and *one* of the others, ie: 'SELECT user_name, user_password, subscribed FROM users' It *works*, if the field list does NOT contain the user_password field, independed of length of the field list, ie: 'SELECT user_name, subscribed, user_id, quota, weight, access_date, access_time, approved FROM users' user_password is of the type 'text'. The table is empty, and the statement works like a charm in the SQL Query console of Server Management Studio. Reproduce code: --- $c = mssql_connect(ALEX, amerz, amerz); mssql_select_db(driver_test, $c); mssql_query('SELECT * FROM users'); mssql_close($c); Expected result: No crash :) Actual result: -- a crash :( -- Edit this bug report at http://bugs.php.net/?id=33309edit=1
#32854 [Opn-Asn]: mssql_pconnect fails under load and doesn't recover
ID: 32854 Updated by: [EMAIL PROTECTED] Reported By: gerritgiliomee at hotmail dot com -Status: Open +Status: Assigned Bug Type: MSSQL related Operating System: Windows 2000 sp4 PHP Version: 5.0.4 -Assigned To: +Assigned To: fmk Previous Comments: [2005-04-27 13:09:17] gerritgiliomee at hotmail dot com Description: Using mssql_pconnect to connect to a MS SQL2000 server on another box. Everything works a treat until I put some load on. When I go above a certain threshhold, e.g. using Apache Benchmark, 20 concurrent users, 500 requests, mssql_pconnect fails with this error: Warning: mssql_pconnect() [function.mssql-pconnect]: Unable to connect to server: servername This is understandable as things will break above a certain point, however, after this happens, mssql_pconnect seems to have hung, even if I change the connection details, or try using mssql_connect, I still get the same error. The only thing that resolves it is restarting IIS. Using Win2K (sp4), IIS5, MS SQL 200 (sp2). PS: I have made sure I'm using the right version of ntwdblib.dll. It's also worth noting that my phpinfo() reports Library Version: 7.0 instead of the presumed 8.0. Not sure if this is connected to the SQL version though. I've toggled around and have these mssql settings in my php.ini [MSSQL] ; Allow or prevent persistent links. mssql.allow_persistent = On ; Maximum number of persistent links. -1 means no limit. mssql.max_persistent = 100 ; Maximum number of links (persistent+non persistent). -1 means no limit. mssql.max_links = 100 ; Minimum error severity to display. mssql.min_error_severity = 10 ; Minimum message severity to display. mssql.min_message_severity = 10 ; Compatability mode with old versions of PHP 3.0. mssql.compatability_mode = Off ; Connect timeout mssql.connect_timeout = 5 ; Query timeout mssql.timeout = 60 ; Valid range 0 - 2147483647. Default = 4096. mssql.textlimit = 4096 ; Valid range 0 - 2147483647. Default = 4096. mssql.textsize = 4096 ; Limits the number of records in each batch. 0 = all records in one batch. mssql.batchsize = 0 ; Specify how datetime and datetim4 columns are returned ; On = Returns data converted to SQL server settings ; Off = Returns values as -MM-DD hh:mm:ss ;DEV - used to be completely commented out mssql.datetimeconvert = Off ; Use NT authentication when connecting to the server mssql.secure_connection = Off ; Specify max number of processes. Default = 25 mssql.max_procs = 25 Any help will be much appreciated. -- Edit this bug report at http://bugs.php.net/?id=32854edit=1
#32682 [Opn-Fbk]: php5activescript doesn't work with php_mssql.dll
ID: 32682 Updated by: [EMAIL PROTECTED] Reported By: ondrej77 at centrum dot cz -Status: Open +Status: Feedback Bug Type: MSSQL related Operating System: Window XP PHP Version: 5.0.4 -Assigned To: +Assigned To: fmk New Comment: I'm getting the same error on PHP 5.1-dev, but only if I'm not using the extension. It looks like a problem on shutdown and I'll take a closer look. If you start using the extensin there is no errors/warnings and everything works fine. I've tested it wit this example: job id=test script language=PHPScript $WScript-Echo(Hello from . phpversion()); $con = mssql_connect('localhost', 'sa', ''); $rs = mssql_query(select * from test, $con); if ($rs) { while ($row = mssql_fetch_assoc($rs)) { $WScript-Echo($row['a']); } mssql_free_result($rs); } /script /job Previous Comments: [2005-04-12 14:52:16] ondrej77 at centrum dot cz Description: I've registered php5activescript.dll (located in directory c:\php), put php-activescript.ini in directory c:\windows\system32 (where is located wscript.exe) and switched on extensions that I want use. I dont't have problem with php_gd2.dll, php_mysql.dll, php_pdf.dll, php_zip.dll. But when I uncomment php_mssql.dll and run any script I recieve error message: Instruction on address 0x733276ac is pointing at address in memory 0x00ff21a8. It is not possible to make operation: read. Press the OK button to end the program. (I tried to translate it - it's written in czech language ... language of my Windows) Note, that I haven't changed any parameters in MSSQL section - there are default values from php-recomended.ini. I also use php in common way (as a SAPI modul on Apache) and I dont have any problems with mssql library. -- Edit this bug report at http://bugs.php.net/?id=32682edit=1
#32682 [Fbk-Csd]: php5activescript doesn't work with php_mssql.dll
ID: 32682 Updated by: [EMAIL PROTECTED] Reported By: ondrej77 at centrum dot cz -Status: Feedback +Status: Closed Bug Type: MSSQL related Operating System: Window XP PHP Version: 5.0.4 Assigned To: fmk New Comment: This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: [2005-04-12 19:24:56] [EMAIL PROTECTED] I'm getting the same error on PHP 5.1-dev, but only if I'm not using the extension. It looks like a problem on shutdown and I'll take a closer look. If you start using the extensin there is no errors/warnings and everything works fine. I've tested it wit this example: job id=test script language=PHPScript $WScript-Echo(Hello from . phpversion()); $con = mssql_connect('localhost', 'sa', ''); $rs = mssql_query(select * from test, $con); if ($rs) { while ($row = mssql_fetch_assoc($rs)) { $WScript-Echo($row['a']); } mssql_free_result($rs); } /script /job [2005-04-12 14:52:16] ondrej77 at centrum dot cz Description: I've registered php5activescript.dll (located in directory c:\php), put php-activescript.ini in directory c:\windows\system32 (where is located wscript.exe) and switched on extensions that I want use. I dont't have problem with php_gd2.dll, php_mysql.dll, php_pdf.dll, php_zip.dll. But when I uncomment php_mssql.dll and run any script I recieve error message: Instruction on address 0x733276ac is pointing at address in memory 0x00ff21a8. It is not possible to make operation: read. Press the OK button to end the program. (I tried to translate it - it's written in czech language ... language of my Windows) Note, that I haven't changed any parameters in MSSQL section - there are default values from php-recomended.ini. I also use php in common way (as a SAPI modul on Apache) and I dont have any problems with mssql library. -- Edit this bug report at http://bugs.php.net/?id=32682edit=1
#32582 [Opn-Bgs]: Stored procedure can not return a data typed varchar more than 255 bytes
ID: 32582 Updated by: [EMAIL PROTECTED] Reported By: liyong at nenu dot edu dot cn -Status: Open +Status: Bogus Bug Type: MSSQL related Operating System: Win2K PHP Version: 5.0.3 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php The dblib library from Microsoft used to generate the MSSQL extension on Windows has not been updated since SQL Server 6.5. It's not possible to to fix this problem with Microsofts library. Use text type to return values longer than 255 bytes. I have a test version of php_dblib.dll available on my home page (http://kromann.info/php.php). So far it's only available for php 5.1. It uses FreeTDS where the limmitations from the MS Library has been fixed. All functions names are still mssql_* so it's a very simple replacement Previous Comments: [2005-04-05 05:05:20] liyong at nenu dot edu dot cn sorry,it's 5.0.3,not 5.0.4 [2005-04-05 04:57:38] liyong at nenu dot edu dot cn this problem is also scripted at http://www.nb321.com/phppost4/php34086.htm [2005-04-05 04:52:21] liyong at nenu dot edu dot cn Description: I want return varchar(600) from stored procedure,but it is shortened to 255 bytes. Reproduce code: --- stored procedure: create procedure p_bug @msg varchar(600) output as set @msg='something more than 255 bytes ..' PHP statement: $stmt=mssql_init('p_bug'); mssql_bind($stmt,@msg,$msg,SQLVARCHAR,TRUE); $result=mssql_execute($stmt); echo $msg; Expected result: something more than 255 bytes .. Actual result: -- something shortened to 255 bytes -- Edit this bug report at http://bugs.php.net/?id=32582edit=1
#31428 [NoF]: Useless results from mssql_get_last_message()
ID: 31428 Updated by: [EMAIL PROTECTED] Reported By: klaus dot kuehne at gga-hannover dot de Status: No Feedback Bug Type: MSSQL related Operating System: Windows XP Server PHP Version: 4.3.10 New Comment: The function is called mssql_get_last_message() for a reason. It returns the last message from the server. In this case the server returns multiple messages and only the last is returned. The internal message handler is called once for each message issued by the server, this causes the printing of multiple lines. Omly the last message is stored. Previous Comments: [2005-03-24 13:00:19] shuleux at datix dot co dot uk We are getting the same results with the latest win32 CVS snapshot. When MS SQL returns an error message on more than one line, mssql_get_last_message() only returns the last line of the error message. For example, inserting a duplicate row into a table gives the following error message with display_errors turned on: Cannot insert duplicate key row in object 'INCIDENTS_REPORT' with unique index 'INC_INDX'. The statement has been terminated. mssql_get_last_message(), however, gives only the following error message: The statement has been terminated. The correct behaviour of mssql_get_last_message() should be to return the whole error message, not just the last line. Regards Sebastien Huleux [2005-02-02 01:00:04] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to Open. [2005-01-17 18:33:22] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip [2005-01-06 16:58:53] klaus dot kuehne at gga-hannover dot de Description: Hello, in many cases, mssql_get_last_message() delivers useless results, which are differing from the original SQL Server messages. An example: .. $ret = mssql_query(insert into TAB (KEY) values (13), $con); if (!$ret) { $errtxt = mssql_get_last_message(); die($errtxt); } .. if value 13 already exists in the unique indexed column KEY of TAB, $errtxt will be set to Die Anweisung wurde beendet (in german, translated to english like statement aborted). Instead of this, one could expect the message Cannot insert duplicate key row in object ... with unique index ... (Code = 2601). This occurs in many other cases, too. In other cases (e. g. SQL-access failed caused by missing user rights on the table), mssql_get_last_message() delivers an empty string, even if the return code of mssql_query() is FALSE. What ist the reason for mhis? Regards Klaus Kühne, GGA Institute Hannover, Germany -- Edit this bug report at http://bugs.php.net/?id=31428edit=1
#32351 [Opn-Fbk]: Problems with freetds and mssql
ID: 32351 Updated by: [EMAIL PROTECTED] Reported By: andre at softexpert dot com -Status: Open +Status: Feedback Bug Type: Compile Failure Operating System: Fedora Core 3 PHP Version: 4CVS-2005-03-17 (stable) New Comment: Just recompiled FreeTDS (0.64 dev from CSV) and the latest version of both PHP4 and PHP5 from CVS. I do not have that problem. What version of FreeTDS are you using? Previous Comments: [2005-03-17 13:39:47] andre at softexpert dot com Description: In file included from /usr/local/freetds/include/sybfront.h:23, from /usr/local/freetds/include/sqlfront.h:23, from /root/install/php4/ext/mssql/php_mssql.h:34, from main/internal_functions.c:39: /usr/local/freetds/include/sybdb.h:118: error: redefinition of typedef 'USHORT' /opt/firebird/include/ibase.h:101: error: previous declaration of 'USHORT' was here /usr/local/freetds/include/sybdb.h:165: error: redefinition of typedef 'BYTE' /opt/firebird/include/ibase.h:156: error: previous declaration of 'BYTE' was here make: ** [main/internal_functions.lo] Erro 1 ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mssql=/usr/local/freetds --with-zlib-dir=/usr/lib --with-interbase=/opt/firebird --with-gd --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-mhash=/usr/local/mhash --with-dom --enable-bcmath --enable-dba=shared --with-db4=/usr/include/db4 Freetds Version: the last stable -- Edit this bug report at http://bugs.php.net/?id=32351edit=1
#32253 [Opn-Fbk]: Accessing MSSQL server crashes Apache
ID: 32253 Updated by: [EMAIL PROTECTED] Reported By: piotr at clickthinking dot com -Status: Open +Status: Feedback Bug Type: MSSQL related Operating System: Windows 2003/2000/XP PHP Version: Irrelevant New Comment: It looks like you are using ODBC and not MSSQL functions. Can you reproduce the same error with native PHP calls (eliminating the ADODB class)? This would be by using odbc_* or mssql_* functions. Note the MSSQL library used for the MSSQL extension is not thread safe and might be causing this probem if you are using mssql_* functions. There is a new version of the mssql extension available. This is build using FreeTDS. You could try this version (mssql_* functions are 100% compatible). The dll is called php_dblib.dll, and it replaces php_mssql.dll. Previous Comments: [2005-03-09 14:41:08] piotr at clickthinking dot com Description: I have checked this with PHP 4.3.10, 5.02, 5.03, latest snapshot and 5.0 in combination with Apache 2.0.53 and 1.3.33 (I tried all combinations). While running under Windows 2000, 2003 and XP and trying to connect to a MSSQL server (on my local machine or a different server) using adodb 4.61 (http://adodb.sourceforge.net) the apache server crashes reporting php5ts.dll to be the problem (a runtime error dialog box occurs that when clicked restarts apache). It crashes Apache entirely and apache stops loading pages until it is reset. There are no error messages in the apache logs and one has to look in event viewer to see what caused the problem. This crash happens randomly, it normally takes 8-10 refreshes of a page for a crash to occur (sometimes as many as 20 refreshes). It doesn't matter what page it is as long as the page pulls information from a MSSQL database. The same page pulling from the exact same database using MySQL does not produce any errors and just keeps running. Reproduce code: --- require_once('adodb/adodb.inc.php'); global $conn; $conn = ADONewConnection('odbc_mssql'); $conn-SetFetchMode(ADODB_FETCH_BOTH); $dsn=driver={sql server}; server=localhost; database=arb_db;; $conn-pconnect($dsn, 'sa', 'ididit'); // Putting pconnect or connect makes no difference $sql = SELECT Desc FROM Tours ORDER BY TourRank; $rs = $conn-Execute($sql); Expected result: I expect it to pull Desc field from the Tours Table in the arb_db database. Actual result: -- Apache crashes in the way described. Apache crashes with a runtime error dialog and an error is logged under event viewer. This occurs on Windows 2003/2000/XP on with PHP 4.3.10, 5.02, 5.03, latest snapshot and 5.0 in combination with Apache 2.0.53 and 1.3.33 (I tried all combinations). MSSQL 2000 and 97 were tried and MySQL 4.1 and 4.0. MySQL worked fine, MSSQL connection crashsed server. -- Edit this bug report at http://bugs.php.net/?id=32253edit=1
#32110 [Opn-Bgs]: MSSQL connection crash when set mssql.textlimit and mssql.textsize
ID: 32110 Updated by: [EMAIL PROTECTED] Reported By: marcos at ivirtua dot com dot br -Status: Open +Status: Bogus Bug Type: Reproducible crash Operating System: Linux PHP Version: 4.3.10 New Comment: The MSSQL library used for this extension is not thread safe, and mght cause problems under any threaded web server. DBTEXTLIMIT is not supported by FreeTDS. I'll commit a patch for this. Previous Comments: [2005-02-25 15:24:32] marcos at ivirtua dot com dot br Sorry, the echo line must be: echo($row[0]); All the rest keep the same. [2005-02-25 15:21:07] marcos at ivirtua dot com dot br Description: I need to retrive more than 4k from a blob field (rtf text). I've set these values in my php.ini: mssql.textlimit = 2147483647; mssql.textsize = 2147483647; Everything works fine using CGI, but when using SAPI (dll) after some operations I can't connect to database anymore. A server restart is needed, and everything works fine again for some time, and crash again. I'm using Apache/1.3.33 (Win32) PHP/4.3.9, but it still happens in Apache 2.0 (Linux) PHP/4.3.10 Reproduce code: --- Use PHP ISAPI. ? ini_set(mssql.textlimit, 2147483647); ini_set(mssql.textsize, 2147483647); mssql_connect('db_host', 'db_user', 'db_pass'); mssql_select_db('db_name'); $qry= mssql_query('select myblobfield from table'); $row=mssql_fetch_row($qry); echo($row_aux[0]); ? Repeat for some times (10, 20, 30 times, etc). Expected result: The full content of blob field, wich has more then 100KB, every time I run the code. Actual result: -- The full content of blob field for just some times. After a period, the server must be restarted because I can't connect with: mssql_connect('db_host', 'db_user', 'db_pass'); mssql_select_db('db_name'); -- Edit this bug report at http://bugs.php.net/?id=32110edit=1