Skip to content

5.8.1 hotfix release #1126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 231 commits into from
Apr 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
231 commits
Select commit Hold shift + click to select a range
16c41e0
Merge pull request #1 from Microsoft/dev
david-puglielli Apr 1, 2017
10ff344
Fixed the potential error reported by Prefast code analysis
yitam Jun 5, 2018
3585bf5
Merge pull request #788 from yitam/fillLastID
yitam Jun 5, 2018
44d1bb3
Use SQLSRV_ASSERT for checking NULL ptrs
yitam Jun 6, 2018
5a66610
Merge pull request #789 from yitam/moreAsserts
yitam Jun 6, 2018
f6e450b
For these AKV tests check env despite not AE connected
yitam Jun 7, 2018
90c6443
Merge pull request #791 from yitam/fixODBC13tests
yitam Jun 7, 2018
071e897
Added the driver option to run functional tests
yitam Jun 8, 2018
ea6381c
Merge pull request #793 from yitam/addDriverOption
yitam Jun 9, 2018
17fa64a
Fixed connection pooling tests for more than one ODBC drivers
yitam Jun 11, 2018
d554492
added driver option to pdo isPooled.php
yitam Jun 11, 2018
53e4da4
Merge pull request #796 from yitam/connPooltests
yitam Jun 11, 2018
81ff085
Removed win32 ifdefs re connection resiliency (#802)
yitam Jun 21, 2018
eeea787
Set the driver argument for getDSN to null by default (#798)
yitam Jun 26, 2018
ae0b95b
Changed int to SQLLEN to avoid infinite loop (#806)
yitam Jun 27, 2018
197489a
Version 5.3.0 (#803)
yitam Jun 27, 2018
aef3830
Modified AE fetch phptypes test to insert only one row at a time and…
yitam Jun 27, 2018
5aa9be7
Streamlined two very similar large column name tests (#807)
yitam Jul 3, 2018
bbfe6df
Updates to change log and readme (#811)
yitam Jul 5, 2018
af9f77e
Fixed connection resiliency tests for Unix, updated AppVeyor for ODBC…
david-puglielli Jul 11, 2018
b2f7b20
Fixed expected output
david-puglielli Jul 11, 2018
82be814
Fixed output and skipifs
david-puglielli Jul 11, 2018
0495513
Fixed skipifs and output
david-puglielli Jul 11, 2018
c1d5793
Fixed driver name
david-puglielli Jul 12, 2018
79be282
Updated installation instructions and sample script (#813)
yitam Jul 12, 2018
a18a59b
build output to debug appveyor failure
david-puglielli Jul 12, 2018
cb78977
removed debug output
david-puglielli Jul 13, 2018
9479d03
Merge pull request #814 from david-puglielli/odbc-172-update
david-puglielli Jul 13, 2018
35631cf
Streamlined two very similar large column name tests (#815)
yitam Jul 13, 2018
706c526
Changelog updated
david-puglielli Jul 18, 2018
7b720e1
changelog updated, test skipif changed to run on unix platforms
david-puglielli Jul 19, 2018
eb80227
Fixed skipif typo
david-puglielli Jul 19, 2018
6cd7dbc
Fixed typo in skipif for pdo
david-puglielli Jul 19, 2018
820bc31
Fixed some output for Travis
david-puglielli Jul 19, 2018
0f66c48
Moved error checking inside pdo connres tests
david-puglielli Jul 19, 2018
faf5ce8
Merge pull request #816 from david-puglielli/changelog-update-5.3.0
david-puglielli Jul 19, 2018
495183e
Added links back to changelog
david-puglielli Jul 19, 2018
6f0f4b7
Merge pull request #817 from david-puglielli/changelog-update-5.3.0
david-puglielli Jul 19, 2018
96efbdb
Fixed output for sqlsrv connres tests
david-puglielli Jul 19, 2018
825b429
Fixed output
david-puglielli Jul 19, 2018
6ee8c44
Fixed output again
david-puglielli Jul 19, 2018
bd34cab
Merge pull request #818 from david-puglielli/connres-test-fixes
david-puglielli Jul 20, 2018
36c45b6
Merge branch 'dev' of https://github.com/david-puglielli/msphpsql int…
david-puglielli Jul 20, 2018
f71c52d
Fixed skipifs for connres
david-puglielli Jul 23, 2018
efde09f
Tweaked per review comments
david-puglielli Jul 23, 2018
b6d815b
Changes made to source and tests to support PHP 7.3 (#822)
yitam Jul 26, 2018
7357a16
One more fix
david-puglielli Jul 26, 2018
c533ffa
Merge pull request #821 from david-puglielli/skipif-fix
david-puglielli Jul 27, 2018
adf86f1
Initialising strings with nulls
david-puglielli Jul 31, 2018
a664a5f
Removed some spaces
david-puglielli Jul 31, 2018
41a7caf
Made array index spacing consistent
david-puglielli Aug 1, 2018
026c5d1
Merge pull request #825 from david-puglielli/string-initialisation-nulls
david-puglielli Aug 1, 2018
29f4ad7
Fix for compilation problem
david-puglielli Aug 1, 2018
d699680
Merge pull request #826 from david-puglielli/string-initialisation-nulls
david-puglielli Aug 1, 2018
0b15997
Fix for compilation problem again
david-puglielli Aug 1, 2018
ba9579b
Merge pull request #827 from david-puglielli/string-initialisation-nulls
david-puglielli Aug 1, 2018
909d1fa
Before freeing stmt in destructor check if dbh driver data is NULL (…
yitam Aug 10, 2018
28a7860
Added driver to the skipif conditions (#831)
yitam Aug 17, 2018
4452a4d
Used git clone instead to download source from a branch of a tag (#832)
yitam Aug 17, 2018
6a688b3
Modified the error handling to make it more flexible (#833)
yitam Aug 20, 2018
c209b72
Enabled Spectre Mitigations (#836)
yitam Aug 24, 2018
084ab72
Incorporated changes in PR 634 to pdo_sqlsrv (#834)
yitam Aug 28, 2018
ae1b413
Modified README re user's suggestion (#841)
yitam Sep 4, 2018
e513806
Adding supporting for Azure AD access token (#837)
yitam Sep 6, 2018
7521f09
Feature request - new PDO_STMT_OPTION_FETCHES_DATETIME_TYPE flag for …
yitam Sep 17, 2018
902a032
Feature request - add ReturnDatesAsStrings option to statement level …
yitam Sep 17, 2018
88dfea3
Updated version 5.4.0-preview (#846)
yitam Sep 18, 2018
0ba11a2
Fixed sqlsrv datetime tests to connect with ColumnEncryption variable…
yitam Sep 21, 2018
432901d
Change log for 5.4.0-preview (#850)
yitam Sep 24, 2018
32732c8
Clear AKV data after setting the connection attribute or when excepti…
yitam Sep 26, 2018
a4eb46c
Change readme links to https
BackEndTea Oct 1, 2018
3ce8eb8
Change readme links to https
BackEndTea Oct 1, 2018
b523306
Save meta data for the fetched result set (#855)
yitam Oct 5, 2018
8e0baba
Merge remote-tracking branch 'upstream/dev' into dev
david-puglielli Oct 6, 2018
a6b1cd5
Added Mojave to macOS instructions (#862)
yitam Oct 11, 2018
36fd97e
Fixed the broken links of Appveyor status badge (#863)
yitam Oct 12, 2018
18094a6
Feature request 415 for sqlsrv (#861)
yitam Oct 12, 2018
b3072a9
Modified how to send stream data using SQLPutData and SQLParamData (#…
yitam Oct 19, 2018
2a9398f
Updated instructions to include Ubuntu 18.10 (#869)
yitam Oct 24, 2018
f4ad2ae
Feature request 415 for pdo_sqlsrv (#873)
yitam Nov 2, 2018
3679b48
Skipped some tests when running against Azure (#874)
yitam Nov 8, 2018
69e8208
Modified config files to add the compiler flag, /Qspectre (#878)
yitam Nov 13, 2018
d51f6db
Merge the commit from master re survey image link (#880)
yitam Nov 14, 2018
78911f4
Fixed the flaws of decimal tests and added more debugging (#879)
yitam Nov 16, 2018
b2a1950
Merge remote-tracking branch 'upstream/dev' into dev
david-puglielli Nov 19, 2018
8e6c181
Changed sample code to adhere to PSR standard (#887)
yitam Nov 23, 2018
76c595f
Decimal places for money types only (#886)
yitam Nov 28, 2018
ae29f73
Version update for 5.5.0-preview (#889)
yitam Nov 29, 2018
cbdc01c
Fixed the error in the pdo decimal test (#890)
yitam Nov 29, 2018
9195f84
Removed warning messages while compiling extensions (#892)
yitam Dec 3, 2018
2f92a26
Improve performance of Unicode conversions (#891)
david-puglielli Dec 4, 2018
ac8ea11
Update sqlsrv_statement_format_money_scales.phpt
yitam Dec 4, 2018
94c5a67
Change log 5.5.0-preview (#895)
yitam Dec 6, 2018
fb55bb7
updated docs for php 7.3
david-puglielli Dec 6, 2018
2124176
Fixed broken links
david-puglielli Dec 7, 2018
a8b5615
Added back Ubuntu 18.10 ODBC instruction
david-puglielli Dec 7, 2018
5d2a653
Merge pull request #899 from david-puglielli/php-7.3-update
david-puglielli Dec 7, 2018
e30ebfa
Drop tests related to fake passwords (#905)
yitam Dec 11, 2018
d4f840f
Initialize output param buffer when allocating extra space (#907)
yitam Dec 17, 2018
4efb54e
Enable compiling extensions statically into PHP (#904)
jjeising Dec 20, 2018
5801edd
Dropped dbname variable and set QUOTED_IDENTIFIER to ON (#911)
yitam Jan 4, 2019
25d6812
Skipped the non-applicables tests against Azure Data Warehouse (#913)
yitam Jan 7, 2019
9a37258
Support for Managed Identity for Azure resources (#875)
yitam Jan 12, 2019
d6c8cc2
Changed version 5.6.0 (#918)
yitam Jan 16, 2019
04f531d
Initialize hasLoss before passing into Convert function (#919)
yitam Jan 21, 2019
d9b6e05
Added new tests for setting client buffer size related to issue 228 (…
yitam Jan 25, 2019
9e49a17
Fixed load order issue in sqlsrv
david-puglielli Feb 5, 2019
d69015c
Merge pull request #925 from david-puglielli/shared-compilation-load-…
david-puglielli Feb 6, 2019
3b9739a
Added source indexing for symbols (#922)
yitam Feb 6, 2019
a39be12
Modified linux and mac instructions for 5.6.0 RTW (#926)
david-puglielli Feb 8, 2019
c5989d8
Change log 5.6.0 (#921)
yitam Feb 11, 2019
5b2b750
add Language option on connect
gdegoulet Feb 13, 2019
3758133
Merge remote-tracking branch 'upstream/master' into dev
david-puglielli Feb 22, 2019
b1b7a40
Updated AppVeyor to download ODBC driver 17.3 (#941)
yitam Feb 27, 2019
12d01c9
Issue 937 - fixed ASSERT and added new tests (#940)
yitam Feb 28, 2019
27d5f64
Changed travis to pull mcr.microsoft.com/mssql/server:2017-latest ins…
yitam Feb 28, 2019
d60748e
Modified money tests to test the accuracies of floats (#944)
yitam Mar 5, 2019
7309fb9
Fixed the returned values for PDOStatement::getColumnMeta (#946)
yitam Mar 8, 2019
1332e3b
Onboarding to Azure Pipelines (#949)
yitam Mar 13, 2019
840ebc2
Fixed the error in Issue 570 (#952)
yitam Mar 14, 2019
bedc430
Added a new status badge on readme (#953)
yitam Mar 14, 2019
df8d7da
Added new tests for issue 569 (#951)
yitam Mar 14, 2019
15f61bd
Fix issue 955 - errors building sqlsrv alone (#956)
yitam Mar 18, 2019
7f56eab
Modified test_largeData for Linux CI (#954)
yitam Mar 18, 2019
a6cee77
Issue 937 - fixed ASSERT and added new tests (#940)
yitam Feb 28, 2019
763913d
Fixed the returned values for PDOStatement::getColumnMeta (#946)
yitam Mar 8, 2019
2c8f8ca
Fix issue 955 - errors building sqlsrv alone (#956)
yitam Mar 18, 2019
3c71213
5.6.1 hotfix
yitam Mar 18, 2019
db488ca
Updated change log
yitam Mar 19, 2019
f76944d
Merge tag 'v5.6.1' into HEAD
yitam Mar 28, 2019
6325284
Merge pull request #930 from gdegoulet/dev
david-puglielli Mar 28, 2019
a99e7c3
Tests modified for language option for SQL Azure (#963)
yitam Mar 29, 2019
7d389e0
Update azure-pipelines.yml for Azure Pipelines [skip ci] (#964)
yitam Mar 29, 2019
1ba1f21
Added more checks for error conditions (#965)
yitam Apr 1, 2019
a8a0146
Removed forward cursor condition
david-puglielli Apr 2, 2019
4b6b650
Added row and column count checks
david-puglielli Apr 5, 2019
486ab9f
Revert "Update azure-pipelines.yml for Azure Pipelines [skip ci] (#96…
yitam Apr 9, 2019
8ba932b
Add new pdo_sqlsrv tests for utf8 encoding errors (#966)
yitam Apr 9, 2019
1e4f014
Modified to check if qualified for AE connections (#967)
yitam Apr 9, 2019
e2a6ece
Fixed test and error message
david-puglielli Apr 11, 2019
847493b
Minor fixes
david-puglielli Apr 11, 2019
cf03cbb
Test fixes
david-puglielli Apr 11, 2019
62738ba
Addressed review comments
david-puglielli Apr 13, 2019
b025110
Fixed test failure
david-puglielli Apr 13, 2019
368d088
Made Azure AD tests more robust (#973)
yitam Apr 15, 2019
ad1d990
Addressed review comments
david-puglielli Apr 15, 2019
fd24a97
Issue 970: use quotes for variables (#971)
yitam Apr 15, 2019
a3456cd
Merge pull request #972 from david-puglielli/redundant-apis
david-puglielli Apr 15, 2019
c1b54aa
Added batch query test
david-puglielli Apr 19, 2019
13fe59d
Fixed 32 bit test failure
david-puglielli Apr 19, 2019
ea17b72
Addressed review comments
david-puglielli Apr 22, 2019
63c6bd3
Formatting changes
david-puglielli Apr 23, 2019
ee3c85a
Used different skipif conditions for these two tests that require AE …
yitam Apr 24, 2019
0f93bbe
Simplified insert logic
david-puglielli Apr 24, 2019
45c1b85
Merge pull request #974 from david-puglielli/batch-query-test
david-puglielli Apr 24, 2019
a8e1138
Modified get column meta method to reference saved metadata (#978)
yitam Apr 24, 2019
e8d1389
Revert "Used different skipif conditions for these two tests that req…
yitam Apr 25, 2019
c5b6540
Fixed failing tests (#981)
yitam Apr 26, 2019
9e90a42
Data Classification sensitivity metadata retrieval (#979)
yitam May 1, 2019
e02db62
Added more pdo tests to verify different error conditions (#984)
yitam May 1, 2019
ffd9849
Fixed memory issues with data classification (#985)
yitam May 8, 2019
6ad5c1e
Added connection string flag
david-puglielli May 9, 2019
aeeba5c
Removed unix skipif
david-puglielli May 9, 2019
51c45a2
Fixed test output
david-puglielli May 10, 2019
e031c1a
Fixed pdo test
david-puglielli May 10, 2019
9d9acc3
Changed flag name
david-puglielli May 10, 2019
ca6d6cb
Fixed test output
david-puglielli May 10, 2019
3b6b076
Updated links and versions (#987) (#988)
yitam May 10, 2019
209c4fd
Fixed test output (again)
david-puglielli May 10, 2019
50ba324
Fixed test output (again)
david-puglielli May 10, 2019
39c57af
Fixed test output (again)
david-puglielli May 10, 2019
6975967
Replaced expected test output altogether
david-puglielli May 11, 2019
06ff53d
Fixed locale issue
david-puglielli May 11, 2019
1aa8dea
Corrected formatting
david-puglielli May 13, 2019
60f20bd
Replaced EXPECTF with EXPECT
david-puglielli May 13, 2019
e152459
Merge pull request #990 from david-puglielli/issue-909-fix
david-puglielli May 13, 2019
f369ce6
Merge pull request #989 from david-puglielli/issue-432-fix
david-puglielli May 13, 2019
7e0bf91
Fixed two failing tests (#991)
yitam May 13, 2019
ac59cfd
Redesigned some tests based on recent test results (#992)
yitam May 17, 2019
9122c15
Modified pipelines to connect using sqlcmd inside of the container in…
yitam May 17, 2019
68d7903
Added batch query
david-puglielli May 22, 2019
7c585c7
Added batch query test for pdo (#997)
david-puglielli May 22, 2019
ec3a7a4
Added a new test and modify a non LOB sqlsrv test (#1000)
yitam Jun 7, 2019
a092523
Two index zval functions are macros in php 7.4 (#1001)
yitam Jun 7, 2019
5c42829
Replaced uint with size_t (#1004)
yitam Jun 18, 2019
d4387a9
Check compiler version for php 74 (#1005)
yitam Jun 18, 2019
c0cf381
Fixed tests that failed in php 7.4 (#1006)
yitam Jun 28, 2019
b839ede
Improve data caching with datetime objects (#1008)
yitam Jul 15, 2019
1a2b493
Fixed for issues found by Semmle (#1011)
david-puglielli Jul 23, 2019
65daa7a
Addressed various issues with PHP 7.4 beta1 (#1015)
yitam Jul 29, 2019
31a7748
Updated dockerfile to use UB 18.04 and PHP 73 (#1016)
yitam Jul 29, 2019
c1bc593
Added survey results (#1017)
yitam Jul 29, 2019
bae6930
Updated ODBC driver 17.4 (#1019)
yitam Aug 8, 2019
aa03782
Modified output.py to take a new argument and travis yml to use inclu…
yitam Aug 15, 2019
eb8ecbf
Used constants in memory stress tests for easier configuration (#1022)
yitam Aug 20, 2019
f5c0b63
Removed KSP related scripts and files (#1030)
yitam Sep 3, 2019
2792ece
Updated version to 5.7.0 preview (#1029)
yitam Sep 3, 2019
fdf029d
Change log for 5.7.0 (#1028)
yitam Sep 4, 2019
2557520
Modified how drivers handle query timeout settings (#1037)
yitam Sep 18, 2019
6a7136d
Feature request: support extended string types (#1043)
yitam Oct 23, 2019
aec733b
Added the required file to ansi tests (#1047)
yitam Oct 24, 2019
0513287
Always Encrypted v2 support (#1045)
david-puglielli Oct 31, 2019
e30752f
Modified pdo tests to work with column encryption (#1051)
yitam Nov 6, 2019
b77bfa8
Saved php types with metadata when fetching (#1049)
yitam Nov 6, 2019
006157a
Updated survey charts for Nov 2019 (#1057)
yitam Nov 14, 2019
75e421c
Updated all CIs (#1058)
yitam Nov 19, 2019
b41135a
Change log 5.7.1 preview (#1060)
yitam Nov 25, 2019
48b0488
Fix AKV keyword test for AE v2 behaviour (#1061)
david-puglielli Nov 25, 2019
efd04e4
Update linux mac instructions for php 7.4 (#1062)
yitam Dec 3, 2019
afa217f
Updated appveyor yml to build 7.3 and 7.4 (#1065)
yitam Dec 5, 2019
eeec2f8
Fixes suggested by Semmle (#1068)
david-puglielli Dec 18, 2019
23f92ef
Added configurable options for setting locales (#1069)
yitam Dec 19, 2019
f64df04
Fixed the skipif wordings and styles (#1070)
yitam Jan 6, 2020
9c9c04a
Modified locale tests to work in both linux and mac (#1074)
yitam Jan 15, 2020
8d6ef75
Include sql_variant type for buffered queries (#1080)
yitam Jan 22, 2020
ba05b24
Updated versions and year (#1082)
yitam Jan 23, 2020
6e312d1
Change log for version 5.8.0 (#1083)
yitam Jan 29, 2020
e7b5a88
5.8.0 rtw docs (#1086)
david-puglielli Jan 31, 2020
71b9d40
Ae v2 extended tests (#1077)
david-puglielli Feb 3, 2020
e90fd2c
Added codecov yml file (#1090)
yitam Feb 5, 2020
5455b4d
Conn res fix (#1091)
david-puglielli Feb 6, 2020
9534f7b
Made some tests more robusts across platforms (#1092)
yitam Feb 11, 2020
af3097d
Removed the use of a conversion matrix (#1095)
yitam Feb 19, 2020
cd64173
Xplat alpine changes (#1094)
david-puglielli Feb 20, 2020
8bb6cef
Revised a few existing tests that are flawed (#1103)
yitam Mar 2, 2020
fb335c0
Modified some BVT tests to be configurable (#1106)
yitam Mar 16, 2020
7214e8d
Set logger for driver API (#1107)
yitam Mar 25, 2020
e8fef22
Updated skipifs and modified tests with HGS enabled servers (#1111)
yitam Apr 3, 2020
3d2f631
Change log 5.8.1 (#1116)
yitam Apr 7, 2020
55e1715
Updated instructions for Alpine Linux (#1117)
yitam Apr 8, 2020
2ec391f
5.8.1 hotfix release
yitam Apr 15, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,30 @@ All notable changes to this project will be documented in this file.

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

## 5.8.1 - 2020-04-15
Updated PECL release packages. Here is the list of updates:

### Fixed
- Pull Request [#1094](https://github.com/microsoft/msphpsql/pull/1094) - Fixed default locale issues in Alpine Linux
- Pull Request [#1095](https://github.com/microsoft/msphpsql/pull/1095) - Removed unnecessary data structure to support Client-Side Cursors feature in Alpine Linux
- Pull Request [#1095](https://github.com/microsoft/msphpsql/pull/1107) - Fixed logging issues when both drivers are enabled in Alpine Linux

### Limitations
- No support for inout / output params when using sql_variant type
- No support for inout / output params when formatting decimal values
- 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
- Always Encrypted requires [MS ODBC Driver 17+](https://docs.microsoft.com/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server)
- Only Windows Certificate Store and Azure Key Vault are supported. Custom Keystores are not yet supported
- Issue [#716](https://github.com/Microsoft/msphpsql/issues/716) - With Always Encrypted enabled, named parameters in subqueries are not supported
- Issue [#1050](https://github.com/microsoft/msphpsql/issues/1050) - With Always Encrypted enabled, insertion requires the column list for any tables with identity columns
- [Always Encrypted limitations](https://docs.microsoft.com/sql/connect/php/using-always-encrypted-php-drivers#limitations-of-the-php-drivers-when-using-always-encrypted)

### Known Issues
- Connection pooling on Linux or macOS is not recommended with [unixODBC](http://www.unixodbc.org/) < 2.3.7
- When pooling is enabled in Linux or macOS
- unixODBC <= 2.3.4 (Linux and macOS) might not return proper diagnostic information, such as error messages, warnings and informative messages
- 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)

## 5.8.0 - 2020-01-31
Updated PECL release packages. Here is the list of updates:

Expand Down
18 changes: 6 additions & 12 deletions Linux-mac-install.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Linux and macOS Installation Tutorial for the Microsoft Drivers for PHP for SQL Server
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).
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).

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.
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.

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.

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

> [!NOTE]
> Alpine support is experimental.

> [!NOTE]
> 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.
> 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.

### Step 1. Install PHP
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:
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:
```
http://<mirror>/alpine/edge/community
```
Expand All @@ -320,10 +317,7 @@ sudo su
echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/10_pdo_sqlsrv.ini
echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/00_sqlsrv.ini
```
You may need to define a locale:
```
export LC_ALL=C
```

### Step 4. Install Apache and configure driver loading
```
sudo apk add php7-apache2 apache2
Expand Down Expand Up @@ -391,7 +385,7 @@ To test your installation, see [Testing your installation](#testing-your-install

## Testing Your Installation

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.
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.
```
<?php
$serverName = "yourServername";
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Azure Pipelines | AppVeyor (Windows) | Travis CI (Linux) | Co
[az-image]: https://dev.azure.com/sqlclientdrivers-ci/msphpsql/_apis/build/status/Microsoft.msphpsql?branchName=dev
[Coverage Coveralls]: https://coveralls.io/repos/github/microsoft/msphpsql/badge.svg?branch=dev
[coveralls-site]: https://coveralls.io/github/microsoft/msphpsql?branch=dev
[Coverage Codecov]: https://codecov.io/gh/microsoft/msphpsql/branch/master/graph/badge.svg
[Coverage Codecov]: https://codecov.io/gh/microsoft/msphpsql/branch/dev/graph/badge.svg
[codecov-site]: https://codecov.io/gh/microsoft/msphpsql

## Get Started
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ install:
}
- echo Downloading MSODBCSQL 17
# AppVeyor build works are x64 VMs and 32-bit ODBC driver cannot be installed on it
- 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')
- cmd /c start /wait msiexec /i "c:\projects\msodbcsql_17.4.2.1_x64.msi" /q IACCEPTMSODBCSQLLICENSETERMS=YES ADDLOCAL=ALL
- 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')
- cmd /c start /wait msiexec /i "c:\projects\msodbcsql.msi" /q IACCEPTMSODBCSQLLICENSETERMS=YES ADDLOCAL=ALL
- echo Checking the version of MSODBCSQL
- reg query "HKLM\SOFTWARE\ODBC\odbcinst.ini\ODBC Driver 17 for SQL Server"
- dir %WINDIR%\System32\msodbcsql*.dll
Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ trigger:
jobs:
- job: macOS
pool:
vmImage: 'macOS-10.13'
vmImage: 'macOS-10.14'
steps:
- checkout: self
clean: true
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
docker pull mcr.microsoft.com/mssql/server:2017-latest
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
docker ps -a
sleep 5
sleep 10
docker exec -t $(host) /opt/mssql-tools/bin/sqlcmd -S $(server) -U $(uid) -P $(pwd) -Q 'select @@Version'
displayName: 'Run SQL Server for Linux'

Expand Down
21 changes: 21 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
codecov:
require_ci_to_pass: yes
max_report_age: off

coverage:
precision: 2
round: down
range: "70...100"

parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: no
macro: no

comment:
layout: "reach,diff,flags,tree"
behavior: default
require_changes: no
11 changes: 8 additions & 3 deletions source/pdo_sqlsrv/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,15 @@ if test "$PHP_PDO_SQLSRV" != "no"; then

HOST_OS_ARCH=`uname`
if test "${HOST_OS_ARCH}" = "Darwin"; then
PDO_SQLSRV_SHARED_LIBADD="$PDO_SQLSRV_SHARED_LIBADD -Wl,-bind_at_load"
MACOSX_DEPLOYMENT_TARGET=`sw_vers -productVersion`
PDO_SQLSRV_SHARED_LIBADD="$PDO_SQLSRV_SHARED_LIBADD -Wl,-bind_at_load"
MACOSX_DEPLOYMENT_TARGET=`sw_vers -productVersion`
else
PDO_SQLSRV_SHARED_LIBADD="$PDO_SQLSRV_SHARED_LIBADD -Wl,-z,now"
PDO_SQLSRV_SHARED_LIBADD="$PDO_SQLSRV_SHARED_LIBADD -Wl,-z,now"
IS_ALPINE_1=`uname -a | cut -f 4 -d ' ' | cut -f 2 -d '-'`
IS_ALPINE_2=`cat /etc/os-release | grep ID | grep alpine | cut -f 2 -d '='`
if test "${IS_ALPINE_1}" = "Alpine" || test "${IS_ALPINE_2}" = "alpine"; then
AC_DEFINE(__MUSL__, 1, [ ])
fi
fi

PHP_REQUIRE_CXX()
Expand Down
21 changes: 4 additions & 17 deletions source/pdo_sqlsrv/pdo_dbh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,26 +489,13 @@ struct pdo_dbh_methods pdo_sqlsrv_dbh_methods = {


// log a function entry point
#ifndef _WIN32
#define PDO_LOG_DBH_ENTRY \
{ \
pdo_sqlsrv_dbh* driver_dbh = reinterpret_cast<pdo_sqlsrv_dbh*>( dbh->driver_data ); \
driver_dbh->set_func( __FUNCTION__ ); \
int length = strlen( __FUNCTION__ ) + strlen( ": entering" ); \
char func[length+1]; \
memset(func, '\0', length+1); \
strcpy_s( func, sizeof( __FUNCTION__ ), __FUNCTION__ ); \
strcat_s( func, length+1, ": entering" ); \
LOG( SEV_NOTICE, func ); \
if (driver_dbh != NULL) driver_dbh->set_func(__FUNCTION__); \
core_sqlsrv_register_severity_checker(pdo_severity_check); \
LOG(SEV_NOTICE, "%1!s!: entering", __FUNCTION__); \
}
#else
#define PDO_LOG_DBH_ENTRY \
{ \
pdo_sqlsrv_dbh* driver_dbh = reinterpret_cast<pdo_sqlsrv_dbh*>( dbh->driver_data ); \
driver_dbh->set_func( __FUNCTION__ ); \
LOG( SEV_NOTICE, __FUNCTION__ ## ": entering" ); \
}
#endif

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

hash_auto_ptr pdo_conn_options_ht;
pdo_error_mode prev_err_mode = dbh->error_mode;
Expand Down
16 changes: 8 additions & 8 deletions source/pdo_sqlsrv/pdo_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ PHP_MINIT_FUNCTION(pdo_sqlsrv)
ZEND_TSRMLS_CACHE_UPDATE();
#endif

core_sqlsrv_register_logger( pdo_sqlsrv_log );
core_sqlsrv_register_severity_checker(pdo_severity_check);

REGISTER_INI_ENTRIES();

LOG( SEV_NOTICE, "pdo_sqlsrv: entering minit" );
PDO_LOG_NOTICE("pdo_sqlsrv: entering minit");

// initialize list of pdo errors
g_pdo_errors_ht = reinterpret_cast<HashTable*>( pemalloc( sizeof( HashTable ), 1 ));
Expand Down Expand Up @@ -200,7 +200,7 @@ PHP_MSHUTDOWN_FUNCTION(pdo_sqlsrv)
}
catch( ... ) {

LOG( SEV_NOTICE, "Unknown exception caught in PHP_MSHUTDOWN_FUNCTION(pdo_sqlsrv)" );
PDO_LOG_NOTICE("Unknown exception caught in PHP_MSHUTDOWN_FUNCTION(pdo_sqlsrv)");
return FAILURE;
}

Expand All @@ -225,18 +225,18 @@ PHP_RINIT_FUNCTION(pdo_sqlsrv)
int set_locale = PDO_SQLSRV_G(set_locale_info);
if (set_locale == 2) {
setlocale(LC_ALL, "");
LOG(SEV_NOTICE, "pdo_sqlsrv: setlocale LC_ALL");
PDO_LOG_NOTICE("pdo_sqlsrv: setlocale LC_ALL");
}
else if (set_locale == 1) {
setlocale(LC_CTYPE, "");
LOG(SEV_NOTICE, "pdo_sqlsrv: setlocale LC_CTYPE");
PDO_LOG_NOTICE("pdo_sqlsrv: setlocale LC_CTYPE");
}
else {
LOG(SEV_NOTICE, "pdo_sqlsrv: setlocale NONE");
PDO_LOG_NOTICE("pdo_sqlsrv: setlocale NONE");
}
#endif

LOG( SEV_NOTICE, "pdo_sqlsrv: entering rinit" );
PDO_LOG_NOTICE("pdo_sqlsrv: entering rinit");

return SUCCESS;
}
Expand All @@ -250,7 +250,7 @@ PHP_RSHUTDOWN_FUNCTION(pdo_sqlsrv)
SQLSRV_UNUSED( module_number );
SQLSRV_UNUSED( type );

LOG( SEV_NOTICE, "pdo_sqlsrv: entering rshutdown" );
PDO_LOG_NOTICE("pdo_sqlsrv: entering rshutdown");

return SUCCESS;
}
Expand Down
19 changes: 3 additions & 16 deletions source/pdo_sqlsrv/pdo_stmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,26 +351,13 @@ void stmt_option_fetch_datetime:: operator()( _Inout_ sqlsrv_stmt* stmt, stmt_op
}

// log a function entry point
#ifndef _WIN32
#define PDO_LOG_STMT_ENTRY \
{ \
pdo_sqlsrv_stmt* driver_stmt = reinterpret_cast<pdo_sqlsrv_stmt*>( stmt->driver_data ); \
driver_stmt->set_func( __FUNCTION__ ); \
int length = strlen( __FUNCTION__ ) + strlen( ": entering" ); \
char func[length+1]; \
memset(func, '\0', length+1); \
strcpy_s( func, sizeof( __FUNCTION__ ), __FUNCTION__ ); \
strcat_s( func, length+1, ": entering" ); \
LOG( SEV_NOTICE, func ); \
if (driver_stmt != NULL) driver_stmt->set_func( __FUNCTION__ ); \
core_sqlsrv_register_severity_checker(pdo_severity_check); \
LOG(SEV_NOTICE, "%1!s!: entering", __FUNCTION__); \
}
#else
#define PDO_LOG_STMT_ENTRY \
{ \
pdo_sqlsrv_stmt* driver_stmt = reinterpret_cast<pdo_sqlsrv_stmt*>( stmt->driver_data ); \
driver_stmt->set_func( __FUNCTION__ ); \
LOG( SEV_NOTICE, __FUNCTION__ ## ": entering" ); \
}
#endif

// PDO SQLSRV statement destructor
pdo_sqlsrv_stmt::~pdo_sqlsrv_stmt( void )
Expand Down
25 changes: 3 additions & 22 deletions source/pdo_sqlsrv/pdo_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@ const int MAX_DIGITS = 11; // +-2 billion = 10 digits + 1 for the sign if negati
// the warning message is not the error message alone; it must take WARNING_TEMPLATE above into consideration without the formats
const int WARNING_MIN_LENGTH = static_cast<const int>( strlen( WARNING_TEMPLATE ) - strlen( "%1!s!%2!d!%3!s!" ));

// buffer used to hold a formatted log message prior to actually logging it.
const int LOG_MSG_SIZE = 2048;
char log_msg[LOG_MSG_SIZE] = {'\0'};

// internal error that says that FormatMessage failed
SQLCHAR INTERNAL_FORMAT_ERROR[] = "An internal error occurred. FormatMessage failed writing an error message.";

// Returns a sqlsrv_error for a given error code.
sqlsrv_error_const* get_error_message( _In_opt_ unsigned int sqlsrv_error_code);

Expand Down Expand Up @@ -623,22 +616,10 @@ void pdo_sqlsrv_retrieve_context_error( _In_ sqlsrv_error const* last_error, _Ou
}
}

// Formats the error message and writes to the php error log.
void pdo_sqlsrv_log( _In_opt_ unsigned int severity TSRMLS_DC, _In_opt_ const char* msg, _In_opt_ va_list* print_args )
// check the global variable of pdo_sqlsrv severity whether the message qualifies to be logged with the LOG macro
bool pdo_severity_check(_In_ unsigned int severity TSRMLS_DC)
{
if( (severity & PDO_SQLSRV_G( log_severity )) == 0 ) {
return;
}

DWORD rc = FormatMessage( FORMAT_MESSAGE_FROM_STRING, msg, 0, 0, log_msg, LOG_MSG_SIZE, print_args );

// if an error occurs for FormatMessage, we just output an internal error occurred.
if( rc == 0 ) {
SQLSRV_STATIC_ASSERT( sizeof( INTERNAL_FORMAT_ERROR ) < sizeof( log_msg ));
std::copy( INTERNAL_FORMAT_ERROR, INTERNAL_FORMAT_ERROR + sizeof( INTERNAL_FORMAT_ERROR ), log_msg );
}

php_log_err( log_msg TSRMLS_CC );
return ((severity & PDO_SQLSRV_G(pdo_log_severity)));
}

namespace {
Expand Down
2 changes: 1 addition & 1 deletion source/pdo_sqlsrv/php_pdo_sqlsrv.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
// request level variables
ZEND_BEGIN_MODULE_GLOBALS(pdo_sqlsrv)

unsigned int log_severity;
unsigned int pdo_log_severity;
zend_long client_buffer_max_size;

#ifndef _WIN32
Expand Down
10 changes: 7 additions & 3 deletions source/pdo_sqlsrv/php_pdo_sqlsrv_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ extern HMODULE g_sqlsrv_hmodule;
#endif

PHP_INI_BEGIN()
STD_PHP_INI_ENTRY( INI_PREFIX INI_PDO_SQLSRV_LOG , "0", PHP_INI_ALL, OnUpdateLong, log_severity,
STD_PHP_INI_ENTRY( INI_PREFIX INI_PDO_SQLSRV_LOG , "0", PHP_INI_ALL, OnUpdateLong, pdo_log_severity,
zend_pdo_sqlsrv_globals, pdo_sqlsrv_globals )
STD_PHP_INI_ENTRY( INI_PREFIX INI_PDO_SQLSRV_CLIENT_BUFFER_MAX_SIZE , INI_BUFFERED_QUERY_LIMIT_DEFAULT, PHP_INI_ALL, OnUpdateLong,
client_buffer_max_size, zend_pdo_sqlsrv_globals, pdo_sqlsrv_globals )
Expand Down Expand Up @@ -326,6 +326,10 @@ inline void pdo_reset_dbh_error( _Inout_ pdo_dbh_t* dbh TSRMLS_DC )
}
}

#define PDO_LOG_NOTICE(message) \
core_sqlsrv_register_severity_checker(pdo_severity_check); \
LOG(SEV_NOTICE, message);

#define PDO_RESET_DBH_ERROR pdo_reset_dbh_error( dbh TSRMLS_CC );

inline void pdo_reset_stmt_error( _Inout_ pdo_stmt_t* stmt )
Expand Down Expand Up @@ -417,8 +421,8 @@ namespace pdo {

} // namespace pdo

// logger for pdo_sqlsrv called by the core layer when it wants to log something with the LOG macro
void pdo_sqlsrv_log( _In_opt_ unsigned int severity TSRMLS_DC, _In_opt_ const char* msg, _In_opt_ va_list* print_args );
// check the global variable of pdo_sqlsrv severity whether the message qualifies to be logged with the LOG macro
bool pdo_severity_check(_In_ unsigned int severity TSRMLS_DC);


#endif /* PHP_PDO_SQLSRV_INT_H */
Loading