xref: /PHP-8.2/ext/pdo_odbc/tests/bug80783a.phpt (revision 74859783)
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 bug80783a (name NVARCHAR(MAX))");
15
16$string = str_repeat("0123456789", 50);
17$db->exec("INSERT INTO bug80783a VALUES('$string')");
18
19$stmt = $db->prepare("SELECT name FROM bug80783a");
20$stmt->setAttribute(PDO::ODBC_ATTR_ASSUME_UTF8, true);
21$stmt->bindColumn(1, $data, PDO::PARAM_STR);
22$stmt->execute();
23$stmt->fetch(PDO::FETCH_BOUND);
24
25var_dump($data === $string);
26?>
27--CLEAN--
28<?php
29require 'ext/pdo/tests/pdo_test.inc';
30$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
31$db->exec("DROP TABLE bug80783a");
32?>
33--EXPECT--
34bool(true)
35