xref: /php-src/ext/odbc/tests/bug69975.phpt (revision 8726ae06)
1--TEST--
2Bug #69975 (PHP segfaults when accessing nvarchar(max) defined columns)
3--EXTENSIONS--
4odbc
5--SKIPIF--
6<?php include 'skipif.inc'; ?>
7--FILE--
8<?php
9include 'config.inc';
10
11$conn = odbc_connect($dsn, $user, $pass);
12odbc_exec($conn, 'CREATE TABLE bug69975 (ID INT, VARCHAR_COL NVARCHAR(MAX))');
13odbc_exec($conn, "INSERT INTO bug69975 VALUES (1, 'foo')");
14
15$result = odbc_exec($conn, "SELECT VARCHAR_COL FROM bug69975");
16var_dump(odbc_fetch_array($result));
17
18echo "ready";
19?>
20--CLEAN--
21<?php
22include 'config.inc';
23
24$conn = odbc_connect($dsn, $user, $pass);
25odbc_exec($conn, 'DROP TABLE bug69975');
26?>
27--EXPECT--
28array(1) {
29  ["VARCHAR_COL"]=>
30  string(3) "foo"
31}
32ready
33
34