From 9294074c0966ef8dac3b3bac8dbfb3517ebae675 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 22 Dec 2020 10:03:57 +0100 Subject: [PATCH] PDO Firebird: Use recreate table Firebird does not have "if exists", and the switch to exception error mode broke the suppressed exec calls. Firebird does have a "recreate table" command that effective perform a "drop table if exists" beforehand. --- ext/pdo_firebird/tests/bug_72583.phpt | 3 +-- ext/pdo_firebird/tests/bug_72931.phpt | 3 +-- ext/pdo_firebird/tests/bug_73087.phpt | 3 +-- ext/pdo_firebird/tests/bug_74462.phpt | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/ext/pdo_firebird/tests/bug_72583.phpt b/ext/pdo_firebird/tests/bug_72583.phpt index 87bc481fdcf..9df4c3e9158 100644 --- a/ext/pdo_firebird/tests/bug_72583.phpt +++ b/ext/pdo_firebird/tests/bug_72583.phpt @@ -6,8 +6,7 @@ PDO_Firebird: Feature 72583 Fetch integers as php integers not as strings exec('drop table atable'); -$dbh->exec('create table atable (aint integer, asmi smallint)'); +$dbh->exec('recreate table atable (aint integer, asmi smallint)'); $dbh->exec('insert into atable values (1, -1)'); $S = $dbh->prepare('select aint, asmi from atable'); $S->execute(); diff --git a/ext/pdo_firebird/tests/bug_72931.phpt b/ext/pdo_firebird/tests/bug_72931.phpt index 56270ba984b..5e2e849ba4f 100644 --- a/ext/pdo_firebird/tests/bug_72931.phpt +++ b/ext/pdo_firebird/tests/bug_72931.phpt @@ -6,8 +6,7 @@ PDO_Firebird: Bug 72931 Insert returning fails on Firebird 3 exec('drop table tablea'); -$dbh->exec('create table tablea (id integer)'); +$dbh->exec('recreate table tablea (id integer)'); $S = $dbh->prepare('insert into tablea (id) values (1) returning id'); $S->execute(); $D = $S->fetch(PDO::FETCH_NUM); diff --git a/ext/pdo_firebird/tests/bug_73087.phpt b/ext/pdo_firebird/tests/bug_73087.phpt index cd3d90137ee..fa642ff5c2e 100644 --- a/ext/pdo_firebird/tests/bug_73087.phpt +++ b/ext/pdo_firebird/tests/bug_73087.phpt @@ -6,8 +6,7 @@ PDO_Firebird: bug 73087 segfault binding blob parameter exec('drop table atable'); -$dbh->exec('create table atable (id integer not null, content blob sub_type 1 segment size 80)'); +$dbh->exec('recreate table atable (id integer not null, content blob sub_type 1 segment size 80)'); $S = $dbh->prepare('insert into atable (id, content) values (:id, :content)'); for ($I = 1; $I < 10; $I++) { $Params = [ diff --git a/ext/pdo_firebird/tests/bug_74462.phpt b/ext/pdo_firebird/tests/bug_74462.phpt index fe97a1fc19f..913b1b89dbf 100644 --- a/ext/pdo_firebird/tests/bug_74462.phpt +++ b/ext/pdo_firebird/tests/bug_74462.phpt @@ -6,8 +6,7 @@ PDO_Firebird: Bug #74462 Returns only NULLs for boolean fields exec('drop table atable'); -$dbh->exec('create table atable (id integer not null, abool boolean)'); +$dbh->exec('recreate table atable (id integer not null, abool boolean)'); $dbh->exec('insert into atable (id, abool) values (1, true)'); $dbh->exec('insert into atable (id, abool) values (2, false)'); $dbh->exec('insert into atable (id, abool) values (3, null)');