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

Valgrind Report for ext/interbase/tests/003.phpt ('InterBase: misc sql types (may take a while)')

Script

1: <?php /* $Id$ */
2:
3:     
require("interbase.inc");
4:     
ibase_connect($test_base);
5:     
6:     
ibase_query(
7:         
"create table test3 (
8:             iter        integer not null,
9:             v_char        char(1000),
10:             v_date      timestamp,
11:                 v_decimal4_2          decimal(4,2),
12:                 v_decimal4_0          decimal(4,0),
13:                 v_decimal7_2          decimal(7,2),
14:                 v_decimal7_0          decimal(7,0),
15:                 v_numeric15_15      numeric(15,15),
16:                 v_numeric15_0      numeric(15,0),
17:             v_double      double precision,
18:             v_float     float,
19:             v_integer   integer,
20:             v_smallint  smallint,
21:             v_varchar   varchar(10000)
22:             )"
);
23:     
ibase_commit();
24:
25:     
/* should fail, but gracefully */
26:     
@ibase_query("insert into test3 (iter) values (?)"null);
27:
28:     
/* if timefmt is not supported, suppress error here */
29:     
ini_set('ibase.timestampformat',"%m/%d/%Y %H:%M:%S");
30:
31:     for(
$iter 0$iter 10$iter++){
32:         
/* prepare data  */
33:         
$v_char rand_str(1000);
34:         
$v_date rand_datetime();
35:         
$v_decimal4_2 rand_number(4,2);
36:         
$v_decimal4_0 rand_number(4,0);
37:         
$v_decimal7_2 rand_number(7,2);
38:         
$v_decimal7_0 rand_number(7,0);
39:         
$v_numeric15_15 rand_number(15,15);
40:         
$v_numeric15_0 $iter rand_number(15,0) : 0;
41:         
$v_double  rand_number(18);
42:         
$v_float   rand_number(7);
43:         
$v_integer rand_number(9,0);
44:         
$v_smallint rand_number(5) % 32767;
45:         
$v_varchar rand_str(10000);
46:
47:         
ibase_query(
48:         
"insert into test3 (iter, v_char,v_date,v_decimal4_2, v_decimal4_0, v_decimal7_2, v_decimal7_0,v_numeric15_15, v_numeric15_0,v_double,v_float,v_integer,v_smallint,v_varchar)
49:         values (
$iter, '$v_char','$v_date',$v_decimal4_2$v_decimal4_0$v_decimal7_2$v_decimal7_0,$v_numeric15_15$v_numeric15_0,$v_double,$v_float,$v_integer,$v_smallint,'$v_varchar')");
50:         
$sel ibase_query("select * from test3 where iter = $iter");
51:         
$row ibase_fetch_object($sel);
52:         if(
substr($row->V_CHAR,0,strlen($v_char)) != $v_char){
53:             echo 
" CHAR fail:\n";
54:             echo 
" in:  $v_char\n";
55:             echo 
" out: $row->V_CHAR\n";
56:         }
57:         if(
$row->V_DATE != $v_date){
58:             echo 
" DATE fail\n";
59:             echo 
" in:  $v_date\n";
60:             echo 
" out: $row->V_DATE\n";
61:         }
62:         if(
$row->V_DECIMAL4_2 != $v_decimal4_2){
63:             echo 
" DECIMAL4_2 fail\n";
64:             echo 
" in:  $v_decimal4_2\n";
65:             echo 
" out: $row->V_DECIMAL4_2\n";
66:         }
67:         if(
$row->V_DECIMAL4_0 != $v_decimal4_0){
68:             echo 
" DECIMAL4_0 fail\n";
69:             echo 
" in:  $v_decimal4_0\n";
70:             echo 
" out: $row->V_DECIMAL4_0\n";
71:         }
72:         if(
$row->V_DECIMAL7_2 != $v_decimal7_2){
73:             echo 
" DECIMAL7_2 fail\n";
74:             echo 
" in:  $v_decimal7_2\n";
75:             echo 
" out: $row->V_DECIMAL7_2\n";
76:         }
77:         if(
$row->V_DECIMAL7_0 != $v_decimal7_0){
78:             echo 
" DECIMAL7_0 fail\n";
79:             echo 
" in:  $v_decimal7_0\n";
80:             echo 
" out: $row->V_DECIMAL7_0\n";
81:         }
82:         if(
$row->V_NUMERIC15_15 != $v_numeric15_15){
83:             echo 
" NUMERIC15_15 fail\n";
84:             echo 
" in:  $v_numeric15_15\n";
85:             echo 
" out: $row->V_NUMERIC15_15\n";
86:         }
87:         if(
$row->V_NUMERIC15_0 != (string)$v_numeric15_0){
88:             echo 
" NUMERIC15_0 fail\n";
89:             echo 
" in:  $v_numeric15_0\n";
90:             echo 
" out: $row->V_NUMERIC15_0\n";
91:         }
92:
93:         if(
abs($row->V_DOUBLE $v_double) > abs($v_double 1E15)){
94:             echo 
" DOUBLE fail\n";
95:             echo 
" in:  $v_double\n";
96:             echo 
" out: $row->V_DOUBLE\n";
97:         }
98:         if(
abs($row->V_FLOAT $v_float) > abs($v_float 1E7)){
99:             echo 
" FLOAT fail\n";
100:             echo 
" in:  $v_float\n";
101:             echo 
" out: $row->V_FLOAT\n";
102:         }
103:         if(
$row->V_INTEGER != $v_integer){
104:             echo 
" INTEGER fail\n";
105:             echo 
" in:  $v_integer\n";
106:             echo 
" out: $row->V_INTEGER\n";
107:         }
108:         if(
$row->V_SMALLINT != $v_smallint){
109:             echo 
" SMALLINT fail\n";
110:             echo 
" in:  $v_smallint\n";
111:             echo 
" out: $row->V_SMALLINT\n";
112:         }
113:
114:       if(
substr($row->V_VARCHAR,0,strlen($v_varchar)) != $v_varchar){
115:             echo 
" VARCHAR fail:\n";
116:             echo 
" in:  $v_varchar\n";
117:             echo 
" out: $row->V_VARCHAR\n";
118:         }
119:
120:         
ibase_free_result($sel);
121:     } 
/* for($iter) */
122:
123:     /* check for correct handling of duplicate field names */
124:     
$q ibase_query('SELECT 1 AS id, 2 AS id, 3 AS id, 4 AS id, 5 AS id, 6 AS id, 7 AS id, 8 AS id, 9 AS id,
125:         10 AS id, 11 AS id, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22 FROM rdb$database'
);
126:     
var_dump(ibase_fetch_assoc($q));
127:     
128:     
ibase_close();
129:     echo 
"end of test\n";
130:
?>
131:

Report

==27213== Conditional jump or move depends on uninitialised value(s)
==27213==    at 0x619D42E: ??? (in /usr/lib64/libfbclient.so.2.5.3)
==27213==    by 0x618C543: isc_dsql_execute2 (in /usr/lib64/libfbclient.so.2.5.3)
==27213==    by 0x7CF3B7: _php_ibase_exec (ibase_query.c:980)
==27213==    by 0x7D0224: zif_ibase_query (ibase_query.c:1175)
==27213==    by 0xEABA1D: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==27213==    by 0xEB5AEC: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==27213==    by 0xEA966C: execute_ex (zend_vm_execute.h:363)
==27213==    by 0xEAA1FE: zend_execute (zend_vm_execute.h:388)
==27213==    by 0xE467D0: zend_execute_scripts (zend.c:1330)
==27213==    by 0xD69884: php_execute_script (main.c:2506)
==27213==    by 0x102ADE9: do_cli (php_cli.c:994)
==27213==    by 0x102C596: main (php_cli.c:1378)
==27213== 
==27213== Invalid read of size 4
==27213==    at 0x6192412: ??? (in /usr/lib64/libfbclient.so.2.5.3)
==27213==    by 0x6184B99: isc_database_info (in /usr/lib64/libfbclient.so.2.5.3)
==27213==    by 0x7CB9D1: _php_ibase_free_stmt_handle (ibase_query.c:127)
==27213==    by 0x7CBB08: _php_ibase_free_result (ibase_query.c:148)
==27213==    by 0xE65612: list_entry_destructor (zend_list.c:183)
==27213==    by 0xE60853: zend_hash_del_key_or_index (zend_hash.c:532)
==27213==    by 0xE64D9D: _zend_list_delete (zend_list.c:57)
==27213==    by 0xE411FD: _zval_dtor_func (zend_variables.c:62)
==27213==    by 0xE2306E: _zval_ptr_dtor (zend_variables.h:35)
==27213==    by 0xE60F9A: zend_hash_apply_deleter (zend_hash.c:650)
==27213==    by 0xE611B1: zend_hash_graceful_reverse_destroy (zend_hash.c:687)
==27213==    by 0xE222F4: shutdown_executor (zend_execute_API.c:247)
==27213==  Address 0x1544cdd0 is 0 bytes inside a block of size 32 free'd
==27213==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==27213==    by 0xDF1C30: _efree (zend_alloc.c:2437)
==27213==    by 0x7C7774: _php_ibase_close_link (interbase.c:648)
==27213==    by 0xE65612: list_entry_destructor (zend_list.c:183)
==27213==    by 0xE60853: zend_hash_del_key_or_index (zend_hash.c:532)
==27213==    by 0xE64D9D: _zend_list_delete (zend_list.c:57)
==27213==    by 0x7C96F7: zif_ibase_close (interbase.c:1074)
==27213==    by 0xEABA1D: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==27213==    by 0xEB5AEC: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==27213==    by 0xEA966C: execute_ex (zend_vm_execute.h:363)
==27213==    by 0xEAA1FE: zend_execute (zend_vm_execute.h:388)
==27213==    by 0xE467D0: zend_execute_scripts (zend.c:1330)
==27213== 

 

Generated at Mon, 15 Sep 2014 17:22:22 +0000 (26 hours ago)

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