- Fix test

This commit is contained in:
Felipe Pena 2009-02-09 12:55:46 +00:00
parent d4baef3d92
commit b2e1e98f08

View File

@ -8,14 +8,14 @@ PDO_Firebird: DDL/transactions
require("testdb.inc"); require("testdb.inc");
$db = new PDO("firebird:dbname=$test_base",$user,$password) or die; $db = new PDO("firebird:dbname=$test_base",$user,$password) or die;
$db->setAttribute(PDO_ATTR_ERRMODE, PDO_ERRMODE_WARNING); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
$db->exec("CREATE TABLE ddl (id INT NOT NULL PRIMARY KEY, text BLOB SUB_TYPE 1)"); $db->exec("CREATE TABLE ddl (id INT NOT NULL PRIMARY KEY, text BLOB SUB_TYPE 1)");
$db->exec("CREATE GENERATOR gen_ddl_id"); $db->exec("CREATE GENERATOR gen_ddl_id");
$db->exec("CREATE TRIGGER ddl_bi FOR ddl BEFORE INSERT AS $db->exec("CREATE TRIGGER ddl_bi FOR ddl BEFORE INSERT AS
BEGIN IF (NEW.id IS NULL) THEN NEW.id=GEN_ID(gen_ddl_id,1); END"); BEGIN IF (NEW.id IS NULL) THEN NEW.id=GEN_ID(gen_ddl_id,1); END");
$db->setAttribute(PDO_ATTR_AUTOCOMMIT,0); $db->setAttribute(PDO::ATTR_AUTOCOMMIT,0);
$db->beginTransaction(); $db->beginTransaction();
var_dump($db->exec("INSERT INTO ddl (text) VALUES ('bla')")); var_dump($db->exec("INSERT INTO ddl (text) VALUES ('bla')"));