PageRenderTime 41ms CodeModel.GetById 13ms RepoModel.GetById 1ms app.codeStats 0ms

/hphp/test/zend/bad/ext/pdo_mysql/tests/bug_33689.php

http://github.com/facebook/hiphop-php
PHP | 30 lines | 24 code | 5 blank | 1 comment | 4 complexity | dc013192dfad4747014107645302ec6b MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
  1. <?php
  2. require dirname(__FILE__) . '/config.inc';
  3. require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
  4. $db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
  5. $db->exec('CREATE TABLE test (bar INT NOT NULL)');
  6. $db->exec('INSERT INTO test VALUES(1)');
  7. var_dump($db->query('SELECT * from test'));
  8. foreach ($db->query('SELECT * from test') as $row) {
  9. print_r($row);
  10. }
  11. $stmt = $db->prepare('SELECT * from test');
  12. print_r($stmt->getColumnMeta(0));
  13. $stmt->execute();
  14. $tmp = $stmt->getColumnMeta(0);
  15. // libmysql and mysqlnd will show the pdo_type entry at a different position in the hash
  16. if (!isset($tmp['pdo_type']) || (isset($tmp['pdo_type']) && $tmp['pdo_type'] != 2))
  17. printf("Expecting pdo_type = 2 got %s\n", $tmp['pdo_type']);
  18. else
  19. unset($tmp['pdo_type']);
  20. print_r($tmp);
  21. ?>
  22. <?php
  23. require dirname(__FILE__) . '/mysql_pdo_test.inc';
  24. MySQLPDOTest::dropTestTable();
  25. ?>