Annotation of embedaddon/php/ext/pdo_firebird/tests/ddl.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: PDO_Firebird: DDL/transactions
3: --SKIPIF--
4: <?php include("skipif.inc"); ?>
5: --FILE--
6: <?php /* $Id: ddl.phpt 275414 2009-02-09 12:56:00Z felipe $ */
7:
8: require("testdb.inc");
9:
10: $db = new PDO("firebird:dbname=$test_base",$user,$password) or die;
11: $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
12:
13: $db->exec("CREATE TABLE ddl (id INT NOT NULL PRIMARY KEY, text BLOB SUB_TYPE 1)");
14: $db->exec("CREATE GENERATOR gen_ddl_id");
15: $db->exec("CREATE TRIGGER ddl_bi FOR ddl BEFORE INSERT AS
16: BEGIN IF (NEW.id IS NULL) THEN NEW.id=GEN_ID(gen_ddl_id,1); END");
17:
18: $db->setAttribute(PDO::ATTR_AUTOCOMMIT,0);
19:
20: $db->beginTransaction();
21: var_dump($db->exec("INSERT INTO ddl (text) VALUES ('bla')"));
22: var_dump($db->exec("UPDATE ddl SET text='blabla'"));
23: $db->rollback();
24:
25: $db->beginTransaction();
26: var_dump($db->exec("DELETE FROM ddl"));
27: $db->commit();
28:
29: unset($db);
30: echo "done\n";
31:
32: ?>
33: --EXPECT--
34: int(1)
35: int(1)
36: int(0)
37: done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>