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