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

==26146== Invalid read of size 1
==26146==    at 0xA96B1E: zval_get_type (zend_types.h:390)
==26146==    by 0xA96B1E: php_oci_register_taf_callback (oci8_failover.c:108)
==26146==    by 0xA96AD7: php_oci_unregister_taf_callback (oci8_failover.c:92)
==26146==    by 0xA91959: zif_oci_close (oci8_interface.c:1620)
==26146==    by 0x11BD4EB: ZEND_DO_ICALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:573)
==26146==    by 0x1339863: execute_ex (zend_vm_execute.h:59726)
==26146==    by 0x1339EDB: zend_execute (zend_vm_execute.h:63763)
==26146==    by 0x10DF02D: zend_execute_scripts (zend.c:1494)
==26146==    by 0xFD0CE5: php_execute_script (main.c:2566)
==26146==    by 0x133FA79: do_cli (php_cli.c:1011)
==26146==    by 0x134142D: main (php_cli.c:1404)
==26146==  Address 0x15103be8 is 136 bytes inside a block of size 144 free'd
==26146==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==26146==    by 0x1076214: _efree (zend_alloc.c:2428)
==26146==    by 0xA6B758: php_oci_connection_close (oci8.c:2267)
==26146==    by 0xA6517B: php_oci_connection_list_dtor (oci8.c:1266)
==26146==    by 0x1120A31: zend_resource_dtor (zend_list.c:76)
==26146==    by 0x1120B09: zend_list_close (zend_list.c:89)
==26146==    by 0xA9193B: zif_oci_close (oci8_interface.c:1617)
==26146==    by 0x11BD4EB: ZEND_DO_ICALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:573)
==26146==    by 0x1339863: execute_ex (zend_vm_execute.h:59726)
==26146==    by 0x1339EDB: zend_execute (zend_vm_execute.h:63763)
==26146==    by 0x10DF02D: zend_execute_scripts (zend.c:1494)
==26146==    by 0xFD0CE5: php_execute_script (main.c:2566)
==26146==  Block was alloc'd at
==26146==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==26146==    by 0x10777DB: __zend_malloc (zend_alloc.c:2811)
==26146==    by 0x1075EF1: _emalloc (zend_alloc.c:2413)
==26146==    by 0x107677F: _safe_emalloc (zend_alloc.c:2472)
==26146==    by 0x1076B91: _ecalloc (zend_alloc.c:2495)
==26146==    by 0xA69EF6: php_oci_do_connect_ex (oci8.c:1981)
==26146==    by 0xA66680: php_oci_do_connect (oci8.c:1645)
==26146==    by 0xA91A11: zif_oci_connect (oci8_interface.c:1640)
==26146==    by 0x11BD9D3: ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:617)
==26146==    by 0x1339863: execute_ex (zend_vm_execute.h:59726)
==26146==    by 0x1339EDB: zend_execute (zend_vm_execute.h:63763)
==26146==    by 0x10DF02D: zend_execute_scripts (zend.c:1494)
==26146== 

 

Generated at Sat, 09 Sep 2017 03:10:54 +0000 (14 days ago)

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