summaryrefslogtreecommitdiffstats
path: root/sqlsrv.patch
blob: 8ea4ce1b84025dbe3a745e7a09a4a73c2a5c8615 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
diff --git a/source/sqlsrv/stmt.cpp b/source/sqlsrv/stmt.cpp
index 96aeae8..7757868 100644
--- a/source/sqlsrv/stmt.cpp
+++ b/source/sqlsrv/stmt.cpp
@@ -889,7 +889,9 @@ PHP_FUNCTION( sqlsrv_fetch_object )
             fci.object = Z_OBJ_P( &retval_z );
 
             memset( &fcic, 0, sizeof( fcic ));
+#if PHP_VERSION_ID < 70300
             fcic.initialized = 1;
+#endif
             fcic.function_handler = class_entry->constructor;
             fcic.calling_scope = class_entry;
 
@@ -1806,10 +1808,8 @@ void fetch_fields_common( _Inout_ ss_sqlsrv_stmt* stmt, _In_ zend_long fetch_typ
         field_names.transferred();
     }
 
-    int zr = array_init( &fields );
-	CHECK_ZEND_ERROR( zr, stmt, SQLSRV_ERROR_ZEND_HASH ) {
-		throw ss::SSException();
-	}
+    int zr;
+    array_init( &fields );
 
 	for( int i = 0; i < num_cols; ++i ) {
 		SQLLEN field_len = -1;
diff --git a/source/sqlsrv/util.cpp b/source/sqlsrv/util.cpp
index 50b963e..a68b93c 100644
--- a/source/sqlsrv/util.cpp
+++ b/source/sqlsrv/util.cpp
@@ -506,10 +506,7 @@ PHP_FUNCTION( sqlsrv_errors )
 	int result;
 	zval err_z;
 	ZVAL_UNDEF( &err_z );
-	result = array_init( &err_z );
-	if( result == FAILURE ) {
-		RETURN_FALSE;
-	}
+	array_init( &err_z );
 	if( flags == SQLSRV_ERR_ALL || flags == SQLSRV_ERR_ERRORS ) {
 		if( Z_TYPE( SQLSRV_G( errors )) == IS_ARRAY && !sqlsrv_merge_zend_hash( &err_z, &SQLSRV_G( errors ) TSRMLS_CC )) {
 			zval_ptr_dtor(&err_z);
@@ -747,9 +744,7 @@ void copy_error_to_zval( _Inout_ zval* error_z, _In_ sqlsrv_error_const* error,
                          _In_ bool warning TSRMLS_DC )
 {
 
-    if( array_init( error_z ) == FAILURE ) {
-        DIE( "Fatal error during error processing" );
-    }
+    array_init( error_z );
 
     // sqlstate
     zval temp; 
@@ -837,10 +832,7 @@ bool handle_errors_and_warnings( _Inout_ sqlsrv_context& ctx, _Inout_ zval* repo
     if( Z_TYPE_P( reported_chain ) == IS_NULL ) {
 
         reported_chain_was_null = true;
-        zr = array_init( reported_chain );
-        if( zr == FAILURE ) {
-            DIE( "Fatal error in handle_errors_and_warnings" );
-        }
+        array_init( reported_chain );
     }
     else {
         prev_reported_cnt = zend_hash_num_elements( Z_ARRVAL_P( reported_chain ));
@@ -852,10 +844,7 @@ bool handle_errors_and_warnings( _Inout_ sqlsrv_context& ctx, _Inout_ zval* repo
         if( Z_TYPE_P( ignored_chain ) == IS_NULL ) {
             
            ignored_chain_was_null = true;
-           zr = array_init( ignored_chain );
-            if( zr == FAILURE ) {
-                DIE( "Fatal error in handle_errors_and_warnings" );
-            }
+           array_init( ignored_chain );
         }
     }