File: bug44618.phpt

package info (click to toggle)
php8.4 8.4.11-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 208,108 kB
  • sloc: ansic: 1,060,628; php: 35,345; sh: 11,866; cpp: 7,201; pascal: 4,913; javascript: 3,091; asm: 2,810; yacc: 2,411; makefile: 689; xml: 446; python: 301; awk: 148
file content (72 lines) | stat: -rw-r--r-- 1,817 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
--TEST--
Bug #44618 (Fetching may rely on uninitialized data)
--EXTENSIONS--
odbc
--SKIPIF--
<?php
include 'skipif.inc';

if (ODBC_TYPE === "unixODBC") {
    die("skip Fails with unixODBC");
}
?>
--FILE--
<?php
include __DIR__ . "/config.inc";
$conn = odbc_connect($dsn, $user, $pass, SQL_CUR_USE_ODBC);

odbc_exec($conn, "CREATE TABLE bug44618(ID INT, real1 REAL, text1 TEXT)");
odbc_exec($conn, "INSERT INTO bug44618 VALUES (1, 10.0199995, 'testing 1,2,3')");

$result = odbc_exec($conn, "SELECT * FROM bug44618");
var_dump(odbc_fetch_array($result));
$result = null;

$result = odbc_exec($conn, "SELECT * FROM bug44618");
odbc_fetch_into($result, $array);
var_dump($array);
$result = null;

$result = odbc_exec($conn, "SELECT * FROM bug44618");
odbc_fetch_row($result);
var_dump(odbc_result($result, "text1"));
$result = null;

$result = odbc_exec($conn, "SELECT * FROM bug44618");
odbc_result_all($result);
$result = null;
?>
--CLEAN--
<?php
include __DIR__ . "/config.inc";
$conn = odbc_connect($dsn, $user, $pass);
odbc_exec($conn, "DROP TABLE bug44618");
?>
--EXPECTF--
Warning: odbc_fetch_array(): Cannot get data of column #3 (retcode 100) in %s on line %d
array(3) {
  ["ID"]=>
  string(1) "1"
  ["real1"]=>
  string(5) "10.02"
  ["text1"]=>
  bool(false)
}

Warning: odbc_fetch_into(): Cannot get data of column #3 (retcode 100) in %s on line %d
array(3) {
  [0]=>
  string(1) "1"
  [1]=>
  string(5) "10.02"
  [2]=>
  bool(false)
}

Warning: odbc_result(): Cannot get data of column #3 (retcode 100) in %s on line %d
bool(false)

Deprecated: Function odbc_result_all() is deprecated since 8.1 in %s on line %d
<table><tr><th>ID</th><th>real1</th><th>text1</th></tr>
<tr><td>1</td><td>10.02</td><td></td></tr></table>
Warning: odbc_result_all(): Cannot get data of column #3 (retcode 100) in %s on line %d