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