#35155 [Csd]: prepared statement with blob field does not work

From: Date: Tue, 22 Nov 2005 06:04:57 +0000
Subject: #35155 [Csd]: prepared statement with blob field does not work
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-88659@lists.php.net to get a copy of this message
ID: 35155 User updated by: f dot engelhardt at 21torr dot com Reported By: f dot engelhardt at 21torr dot com Status: Closed Bug Type: MySQLi related Operating System: Linux 2.6 PHP Version: 5CVS-2005-11-09 (snap) Assigned To: andrey New Comment: Thanks a lot, i tried it now again with the latest cvs and it is working. I hope 5.1 will be stable soon. Kind Regards Florian Engelhardt Previous Comments: ------------------------------------------------------------------------ [2005-11-21 22:11:09] andrey@php.net Well not bogus. This is fixed in the upcoming 5.1.0 . AFAIK there will be no release in the 5.0 branch after 5.0.5 where the problem exists. ------------------------------------------------------------------------ [2005-11-21 22:06:05] andrey@php.net Z_STRLEN_PP() macro does not use the strlen() function. It's a macro to access the real length from the zval** (PP). So, from what I see it should work correctly. PHP reads the file and is \0 aware so the length in the zval that represents the string should be ok. I have done a test and for me it seems to work ok. See the md5() hash of what's in the column. Just mysql cmdline client does not show the whole string but stops at the \0. Try with the function LENGTH() and it will work (shows 8 for me). mysql> create table blob_test (a mediumblob); Query OK, 0 rows affected (0.19 sec) ----------------------------------------------------- php -r ' $c=new mysqli("127.0.0.1", "root",""); var_dump($c); $s=$c->prepare("INSERT INTO test.blob_test VALUES(?)"); $v="aaaa\0bbb"; $s->bind_param("s",$v); var_dump($s->execute(), $s->execute());' ------------------------------------------------------- mysql> select md5("aaaa"), md5("aaaa\0bbb"), md5(a), a from blob_test\G *************************** 1. row *************************** md5("aaaa"): 74b87337454200d4d33f80c4663dc5e5 md5("aaaa\0bbb"): f04bbe8400c631e6bab90d30900ccc69 md5(a): f04bbe8400c631e6bab90d30900ccc69 a: aaaa *************************** 2. row *************************** md5("aaaa"): 74b87337454200d4d33f80c4663dc5e5 md5("aaaa\0bbb"): f04bbe8400c631e6bab90d30900ccc69 md5(a): f04bbe8400c631e6bab90d30900ccc69 a: aaaa 2 rows in set (0.00 sec) ------------------------------------------------------------------------ [2005-11-17 08:33:56] f dot engelhardt at 21torr dot com Is there someone working on the bug, i havent heard anything for a couple of days now. ------------------------------------------------------------------------ [2005-11-14 12:07:04] f dot engelhardt at 21torr dot com Note: with the PDO it is working as expectet, but we can not use software that is still in a beta stadium. ------------------------------------------------------------------------ [2005-11-12 01:22:11] sniper@php.net Georg, see the feedback. ------------------------------------------------------------------------ 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/35155 -- Edit this bug report at http://bugs.php.net/?id=35155&edit=1

« previous php.bugs (#88659) next »