Test Failure Report for ext/pdo_odbc/tests/pdo_025.phpt ('ODBC PDO Common: PDO::FETCH_INTO')
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(id INT NOT NULL PRIMARY KEY, val VARCHAR(10), val2 VARCHAR(16))'); 7: 8: $data = array( 9: array('10', 'Abc', 'zxy'), 10: array('20', 'Def', 'wvu'), 11: array('30', 'Ghi', 'tsr'), 12: array('40', 'Jkl', 'qpo'), 13: array('50', 'Mno', 'nml'), 14: array('60', 'Pqr', 'kji'), 15: ); 16: 17: 18: // Insert using question mark placeholders 19: $stmt = $db->prepare("INSERT INTO test VALUES(?, ?, ?)"); 20: foreach ($data as $row) { 21: $stmt->execute($row); 22: } 23: 24: class Test { 25: public $id, $val, $val2; 26: } 27: 28: $stmt = $db->prepare('SELECT * FROM test'); 29: $stmt->setFetchMode(PDO::FETCH_INTO, new Test); 30: $stmt->execute(); 31: 32: foreach($stmt as $obj) { 33: var_dump($obj); 34: } 35: 36: echo "===FAIL===\n"; 37: 38: class Fail { 39: protected $id; 40: public $val, $val2; 41: } 42: 43: $stmt->setFetchMode(PDO::FETCH_INTO, new Fail); 44: $stmt->execute(); 45: 46: foreach($stmt as $obj) { 47: var_dump($obj); 48: } 49: 50: ?> 51:
Expected
object(Test)#%d (3) {
["id"]=>
string(2) "10"
["val"]=>
string(3) "Abc"
["val2"]=>
string(3) "zxy"
}
object(Test)#%d (3) {
["id"]=>
string(2) "20"
["val"]=>
string(3) "Def"
["val2"]=>
string(3) "wvu"
}
object(Test)#%d (3) {
["id"]=>
string(2) "30"
["val"]=>
string(3) "Ghi"
["val2"]=>
string(3) "tsr"
}
object(Test)#%d (3) {
["id"]=>
string(2) "40"
["val"]=>
string(3) "Jkl"
["val2"]=>
string(3) "qpo"
}
object(Test)#%d (3) {
["id"]=>
string(2) "50"
["val"]=>
string(3) "Mno"
["val2"]=>
string(3) "nml"
}
object(Test)#%d (3) {
["id"]=>
string(2) "60"
["val"]=>
string(3) "Pqr"
["val2"]=>
string(3) "kji"
}
===FAIL===
Fatal error: Cannot access protected property Fail::$id in %spdo_025.php on line %d%A
Output
Warning: PDOStatement::execute(): 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_5_3/ext/pdo_odbc/odbc_stmt.c:254) in /var/php_gcov/PHP_5_3/ext/pdo_odbc/tests/pdo_025.php on line 21
Warning: PDOStatement::execute(): 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_5_3/ext/pdo_odbc/odbc_stmt.c:254) in /var/php_gcov/PHP_5_3/ext/pdo_odbc/tests/pdo_025.php on line 21
Warning: PDOStatement::execute(): 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_5_3/ext/pdo_odbc/odbc_stmt.c:254) in /var/php_gcov/PHP_5_3/ext/pdo_odbc/tests/pdo_025.php on line 21
Warning: PDOStatement::execute(): 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_5_3/ext/pdo_odbc/odbc_stmt.c:254) in /var/php_gcov/PHP_5_3/ext/pdo_odbc/tests/pdo_025.php on line 21
Warning: PDOStatement::execute(): 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_5_3/ext/pdo_odbc/odbc_stmt.c:254) in /var/php_gcov/PHP_5_3/ext/pdo_odbc/tests/pdo_025.php on line 21
Warning: PDOStatement::execute(): 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_5_3/ext/pdo_odbc/odbc_stmt.c:254) in /var/php_gcov/PHP_5_3/ext/pdo_odbc/tests/pdo_025.php on line 21
===FAIL===
Diff
# original source file: ext/pdo/tests/pdo_025.phpt
001+ Warning: PDOStatement::execute(): 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_5_3/ext/pdo_odbc/odbc_stmt.c:254) in /var/php_gcov/PHP_5_3/ext/pdo_odbc/tests/pdo_025.php on line 21
002+
003+ Warning: PDOStatement::execute(): 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_5_3/ext/pdo_odbc/odbc_stmt.c:254) in /var/php_gcov/PHP_5_3/ext/pdo_odbc/tests/pdo_025.php on line 21
004+
005+ Warning: PDOStatement::execute(): 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_5_3/ext/pdo_odbc/odbc_stmt.c:254) in /var/php_gcov/PHP_5_3/ext/pdo_odbc/tests/pdo_025.php on line 21
006+
007+ Warning: PDOStatement::execute(): 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_5_3/ext/pdo_odbc/odbc_stmt.c:254) in /var/php_gcov/PHP_5_3/ext/pdo_odbc/tests/pdo_025.php on line 21
008+
009+ Warning: PDOStatement::execute(): 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_5_3/ext/pdo_odbc/odbc_stmt.c:254) in /var/php_gcov/PHP_5_3/ext/pdo_odbc/tests/pdo_025.php on line 21
010+
011+ Warning: PDOStatement::execute(): 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_5_3/ext/pdo_odbc/odbc_stmt.c:254) in /var/php_gcov/PHP_5_3/ext/pdo_odbc/tests/pdo_025.php on line 21
012+ ===FAIL===
001- object(Test)#%d (3) {
002- ["id"]=>
003- string(2) "10"
004- ["val"]=>
005- string(3) "Abc"
006- ["val2"]=>
007- string(3) "zxy"
008- }
009- object(Test)#%d (3) {
010- ["id"]=>
011- string(2) "20"
012- ["val"]=>
013- string(3) "Def"
014- ["val2"]=>
015- string(3) "wvu"
016- }
017- object(Test)#%d (3) {
018- ["id"]=>
019- string(2) "30"
020- ["val"]=>
021- string(3) "Ghi"
022- ["val2"]=>
023- string(3) "tsr"
024- }
025- object(Test)#%d (3) {
026- ["id"]=>
027- string(2) "40"
028- ["val"]=>
029- string(3) "Jkl"
030- ["val2"]=>
031- string(3) "qpo"
032- }
033- object(Test)#%d (3) {
034- ["id"]=>
035- string(2) "50"
036- ["val"]=>
037- string(3) "Mno"
038- ["val2"]=>
039- string(3) "nml"
040- }
041- object(Test)#%d (3) {
042- ["id"]=>
043- string(2) "60"
044- ["val"]=>
045- string(3) "Pqr"
046- ["val2"]=>
047- string(3) "kji"
048- }
049- ===FAIL===
050-
051- Fatal error: Cannot access protected property Fail::$id in %spdo_025.php on line %d%A
Generated at Sun, 19 May 2013 20:27:25 +0000 (3 days ago)
|