diff options
author | Remi Collet <remi@remirepo.net> | 2019-07-24 09:06:45 +0200 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2019-07-24 09:06:45 +0200 |
commit | 2c6f8751f322f04232d744d8f177bb4f97a5673b (patch) | |
tree | cf27eeafe3b9bac50e8d291436cb680553c63dfe | |
parent | 7163c800fcb30d9d050ede10e05306573e2e4c6e (diff) |
add patch for 7.4.0beta1 from https://github.com/microsoft/msphpsql/pull/1013
-rw-r--r-- | 1013.patch | 25 | ||||
-rw-r--r-- | php-sqlsrv.spec | 14 | ||||
-rw-r--r-- | shared.patch | 27 |
3 files changed, 33 insertions, 33 deletions
diff --git a/1013.patch b/1013.patch new file mode 100644 index 0000000..581ef14 --- /dev/null +++ b/1013.patch @@ -0,0 +1,25 @@ +From c0ee075892d8d38f0f47981f8e4db214a4a86d1a Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Wed, 24 Jul 2019 07:30:26 +0200 +Subject: [PATCH] fix for 7.4.0beta1 + +--- + source/shared/core_stream.cpp | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/source/shared/core_stream.cpp b/source/shared/core_stream.cpp +index d822d4a85..559498b8e 100644 +--- a/source/shared/core_stream.cpp ++++ b/source/shared/core_stream.cpp +@@ -44,7 +44,11 @@ int sqlsrv_stream_close( _Inout_ php_stream* stream, int /*close_handle*/ TSRMLS + // read from a sqlsrv stream into the buffer provided by Zend. The parameters for binary vs. char are + // set when sqlsrv_get_field is called by the user specifying which field type they want. + ++#if PHP_VERSION_ID < 70400 + size_t sqlsrv_stream_read( _Inout_ php_stream* stream, _Out_writes_bytes_(count) char* buf, _Inout_ size_t count TSRMLS_DC ) ++#else ++ssize_t sqlsrv_stream_read( _Inout_ php_stream* stream, _Out_writes_bytes_(count) char* buf, _Inout_ size_t count TSRMLS_DC ) ++#endif + { + SQLLEN read = 0; + SQLSMALLINT c_type = SQL_C_CHAR; diff --git a/php-sqlsrv.spec b/php-sqlsrv.spec index b23adb0..c8368b5 100644 --- a/php-sqlsrv.spec +++ b/php-sqlsrv.spec @@ -27,7 +27,7 @@ Name: %{?scl_prefix}php-sqlsrv Summary: Microsoft Drivers for PHP for SQL Server %global tarversion 5.6.1 Version: 5.6.1 -Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: MIT URL: https://github.com/Microsoft/msphpsql @@ -38,9 +38,7 @@ Source1: http://pecl.php.net/get/pdo_%{extname}-%{tarversion}.tgz Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz %endif -# workaround for 7.4.0alpha1 -# TODO remove when alpha2 -Patch0: shared.patch +Patch0: https://patch-diff.githubusercontent.com/raw/microsoft/msphpsql/pull/1013.patch BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?dtsprefix}gcc-c++ @@ -130,9 +128,9 @@ mv %{gh_project}-%{gh_commit}/LICENSE . cd NTS cd %{extname} -%patch0 -p0 +%patch0 -p2 cd ../pdo_%{extname} -%patch0 -p0 +%patch0 -p2 cd .. # Sanity check, really often broken @@ -287,6 +285,10 @@ fi %changelog +* Wed Jul 24 2019 Remi Collet <remi@remirepo.net> - 5.6.1-4 +- add patch for 7.4.0beta1 from + https://github.com/microsoft/msphpsql/pull/1013 + * Fri Jun 14 2019 Remi Collet <remi@remirepo.net> - 5.6.1-3 - add workaround for 7.4.0alpha1 diff --git a/shared.patch b/shared.patch deleted file mode 100644 index 9988ea6..0000000 --- a/shared.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff -up shared/core_sqlsrv.h.old shared/core_sqlsrv.h ---- shared/core_sqlsrv.h.old 2019-06-14 14:35:28.803295513 +0200 -+++ shared/core_sqlsrv.h 2019-06-14 14:37:01.829830963 +0200 -@@ -2402,7 +2402,11 @@ namespace core { - - inline void sqlsrv_add_index_zval( _Inout_ sqlsrv_context& ctx, _Inout_ zval* array, _In_ zend_ulong index, _In_ zval* value TSRMLS_DC) - { -+#ifdef add_index_zval -+ int zr = add_index_zval( array, index, value ); -+#else - int zr = ::add_index_zval( array, index, value ); -+#endif - CHECK_ZEND_ERROR( zr, ctx, SQLSRV_ERROR_ZEND_HASH ) { - throw CoreException(); - } -@@ -2410,7 +2414,11 @@ namespace core { - - inline void sqlsrv_add_next_index_zval( _Inout_ sqlsrv_context& ctx, _Inout_ zval* array, _In_ zval* value TSRMLS_DC) - { -+#ifdef add_next_index_zval -+ int zr = add_next_index_zval( array, value ); -+#else - int zr = ::add_next_index_zval( array, value ); -+#endif - CHECK_ZEND_ERROR( zr, ctx, SQLSRV_ERROR_ZEND_HASH ) { - throw CoreException(); - } |