1--TEST--
2SQLite3::execute() with a resource bound for blob param
3--EXTENSIONS--
4sqlite3
5--FILE--
6<?php
7
8require_once(__DIR__ . '/new_db.inc');
9require_once(__DIR__ . '/stream_test.inc');
10
11var_dump($db->exec('CREATE TABLE test (id STRING, data BLOB)'));
12$insert_stmt = $db->prepare("INSERT INTO test (id, data) VALUES (1, ?)");
13
14
15class HelloWrapper {
16    public $context;
17    public function stream_open() { return true; }
18    public function stream_eof() { return true; }
19    public function stream_read() { return NULL; }
20    public function stream_stat() { return array(); }
21}
22stream_wrapper_register("hello", "HelloWrapper");
23
24$f = fopen("hello://there", "r");
25
26var_dump($insert_stmt->bindParam(1, $f, SQLITE3_BLOB));
27var_dump($insert_stmt->execute());
28
29var_dump($insert_stmt->close());
30fclose($f);
31
32?>
33+++DONE+++
34--EXPECTF--
35bool(true)
36bool(true)
37object(SQLite3Result)#%d (%d) {
38}
39bool(true)
40+++DONE+++
41