|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2012-10-08 19:42 UTC] cbeck at good-sam dot com
Description:
------------
If an SQL select is issued with more data in the where clause than the size of the
field and the first part of the string matches it will return the record(s)
anyway.
This was confirmed by Zend Support and suggested I log a bug here: ref #00041272
ib_db2 module version = 1.9.0
Test script:
---------------
$i5 = db2_connect(null,null,null);
@db2_exec($i5, 'CREATE SCHEMA DB2TEST');
@db2_exec($i5,'CREATE TABLE DB2TEST.DB2TEST (FIELD1 CHAR (10 ) NOT NULL WITH DEFAULT)');
db2_exec($i5,"INSERT INTO DB2TEST.DB2TEST (FIELD1) VALUES('TESTVALUEX')");
$stmt = db2_prepare($i5, 'select * from DB2TEST.DB2TEST where FIELD1 = ?');
db2_execute($stmt, array('TESTVALUEX1234567890'));
var_dump(db2_fetch_assoc($stmt));
db2_exec($i5,"DELETE FROM DB2TEST.DB2TEST");
Expected result:
----------------
I would expect the dump to show no records
Actual result:
--------------
One record is shown in the dump.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 08:00:01 2025 UTC |
V7.1 results do not show issue using ibm_db2 1.9.6 bash-4.2$ php zz63243.php value is ... NULL ... end zz63243.php: require "connection.inc"; $i5 = db2_connect($db,$uid,$pwd); @db2_exec($i5,'CREATE TABLE DB2TEST (FIELD1 CHAR (10 ) NOT NULL WITH DEFAULT)'); db2_exec($i5,"INSERT INTO DB2TEST (FIELD1) VALUES('TESTVALUEX')"); $stmt = db2_prepare($i5, 'select * from DB2TEST where FIELD1 = ?'); db2_execute($stmt, array('TESTVALUEX1234567890')); echo "value is ...\n"; var_dump(db2_fetch_assoc($stmt)); echo "... end\n"; db2_exec($i5,"DELETE FROM DB2TEST"); echo "\n";