PHP  
 PHP_7_3
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/odbc/tests/bug44618.phpt ('Bug #44618 (Fetching may rely on uninitialized data)')

Script

1: <?php
2:
include __DIR__ "/config.inc";
3:
$conn odbc_connect($dsn$user$passSQL_CUR_USE_ODBC);
4:
5:
odbc_exec($conn"CREATE TABLE bug44618(ID INT, real1 REAL, text1 TEXT)");
6:
odbc_exec($conn"INSERT INTO bug44618 VALUES (1, 10.0199995, 'testing 1,2,3')");
7:
8:
$result odbc_exec($conn"SELECT * FROM bug44618");
9:
var_dump(odbc_fetch_array($result));
10:
$result null;
11:
12:
$result odbc_exec($conn"SELECT * FROM bug44618");
13:
odbc_fetch_into($result$array);
14:
var_dump($array);
15:
$result null;
16:
17:
$result odbc_exec($conn"SELECT * FROM bug44618");
18:
odbc_fetch_row($result);
19:
var_dump(odbc_result($result"text1"));
20:
$result null;
21:
22:
$result odbc_exec($conn"SELECT * FROM bug44618");
23:
odbc_result_all($result);
24:
$result null;
25:
?>
26:

Expected

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)
<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

Output

array(3) {
  ["ID"]=>
  string(1) "1"
  ["real1"]=>
  string(10) "10.0199995"
  ["text1"]=>
  string(13) "testing 1,2,3"
}
array(3) {
  [0]=>
  string(1) "1"
  [1]=>
  string(10) "10.0199995"
  [2]=>
  string(13) "testing 1,2,3"
}
string(13) "testing 1,2,3"
<table><tr><th>ID</th><th>real1</th><th>text1</th></tr>
<tr><td>1</td><td>10.0199995</td><td>testing 1,2,3</td></tr>
</table>

Diff

001- Warning: odbc_fetch_array(): Cannot get data of column #3 (retcode 100) in %s on line %d
005+   string(10) "10.0199995"
006-   string(5) "10.02"
007+   string(13) "testing 1,2,3"
008-   bool(false)
010- 
011- Warning: odbc_fetch_into(): Cannot get data of column #3 (retcode 100) in %s on line %d
013+   string(10) "10.0199995"
015+   string(13) "testing 1,2,3"
016-   string(5) "10.02"
017+ string(13) "testing 1,2,3"
018-   bool(false)
019+ <tr><td>1</td><td>10.0199995</td><td>testing 1,2,3</td></tr>
020+ </table>
020- 
021- Warning: odbc_result(): Cannot get data of column #3 (retcode 100) in %s on line %d
022- bool(false)
024- <tr><td>1</td><td>10.02</td><td></td></tr></table>
025- Warning: odbc_result_all(): Cannot get data of column #3 (retcode 100) in %s on line %d

 

Generated at Fri, 26 Nov 2021 01:14:57 +0000 (7 days ago)

Copyright © 2005-2021 The PHP Group
All rights reserved.