Test Failure Report for ext/pdo_odbc/tests/bug_35671.phpt ('ODBC PDO Common: Bug #35671 (binding by name breakage)')
Script
1:
<?php 2: if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); 3: require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; 4: $db = PDOTest::factory(); 5: 6: $db->exec('CREATE TABLE test (field1 VARCHAR(32), field2 VARCHAR(32), field3 VARCHAR(32))'); 7: $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 8: 9: $insert = $db->prepare("insert into test (field1, field2, field3) values (:value1, :value2, :value3)"); 10: 11: $parm = array( 12: ":value1" => 15, 13: ":value2" => 20, 14: ":value3" => 25 15: ); 16: 17: $insert->execute($parm); 18: $insert = null; 19: 20: var_dump($db->query("SELECT * from test")->fetchAll(PDO::FETCH_ASSOC)); 21: 22: ?> 23:
Expected
array(1) {
[0]=>
array(3) {
["field1"]=>
string(2) "15"
["field2"]=>
string(2) "20"
["field3"]=>
string(2) "25"
}
}
Output
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 [MySQL][ODBC 5.1 Driver][mysqld-5.1.69]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' , )' at line 1 (SQLExecute[1064] at /var/php_gcov/PHP_HEAD/ext/pdo_odbc/odbc_stmt.c:254)' in /var/php_gcov/PHP_HEAD/ext/pdo_odbc/tests/bug_35671.php:17
Stack trace:
#0 /var/php_gcov/PHP_HEAD/ext/pdo_odbc/tests/bug_35671.php(17): PDOStatement->execute(Array)
#1 {main}
thrown in /var/php_gcov/PHP_HEAD/ext/pdo_odbc/tests/bug_35671.php on line 17
Diff
# original source file: ext/pdo/tests/bug_35671.phpt
001+ Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 [MySQL][ODBC 5.1 Driver][mysqld-5.1.69]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' , )' at line 1 (SQLExecute[1064] at /var/php_gcov/PHP_HEAD/ext/pdo_odbc/odbc_stmt.c:254)' in /var/php_gcov/PHP_HEAD/ext/pdo_odbc/tests/bug_35671.php:17
002+ Stack trace:
003+ #0 /var/php_gcov/PHP_HEAD/ext/pdo_odbc/tests/bug_35671.php(17): PDOStatement->execute(Array)
004+ #1 {main}
005+ thrown in /var/php_gcov/PHP_HEAD/ext/pdo_odbc/tests/bug_35671.php on line 17
001- array(1) {
002- [0]=>
003- array(3) {
004- ["field1"]=>
005- string(2) "15"
006- ["field2"]=>
007- string(2) "20"
008- ["field3"]=>
009- string(2) "25"
010- }
011- }
Generated at Fri, 17 May 2013 23:23:52 +0000 (7 days ago)
|