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

==3364== Conditional jump or move depends on uninitialised value(s)
==3364==    at 0x9EC92A: odbc_bindcols (php_odbc.c:960)
==3364==    by 0x9EFCA1: zif_odbc_exec (php_odbc.c:1636)
==3364==    by 0x10C6FEA: ZEND_DO_FCALL_SPEC_HANDLER (zend_vm_execute.h:596)
==3364==    by 0x10C3CE4: execute_ex (zend_vm_execute.h:352)
==3364==    by 0x10C4962: zend_execute (zend_vm_execute.h:381)
==3364==    by 0x101C58E: zend_execute_scripts (zend.c:1271)
==3364==    by 0xF230B5: php_execute_script (main.c:2554)
==3364==    by 0x11D62F9: do_cli (php_cli.c:982)
==3364==    by 0x11D7D7A: main (php_cli.c:1361)
==3364== 
==3364== Conditional jump or move depends on uninitialised value(s)
==3364==    at 0x9ECA04: odbc_bindcols (php_odbc.c:991)
==3364==    by 0x9EFCA1: zif_odbc_exec (php_odbc.c:1636)
==3364==    by 0x10C6FEA: ZEND_DO_FCALL_SPEC_HANDLER (zend_vm_execute.h:596)
==3364==    by 0x10C3CE4: execute_ex (zend_vm_execute.h:352)
==3364==    by 0x10C4962: zend_execute (zend_vm_execute.h:381)
==3364==    by 0x101C58E: zend_execute_scripts (zend.c:1271)
==3364==    by 0xF230B5: php_execute_script (main.c:2554)
==3364==    by 0x11D62F9: do_cli (php_cli.c:982)
==3364==    by 0x11D7D7A: main (php_cli.c:1361)
==3364== 
==3364== Conditional jump or move depends on uninitialised value(s)
==3364==    at 0x9F25F2: zif_odbc_result (php_odbc.c:2087)
==3364==    by 0x10C6FEA: ZEND_DO_FCALL_SPEC_HANDLER (zend_vm_execute.h:596)
==3364==    by 0x10C3CE4: execute_ex (zend_vm_execute.h:352)
==3364==    by 0x10C4962: zend_execute (zend_vm_execute.h:381)
==3364==    by 0x101C58E: zend_execute_scripts (zend.c:1271)
==3364==    by 0xF230B5: php_execute_script (main.c:2554)
==3364==    by 0x11D62F9: do_cli (php_cli.c:982)
==3364==    by 0x11D7D7A: main (php_cli.c:1361)
==3364== 
==3364== Conditional jump or move depends on uninitialised value(s)
==3364==    at 0x9F2609: zif_odbc_result (php_odbc.c:2087)
==3364==    by 0x10C6FEA: ZEND_DO_FCALL_SPEC_HANDLER (zend_vm_execute.h:596)
==3364==    by 0x10C3CE4: execute_ex (zend_vm_execute.h:352)
==3364==    by 0x10C4962: zend_execute (zend_vm_execute.h:381)
==3364==    by 0x101C58E: zend_execute_scripts (zend.c:1271)
==3364==    by 0xF230B5: php_execute_script (main.c:2554)
==3364==    by 0x11D62F9: do_cli (php_cli.c:982)
==3364==    by 0x11D7D7A: main (php_cli.c:1361)
==3364== 

 

Generated at Mon, 26 Jan 2015 14:47:00 +0000 (32 hours ago)

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