xref: /PHP-8.4/ext/pdo_odbc/tests/bug80783.phpt (revision f4a5db3e)
1--TEST--
2Bug #80783 (PDO ODBC truncates BLOB records at every 256th byte)
3--EXTENSIONS--
4pdo_odbc
5--SKIPIF--
6<?php
7require 'ext/pdo/tests/pdo_test.inc';
8PDOTest::skip();
9?>
10--FILE--
11<?php
12require 'ext/pdo/tests/pdo_test.inc';
13$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
14$db->exec("CREATE TABLE bug80783 (name IMAGE)");
15
16$string = str_repeat("0123456789", 50);
17$db->exec("INSERT INTO bug80783 VALUES('$string')");
18
19$stmt = $db->prepare("SELECT name FROM bug80783");
20$stmt->bindColumn(1, $data, PDO::PARAM_LOB);
21$stmt->execute();
22$stmt->fetch(PDO::FETCH_BOUND);
23
24var_dump($data === bin2hex($string));
25?>
26--CLEAN--
27<?php
28require 'ext/pdo/tests/pdo_test.inc';
29$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
30$db->exec("DROP TABLE IF EXISTS bug80783");
31?>
32--EXPECT--
33bool(true)
34