1--TEST--
2Bug #62024 Cannot insert second row with null using parametrized query (Firebird PDO)
3--SKIPIF--
4<?php extension_loaded("pdo_firebird") or die("skip"); ?>
5<?php function_exists("ibase_query") or die("skip"); ?>
6--FILE--
7<?php
8
9require("testdb.inc");
10
11$dbh = new PDO("firebird:dbname=$test_base",$user,$password) or die;
12$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
13$value = '2';
14@$dbh->exec('DROP TABLE test_insert');
15$dbh->exec("CREATE TABLE test_insert (ID INTEGER NOT NULL, TEXT VARCHAR(10))");
16
17$dbh->commit();
18
19//start actual test
20
21$sql = "insert into test_insert (id, text) values (?, ?)";
22$sttmt = $dbh->prepare($sql);
23
24$args_ok = array(1, "test1");
25$args_err = array(2, null);
26
27$res = $sttmt->execute($args_ok);
28var_dump($res);
29
30$res = $sttmt->execute($args_err);
31var_dump($res);
32
33$dbh->commit();
34
35
36//teardown test data
37$sttmt = $dbh->prepare('DELETE FROM test_insert');
38$sttmt->execute();
39
40$dbh->commit();
41
42$dbh->exec('DROP TABLE test_insert');
43
44unset($sttmt);
45unset($dbh);
46
47?>
48--EXPECT--
49bool(true)
50bool(true)
51