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

Valgrind Report for ext/odbc/tests/bug60616.phpt ('odbc_exec(): Getting accurate unicode data from query')

Script

1: <?php
2:
3:
// Test strings
4:
mb_internal_encoding("EUC_JP");
5:
$euc_jp_base64 'pdal6aWkpcCl676uyqo=';
6:
$euc_jp base64_decode($euc_jp_base64);
7:
$ascii 'abcdefghijklmnopqrstuvwxyz;]=#0123456789';
8:
9: include 
'config.inc';
10:
ini_set("odbc.defaultlrl"4); // Set artifically low
11:
12:
$conn odbc_connect($dsn$user$pass);
13:
14:
odbc_exec($conn'CREATE DATABASE odbcTEST ENCODING=\'EUC_JP\'');
15:
16:
odbc_exec($conn'CREATE TABLE FOO (ID INT, CHAR_COL CHAR(200), VARCHAR_COL VARCHAR(200), TEXT_COL TEXT)');
17:
18:
odbc_exec($conn"INSERT INTO FOO(ID, CHAR_COL, VARCHAR_COL, TEXT_COL) VALUES (1, '$euc_jp', '$euc_jp', '$euc_jp')");
19:
odbc_exec($conn"INSERT INTO FOO(ID, CHAR_COL, VARCHAR_COL, TEXT_COL) VALUES (2, '$ascii', '$ascii', '$ascii')");
20:
21:
$res odbc_exec($conn'SELECT * FROM FOO ORDER BY ID ASC');
22:
23: while(
odbc_fetch_row($res)) {
24:     
$char_col odbc_result($res"CHAR_COL");
25:     
$varchar_col odbc_result($res"VARCHAR_COL");
26:     
$id odbc_result($res"ID");
27:     
$text_col "";
28:     while ((
$chunk=odbc_result($res"TEXT_COL")) !== false) {
29:         
$text_col .= $chunk;
30:     }
31:
32:     if (
$id == 1) {
33:         
$euc_jp_check $euc_jp str_repeat(" ", (200 mb_strlen($euc_jp)));
34:         if (
strcmp($char_col$euc_jp_check) == && strcmp($varchar_col$euc_jp) == &&
35:             
strcmp($text_col$euc_jp) == 0) {
36:             print 
"EUC-JP matched\n";
37:         } else {
38:             print 
"EUC-JP mismatched\n";
39:         }
40:     } else {
41:         
$ascii_check $ascii str_repeat(" ", (200 strlen($ascii)));
42:         if (
strcmp($char_col$ascii_check) == && strcmp($varchar_col$ascii) == &&
43:             
strcmp($text_col$ascii) == 0) {
44:             print 
"ASCII matched\n";
45:         } else {
46:             print 
"ASCII mismatched\n";
47:         }
48:     }
49: }
50:
51:
?>
52:

Report

==7900== Conditional jump or move depends on uninitialised value(s)
==7900==    at 0x96FE60: odbc_bindcols (php_odbc.c:971)
==7900==    by 0x97347B: zif_odbc_exec (php_odbc.c:1655)
==7900==    by 0xEC69CD: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==7900==    by 0xED24AE: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==7900==    by 0xEC4459: execute_ex (zend_vm_execute.h:363)
==7900==    by 0xEC4FFC: zend_execute (zend_vm_execute.h:388)
==7900==    by 0xE5A064: zend_execute_scripts (zend.c:1330)
==7900==    by 0xD7ADAA: php_execute_script (main.c:2550)
==7900==    by 0x100CA1E: do_cli (php_cli.c:994)
==7900==    by 0x100E1CB: main (php_cli.c:1378)
==7900== 
==7900== Conditional jump or move depends on uninitialised value(s)
==7900==    at 0x96FF3A: odbc_bindcols (php_odbc.c:1002)
==7900==    by 0x97347B: zif_odbc_exec (php_odbc.c:1655)
==7900==    by 0xEC69CD: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==7900==    by 0xED24AE: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==7900==    by 0xEC4459: execute_ex (zend_vm_execute.h:363)
==7900==    by 0xEC4FFC: zend_execute (zend_vm_execute.h:388)
==7900==    by 0xE5A064: zend_execute_scripts (zend.c:1330)
==7900==    by 0xD7ADAA: php_execute_script (main.c:2550)
==7900==    by 0x100CA1E: do_cli (php_cli.c:994)
==7900==    by 0x100E1CB: main (php_cli.c:1378)
==7900== 
==7900== Conditional jump or move depends on uninitialised value(s)
==7900==    at 0x975585: zif_odbc_result (php_odbc.c:2116)
==7900==    by 0xEC69CD: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==7900==    by 0xED24AE: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==7900==    by 0xEC4459: execute_ex (zend_vm_execute.h:363)
==7900==    by 0xEC4FFC: zend_execute (zend_vm_execute.h:388)
==7900==    by 0xE5A064: zend_execute_scripts (zend.c:1330)
==7900==    by 0xD7ADAA: php_execute_script (main.c:2550)
==7900==    by 0x100CA1E: do_cli (php_cli.c:994)
==7900==    by 0x100E1CB: main (php_cli.c:1378)
==7900== 
==7900== Conditional jump or move depends on uninitialised value(s)
==7900==    at 0x97559C: zif_odbc_result (php_odbc.c:2116)
==7900==    by 0xEC69CD: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==7900==    by 0xED24AE: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==7900==    by 0xEC4459: execute_ex (zend_vm_execute.h:363)
==7900==    by 0xEC4FFC: zend_execute (zend_vm_execute.h:388)
==7900==    by 0xE5A064: zend_execute_scripts (zend.c:1330)
==7900==    by 0xD7ADAA: php_execute_script (main.c:2550)
==7900==    by 0x100CA1E: do_cli (php_cli.c:994)
==7900==    by 0x100E1CB: main (php_cli.c:1378)
==7900== 

 

Generated at Mon, 04 Aug 2014 15:49:20 +0000 (43 days ago)

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