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