Annotation of embedaddon/php/ext/pdo_mysql/tests/bug_33689.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: PDO MySQL Bug #33689 (query() execute() and fetch() return false on valid select queries)
! 3: --SKIPIF--
! 4: <?php
! 5: if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
! 6: require dirname(__FILE__) . '/config.inc';
! 7: require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
! 8: PDOTest::skip();
! 9: ?>
! 10: --FILE--
! 11: <?php
! 12: require dirname(__FILE__) . '/config.inc';
! 13: require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
! 14: $db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
! 15:
! 16: $db->exec('CREATE TABLE test (bar INT NOT NULL)');
! 17: $db->exec('INSERT INTO test VALUES(1)');
! 18:
! 19: var_dump($db->query('SELECT * from test'));
! 20: foreach ($db->query('SELECT * from test') as $row) {
! 21: print_r($row);
! 22: }
! 23:
! 24: $stmt = $db->prepare('SELECT * from test');
! 25: print_r($stmt->getColumnMeta(0));
! 26: $stmt->execute();
! 27: $tmp = $stmt->getColumnMeta(0);
! 28:
! 29: // libmysql and mysqlnd will show the pdo_type entry at a different position in the hash
! 30: if (!isset($tmp['pdo_type']) || (isset($tmp['pdo_type']) && $tmp['pdo_type'] != 2))
! 31: printf("Expecting pdo_type = 2 got %s\n", $tmp['pdo_type']);
! 32: else
! 33: unset($tmp['pdo_type']);
! 34:
! 35: print_r($tmp);
! 36: ?>
! 37: --CLEAN--
! 38: <?php
! 39: require dirname(__FILE__) . '/mysql_pdo_test.inc';
! 40: MySQLPDOTest::dropTestTable();
! 41: ?>
! 42: --EXPECTF--
! 43: object(PDOStatement)#%d (1) {
! 44: [%u|b%"queryString"]=>
! 45: %unicode|string%(18) "SELECT * from test"
! 46: }
! 47: Array
! 48: (
! 49: [bar] => 1
! 50: [0] => 1
! 51: )
! 52: Array
! 53: (
! 54: [native_type] => LONG
! 55: [flags] => Array
! 56: (
! 57: [0] => not_null
! 58: )
! 59:
! 60: [table] => test
! 61: [name] => bar
! 62: [len] => 11
! 63: [precision] => 0
! 64: )
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>