php-src/ext/pdo_sqlite/tests/pdo_sqlite_statement_getattribute.phpt
BohwaZ 6f9ebe677b Add \PDO::SQLITE_ATTR_READONLY_STATEMENT
This attribute is a boolean value. It is taken from the return value of
sqlite3_stmt_readonly(), indicating if and only if the prepared statement makes
no direct changes to the content of the database.
2018-08-01 17:45:20 -04:00

20 lines
No EOL
447 B
PHP

--TEST--
PDO_sqlite: Testing PDOStatement::getAttribute()
--SKIPIF--
<?php if (!extension_loaded('pdo_sqlite')) print 'skip not loaded'; ?>
--FILE--
<?php
$db = new PDO('sqlite::memory:');
$st = $db->prepare('SELECT 1;');
var_dump($st->getAttribute(PDO::SQLITE_ATTR_READONLY_STATEMENT));
$st = $db->prepare('CREATE TABLE test (a TEXT);');
var_dump($st->getAttribute(PDO::SQLITE_ATTR_READONLY_STATEMENT));
?>
--EXPECTF--
bool(true)
bool(false)