mirror of
https://github.com/php/php-src.git
synced 2024-11-24 18:34:21 +08:00
add test for bug #71171
This commit is contained in:
parent
cd75429ad8
commit
01e85f3fdc
43
ext/odbc/tests/bug71171.phpt
Normal file
43
ext/odbc/tests/bug71171.phpt
Normal file
@ -0,0 +1,43 @@
|
||||
--TEST--
|
||||
Bug #71171 odbc_fetch_array generates SIGFAULT, variant 0
|
||||
--SKIPIF--
|
||||
<?php include 'skipif.inc'; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
include 'config.inc';
|
||||
|
||||
$conn = odbc_connect($dsn, $user, $pass);
|
||||
|
||||
@odbc_exec($conn, 'CREATE DATABASE odbcTEST');
|
||||
|
||||
odbc_exec($conn, 'CREATE TABLE FOO (ID INT, VARCHAR_COL NVARCHAR(40))');
|
||||
|
||||
odbc_exec($conn, "INSERT INTO FOO(ID, VARCHAR_COL) VALUES (1, '" . chr(0x81) . "')");
|
||||
|
||||
$res = odbc_exec($conn,"SELECT ID FROM FOO WHERE VARCHAR_COL = '" . chr(0x81) . "'");
|
||||
if ($res) {
|
||||
while($record = odbc_fetch_array($res)) var_dump($record);
|
||||
}
|
||||
|
||||
odbc_close($conn);
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
["ID"]=>
|
||||
string(1) "1"
|
||||
}
|
||||
==DONE==
|
||||
--CLEAN--
|
||||
<?php
|
||||
include 'config.inc';
|
||||
|
||||
$conn = odbc_connect($dsn, $user, $pass);
|
||||
|
||||
odbc_exec($conn, 'DROP TABLE FOO');
|
||||
odbc_exec($conn, 'DROP DATABASE odbcTEST');
|
||||
|
||||
odbc_close($conn);
|
||||
|
||||
?>
|
Loading…
Reference in New Issue
Block a user