mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
* Deprecate warnings in SQLite3, change returned exception class to SQLite3Exception RFC: https://wiki.php.net/rfc/sqlite3_exceptions Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>
27 lines
593 B
PHP
27 lines
593 B
PHP
--TEST--
|
|
SQLite3 authorizer crashes on NULL values
|
|
--EXTENSIONS--
|
|
sqlite3
|
|
--INI--
|
|
open_basedir=.
|
|
--FILE--
|
|
<?php
|
|
$db = new SQLite3(":memory:");
|
|
$db->enableExceptions(true);
|
|
|
|
$db->exec('attach database \':memory:\' AS "db1"');
|
|
var_dump($db->exec('create table db1.r (id int)'));
|
|
|
|
try {
|
|
$st = $db->prepare('attach database :a AS "db2"');
|
|
$st->bindValue("a", ":memory:");
|
|
$st->execute();
|
|
var_dump($db->exec('create table db2.r (id int)'));
|
|
} catch (SQLite3Exception $ex) {
|
|
echo $ex->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
bool(true)
|
|
Unable to prepare statement: not authorized
|