1--TEST-- 2Bug #81227 (PDO::inTransaction reports false when in transaction) 3--EXTENSIONS-- 4pdo_sqlite 5--FILE-- 6<?php 7$db = new PDO("sqlite::memory:"); 8var_dump($db->inTransaction()); 9 10$db->exec("BEGIN EXCLUSIVE TRANSACTION"); 11var_dump($db->inTransaction()); 12 13try { 14 $db->beginTransaction(); 15} catch (PDOException $e) { 16 echo $e->getMessage(), "\n"; 17} 18 19$db->commit(); 20var_dump($db->inTransaction()); 21 22$db->beginTransaction(); 23var_dump($db->inTransaction()); 24?> 25--EXPECT-- 26bool(false) 27bool(true) 28There is already an active transaction 29bool(false) 30bool(true) 31