PHP  
 PHP_7_0
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
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

==20009== Conditional jump or move depends on uninitialised value(s)
==20009==    at 0x5F4803E: ??? (in /usr/lib64/libfbclient.so.2.5.7)
==20009==    by 0x5F39283: isc_dsql_execute2 (in /usr/lib64/libfbclient.so.2.5.7)
==20009==    by 0x877448: _php_ibase_exec (ibase_query.c:985)
==20009==    by 0x8781D5: zif_ibase_query (ibase_query.c:1179)
==20009==    by 0x1092F2A: ZEND_DO_ICALL_SPEC_HANDLER (zend_vm_execute.h:586)
==20009==    by 0x1090CFD: execute_ex (zend_vm_execute.h:417)
==20009==    by 0x1091923: zend_execute (zend_vm_execute.h:458)
==20009==    by 0xFC3656: zend_execute_scripts (zend.c:1443)
==20009==    by 0xEC11C4: php_execute_script (main.c:2493)
==20009==    by 0x11C5E29: do_cli (php_cli.c:977)
==20009==    by 0x11C77B9: main (php_cli.c:1347)
==20009== 
==20009== Invalid read of size 4
==20009==    at 0x5F3DA82: ??? (in /usr/lib64/libfbclient.so.2.5.7)
==20009==    by 0x5F2F759: isc_database_info (in /usr/lib64/libfbclient.so.2.5.7)
==20009==    by 0x8737B2: _php_ibase_free_stmt_handle (ibase_query.c:127)
==20009==    by 0x8738EA: _php_ibase_free_result (ibase_query.c:148)
==20009==    by 0x10033C9: zend_resource_dtor (zend_list.c:76)
==20009==    by 0x1003B4D: list_entry_destructor (zend_list.c:187)
==20009==    by 0xFF5E80: _zend_hash_del_el_ex (zend_hash.c:1025)
==20009==    by 0xFF5E80: zend_hash_index_del (zend_hash.c:1239)
==20009==    by 0x10032AF: zend_list_free (zend_list.c:59)
==20009==    by 0xFBD4C8: _zval_dtor_func_for_ptr (zend_variables.c:115)
==20009==    by 0xF93864: i_zval_ptr_dtor (zend_variables.h:58)
==20009==    by 0xF93864: _zval_ptr_dtor (zend_execute_API.c:533)
==20009==    by 0xFF8901: _zend_hash_del_el_ex (zend_hash.c:1025)
==20009==    by 0xFF8901: _zend_hash_del_el (zend_hash.c:1049)
==20009==    by 0xFF8901: zend_hash_graceful_reverse_destroy (zend_hash.c:1505)
==20009==    by 0xF92548: shutdown_executor (zend_execute_API.c:277)
==20009==  Address 0x14fe0c50 is 0 bytes inside a block of size 32 free'd
==20009==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==20009==    by 0xF643C0: _efree (zend_alloc.c:2472)
==20009==    by 0x86FB60: _php_ibase_close_link (interbase.c:643)
==20009==    by 0x10033C9: zend_resource_dtor (zend_list.c:76)
==20009==    by 0x10034A1: zend_list_close (zend_list.c:89)
==20009==    by 0x871E4D: zif_ibase_close (interbase.c:1072)
==20009==    by 0x1092F2A: ZEND_DO_ICALL_SPEC_HANDLER (zend_vm_execute.h:586)
==20009==    by 0x1090CFD: execute_ex (zend_vm_execute.h:417)
==20009==    by 0x1091923: zend_execute (zend_vm_execute.h:458)
==20009==    by 0xFC3656: zend_execute_scripts (zend.c:1443)
==20009==    by 0xEC11C4: php_execute_script (main.c:2493)
==20009==    by 0x11C5E29: do_cli (php_cli.c:977)
==20009==  Block was alloc'd at
==20009==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==20009==    by 0xF65A20: __zend_malloc (zend_alloc.c:2864)
==20009==    by 0xF5F175: _emalloc_32 (zend_alloc.c:2380)
==20009==    by 0x87166C: _php_ibase_connect (interbase.c:988)
==20009==    by 0x871C91: zif_ibase_connect (interbase.c:1037)
==20009==    by 0x1092F2A: ZEND_DO_ICALL_SPEC_HANDLER (zend_vm_execute.h:586)
==20009==    by 0x1090CFD: execute_ex (zend_vm_execute.h:417)
==20009==    by 0x1091923: zend_execute (zend_vm_execute.h:458)
==20009==    by 0xFC3656: zend_execute_scripts (zend.c:1443)
==20009==    by 0xEC11C4: php_execute_script (main.c:2493)
==20009==    by 0x11C5E29: do_cli (php_cli.c:977)
==20009==    by 0x11C77B9: main (php_cli.c:1347)
==20009== 

 

Generated at Wed, 20 Sep 2017 13:49:37 +0000 (3 days ago)

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