@@ -45,31 +45,34 @@ if (file_exists(dirname(__FILE__)."/details_local.inc")) {
45
45
* Used for creating/dropping schema objects used by a test
46
46
*/
47
47
48
- function oci8_test_sql_execute ($ c , $ stmtarray )
49
- {
50
- foreach ($ stmtarray as $ stmt ) {
51
- $ s = oci_parse ($ c , $ stmt );
52
- if (!$ s ) {
53
- $ m = oci_error ($ c );
54
- echo $ stmt . PHP_EOL . $ m ['message ' ] . PHP_EOL ;
55
- }
56
- else {
57
- $ r = @oci_execute ($ s );
58
- if (!$ r ) {
59
- $ m = oci_error ($ s );
60
- if (!in_array ($ m ['code ' ], array ( // ignore expected errors
61
- 942 // table or view does not exist
62
- , 1918 // user does not exist
63
- , 2024 // database link not found
64
- , 2289 // sequence does not exist
65
- , 4080 // trigger does not exist
66
- , 38802 // edition does not exist
67
- ))) {
68
- echo $ stmt . PHP_EOL . $ m ['message ' ] . PHP_EOL ;
69
- }
70
- }
71
- }
72
- }
48
+ if (!function_exists ('oci8_test_sql_execute ' )) {
49
+ function oci8_test_sql_execute ($ c , $ stmtarray )
50
+ {
51
+ foreach ($ stmtarray as $ stmt ) {
52
+ $ s = oci_parse ($ c , $ stmt );
53
+ if (!$ s ) {
54
+ $ m = oci_error ($ c );
55
+ echo $ stmt . PHP_EOL . $ m ['message ' ] . PHP_EOL ;
56
+ }
57
+ else {
58
+ $ r = @oci_execute ($ s );
59
+ if (!$ r ) {
60
+ $ m = oci_error ($ s );
61
+ if (!in_array ($ m ['code ' ], array ( // ignore expected errors
62
+ 942 // table or view does not exist
63
+ , 1918 // user does not exist
64
+ , 2024 // database link not found
65
+ , 2289 // sequence does not exist
66
+ , 4080 // trigger does not exist
67
+ , 38802 // edition does not exist
68
+ ))) {
69
+ echo $ stmt . PHP_EOL . $ m ['message ' ] . PHP_EOL ;
70
+ }
71
+ }
72
+ }
73
+ }
74
+ }
75
+
73
76
}
74
77
75
78
?>
0 commit comments