xref: /PHP-7.4/ext/odbc/tests/bug71171.phpt (revision 01e85f3f)
1--TEST--
2Bug #71171 odbc_fetch_array generates SIGFAULT, variant 0
3--SKIPIF--
4<?php include 'skipif.inc'; ?>
5--FILE--
6<?php
7
8include 'config.inc';
9
10$conn = odbc_connect($dsn, $user, $pass);
11
12@odbc_exec($conn, 'CREATE DATABASE odbcTEST');
13
14odbc_exec($conn, 'CREATE TABLE FOO (ID INT, VARCHAR_COL NVARCHAR(40))');
15
16odbc_exec($conn, "INSERT INTO FOO(ID, VARCHAR_COL) VALUES (1, '" . chr(0x81) . "')");
17
18$res = odbc_exec($conn,"SELECT ID FROM FOO WHERE VARCHAR_COL = '" . chr(0x81) . "'");
19if ($res) {
20	while($record = odbc_fetch_array($res)) var_dump($record);
21}
22
23odbc_close($conn);
24?>
25==DONE==
26--EXPECT--
27array(1) {
28  ["ID"]=>
29  string(1) "1"
30}
31==DONE==
32--CLEAN--
33<?php
34include 'config.inc';
35
36$conn = odbc_connect($dsn, $user, $pass);
37
38odbc_exec($conn, 'DROP TABLE FOO');
39odbc_exec($conn, 'DROP DATABASE odbcTEST');
40
41odbc_close($conn);
42
43?>
44