php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #73002
Patch oci8_statement.patch_8_2_0 revision 2022-12-31 20:02 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement.patch_8_0_9 revision 2021-08-30 09:49 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement.patch_8_0_0 revision 2020-08-17 10:52 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement.patch_7_4_0boolean2 revision 2019-12-16 10:52 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement.patch_7_4_0boolean revision 2019-12-16 10:17 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement.patch_7_4_0 revision 2019-11-27 10:12 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement.patch_7_3_0_RC2 revision 2018-10-01 11:57 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement.patch_7_3_0 revision 2018-06-12 15:01 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement.patch_7_1_11 revision 2017-10-29 14:53 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement.patch_7_1_8 revision 2017-08-10 13:06 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement.patch_7_1_4 revision 2017-04-28 08:33 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement.patch_7_0_13_v2 revision 2016-11-14 19:12 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement.patch_7_0_13 revision 2016-11-14 12:11 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement_v2.patch_7_0_11 revision 2016-09-16 11:13 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement.patch_7_0_11 revision 2016-09-16 10:28 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement_v2.patch revision 2016-09-08 10:22 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement.patch revision 2016-09-02 11:14 UTC by lzsiga at freemail dot c3 dot hu

Patch oci8_statement.patch_8_2_0 for OCI8 related Bug #73002

Patch version 2022-12-31 20:02 UTC

Return to Bug #73002 | Download this patch
Patch Revisions:

Developer: lzsiga@freemail.c3.hu

*** ext/oci8/oci8_statement.c	2022-12-06 15:26:47 +0100
--- ../php-8.2.0-patched/ext/oci8/oci8_statement.c	2022-12-31 20:18:55 +0100
***************
*** 42,47 ****
--- 42,57 ----
  typedef ub4 oci_phpsized_int;
  #endif
  
+ #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+   #define ZendLongPtr2UInt32Ptr(zendlongptr) ((uint32_t *)(zendlongptr))
+   #define ZendLongPtr2OciPhpsizedIntPtr(zendlongptr) ((oci_phpsized_int *)(zendlongptr))
+ #else
+   #define ZendLongPtr2UInt32Ptr(zendlongptr) \
+     ((uint32_t *)((char *)(zendlongptr)+(sizeof(zend_long)-sizeof(uint32_t))))
+   #define ZendLongPtr2OciPhpsizedIntPtr(zendlongptr) \
+     ((oci_phpsized_int *)((char *)(zendlongptr)+(sizeof(zend_long)-sizeof(oci_phpsized_int))))
+ #endif
+ 
  /* {{{ php_oci_statement_create()
   Create statemend handle and allocate necessary resources */
  php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char *query, int query_len)
***************
*** 1106,1112 ****
  		/* This convetrsion is done on purpose (ext/oci8 uses LVAL as a temporary value) */
  		if (Z_LVAL_P(zv) == 0)
  			ZVAL_FALSE(zv);
! 		else if (Z_LVAL_P(zv) == 1)
  			ZVAL_TRUE(zv);
  	}
  
--- 1116,1122 ----
  		/* This convetrsion is done on purpose (ext/oci8 uses LVAL as a temporary value) */
  		if (Z_LVAL_P(zv) == 0)
  			ZVAL_FALSE(zv);
! 		else
  			ZVAL_TRUE(zv);
  	}
  
***************
*** 1185,1191 ****
  				return 1;
  			}
  			convert_to_long(param);
! 			bind_data = (oci_phpsized_int *)&Z_LVAL_P(param);
  			value_sz = sizeof(oci_phpsized_int);
  			mode = OCI_DEFAULT;
  			break;
--- 1195,1201 ----
  				return 1;
  			}
  			convert_to_long(param);
! 			bind_data = ZendLongPtr2OciPhpsizedIntPtr(&Z_LVAL_P(param));
  			value_sz = sizeof(oci_phpsized_int);
  			mode = OCI_DEFAULT;
  			break;
***************
*** 1250,1256 ****
  				return 1;
  			}
  
! 			value_sz = sizeof(zend_long);
  
  			mode = OCI_DEFAULT;
  			break;
--- 1260,1267 ----
  				return 1;
  			}
  
! 			bind_data = ZendLongPtr2UInt32Ptr (bind_data);	/* relevant on bigendian 64-bit platforms */
! 			value_sz = sizeof(int32_t);
  
  			mode = OCI_DEFAULT;
  			break;
***************
*** 1502,1509 ****
  			efree(p);
  		}
  
! 		/* XXX we assume that zend-zval len has 4 bytes */
! 		*alenpp = (ub4*) &Z_STRLEN_P(val);
  		*bufpp = Z_STRVAL_P(val);
  		*piecep = OCI_ONE_PIECE;
  		*rcodepp = &phpbind->retcode;
--- 1513,1520 ----
  			efree(p);
  		}
  
! 		/* in 64-bit, length is 8 bytes long, Oracle expects 4 bytes */
! 		*alenpp = ZendLongPtr2UInt32Ptr(&Z_STRLEN_P(val));
  		*bufpp = Z_STRVAL_P(val);
  		*piecep = OCI_ONE_PIECE;
  		*rcodepp = &phpbind->retcode;
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 15:01:29 2024 UTC