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