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.
This commit is contained in:
Nikita Popov 2020-12-22 10:03:57 +01:00
parent a9253b0e22
commit 9294074c09
4 changed files with 4 additions and 8 deletions

View File

@ -6,8 +6,7 @@ PDO_Firebird: Feature 72583 Fetch integers as php integers not as strings
<?php
require 'testdb.inc';
@$dbh->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();

View File

@ -6,8 +6,7 @@ PDO_Firebird: Bug 72931 Insert returning fails on Firebird 3
<?php
require 'testdb.inc';
@$dbh->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);

View File

@ -6,8 +6,7 @@ PDO_Firebird: bug 73087 segfault binding blob parameter
<?php
require 'testdb.inc';
@$dbh->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 = [

View File

@ -6,8 +6,7 @@ PDO_Firebird: Bug #74462 Returns only NULLs for boolean fields
<?php
require 'testdb.inc';
@$dbh->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)');