Test Failure Report for ext/pdo_odbc/tests/pdo_026.phpt ('ODBC PDO Common: extending PDO (2)')
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: 5: $data = array( 6: array('10', 'Abc', 'zxy'), 7: array('20', 'Def', 'wvu'), 8: array('30', 'Ghi', 'tsr'), 9: ); 10: 11: class PDOStatementX extends PDOStatement 12: { 13: public $dbh; 14: 15: protected function __construct($dbh) 16: { 17: $this->dbh = $dbh; 18: echo __METHOD__ . "()\n"; 19: } 20: 21: function __destruct() 22: { 23: echo __METHOD__ . "()\n"; 24: } 25: } 26: 27: class PDODatabase extends PDO 28: { 29: function __destruct() 30: { 31: echo __METHOD__ . "()\n"; 32: } 33: 34: function query($sql) 35: { 36: echo __METHOD__ . "()\n"; 37: $stmt = $this->prepare($sql, array(PDO::ATTR_STATEMENT_CLASS=>array('PDOStatementx', array($this)))); 38: $stmt->setFetchMode(PDO::FETCH_ASSOC); 39: $stmt->execute(); 40: return $stmt; 41: } 42: } 43: 44: $db = PDOTest::factory('PDODatabase'); 45: var_dump(get_class($db)); 46: 47: $db->exec('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val VARCHAR(10), val2 VARCHAR(16))'); 48: 49: $stmt = $db->prepare("INSERT INTO test VALUES(?, ?, ?)"); 50: var_dump(get_class($stmt)); 51: foreach ($data as $row) { 52: $stmt->execute($row); 53: } 54: 55: unset($stmt); 56: 57: $stmt = $db->query('SELECT * FROM test'); 58: var_dump(get_class($stmt)); 59: var_dump(get_class($stmt->dbh)); 60: 61: foreach($stmt as $obj) { 62: var_dump($obj); 63: } 64: 65: echo "===DONE===\n"; 66: ?> 67:
Expected
string(11) "PDODatabase"
string(12) "PDOStatement"
PDODatabase::query()
PDOStatementX::__construct()
string(13) "PDOStatementX"
string(11) "PDODatabase"
array(3) {
["id"]=>
string(2) "10"
["val"]=>
string(3) "Abc"
["val2"]=>
string(3) "zxy"
}
array(3) {
["id"]=>
string(2) "20"
["val"]=>
string(3) "Def"
["val2"]=>
string(3) "wvu"
}
array(3) {
["id"]=>
string(2) "30"
["val"]=>
string(3) "Ghi"
["val2"]=>
string(3) "tsr"
}
===DONE===
PDOStatementX::__destruct()
PDODatabase::__destruct()
Output
string(11) "PDODatabase"
string(12) "PDOStatement"
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_5/ext/pdo_odbc/odbc_stmt.c:254) in /var/php_gcov/PHP_5_5/ext/pdo_odbc/tests/pdo_026.php on line 52
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_5/ext/pdo_odbc/odbc_stmt.c:254) in /var/php_gcov/PHP_5_5/ext/pdo_odbc/tests/pdo_026.php on line 52
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_5/ext/pdo_odbc/odbc_stmt.c:254) in /var/php_gcov/PHP_5_5/ext/pdo_odbc/tests/pdo_026.php on line 52
PDODatabase::query()
PDOStatementX::__construct()
string(13) "PDOStatementX"
string(11) "PDODatabase"
===DONE===
PDOStatementX::__destruct()
PDODatabase::__destruct()
Diff
# original source file: ext/pdo/tests/pdo_026.phpt
003+
004+ 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_5/ext/pdo_odbc/odbc_stmt.c:254) in /var/php_gcov/PHP_5_5/ext/pdo_odbc/tests/pdo_026.php on line 52
005+
006+ 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_5/ext/pdo_odbc/odbc_stmt.c:254) in /var/php_gcov/PHP_5_5/ext/pdo_odbc/tests/pdo_026.php on line 52
007+
008+ 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_5/ext/pdo_odbc/odbc_stmt.c:254) in /var/php_gcov/PHP_5_5/ext/pdo_odbc/tests/pdo_026.php on line 52
007- array(3) {
008- ["id"]=>
009- string(2) "10"
013+ ===DONE===
014+ PDOStatementX::__destruct()
015+ PDODatabase::__destruct()
010- ["val"]=>
011- string(3) "Abc"
012- ["val2"]=>
013- string(3) "zxy"
014- }
015- array(3) {
016- ["id"]=>
017- string(2) "20"
018- ["val"]=>
019- string(3) "Def"
020- ["val2"]=>
021- string(3) "wvu"
022- }
023- array(3) {
024- ["id"]=>
025- string(2) "30"
026- ["val"]=>
027- string(3) "Ghi"
028- ["val2"]=>
029- string(3) "tsr"
030- }
031- ===DONE===
032- PDOStatementX::__destruct()
033- PDODatabase::__destruct()
Generated at Wed, 15 May 2013 22:03:26 +0000 (7 days ago)
|