#29383 [Com]: A SELECT statement returns instead of an empty value, a value containing space
ID: 29383 Comment by: dcrignon at adequasys dot com Reported By: gunther at ultraconsulting dot com Status: Open Bug Type: MSSQL related Operating System: Windows 2000 PHP Version: 4.3.7, 5.0.0 New Comment: I exaclty have the same problem! In our intranet Php Solution, we can't upgrade from php 4.3.3 if we use mssql database. With Oracle or MySql, no problem, we can go to 4.3.9 or 5.0. Now, a new element. On a customer installation, we need Apache 2.0.52 with SSL and in that case, PHP 4.3.3 is really unstable... So we need to go to 4.3.8 or 4.3.9 but we can't, because of MSSQL bug with this space returned instead of empty string !!! Please PHP Team, any solution ??? Thanks, David Previous Comments: [2004-09-30 12:52:06] andreyra at chtivo dot ru I have the same experience on version 4.3.8 - 4.3.9. Thank for advice to use dll from version 4.3.2. It really solves a problem :). [2004-09-22 02:35:53] gunther at ultraconsulting dot com It seems this problem is a long term problem as it was first reported a year ago. Not quite sure why the developers are tagging these reports as 'Bogus'. Everybody using PHP 4.3.3 and higher and MSSQL is affected. The problem is definetely in the php_mssql.dll as the version 4.3.2 dll is working fine, even with PHP 4.3.8. There is no way to upgrade to PHP 5.0.x as the functioning dll doesn't work with 5.0. Any clues if and when this bug will be fixed? Or at least a workaround for this bug without changing thousands of lines of code withing the application. [2004-07-26 14:25:18] gunther at ultraconsulting dot com This is the same as Bug #29292 .. didn't find that one before ... [2004-07-26 04:49:49] gunther at ultraconsulting dot com php_mssql.dll up to PHP 4.3.3 is working fine, problem first started with PHP 4.3.4 [2004-07-26 03:46:00] gunther at ultraconsulting dot com Description: A SELECT statement returns instead of an empty value for a varchar field, a value containing a single space. Therefore using the empty() directive will not work anymore. Problem only happens with php_mssql.dll from year 2004 for PHP version 4.3.7 and 5.0.0. Using a previous dll from 3/13/03 (4.3.2-RC1) for instance solves the problem ... but might cause others. Reproduce code: --- DB: "'.$db_name.'" connected'); } else { print ("DB NOK "); exit; } $query = 'SELECT * FROM mydb WHERE id = 1'; $result = mssql_query($query, $dbh); { if ($row = mssql_fetch_array($result, MSSQL_ASSOC)) { print_r($row); print("\n(" . $row['id'] . ')'); } } ?> Expected result: ... () Actual result: -- ... ( ) -- Edit this bug report at http://bugs.php.net/?id=29383&edit=1
#29292 [Com]: Single space character returned instead of empty string
ID: 29292 Comment by: dcrignon at adequasys dot com Reported By: jmelville at selectaustralasia dot com dot au Status: Open Bug Type: MSSQL related Operating System: Windows 2000 Server SP4 PHP Version: 4.3.8 New Comment: I confirm this problem, under Windows 2003 Server, with Apache 2 or 1.3 and PHP 4.3.8 or 5.0. The only way is to go back to PHP 4.3.3 ... Not the good solution for me. Do you know if someone is working on this bug to fix it? We can adapt our product and trim() any variable to recover good values, but is it the good solution?.. Thank you for your help! David Previous Comments: [2004-08-30 17:41:45] vikinoha at yahoo dot com PHP 4.3.8 I am experiencing the same problem with non-empty string returned by a query that should return an empty string. I have tried to replace the php_mssql.dll file in version 4.3.8 with the one from 4.3.3, but the problem remains with no change whatsoever:( If there is someone familiar with PHP sources, does the php_mssql.c 1.138 revision changes deal with this bug, or it is something completely unrelated? And also, if the 'illia_0' change (pointed out by richard dot quadling at bandvulc dot co dot uk) effectively removes this bug (does it?), why is it then if'd out? Thanks, Viktor [2004-08-13 12:22:27] richard dot quadling at bandvulc dot co dot uk Hi. If the column contains NULL (using Enterprise Manager to enter CTRL+0), then the output is correct. But having to convert all '' to NULLs is not right. Richard. [2004-08-13 09:48:32] richard dot quadling at bandvulc dot co dot uk Hi. Following script ... Length of user_icq = ' . strlen($row['user_icq']) . ''; } mssql_free_result($rResults); mssql_close($rConn); ?> produces output of ... array ( 'user_icq' => ' ', 'user_icq_len' => 0, ) Length of user_icq = 1 array ( 'user_icq' => '1711757', 'user_icq_len' => 7, ) Length of user_icq = 7 array ( 'user_icq' => ' ', 'user_icq_len' => 0, ) Length of user_icq = 1 Which is clearly wrong! The length being returned by SQL is 0, the data being returned by PHP is ' '. The data via enterprise manager is ''. I'm using Sambar Server V6.1 Beta 3, PHP V5.0.0 (about to upgrade to V5.0.1). MS SQL 2000 SP3 Developer Edition all on a Windows XP Pro. But none of this seems to be making any difference. According to all the comments made, this was broken a LONG time ago. It seems that a small patch HAS been applied to the source (php_mssql.c line 793-797), but is under a compiler directive of ilia_0. (Is this Ilia Alshanetsky? If so, great article in PHP|Architect about contexts!!!). The code is in the php_mssql_get_column_content_with_type() function. ... case SQLTEXT: { int length; char *data = charcol(offset); length=dbdatlen(mssql_ptr->link,offset); #if ilia_0 while (length>0 && data[length-1] == ' ') { /* nuke trailing whitespace */ length--; } #endif ZVAL_STRINGL(result, data, length, 1); break; } ... The macro ZVAL_STRINGL is ... #define ZVAL_STRINGL(z, s, l, duplicate) { \ char *__s=(s); int __l=l; \ (z)->value.str.len = __l; \ (z)->value.str.val = (duplicate?estrndup(__s, __l):__s);\ (z)->type = IS_STRING; \ } If someone can recompile the code, can they do so WITHOUT the directive first but put in some debugs (forget thread safeness, only testing) and show what the value of length in the assignment from dbdatlen(mssql_ptr->link,offset) and what happens if the macro is called with a 0 rather than a 1. [2004-08-10 18:22:55] chris at fjmercedes dot com I'm experiencing the same problem with the latest CVS of PHP5 and no php_mssql.dll extensions from older versions are compatable with PHP5. [2004-08-10 16:38:51] jeremyirons at genevus dot com I've been having the same problem with 4.3.8. I swapped php_mssql.dll with versions from 4.3.7, 4.3.6, 4.3.5, 4.3.4, and 4.3.3. The space problem went away at 4.3.3 only. 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/29292 -- Edit this bug report at http://bugs.php.net/?id=29292&edit=1
#25617 [Com]: segmentation_fault with gdFreeFontCache with t1lib/freetype 1+2
ID: 25617 Comment by: dcrignon at adequasys dot com Reported By: volker dot augustin at multiartstudio dot com Status: Bogus Bug Type: GD related Operating System: Linux PHP Version: 4.3.3 New Comment: I have the same problem on PHP 4.3.3 Win 32 ISAPI mode undrer IIS5 and it's a new an strange problem ... We didn't have it under 4.3.1 and neither under 4.3.3 on several customer plateforms ! We also have it on a customer plateform with Apache It seems to be dependant of the Service Pack level or Hotfixes level ... Sometimes we have broken images, some times error messages from ImageTTFText and sometimes "PHP has encountered an Access Violation at " errors. Can you help us please ? It's a very critical situation for us ! David Previous Comments: [2003-09-21 00:52:45] [EMAIL PROTECTED] We do not support using the external GD library. Use the bundled GD library which has many fixes and improvements in it. [2003-09-20 21:49:08] volker dot augustin at multiartstudio dot com Description: php 4.3.3 gives segmentation fault using the t1lib together with gdlib 2 and freetype 1+2 tried to combine different versions, and find out that this error comes from gdFreeFontCache() in gd.c at /usr/src/php/ext/gd i wrote down everything i know and find out and put it on a website , its to much to post here here it is: http://www.erdtrabant.de/index.php?i=77000 also i find how to fix it temporarily... sorry for my bad english. Reproduce code: --- ImageTTFBBox() ImageTTFText() Actual result: -- please have a look at: http://www.erdtrabant.de/index.php?i=77000 i will put everything here... -- Edit this bug report at http://bugs.php.net/?id=25617&edit=1
#21189 [Com]: TTF output function frose Apache
ID: 21189 Comment by: dcrignon at adequasys dot com Reported By: pvy at novosoft dot ru Status: No Feedback Bug Type: GD related Operating System: windows 2000/sp3 PHP Version: 4.3.0RC4 New Comment: I have the same kinf of problem under IIS5, W2K SP4, PHP 4.3.3 After multiple display, I've got this error on all GD images: imagettfbbox(): Could not set character size The first problem is that I usally have broken GD images. But if I do a right-click + Show image, it comes back. And I don't know the reason of this problem... Thanks for your help We are also having problem under Apache/PHP4.3.3 under W2K... So, is GD2 really stable ? Thanks, David Here is my script : = 2) { // size, angle, font file, text $tab = imagettfbbox($taille_txt,0,$fontfile,$string); $largeur_txt = $tab[2]; } $lg = $largeur_txt + 26; $ht = 17; $lg_dst_milieu = $largeur_txt + 2; $x_dst_d = $lg_dst_milieu + $lg_matrice_cote - 1; $x_src_d = $lg_matrice_cote + $lg_matrice_centre; $im_dst = imagecreate($lg,$ht); $im_src = imagecreatefrompng($matrice); imagecopyresized($im_dst, $im_src, 0, 0, 0, 0, $lg_matrice_cote, $ht, $lg_matrice_cote, $ht); imagecopyresized($im_dst, $im_src, $lg_matrice_cote, 0, $lg_matrice_cote, 0, $lg_dst_milieu, $ht, $lg_matrice_centre, $ht); imagecopyresized($im_dst, $im_src, $x_dst_d, 0, $x_src_d, 0, $lg_matrice_cote, $ht, $lg_matrice_cote, $ht); $red = hexdec(substr($couleur_text,0,2)); $green = hexdec(substr($couleur_text,2,2)); $blue = hexdec(substr($couleur_text,4,2)); $couleur = ImageColorAllocate($im_dst, $red, $green, $blue); if ($style == "l") { $px = $lg_matrice_cote + 3; } else { $px = $lg_matrice_cote - 6; } if ($style == "b") { $py = $taille_txt + 4; } else { $py = $taille_txt + 3; } imagettftext($im_dst,$taille_txt,0,$px,$py,$couleur,$fontfile,$string); Imagepng($im_dst,'',100); ImageDestroy($im_dst); ?> Previous Comments: [2003-01-27 22:29:49] [EMAIL PROTECTED] No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you. [2003-01-13 19:26:09] [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 [2002-12-27 11:36:44] renaud dot boyer at helio-service dot fr I have problems too, the same OS (Win2k sp3) with php_gd.dll and php_gd2.dll and php 4.2.3 & php 4.3.0RC4 php installed as an Apache 1.3.24 module I use the gd only to produce small png, and i get error using imagettfbbox with this script: - the results : - php 4.2.3 with php_gd.dll 99% CPU used and a lot of ram, forced to stop apache service nothing appears in the php error log. - php 4.2.3 with php_gd2.dll "Unable to find font" warning, with a relative link to the font or with an absolute link. no image is drawn. - php 4.3.0RC4 with php_gd.dll 99% CPU used and a lot of ram, forced to stop apache service nothing appears in the php error log. - php 4.3.0RC4 with php_gd2.dll "Could not set character size" warning... Don't know why... And the strange thing is that sometimes the image is drawn, and sometimes not. the script worked before on php 4.2.1, gd2, apache 1.3.?. [2002-12-26 17:20:50] [EMAIL PROTECTED] Small note, TTF library is not thread safe, meaning that in Win32 enviroment it may not operate well. [2002-12-26 04:55:12] pvy at novosoft dot ru Hello! I made crash tests using WebRoller software. I set to 10 requests my PHP code from 50 virtual clients simultaneously, and run 40 iterations. I test php with php_gd.dll and php_gd2.dll. in second case apache generates error on windows console (GPF) I use next code: after crash test my system was frosen,apache haves 99% CPU and a lot of memory. As next, I comment string with ImageTTFText function and test it again. Apache lives! Below I will provide output from WebRollers test results: Results from WebRoller with TTF function: --- Start statistics --- --- Basic statistics --- Min:50.00 20.00 30.00 50.00 70.00 60.00 30.00 30.00 Avg:514.82 602.53 785.38 827.82 378.96 238.82 200.40 199.07 Max:3270.00 4990.00 6350.00 7550.00 3410.00 2680.00 510.00 560.00 --- Network traffic details --- Tot