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/oci8/tests/edition_1.phpt ('Basic test for setting Oracle 11gR2 "edition" attribute')

Script

1: <?php
2:
3:
/* In 11.2, there can only be one child edition.  So this test will
4:  * fail to create the necessary editions if a child edition exists
5:  * already 
6:  */
7:
8:
$testuser     'testuser_attr_1';  // Used in conn_attr.inc
9:
$testpassword 'testuser'
10:
11: require(
dirname(__FILE__)."/conn_attr.inc");
12:
13: function 
select_fn($conn) {
14:     
$s oci_parse($conn,"select * from view_ed");
15:     
oci_execute($s);
16:     while (
$row oci_fetch_row($s)) {
17:         
var_dump($row);
18:     }
19: }
20:
/* Create a editon MYEDITION 
21:    create a view view_ed in MYEDITION1.
22:    create the same view 'view_ed' with a different definition in MYEDITION.
23:    select from both the editions and verify the contents. */
24:
25:
set_edit_attr('MYEDITION');
26:
$conn oci_connect($testuser,$testpassword,$dbase); 
27: if (
$conn === false) {
28:     
$m oci_error();
29:     die(
"Error:" $m['message']);
30: }
31:     
32:
$stmtarray = array(
33:     
"drop table edit_tab",
34:     
"create table edit_tab (name varchar2(10),age number,job varchar2(50), salary number)",
35:     
"insert into edit_tab values('mike',30,'Senior engineer',200)",
36:     
"insert into edit_tab values('juan',25,'engineer',100)",
37:     
"create or replace editioning view view_ed as select name,age,job from edit_tab",
38: );
39:
40:
oci8_test_sql_execute($conn$stmtarray);
41:
42:
// Check the current edition of the DB and the contents of view_ed.
43:
get_edit_attr($conn);
44:
select_fn($conn);
45:
46:
// Create a different version of view_ed in MYEDITION1.
47:
set_edit_attr('MYEDITION1');
48:
$conn2 oci_new_connect($testuser,$testpassword,$dbase); 
49:
$stmt "create or replace editioning view view_ed as select name,age,job,salary from edit_tab";
50:
$s oci_parse($conn2$stmt);
51:
oci_execute($s);
52:
53:
// Check the current edition of the DB and the contents of view_ed.
54:
get_edit_attr($conn2);
55:
select_fn($conn2);
56:
57:
// Verify the contents in MYEDITION EDITION.
58:
echo "version of view_ed in MYEDITION \n";
59:
get_edit_attr($conn);
60:
select_fn($conn);
61:
62:
clean_up($c);
63:
64:
oci_close($conn);
65:
oci_close($conn2);
66: echo 
"Done\n";
67:
68:
?>
69:

Report

==31106== Invalid read of size 1
==31106==    at 0xA1E9C6: zval_get_type (zend_types.h:327)
==31106==    by 0xA1E9C6: php_oci_register_taf_callback (oci8_failover.c:108)
==31106==    by 0xA1E97F: php_oci_unregister_taf_callback (oci8_failover.c:92)
==31106==    by 0xA1998D: zif_oci_close (oci8_interface.c:1620)
==31106==    by 0x1092F2A: ZEND_DO_ICALL_SPEC_HANDLER (zend_vm_execute.h:586)
==31106==    by 0x1090CFD: execute_ex (zend_vm_execute.h:417)
==31106==    by 0x1091923: zend_execute (zend_vm_execute.h:458)
==31106==    by 0xFC3656: zend_execute_scripts (zend.c:1443)
==31106==    by 0xEC11C4: php_execute_script (main.c:2493)
==31106==    by 0x11C5E29: do_cli (php_cli.c:977)
==31106==    by 0x11C77B9: main (php_cli.c:1347)
==31106==  Address 0x1517b578 is 136 bytes inside a block of size 144 free'd
==31106==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==31106==    by 0xF643C0: _efree (zend_alloc.c:2472)
==31106==    by 0x9F3CAF: php_oci_connection_close (oci8.c:2267)
==31106==    by 0x9ED7DB: php_oci_connection_list_dtor (oci8.c:1266)
==31106==    by 0x10033C9: zend_resource_dtor (zend_list.c:76)
==31106==    by 0x10034A1: zend_list_close (zend_list.c:89)
==31106==    by 0xA1996F: zif_oci_close (oci8_interface.c:1617)
==31106==    by 0x1092F2A: ZEND_DO_ICALL_SPEC_HANDLER (zend_vm_execute.h:586)
==31106==    by 0x1090CFD: execute_ex (zend_vm_execute.h:417)
==31106==    by 0x1091923: zend_execute (zend_vm_execute.h:458)
==31106==    by 0xFC3656: zend_execute_scripts (zend.c:1443)
==31106==    by 0xEC11C4: php_execute_script (main.c:2493)
==31106==  Block was alloc'd at
==31106==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==31106==    by 0xF65A20: __zend_malloc (zend_alloc.c:2864)
==31106==    by 0xF6409D: _emalloc (zend_alloc.c:2457)
==31106==    by 0xF6492B: _safe_emalloc (zend_alloc.c:2516)
==31106==    by 0xF64D3D: _ecalloc (zend_alloc.c:2539)
==31106==    by 0x9F244D: php_oci_do_connect_ex (oci8.c:1981)
==31106==    by 0x9EECE0: php_oci_do_connect (oci8.c:1645)
==31106==    by 0xA19A45: zif_oci_connect (oci8_interface.c:1640)
==31106==    by 0x1092F2A: ZEND_DO_ICALL_SPEC_HANDLER (zend_vm_execute.h:586)
==31106==    by 0x1090CFD: execute_ex (zend_vm_execute.h:417)
==31106==    by 0x1091923: zend_execute (zend_vm_execute.h:458)
==31106==    by 0xFC3656: zend_execute_scripts (zend.c:1443)
==31106== 

 

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

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