Skip to content

Commit 5f76f83

Browse files
authored
5.8.1 hotfix release (#1126)
1 parent 7458a6c commit 5f76f83

File tree

77 files changed

+4516
-884
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+4516
-884
lines changed

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,30 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55

6+
## 5.8.1 - 2020-04-15
7+
Updated PECL release packages. Here is the list of updates:
8+
9+
### Fixed
10+
- Pull Request [#1094](https://github.com/microsoft/msphpsql/pull/1094) - Fixed default locale issues in Alpine Linux
11+
- Pull Request [#1095](https://github.com/microsoft/msphpsql/pull/1095) - Removed unnecessary data structure to support Client-Side Cursors feature in Alpine Linux
12+
- Pull Request [#1095](https://github.com/microsoft/msphpsql/pull/1107) - Fixed logging issues when both drivers are enabled in Alpine Linux
13+
14+
### Limitations
15+
- No support for inout / output params when using sql_variant type
16+
- No support for inout / output params when formatting decimal values
17+
- In Linux and macOS, setlocale() only takes effect if it is invoked before the first connection. Attempting to set the locale after connecting will not work
18+
- Always Encrypted requires [MS ODBC Driver 17+](https://docs.microsoft.com/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server)
19+
- Only Windows Certificate Store and Azure Key Vault are supported. Custom Keystores are not yet supported
20+
- Issue [#716](https://github.com/Microsoft/msphpsql/issues/716) - With Always Encrypted enabled, named parameters in subqueries are not supported
21+
- Issue [#1050](https://github.com/microsoft/msphpsql/issues/1050) - With Always Encrypted enabled, insertion requires the column list for any tables with identity columns
22+
- [Always Encrypted limitations](https://docs.microsoft.com/sql/connect/php/using-always-encrypted-php-drivers#limitations-of-the-php-drivers-when-using-always-encrypted)
23+
24+
### Known Issues
25+
- Connection pooling on Linux or macOS is not recommended with [unixODBC](http://www.unixodbc.org/) < 2.3.7
26+
- When pooling is enabled in Linux or macOS
27+
- unixODBC <= 2.3.4 (Linux and macOS) might not return proper diagnostic information, such as error messages, warnings and informative messages
28+
- due to this unixODBC bug, fetch large data (such as xml, binary) as streams as a workaround. See the examples [here](https://github.com/Microsoft/msphpsql/wiki/Features#pooling)
29+
630
## 5.8.0 - 2020-01-31
731
Updated PECL release packages. Here is the list of updates:
832

Linux-mac-install.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Linux and macOS Installation Tutorial for the Microsoft Drivers for PHP for SQL Server
2-
The following instructions assume a clean environment and show how to install PHP 7.x, the Microsoft ODBC driver, the Apache web server, and the Microsoft Drivers for PHP for SQL Server on Ubuntu 16.04, 18.04, and 19.10, RedHat 7 and 8, Debian 8, 9, and 10, Suse 12 and 15, Alpine 3.11 (experimental), and macOS 10.13, 10.14, and 10.15. These instructions advise installing the drivers using PECL, but you can also download the prebuilt binaries from the [Microsoft Drivers for PHP for SQL Server](https://github.com/Microsoft/msphpsql/releases) Github project page and install them following the instructions in [Loading the Microsoft Drivers for PHP for SQL Server](https://docs.microsoft.com/sql/connect/php/loading-the-php-sql-driver). For an explanation of extension loading and why we do not add the extensions to php.ini, see the section on [loading the drivers](https://docs.microsoft.com/sql/connect/php/loading-the-php-sql-driver#loading-the-driver-at-php-startup).
2+
The following instructions assume a clean environment and show how to install PHP 7.x, the Microsoft ODBC driver, the Apache web server, and the Microsoft Drivers for PHP for SQL Server on Ubuntu 16.04, 18.04, and 19.10, RedHat 7 and 8, Debian 8, 9, and 10, Suse 12 and 15, Alpine 3.11, and macOS 10.13, 10.14, and 10.15. These instructions advise installing the drivers using PECL, but you can also download the prebuilt binaries from the [Microsoft Drivers for PHP for SQL Server](https://github.com/Microsoft/msphpsql/releases) Github project page and install them following the instructions in [Loading the Microsoft Drivers for PHP for SQL Server](https://docs.microsoft.com/sql/connect/php/loading-the-php-sql-driver). For an explanation of extension loading and why we do not add the extensions to php.ini, see the section on [loading the drivers](https://docs.microsoft.com/sql/connect/php/loading-the-php-sql-driver#loading-the-driver-at-php-startup).
33

4-
These instructions install PHP 7.4 by default. Note that some supported Linux distros default to PHP 7.1 or earlier, which is not supported for the latest version of the PHP drivers for SQL Server -- please see the notes at the beginning of each section to install PHP 7.2 or 7.3 instead.
4+
These instructions install PHP 7.4 by default using `pecl install`. You may need to run `pecl channel-update pecl.php.net` first. Note that some supported Linux distros default to PHP 7.1 or earlier, which is not supported for the latest version of the PHP drivers for SQL Server -- please see the notes at the beginning of each section to install PHP 7.2 or 7.3 instead.
55

66
Also included are instructions for installing the PHP FastCGI Process Manager, PHP-FPM, on Ubuntu. This is needed if using the nginx web server instead of Apache.
77

@@ -293,13 +293,10 @@ To test your installation, see [Testing your installation](#testing-your-install
293293
## Installing the drivers on Alpine 3.11
294294

295295
> [!NOTE]
296-
> Alpine support is experimental.
297-
298-
> [!NOTE]
299-
> The default version of PHP is 7.3. Alternate versions of PHP are not available from other repositories for Alpine 3.11. You can instead compile PHP from source.
296+
> The default version of PHP is 7.3. Alternate versions of PHP may be available from other repositories for Alpine 3.11. You can instead compile PHP from source.
300297
301298
### Step 1. Install PHP
302-
PHP packages for Alpine are found in the `edge/community` repository. Add the following line to `/etc/apt/repositories`, replacing `<mirror>` with the URL of an Alpine repository mirror:
299+
PHP packages for Alpine can be found in the `edge/community` repository. Please check [Enable Community Repository](https://wiki.alpinelinux.org/wiki/Enable_Community_Repository) on their WIKI page. Add the following line to `/etc/apt/repositories`, replacing `<mirror>` with the URL of an Alpine repository mirror:
303300
```
304301
http://<mirror>/alpine/edge/community
305302
```
@@ -320,10 +317,7 @@ sudo su
320317
echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/10_pdo_sqlsrv.ini
321318
echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/00_sqlsrv.ini
322319
```
323-
You may need to define a locale:
324-
```
325-
export LC_ALL=C
326-
```
320+
327321
### Step 4. Install Apache and configure driver loading
328322
```
329323
sudo apk add php7-apache2 apache2
@@ -391,7 +385,7 @@ To test your installation, see [Testing your installation](#testing-your-install
391385

392386
## Testing Your Installation
393387

394-
To test this sample script, create a file called testsql.php in your system's document root. This is `/var/www/html/` on Ubuntu, Debian, and Redhat, `/srv/www/htdocs` on SUSE, `/var/www/localhost/htdocs` on Alpine, or `/usr/local/var/www` on macOS. Copy the following script to it, replacing the server, database, username, and password as appropriate. On Alpine 3.11, you may also need to specify the **CharacterSet** as 'UTF-8' in the `$connectionOptions` array.
388+
To test this sample script, create a file called testsql.php in your system's document root. This is `/var/www/html/` on Ubuntu, Debian, and Redhat, `/srv/www/htdocs` on SUSE, `/var/www/localhost/htdocs` on Alpine, or `/usr/local/var/www` on macOS. Copy the following script to it, replacing the server, database, username, and password as appropriate.
395389
```
396390
<?php
397391
$serverName = "yourServername";

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Azure Pipelines | AppVeyor (Windows) | Travis CI (Linux) | Co
2525
[az-image]: https://dev.azure.com/sqlclientdrivers-ci/msphpsql/_apis/build/status/Microsoft.msphpsql?branchName=dev
2626
[Coverage Coveralls]: https://coveralls.io/repos/github/microsoft/msphpsql/badge.svg?branch=dev
2727
[coveralls-site]: https://coveralls.io/github/microsoft/msphpsql?branch=dev
28-
[Coverage Codecov]: https://codecov.io/gh/microsoft/msphpsql/branch/master/graph/badge.svg
28+
[Coverage Codecov]: https://codecov.io/gh/microsoft/msphpsql/branch/dev/graph/badge.svg
2929
[codecov-site]: https://codecov.io/gh/microsoft/msphpsql
3030

3131
## Get Started

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ install:
8383
}
8484
- echo Downloading MSODBCSQL 17
8585
# AppVeyor build works are x64 VMs and 32-bit ODBC driver cannot be installed on it
86-
- ps: (new-object net.webclient).DownloadFile('https://download.microsoft.com/download/E/6/B/E6BFDC7A-5BCD-4C51-9912-635646DA801E/en-US/msodbcsql_17.4.2.1_x64.msi', 'c:\projects\msodbcsql_17.4.2.1_x64.msi')
87-
- cmd /c start /wait msiexec /i "c:\projects\msodbcsql_17.4.2.1_x64.msi" /q IACCEPTMSODBCSQLLICENSETERMS=YES ADDLOCAL=ALL
86+
- ps: (new-object net.webclient).DownloadFile('https://download.microsoft.com/download/E/6/B/E6BFDC7A-5BCD-4C51-9912-635646DA801E/en-US/17.5.2.1/x64/msodbcsql.msi', 'c:\projects\msodbcsql.msi')
87+
- cmd /c start /wait msiexec /i "c:\projects\msodbcsql.msi" /q IACCEPTMSODBCSQLLICENSETERMS=YES ADDLOCAL=ALL
8888
- echo Checking the version of MSODBCSQL
8989
- reg query "HKLM\SOFTWARE\ODBC\odbcinst.ini\ODBC Driver 17 for SQL Server"
9090
- dir %WINDIR%\System32\msodbcsql*.dll

azure-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ trigger:
1616
jobs:
1717
- job: macOS
1818
pool:
19-
vmImage: 'macOS-10.13'
19+
vmImage: 'macOS-10.14'
2020
steps:
2121
- checkout: self
2222
clean: true
@@ -105,7 +105,7 @@ jobs:
105105
docker pull mcr.microsoft.com/mssql/server:2017-latest
106106
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=$(pwd)' -p 1433:1433 -h $(host) --name=$(host) -d mcr.microsoft.com/mssql/server:2017-latest
107107
docker ps -a
108-
sleep 5
108+
sleep 10
109109
docker exec -t $(host) /opt/mssql-tools/bin/sqlcmd -S $(server) -U $(uid) -P $(pwd) -Q 'select @@Version'
110110
displayName: 'Run SQL Server for Linux'
111111

codecov.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
codecov:
2+
require_ci_to_pass: yes
3+
max_report_age: off
4+
5+
coverage:
6+
precision: 2
7+
round: down
8+
range: "70...100"
9+
10+
parsers:
11+
gcov:
12+
branch_detection:
13+
conditional: yes
14+
loop: yes
15+
method: no
16+
macro: no
17+
18+
comment:
19+
layout: "reach,diff,flags,tree"
20+
behavior: default
21+
require_changes: no

source/pdo_sqlsrv/config.m4

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,15 @@ if test "$PHP_PDO_SQLSRV" != "no"; then
7878

7979
HOST_OS_ARCH=`uname`
8080
if test "${HOST_OS_ARCH}" = "Darwin"; then
81-
PDO_SQLSRV_SHARED_LIBADD="$PDO_SQLSRV_SHARED_LIBADD -Wl,-bind_at_load"
82-
MACOSX_DEPLOYMENT_TARGET=`sw_vers -productVersion`
81+
PDO_SQLSRV_SHARED_LIBADD="$PDO_SQLSRV_SHARED_LIBADD -Wl,-bind_at_load"
82+
MACOSX_DEPLOYMENT_TARGET=`sw_vers -productVersion`
8383
else
84-
PDO_SQLSRV_SHARED_LIBADD="$PDO_SQLSRV_SHARED_LIBADD -Wl,-z,now"
84+
PDO_SQLSRV_SHARED_LIBADD="$PDO_SQLSRV_SHARED_LIBADD -Wl,-z,now"
85+
IS_ALPINE_1=`uname -a | cut -f 4 -d ' ' | cut -f 2 -d '-'`
86+
IS_ALPINE_2=`cat /etc/os-release | grep ID | grep alpine | cut -f 2 -d '='`
87+
if test "${IS_ALPINE_1}" = "Alpine" || test "${IS_ALPINE_2}" = "alpine"; then
88+
AC_DEFINE(__MUSL__, 1, [ ])
89+
fi
8590
fi
8691

8792
PHP_REQUIRE_CXX()

source/pdo_sqlsrv/pdo_dbh.cpp

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -489,26 +489,13 @@ struct pdo_dbh_methods pdo_sqlsrv_dbh_methods = {
489489

490490

491491
// log a function entry point
492-
#ifndef _WIN32
493492
#define PDO_LOG_DBH_ENTRY \
494493
{ \
495494
pdo_sqlsrv_dbh* driver_dbh = reinterpret_cast<pdo_sqlsrv_dbh*>( dbh->driver_data ); \
496-
driver_dbh->set_func( __FUNCTION__ ); \
497-
int length = strlen( __FUNCTION__ ) + strlen( ": entering" ); \
498-
char func[length+1]; \
499-
memset(func, '\0', length+1); \
500-
strcpy_s( func, sizeof( __FUNCTION__ ), __FUNCTION__ ); \
501-
strcat_s( func, length+1, ": entering" ); \
502-
LOG( SEV_NOTICE, func ); \
495+
if (driver_dbh != NULL) driver_dbh->set_func(__FUNCTION__); \
496+
core_sqlsrv_register_severity_checker(pdo_severity_check); \
497+
LOG(SEV_NOTICE, "%1!s!: entering", __FUNCTION__); \
503498
}
504-
#else
505-
#define PDO_LOG_DBH_ENTRY \
506-
{ \
507-
pdo_sqlsrv_dbh* driver_dbh = reinterpret_cast<pdo_sqlsrv_dbh*>( dbh->driver_data ); \
508-
driver_dbh->set_func( __FUNCTION__ ); \
509-
LOG( SEV_NOTICE, __FUNCTION__ ## ": entering" ); \
510-
}
511-
#endif
512499

513500
// constructor for the internal object for connections
514501
pdo_sqlsrv_dbh::pdo_sqlsrv_dbh( _In_ SQLHANDLE h, _In_ error_callback e, _In_ void* driver TSRMLS_DC ) :
@@ -547,7 +534,7 @@ pdo_sqlsrv_dbh::pdo_sqlsrv_dbh( _In_ SQLHANDLE h, _In_ error_callback e, _In_ vo
547534
// 0 for failure, 1 for success.
548535
int pdo_sqlsrv_db_handle_factory( _Inout_ pdo_dbh_t *dbh, _In_opt_ zval *driver_options TSRMLS_DC)
549536
{
550-
LOG( SEV_NOTICE, "pdo_sqlsrv_db_handle_factory: entering" );
537+
PDO_LOG_DBH_ENTRY;
551538

552539
hash_auto_ptr pdo_conn_options_ht;
553540
pdo_error_mode prev_err_mode = dbh->error_mode;

source/pdo_sqlsrv/pdo_init.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,11 @@ PHP_MINIT_FUNCTION(pdo_sqlsrv)
128128
ZEND_TSRMLS_CACHE_UPDATE();
129129
#endif
130130

131-
core_sqlsrv_register_logger( pdo_sqlsrv_log );
131+
core_sqlsrv_register_severity_checker(pdo_severity_check);
132132

133133
REGISTER_INI_ENTRIES();
134134

135-
LOG( SEV_NOTICE, "pdo_sqlsrv: entering minit" );
135+
PDO_LOG_NOTICE("pdo_sqlsrv: entering minit");
136136

137137
// initialize list of pdo errors
138138
g_pdo_errors_ht = reinterpret_cast<HashTable*>( pemalloc( sizeof( HashTable ), 1 ));
@@ -200,7 +200,7 @@ PHP_MSHUTDOWN_FUNCTION(pdo_sqlsrv)
200200
}
201201
catch( ... ) {
202202

203-
LOG( SEV_NOTICE, "Unknown exception caught in PHP_MSHUTDOWN_FUNCTION(pdo_sqlsrv)" );
203+
PDO_LOG_NOTICE("Unknown exception caught in PHP_MSHUTDOWN_FUNCTION(pdo_sqlsrv)");
204204
return FAILURE;
205205
}
206206

@@ -225,18 +225,18 @@ PHP_RINIT_FUNCTION(pdo_sqlsrv)
225225
int set_locale = PDO_SQLSRV_G(set_locale_info);
226226
if (set_locale == 2) {
227227
setlocale(LC_ALL, "");
228-
LOG(SEV_NOTICE, "pdo_sqlsrv: setlocale LC_ALL");
228+
PDO_LOG_NOTICE("pdo_sqlsrv: setlocale LC_ALL");
229229
}
230230
else if (set_locale == 1) {
231231
setlocale(LC_CTYPE, "");
232-
LOG(SEV_NOTICE, "pdo_sqlsrv: setlocale LC_CTYPE");
232+
PDO_LOG_NOTICE("pdo_sqlsrv: setlocale LC_CTYPE");
233233
}
234234
else {
235-
LOG(SEV_NOTICE, "pdo_sqlsrv: setlocale NONE");
235+
PDO_LOG_NOTICE("pdo_sqlsrv: setlocale NONE");
236236
}
237237
#endif
238238

239-
LOG( SEV_NOTICE, "pdo_sqlsrv: entering rinit" );
239+
PDO_LOG_NOTICE("pdo_sqlsrv: entering rinit");
240240

241241
return SUCCESS;
242242
}
@@ -250,7 +250,7 @@ PHP_RSHUTDOWN_FUNCTION(pdo_sqlsrv)
250250
SQLSRV_UNUSED( module_number );
251251
SQLSRV_UNUSED( type );
252252

253-
LOG( SEV_NOTICE, "pdo_sqlsrv: entering rshutdown" );
253+
PDO_LOG_NOTICE("pdo_sqlsrv: entering rshutdown");
254254

255255
return SUCCESS;
256256
}

source/pdo_sqlsrv/pdo_stmt.cpp

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -351,26 +351,13 @@ void stmt_option_fetch_datetime:: operator()( _Inout_ sqlsrv_stmt* stmt, stmt_op
351351
}
352352

353353
// log a function entry point
354-
#ifndef _WIN32
355354
#define PDO_LOG_STMT_ENTRY \
356355
{ \
357356
pdo_sqlsrv_stmt* driver_stmt = reinterpret_cast<pdo_sqlsrv_stmt*>( stmt->driver_data ); \
358-
driver_stmt->set_func( __FUNCTION__ ); \
359-
int length = strlen( __FUNCTION__ ) + strlen( ": entering" ); \
360-
char func[length+1]; \
361-
memset(func, '\0', length+1); \
362-
strcpy_s( func, sizeof( __FUNCTION__ ), __FUNCTION__ ); \
363-
strcat_s( func, length+1, ": entering" ); \
364-
LOG( SEV_NOTICE, func ); \
357+
if (driver_stmt != NULL) driver_stmt->set_func( __FUNCTION__ ); \
358+
core_sqlsrv_register_severity_checker(pdo_severity_check); \
359+
LOG(SEV_NOTICE, "%1!s!: entering", __FUNCTION__); \
365360
}
366-
#else
367-
#define PDO_LOG_STMT_ENTRY \
368-
{ \
369-
pdo_sqlsrv_stmt* driver_stmt = reinterpret_cast<pdo_sqlsrv_stmt*>( stmt->driver_data ); \
370-
driver_stmt->set_func( __FUNCTION__ ); \
371-
LOG( SEV_NOTICE, __FUNCTION__ ## ": entering" ); \
372-
}
373-
#endif
374361

375362
// PDO SQLSRV statement destructor
376363
pdo_sqlsrv_stmt::~pdo_sqlsrv_stmt( void )

0 commit comments

Comments
 (0)