gh9032.phpt 590 B

1234567891011121314151617181920212223242526
  1. --TEST--
  2. SQLite3 authorizer crashes on NULL values
  3. --EXTENSIONS--
  4. sqlite3
  5. --INI--
  6. open_basedir=.
  7. --FILE--
  8. <?php
  9. $db = new SQLite3(":memory:");
  10. $db->enableExceptions(true);
  11. $db->exec('attach database \':memory:\' AS "db1"');
  12. var_dump($db->exec('create table db1.r (id int)'));
  13. try {
  14. $st = $db->prepare('attach database :a AS "db2"');
  15. $st->bindValue("a", ":memory:");
  16. $st->execute();
  17. var_dump($db->exec('create table db2.r (id int)'));
  18. } catch (Exception $ex) {
  19. echo $ex->getMessage(), PHP_EOL;
  20. }
  21. ?>
  22. --EXPECT--
  23. bool(true)
  24. Unable to prepare statement: 23, not authorized