xref: /PHP-8.0/ext/odbc/tests/bug73725.phpt (revision a555cc0b)
1--TEST--
2Bug #73725 Unable to retrieve value of varchar(max) type
3--SKIPIF--
4<?php include 'skipif.inc'; ?>
5--FILE--
6<?php
7
8include __DIR__ . "/config.inc";
9
10$conn = odbc_connect($dsn, $user, $pass);
11
12odbc_do($conn, "CREATE TABLE bug73725(i int, txt varchar(max), k int)");
13
14odbc_do($conn, "INSERT INTO bug73725 VALUES(101,'Any text', 33)");
15odbc_do($conn, "INSERT INTO bug73725 VALUES(102,'Müsliriegel', 34)");
16
17$rc = odbc_do($conn, "SELECT i, txt, k FROM bug73725");
18
19$r = odbc_fetch_array($rc);
20var_dump($r);
21
22$r = odbc_fetch_array($rc);
23var_dump($r);
24
25?>
26--EXPECT--
27array(3) {
28  ["i"]=>
29  string(3) "101"
30  ["txt"]=>
31  string(8) "Any text"
32  ["k"]=>
33  string(2) "33"
34}
35array(3) {
36  ["i"]=>
37  string(3) "102"
38  ["txt"]=>
39  string(12) "Müsliriegel"
40  ["k"]=>
41  string(2) "34"
42}
43--CLEAN--
44<?php
45include 'config.inc';
46
47$conn = odbc_connect($dsn, $user, $pass);
48
49odbc_exec($conn, 'DROP TABLE bug73725');
50
51odbc_close($conn);
52
53?>
54