xref: /PHP-7.3/ext/odbc/tests/bug73725.phpt (revision 2384ade5)
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 dirname(__FILE__) . "/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==DONE==
27--EXPECT--
28array(3) {
29  ["i"]=>
30  string(3) "101"
31  ["txt"]=>
32  string(8) "Any text"
33  ["k"]=>
34  string(2) "33"
35}
36array(3) {
37  ["i"]=>
38  string(3) "102"
39  ["txt"]=>
40  string(12) "Müsliriegel"
41  ["k"]=>
42  string(2) "34"
43}
44==DONE==
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