diff options
| -rw-r--r-- | PHPINFO | 2 | ||||
| -rw-r--r-- | REFLECTION | 154 | ||||
| -rw-r--r-- | php-sqlsrv.spec | 64 | ||||
| -rw-r--r-- | php85.patch | 57 |
4 files changed, 162 insertions, 115 deletions
@@ -2,7 +2,7 @@ sqlsrv sqlsrv support => enabled -ExtensionVer => 5.12.0-beta1 +ExtensionVer => 5.13.0-beta1 Directive => Local Value => Master Value sqlsrv.WarningsReturnAsErrors => On => On @@ -1,4 +1,4 @@ -Extension [ <persistent> extension #72 sqlsrv version 5.12.0-beta1 ] { +Extension [ <persistent> extension #117 sqlsrv version 5.13.0-beta1 ] { - INI { Entry [ sqlsrv.WarningsReturnAsErrors <ALL> ] @@ -19,82 +19,82 @@ Extension [ <persistent> extension #72 sqlsrv version 5.12.0-beta1 ] { } - Constants [76] { - Constant [ int SQLSRV_ERR_ERRORS ] { 0 } - Constant [ int SQLSRV_ERR_WARNINGS ] { 1 } - Constant [ int SQLSRV_ERR_ALL ] { 2 } - Constant [ int SQLSRV_LOG_SYSTEM_OFF ] { 0 } - Constant [ int SQLSRV_LOG_SYSTEM_INIT ] { 1 } - Constant [ int SQLSRV_LOG_SYSTEM_CONN ] { 2 } - Constant [ int SQLSRV_LOG_SYSTEM_STMT ] { 4 } - Constant [ int SQLSRV_LOG_SYSTEM_UTIL ] { 8 } - Constant [ int SQLSRV_LOG_SYSTEM_ALL ] { -1 } - Constant [ int SQLSRV_LOG_SEVERITY_ERROR ] { 1 } - Constant [ int SQLSRV_LOG_SEVERITY_WARNING ] { 2 } - Constant [ int SQLSRV_LOG_SEVERITY_NOTICE ] { 4 } - Constant [ int SQLSRV_LOG_SEVERITY_ALL ] { -1 } - Constant [ int SQLSRV_FETCH_NUMERIC ] { 1 } - Constant [ int SQLSRV_FETCH_ASSOC ] { 2 } - Constant [ int SQLSRV_FETCH_BOTH ] { 3 } - Constant [ int SQLSRV_PHPTYPE_NULL ] { 1 } - Constant [ int SQLSRV_PHPTYPE_INT ] { 2 } - Constant [ int SQLSRV_PHPTYPE_FLOAT ] { 3 } - Constant [ int SQLSRV_PHPTYPE_DATETIME ] { 5 } - Constant [ int SQLSRV_PHPTYPE_TABLE ] { 7 } - Constant [ string SQLSRV_ENC_BINARY ] { binary } - Constant [ string SQLSRV_ENC_CHAR ] { char } - Constant [ int SQLSRV_NULLABLE_NO ] { 0 } - Constant [ int SQLSRV_NULLABLE_YES ] { 1 } - Constant [ int SQLSRV_NULLABLE_UNKNOWN ] { 2 } - Constant [ int SQLSRV_SQLTYPE_BIGINT ] { -5 } - Constant [ int SQLSRV_SQLTYPE_BIT ] { -7 } - Constant [ int SQLSRV_SQLTYPE_DATETIME ] { 25177693 } - Constant [ int SQLSRV_SQLTYPE_FLOAT ] { 6 } - Constant [ int SQLSRV_SQLTYPE_IMAGE ] { -4 } - Constant [ int SQLSRV_SQLTYPE_INT ] { 4 } - Constant [ int SQLSRV_SQLTYPE_MONEY ] { 33564163 } - Constant [ int SQLSRV_SQLTYPE_NTEXT ] { -10 } - Constant [ int SQLSRV_SQLTYPE_TEXT ] { -1 } - Constant [ int SQLSRV_SQLTYPE_REAL ] { 7 } - Constant [ int SQLSRV_SQLTYPE_SMALLDATETIME ] { 8285 } - Constant [ int SQLSRV_SQLTYPE_SMALLINT ] { 5 } - Constant [ int SQLSRV_SQLTYPE_SMALLMONEY ] { 33559555 } - Constant [ int SQLSRV_SQLTYPE_TIMESTAMP ] { 4606 } - Constant [ int SQLSRV_SQLTYPE_TINYINT ] { -6 } - Constant [ int SQLSRV_SQLTYPE_UDT ] { -151 } - Constant [ int SQLSRV_SQLTYPE_TABLE ] { -153 } - Constant [ int SQLSRV_SQLTYPE_UNIQUEIDENTIFIER ] { -11 } - Constant [ int SQLSRV_SQLTYPE_XML ] { -152 } - Constant [ int SQLSRV_SQLTYPE_DATE ] { 5211 } - Constant [ int SQLSRV_SQLTYPE_TIME ] { 58728806 } - Constant [ int SQLSRV_SQLTYPE_DATETIMEOFFSET ] { 58738021 } - Constant [ int SQLSRV_SQLTYPE_DATETIME2 ] { 58734173 } - Constant [ int SQLSRV_SQLTYPE_DECIMAL ] { 3 } - Constant [ int SQLSRV_SQLTYPE_NUMERIC ] { 2 } - Constant [ int SQLSRV_SQLTYPE_CHAR ] { 1 } - Constant [ int SQLSRV_SQLTYPE_NCHAR ] { -8 } - Constant [ int SQLSRV_SQLTYPE_VARCHAR ] { 12 } - Constant [ int SQLSRV_SQLTYPE_NVARCHAR ] { -9 } - Constant [ int SQLSRV_SQLTYPE_BINARY ] { -2 } - Constant [ int SQLSRV_SQLTYPE_VARBINARY ] { -3 } - Constant [ int SQLSRV_PARAM_IN ] { 1 } - Constant [ int SQLSRV_PARAM_OUT ] { 4 } - Constant [ int SQLSRV_PARAM_INOUT ] { 2 } - Constant [ int SQLSRV_TXN_READ_UNCOMMITTED ] { 1 } - Constant [ int SQLSRV_TXN_READ_COMMITTED ] { 2 } - Constant [ int SQLSRV_TXN_REPEATABLE_READ ] { 4 } - Constant [ int SQLSRV_TXN_SERIALIZABLE ] { 8 } - Constant [ int SQLSRV_TXN_SNAPSHOT ] { 32 } - Constant [ int SQLSRV_SCROLL_NEXT ] { 1 } - Constant [ int SQLSRV_SCROLL_PRIOR ] { 4 } - Constant [ int SQLSRV_SCROLL_FIRST ] { 2 } - Constant [ int SQLSRV_SCROLL_LAST ] { 3 } - Constant [ int SQLSRV_SCROLL_ABSOLUTE ] { 5 } - Constant [ int SQLSRV_SCROLL_RELATIVE ] { 6 } - Constant [ string SQLSRV_CURSOR_FORWARD ] { forward } - Constant [ string SQLSRV_CURSOR_STATIC ] { static } - Constant [ string SQLSRV_CURSOR_DYNAMIC ] { dynamic } - Constant [ string SQLSRV_CURSOR_KEYSET ] { keyset } - Constant [ string SQLSRV_CURSOR_CLIENT_BUFFERED ] { buffered } + Constant [ <persistent> int SQLSRV_ERR_ERRORS ] { 0 } + Constant [ <persistent> int SQLSRV_ERR_WARNINGS ] { 1 } + Constant [ <persistent> int SQLSRV_ERR_ALL ] { 2 } + Constant [ <persistent> int SQLSRV_LOG_SYSTEM_OFF ] { 0 } + Constant [ <persistent> int SQLSRV_LOG_SYSTEM_INIT ] { 1 } + Constant [ <persistent> int SQLSRV_LOG_SYSTEM_CONN ] { 2 } + Constant [ <persistent> int SQLSRV_LOG_SYSTEM_STMT ] { 4 } + Constant [ <persistent> int SQLSRV_LOG_SYSTEM_UTIL ] { 8 } + Constant [ <persistent> int SQLSRV_LOG_SYSTEM_ALL ] { -1 } + Constant [ <persistent> int SQLSRV_LOG_SEVERITY_ERROR ] { 1 } + Constant [ <persistent> int SQLSRV_LOG_SEVERITY_WARNING ] { 2 } + Constant [ <persistent> int SQLSRV_LOG_SEVERITY_NOTICE ] { 4 } + Constant [ <persistent> int SQLSRV_LOG_SEVERITY_ALL ] { -1 } + Constant [ <persistent> int SQLSRV_FETCH_NUMERIC ] { 1 } + Constant [ <persistent> int SQLSRV_FETCH_ASSOC ] { 2 } + Constant [ <persistent> int SQLSRV_FETCH_BOTH ] { 3 } + Constant [ <persistent> int SQLSRV_PHPTYPE_NULL ] { 1 } + Constant [ <persistent> int SQLSRV_PHPTYPE_INT ] { 2 } + Constant [ <persistent> int SQLSRV_PHPTYPE_FLOAT ] { 3 } + Constant [ <persistent> int SQLSRV_PHPTYPE_DATETIME ] { 5 } + Constant [ <persistent> int SQLSRV_PHPTYPE_TABLE ] { 7 } + Constant [ <persistent> string SQLSRV_ENC_BINARY ] { binary } + Constant [ <persistent> string SQLSRV_ENC_CHAR ] { char } + Constant [ <persistent> int SQLSRV_NULLABLE_NO ] { 0 } + Constant [ <persistent> int SQLSRV_NULLABLE_YES ] { 1 } + Constant [ <persistent> int SQLSRV_NULLABLE_UNKNOWN ] { 2 } + Constant [ <persistent> int SQLSRV_SQLTYPE_BIGINT ] { -5 } + Constant [ <persistent> int SQLSRV_SQLTYPE_BIT ] { -7 } + Constant [ <persistent> int SQLSRV_SQLTYPE_DATETIME ] { 25177693 } + Constant [ <persistent> int SQLSRV_SQLTYPE_FLOAT ] { 6 } + Constant [ <persistent> int SQLSRV_SQLTYPE_IMAGE ] { -4 } + Constant [ <persistent> int SQLSRV_SQLTYPE_INT ] { 4 } + Constant [ <persistent> int SQLSRV_SQLTYPE_MONEY ] { 33564163 } + Constant [ <persistent> int SQLSRV_SQLTYPE_NTEXT ] { -10 } + Constant [ <persistent> int SQLSRV_SQLTYPE_TEXT ] { -1 } + Constant [ <persistent> int SQLSRV_SQLTYPE_REAL ] { 7 } + Constant [ <persistent> int SQLSRV_SQLTYPE_SMALLDATETIME ] { 8285 } + Constant [ <persistent> int SQLSRV_SQLTYPE_SMALLINT ] { 5 } + Constant [ <persistent> int SQLSRV_SQLTYPE_SMALLMONEY ] { 33559555 } + Constant [ <persistent> int SQLSRV_SQLTYPE_TIMESTAMP ] { 4606 } + Constant [ <persistent> int SQLSRV_SQLTYPE_TINYINT ] { -6 } + Constant [ <persistent> int SQLSRV_SQLTYPE_UDT ] { -151 } + Constant [ <persistent> int SQLSRV_SQLTYPE_TABLE ] { -153 } + Constant [ <persistent> int SQLSRV_SQLTYPE_UNIQUEIDENTIFIER ] { -11 } + Constant [ <persistent> int SQLSRV_SQLTYPE_XML ] { -152 } + Constant [ <persistent> int SQLSRV_SQLTYPE_DATE ] { 5211 } + Constant [ <persistent> int SQLSRV_SQLTYPE_TIME ] { 58728806 } + Constant [ <persistent> int SQLSRV_SQLTYPE_DATETIMEOFFSET ] { 58738021 } + Constant [ <persistent> int SQLSRV_SQLTYPE_DATETIME2 ] { 58734173 } + Constant [ <persistent> int SQLSRV_SQLTYPE_DECIMAL ] { 3 } + Constant [ <persistent> int SQLSRV_SQLTYPE_NUMERIC ] { 2 } + Constant [ <persistent> int SQLSRV_SQLTYPE_CHAR ] { 1 } + Constant [ <persistent> int SQLSRV_SQLTYPE_NCHAR ] { -8 } + Constant [ <persistent> int SQLSRV_SQLTYPE_VARCHAR ] { 12 } + Constant [ <persistent> int SQLSRV_SQLTYPE_NVARCHAR ] { -9 } + Constant [ <persistent> int SQLSRV_SQLTYPE_BINARY ] { -2 } + Constant [ <persistent> int SQLSRV_SQLTYPE_VARBINARY ] { -3 } + Constant [ <persistent> int SQLSRV_PARAM_IN ] { 1 } + Constant [ <persistent> int SQLSRV_PARAM_OUT ] { 4 } + Constant [ <persistent> int SQLSRV_PARAM_INOUT ] { 2 } + Constant [ <persistent> int SQLSRV_TXN_READ_UNCOMMITTED ] { 1 } + Constant [ <persistent> int SQLSRV_TXN_READ_COMMITTED ] { 2 } + Constant [ <persistent> int SQLSRV_TXN_REPEATABLE_READ ] { 4 } + Constant [ <persistent> int SQLSRV_TXN_SERIALIZABLE ] { 8 } + Constant [ <persistent> int SQLSRV_TXN_SNAPSHOT ] { 32 } + Constant [ <persistent> int SQLSRV_SCROLL_NEXT ] { 1 } + Constant [ <persistent> int SQLSRV_SCROLL_PRIOR ] { 4 } + Constant [ <persistent> int SQLSRV_SCROLL_FIRST ] { 2 } + Constant [ <persistent> int SQLSRV_SCROLL_LAST ] { 3 } + Constant [ <persistent> int SQLSRV_SCROLL_ABSOLUTE ] { 5 } + Constant [ <persistent> int SQLSRV_SCROLL_RELATIVE ] { 6 } + Constant [ <persistent> string SQLSRV_CURSOR_FORWARD ] { forward } + Constant [ <persistent> string SQLSRV_CURSOR_STATIC ] { static } + Constant [ <persistent> string SQLSRV_CURSOR_DYNAMIC ] { dynamic } + Constant [ <persistent> string SQLSRV_CURSOR_KEYSET ] { keyset } + Constant [ <persistent> string SQLSRV_CURSOR_CLIENT_BUFFERED ] { buffered } } - Functions { diff --git a/php-sqlsrv.spec b/php-sqlsrv.spec index 1e0a158..33da0c7 100644 --- a/php-sqlsrv.spec +++ b/php-sqlsrv.spec @@ -1,8 +1,8 @@ # remirepo spec file for php-sqlsrv # -# Copyright (c) 2016-2023 Remi Collet -# License: CC-BY-SA-4.0 -# http://creativecommons.org/licenses/by-sa/4.0/ +# SPDX-FileCopyrightText: Copyright 2016-2026 Remi Collet +# SPDX-License-Identifier: CECILL-2.1 +# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt # # Please, preserve the changelog entries # @@ -23,9 +23,9 @@ Name: %{?scl_prefix}php-sqlsrv Summary: Microsoft Drivers for PHP for SQL Server -%global tarversion 5.12.0beta1 -Version: 5.12.0~beta1 -Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +%global tarversion 5.13.0beta1 +Version: 5.13.0~beta1 +Release: 1%{?dist} License: MIT URL: https://github.com/Microsoft/msphpsql @@ -36,21 +36,21 @@ 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 +# See https://github.com/microsoft/msphpsql/pull/1543 +Patch0: php85.patch + BuildRequires: make BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?dtsprefix}gcc-c++ BuildRequires: libtool-ltdl-devel -BuildRequires: %{?scl_prefix}php-devel >= 8.1 +BuildRequires: %{?scl_prefix}php-devel >= 8.2 BuildRequires: %{?scl_prefix}php-pdo BuildRequires: %{?scl_prefix}php-pear BuildRequires: unixODBC-devel >= 2.3.1 -%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +# grep 'ODBC_DRIVER drivers' shared/core_conn.cpp +# { ODBC_DRIVER::VER_17, ODBC_DRIVER::VER_18, ODBC_DRIVER::VER_13 } BuildRequires:(msodbcsql18 >= %{msodbcsqlver18} or msodbcsql17 >= %{msodbcsqlver17}) Requires: (msodbcsql18%{?_isa} >= %{msodbcsqlver18} or msodbcsql17%{?_isa} >= %{msodbcsqlver17}) -%else -BuildRequires: msodbcsql17 >= %{msodbcsqlver17} -Requires: msodbcsql17%{?_isa} >= %{msodbcsqlver17} -%endif # ABI check Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} @@ -108,7 +108,7 @@ cd NTS cd %{extname} : no patch cd ../pdo_%{extname} -: no patch +%patch -P0 -p3 cd .. # Sanity check, really often broken @@ -147,6 +147,10 @@ EOF cp -pr NTS ZTS %endif +: ====== Known driver versions ====== +grep 'ODBC_DRIVER drivers' NTS/%{extname}/shared/core_conn.cpp | \ + sed -e 's/ODBC_DRIVER/\n\tODBC_DRIVER/g' + %build %{?dtsenable} @@ -224,31 +228,7 @@ install -D -m 644 %{ininame} %{buildroot}%{php_ztsinidir}/%{ininame} %endif -%if 0%{?fedora} < 24 && 0%{?rhel} < 8 -# when pear installed alone, after us -%triggerin -- %{?scl_prefix}php-pear -if [ -x %{__pecl} ] ; then - %{pecl_install} %{pecl_xmldir}/php-pecl-%{extname}.xml >/dev/null || : - %{pecl_install} %{pecl_xmldir}/php-pecl-pdo-%{extname}.xml >/dev/null || : -fi - -# posttrans as pear can be installed after us -%posttrans -if [ -x %{__pecl} ] ; then - %{pecl_install} %{pecl_xmldir}/php-pecl-%{extname}.xml >/dev/null || : - %{pecl_install} %{pecl_xmldir}/php-pecl-pdo-%{extname}.xml >/dev/null || : -fi - -%postun -if [ $1 -eq 0 -a -x %{__pecl} ] ; then - %{pecl_uninstall} %{extname} >/dev/null || : - %{pecl_uninstall} pdo_%{extname} >/dev/null || : -fi -%endif - - %files -%{!?_licensedir:%global license %%doc} %license LICENSE %{pecl_xmldir}/php-pecl-%{extname}.xml %{pecl_xmldir}/php-pecl-pdo-%{extname}.xml @@ -265,6 +245,16 @@ fi %changelog +* Sat Jan 31 2026 Remi Collet <remi@remirepo.net> - 5.12.0~beta1-1 +- update to 5.13.0beta1 + +* Sat Jan 17 2026 Remi Collet <remi@remirepo.net> - 5.12.0-2 +- add patch for PHP 8.5 +- re-license spec file to CECILL-2.1 + +* Thu Feb 1 2024 Remi Collet <remi@remirepo.net> - 5.12.0-1 +- update to 5.12.0 + * Mon Dec 11 2023 Remi Collet <remi@remirepo.net> - 5.12.0~beta1-1 - update to 5.12.0beta1 diff --git a/php85.patch b/php85.patch new file mode 100644 index 0000000..1f58929 --- /dev/null +++ b/php85.patch @@ -0,0 +1,57 @@ +From bad3c5e0058aa519d9e389739997dd94a8e697ed Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Samuel=20=C5=A0tancl?= <samuel@archte.ch> +Date: Sun, 19 Oct 2025 23:11:41 +0200 +Subject: [PATCH] PHP 8.5 (compilation) support + +Since https://github.com/php/php-src/pull/17741, dbh->error_mode is +stored as uint8_t. We cast the value to pdo_error_mode for the +assignment to work. + +Since https://github.com/php/php-src/pull/17742, query_stmt_zval has +been replaced by query_stmt_obj. The diff in the linked PR shows +the new destructor usage. We follow that same usage in this commit. +--- + source/pdo_sqlsrv/pdo_dbh.cpp | 4 ++-- + source/pdo_sqlsrv/php_pdo_sqlsrv_int.h | 7 ++++++- + 2 files changed, 8 insertions(+), 3 deletions(-) + +diff --git a/source/pdo_sqlsrv/pdo_dbh.cpp b/source/pdo_sqlsrv/pdo_dbh.cpp +index 8f39e72fd..075134e05 100644 +--- a/source/pdo_sqlsrv/pdo_dbh.cpp ++++ b/source/pdo_sqlsrv/pdo_dbh.cpp +@@ -625,7 +625,7 @@ int pdo_sqlsrv_db_handle_factory( _Inout_ pdo_dbh_t *dbh, _In_opt_ zval *driver_ + PDO_LOG_DBH_ENTRY; + + hash_auto_ptr pdo_conn_options_ht; +- pdo_error_mode prev_err_mode = dbh->error_mode; ++ pdo_error_mode prev_err_mode = static_cast<pdo_error_mode>( dbh->error_mode ); + + // must be done in all cases so that even a failed connection can query the + // object for errors. +@@ -1604,7 +1604,7 @@ zend_string * pdo_sqlsrv_dbh_last_id(_Inout_ pdo_dbh_t *dbh, _In_ const zend_str + PDO_LOG_DBH_ENTRY; + + // turn off any error handling for last_id +- pdo_error_mode prev_err_mode = dbh->error_mode; ++ pdo_error_mode prev_err_mode = static_cast<pdo_error_mode>( dbh->error_mode ); + dbh->error_mode = PDO_ERRMODE_SILENT; + + sqlsrv_malloc_auto_ptr<sqlsrv_stmt> driver_stmt; +diff --git a/source/pdo_sqlsrv/php_pdo_sqlsrv_int.h b/source/pdo_sqlsrv/php_pdo_sqlsrv_int.h +index a0a6dd89b..4ce153261 100644 +--- a/source/pdo_sqlsrv/php_pdo_sqlsrv_int.h ++++ b/source/pdo_sqlsrv/php_pdo_sqlsrv_int.h +@@ -301,7 +301,12 @@ inline void pdo_reset_dbh_error( _Inout_ pdo_dbh_t* dbh ) + // release the last statement from the dbh so that error handling won't have a statement passed to it + if( dbh->query_stmt ) { + dbh->query_stmt = NULL; +- zval_ptr_dtor( &dbh->query_stmt_zval ); ++ #if PHP_VERSION_ID < 80500 ++ zval_ptr_dtor( &dbh->query_stmt_zval ); ++ #else ++ OBJ_RELEASE( dbh->query_stmt_obj ); ++ dbh->query_stmt_obj = NULL; ++ #endif + } + + // if the driver isn't valid, just return (PDO calls close sometimes more than once?) |
