diff options
| author | Remi Collet <remi@remirepo.net> | 2019-06-14 14:44:48 +0200 | 
|---|---|---|
| committer | Remi Collet <remi@remirepo.net> | 2019-06-14 14:44:48 +0200 | 
| commit | 7163c800fcb30d9d050ede10e05306573e2e4c6e (patch) | |
| tree | 437f259e6b3098f9b43d8fb937b7b4fb3ef7eec6 | |
| parent | 89f5c7bd0e942f18bab8ca1ecacc3b45013b1cec (diff) | |
add workaround for 7.4.0alpha1
| -rw-r--r-- | php-sqlsrv.spec | 15 | ||||
| -rw-r--r-- | shared.patch | 54 | 
2 files changed, 38 insertions, 31 deletions
| diff --git a/php-sqlsrv.spec b/php-sqlsrv.spec index d4bbbd3..b23adb0 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:       2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release:       3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}  License:       MIT  URL:           https://github.com/Microsoft/msphpsql @@ -38,6 +38,10 @@ 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 +  BuildRequires: %{?dtsprefix}gcc  BuildRequires: %{?dtsprefix}gcc-c++  BuildRequires: %{?scl_prefix}php-devel > 7.1 @@ -125,6 +129,12 @@ mv %{gh_project}-%{gh_commit}/LICENSE .  %endif  cd NTS +cd %{extname} +%patch0 -p0 +cd ../pdo_%{extname} +%patch0 -p0 +cd .. +  # Sanity check, really often broken  extmaj=$(sed -n '/#define SQLVERSION_MAJOR/{s/.*MAJOR //;s/\r//;p}' sqlsrv/shared/version.h)  extmin=$(sed -n '/#define SQLVERSION_MINOR/{s/.*MINOR //;s/\r//;p}' sqlsrv/shared/version.h) @@ -277,6 +287,9 @@ fi  %changelog +* Fri Jun 14 2019 Remi Collet <remi@remirepo.net> - 5.6.1-3 +- add workaround for 7.4.0alpha1 +  * Wed Apr 10 2019 Remi Collet <remi@remirepo.net> - 5.6.1-2  - switch from msodbcsql to msodbcsql17 diff --git a/shared.patch b/shared.patch index 4090070..9988ea6 100644 --- a/shared.patch +++ b/shared.patch @@ -1,33 +1,27 @@ -diff --git a/source/shared/core_sqlsrv.h b/source/shared/core_sqlsrv.h -index 39e53b1..2d6a357 100644 ---- a/source/shared/core_sqlsrv.h -+++ b/source/shared/core_sqlsrv.h -@@ -2381,10 +2381,7 @@ namespace core { +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_array_init( _Inout_ sqlsrv_context& ctx, _Out_ zval* new_array TSRMLS_DC)  +     inline void sqlsrv_add_index_zval( _Inout_ sqlsrv_context& ctx, _Inout_ zval* array, _In_ zend_ulong index, _In_ zval* value TSRMLS_DC)        { --        int zr = ::array_init(new_array); --        CHECK_ZEND_ERROR( zr, ctx, SQLSRV_ERROR_ZEND_HASH ) { --            throw CoreException(); --        } -+        array_init(new_array); -     } ++#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_php_stream_from_zval_no_verify( _Inout_ sqlsrv_context& ctx, _Outref_result_maybenull_ php_stream*& stream, _In_opt_ zval* stream_z TSRMLS_DC ) -diff --git a/source/shared/core_util.cpp b/source/shared/core_util.cpp -index c537f76..1f6af42 100644 ---- a/source/shared/core_util.cpp -+++ b/source/shared/core_util.cpp -@@ -353,10 +353,10 @@ void die( _In_opt_ const char* msg, ... ) -     DWORD rc = FormatMessage( FORMAT_MESSAGE_FROM_STRING, msg, 0, 0, last_err_msg, sizeof( last_err_msg ), &format_args ); -     va_end( format_args ); -     if( rc == 0 ) { --        php_error( E_ERROR, reinterpret_cast<const char*>( INTERNAL_FORMAT_ERROR )); -+        php_error( E_ERROR, "%s", reinterpret_cast<const char*>( INTERNAL_FORMAT_ERROR )); -     } -  --    php_error( E_ERROR, last_err_msg ); -+    php_error( E_ERROR, "%s", last_err_msg ); - } -  - namespace { +     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(); +         } | 
