From e2c15977efbfb0a371c2c06729ad87fa330564bd Mon Sep 17 00:00:00 2001 From: Sicong Date: Mon, 29 Aug 2022 18:48:04 -0700 Subject: [PATCH 01/21] Fix clientInfo related test cases (#1407) --- test/functional/pdo_sqlsrv/pdo_getAttribute_clientInfo.phpt | 2 +- test/functional/pdo_sqlsrv/pdo_get_set_attr.phpt | 2 +- test/functional/sqlsrv/sqlsrv_client_info.phpt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/functional/pdo_sqlsrv/pdo_getAttribute_clientInfo.phpt b/test/functional/pdo_sqlsrv/pdo_getAttribute_clientInfo.phpt index 521940ba..47469775 100644 --- a/test/functional/pdo_sqlsrv/pdo_getAttribute_clientInfo.phpt +++ b/test/functional/pdo_sqlsrv/pdo_getAttribute_clientInfo.phpt @@ -20,7 +20,7 @@ try { --EXPECTREGEX-- Array \( - \[(DriverDllName|DriverName)\] => (msodbcsql1[1-9].dll|(libmsodbcsql-[0-9]{2}\.[0-9]\.so\.[0-9]\.[0-9]|libmsodbcsql.[0-9]{2}.dylib)) + \[(DriverDllName|DriverName)\] => (msodbcsql1[1-9].dll|(libmsodbcsql-[0-9]{2}\.[0-9]{1,2}\.so\.[0-9]\.[0-9]|libmsodbcsql.[0-9]{2}.dylib)) \[DriverODBCVer\] => [0-9]{1,2}\.[0-9]{1,2} \[DriverVer\] => [0-9]{1,2}\.[0-9]{1,2}\.[0-9]{4} \[ExtensionVer\] => [0-9]\.[0-9]+\.[0-9](-(RC[1-9]?|beta[1-9]))?(\.[0-9]+)?(\+[0-9]+)? diff --git a/test/functional/pdo_sqlsrv/pdo_get_set_attr.phpt b/test/functional/pdo_sqlsrv/pdo_get_set_attr.phpt index 37178afe..af121a68 100644 --- a/test/functional/pdo_sqlsrv/pdo_get_set_attr.phpt +++ b/test/functional/pdo_sqlsrv/pdo_get_set_attr.phpt @@ -125,7 +125,7 @@ SQLSTATE\[IMSSP\]: A read-only attribute was designated on the PDO object. Get Result PDO::ATTR_CLIENT_VERSION : array\(4\) { \[\"(DriverDllName|DriverName)\"\]=> - (string\([0-9]+\) \"msodbcsql1[1-9].dll\"|string\([0-9]+\) \"(libmsodbcsql-[0-9]{2}\.[0-9]\.so\.[0-9]\.[0-9]|libmsodbcsql.[0-9]{2}.dylib)\") + (string\([0-9]+\) \"msodbcsql1[1-9].dll\"|string\([0-9]+\) \"(libmsodbcsql-[0-9]{2}\.[0-9]{1,2}\.so\.[0-9]\.[0-9]|libmsodbcsql.[0-9]{2}.dylib)\") \["DriverODBCVer"\]=> string\(5\) \"[0-9]{1,2}\.[0-9]{1,2}\" \["DriverVer"\]=> diff --git a/test/functional/sqlsrv/sqlsrv_client_info.phpt b/test/functional/sqlsrv/sqlsrv_client_info.phpt index d39819f9..5b62871b 100644 --- a/test/functional/sqlsrv/sqlsrv_client_info.phpt +++ b/test/functional/sqlsrv/sqlsrv_client_info.phpt @@ -15,7 +15,7 @@ var_dump( $client_info ); --EXPECTREGEX-- array\(4\) { \[\"(DriverDllName|DriverName)\"\]=> - (string\([0-9]+\) \"msodbcsql1[1-9].dll\"|string\([0-9]+\) \"(libmsodbcsql-[0-9]{2}\.[0-9]\.so\.[0-9]\.[0-9]|libmsodbcsql.[0-9]{2}.dylib)\") + (string\([0-9]+\) \"msodbcsql1[1-9].dll\"|string\([0-9]+\) \"(libmsodbcsql-[0-9]{2}\.[0-9]{1,2}\.so\.[0-9]\.[0-9]|libmsodbcsql.[0-9]{2}.dylib)\") \[\"DriverODBCVer\"\]=> string\(5\) \"[0-9]{1,2}\.[0-9]{1,2}\" \[\"DriverVer\"\]=> From ed9671815294c84b0bc80c0baba7d22bac166b2f Mon Sep 17 00:00:00 2001 From: Sicong Date: Mon, 12 Sep 2022 10:15:04 -0700 Subject: [PATCH 02/21] Print error messages for managed identity test (#1392) * Print error messages for managed identity test * Skip appveyor MSI tests * Skip msi tests for unix --- .gitignore | 9 +++++++++ appveyor.yml | 1 + .../pdo_sqlsrv/pdo_azure_ad_managed_identity.phpt | 14 +++++++++++--- test/functional/pdo_sqlsrv/skipif_Appveyor.inc | 4 ++++ 4 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 .gitignore create mode 100644 test/functional/pdo_sqlsrv/skipif_Appveyor.inc diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..db797324 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +.vs +.vscode +__pycache__ +*.diff +*.exp +*.log +*.sh +*.out +test/**/**/*.php \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index 4cf0be78..5f5e8a5c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -12,6 +12,7 @@ environment: SQLSRV_DBNAME: msphpsql_sqlsrv PDOSQLSRV_DBNAME: msphpsql_pdosqlsrv PYTHON: c:\Python36 + APPVEYOR: true # For details about Appveyor build worker images (VM template): https://www.appveyor.com/docs/build-environment/#build-worker-images matrix: - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 diff --git a/test/functional/pdo_sqlsrv/pdo_azure_ad_managed_identity.phpt b/test/functional/pdo_sqlsrv/pdo_azure_ad_managed_identity.phpt index 03856d90..cf84d8a3 100644 --- a/test/functional/pdo_sqlsrv/pdo_azure_ad_managed_identity.phpt +++ b/test/functional/pdo_sqlsrv/pdo_azure_ad_managed_identity.phpt @@ -3,7 +3,11 @@ Test some error conditions of Azure AD Managed Identity support --DESCRIPTION-- This test expects certain exceptions to be thrown under some conditions. --SKIPIF-- - + --FILE-- getMessage()); + echo "\n"; } } catch(PDOException $e) { print_r($e->getMessage()); @@ -72,7 +78,9 @@ function connectInvalidServerWithUser() $conn = new PDO("sqlsrv:server = invalidServer; $connectionInfo", $user, null); echo $message . $testCase . PHP_EOL; } catch(PDOException $e) { - // TODO: check the exception message here + echo "Failed to connect\n"; + print_r($e->getMessage()); + echo "\n"; } } catch(PDOException $e) { print_r($e->getMessage()); diff --git a/test/functional/pdo_sqlsrv/skipif_Appveyor.inc b/test/functional/pdo_sqlsrv/skipif_Appveyor.inc new file mode 100644 index 00000000..f757973c --- /dev/null +++ b/test/functional/pdo_sqlsrv/skipif_Appveyor.inc @@ -0,0 +1,4 @@ + Date: Tue, 13 Sep 2022 11:17:57 -0700 Subject: [PATCH 03/21] Update bvt tests for PHP 8.2 (#1409) --- buildscripts/buildtools.py | 2 +- test/bvt/pdo_sqlsrv/msdn_pdoStatement_fetch.phpt | 8 ++++++-- test/bvt/pdo_sqlsrv/msdn_pdoStatement_fetchAll.phpt | 6 +++++- test/bvt/pdo_sqlsrv/msdn_pdo_query.phpt | 6 +++++- test/bvt/sqlsrv/msdn_sqlsrv_connect_utf8.phpt | 2 +- test/bvt/sqlsrv/msdn_sqlsrv_fetch_object_2.phpt | 4 ++++ test/bvt/sqlsrv/msdn_sqlsrv_query_utf8.phpt | 2 +- 7 files changed, 23 insertions(+), 7 deletions(-) diff --git a/buildscripts/buildtools.py b/buildscripts/buildtools.py index 58177854..395cae1a 100644 --- a/buildscripts/buildtools.py +++ b/buildscripts/buildtools.py @@ -321,7 +321,7 @@ class BuildUtil(object): else: # pdo_sqlsrv cmd_line = ' --enable-pdo --with-pdo-sqlsrv=shared ' + cmd_line - cmd_line = 'cscript configure.js --disable-all --enable-cli --enable-cgi --enable-json --enable-embed' + cmd_line + cmd_line = 'cscript configure.js --disable-all --enable-cli --enable-cgi --enable-json --enable-embed --enable-mbstring' + cmd_line if self.thread == 'nts': cmd_line = cmd_line + ' --disable-zts' return cmd_line diff --git a/test/bvt/pdo_sqlsrv/msdn_pdoStatement_fetch.phpt b/test/bvt/pdo_sqlsrv/msdn_pdoStatement_fetch.phpt index e65eb156..665722ab 100644 --- a/test/bvt/pdo_sqlsrv/msdn_pdoStatement_fetch.phpt +++ b/test/bvt/pdo_sqlsrv/msdn_pdoStatement_fetch.phpt @@ -8,9 +8,13 @@ fetch with all fetch styles $conn = new PDO( "sqlsrv:server=$server ; Database = $databaseName", "$uid", "$pwd"); print( "\n---------- PDO::FETCH_CLASS -------------\n" ); - $stmt = $conn->query( "select * from HumanResources.Department order by GroupName" ); + $stmt = $conn->query( "select DepartmentID, Name, GroupName from HumanResources.Department order by GroupName" ); class cc { + public $DepartmentID; + public $Name; + public $GroupName; + function __construct( $arg ) { echo "$arg"; } @@ -26,7 +30,7 @@ fetch with all fetch styles } print( "\n---------- PDO::FETCH_INTO -------------\n" ); - $stmt = $conn->query( "select * from HumanResources.Department order by GroupName" ); + $stmt = $conn->query( "select DepartmentID, Name, GroupName from HumanResources.Department order by GroupName" ); $c_obj = new cc( '' ); $stmt->setFetchMode(PDO::FETCH_INTO, $c_obj); diff --git a/test/bvt/pdo_sqlsrv/msdn_pdoStatement_fetchAll.phpt b/test/bvt/pdo_sqlsrv/msdn_pdoStatement_fetchAll.phpt index 1d85aef6..88eb8700 100644 --- a/test/bvt/pdo_sqlsrv/msdn_pdoStatement_fetchAll.phpt +++ b/test/bvt/pdo_sqlsrv/msdn_pdoStatement_fetchAll.phpt @@ -25,6 +25,10 @@ fetches the rows in a result set in an array print "\n-----------\n"; class cc { + public $ContactTypeID; + public $Name; + public $ModifiedDate; + function __construct( $arg ) { echo "$arg\n"; } @@ -34,7 +38,7 @@ fetches the rows in a result set in an array } }; - $stmt = $conn->query( 'SELECT TOP(2) * FROM Person.ContactType' ); + $stmt = $conn->query( 'SELECT TOP(2) ContactTypeID, Name, ModifiedDate FROM Person.ContactType' ); $all = $stmt->fetchAll( PDO::FETCH_CLASS, 'cc', array( 'Hi!' )); var_dump( $all ); diff --git a/test/bvt/pdo_sqlsrv/msdn_pdo_query.phpt b/test/bvt/pdo_sqlsrv/msdn_pdo_query.phpt index 15a85b18..9d2490a2 100644 --- a/test/bvt/pdo_sqlsrv/msdn_pdo_query.phpt +++ b/test/bvt/pdo_sqlsrv/msdn_pdo_query.phpt @@ -26,9 +26,13 @@ while ( $row = $stmt->fetch() ){ } echo "\n........ query with a new class ............\n"; -$query = 'select * from HumanResources.Department order by GroupName'; +$query = 'select DepartmentID, Name, GroupName from HumanResources.Department order by GroupName'; // query with a class class cc { + public $DepartmentID; + public $Name; + public $GroupName; + function __construct( $arg ) { echo "$arg"; } diff --git a/test/bvt/sqlsrv/msdn_sqlsrv_connect_utf8.phpt b/test/bvt/sqlsrv/msdn_sqlsrv_connect_utf8.phpt index b6b35d2a..c965aa8d 100644 --- a/test/bvt/sqlsrv/msdn_sqlsrv_connect_utf8.phpt +++ b/test/bvt/sqlsrv/msdn_sqlsrv_connect_utf8.phpt @@ -25,7 +25,7 @@ $tsql1 = "UPDATE Production.ProductReview // $reviewID = 3; -$comments = utf8_encode("testing 1, 2, 3, 4. Testing."); +$comments = mb_convert_encoding("testing 1, 2, 3, 4. Testing.", 'ISO-8859-1', 'UTF-8'); $params1 = array( array( $comments, null ), array( $reviewID, null ) diff --git a/test/bvt/sqlsrv/msdn_sqlsrv_fetch_object_2.phpt b/test/bvt/sqlsrv/msdn_sqlsrv_fetch_object_2.phpt index 73f2ea13..0370d3a9 100644 --- a/test/bvt/sqlsrv/msdn_sqlsrv_fetch_object_2.phpt +++ b/test/bvt/sqlsrv/msdn_sqlsrv_fetch_object_2.phpt @@ -7,6 +7,8 @@ retrieves each row of a result set as an instance of the Product class defined i /* Define the Product class. */ class Product { + + /* Constructor */ public function ProductConstruct($ID) { @@ -17,6 +19,8 @@ class Product public $StockedQty; public $SafetyStockLevel; private $UnitPrice; + public $Name; + public $Color; function getPrice() { return $this->UnitPrice; diff --git a/test/bvt/sqlsrv/msdn_sqlsrv_query_utf8.phpt b/test/bvt/sqlsrv/msdn_sqlsrv_query_utf8.phpt index b0779295..d035ca75 100644 --- a/test/bvt/sqlsrv/msdn_sqlsrv_query_utf8.phpt +++ b/test/bvt/sqlsrv/msdn_sqlsrv_query_utf8.phpt @@ -27,7 +27,7 @@ $tsql1 = "UPDATE Production.ProductReview // utf8_encode to simulate an application that uses UTF-8 encoded data. // $reviewID = 3; -$comments = utf8_encode("testing"); +$comments = mb_convert_encoding("testing", 'ISO-8859-1', 'UTF-8'); $params1 = array( array($comments, SQLSRV_PARAM_IN, From 15d25ceb76a8ca78127a5bf8b5bf8d7180bd2850 Mon Sep 17 00:00:00 2001 From: Sicong Date: Tue, 13 Sep 2022 13:30:58 -0700 Subject: [PATCH 04/21] Fix right truncation issue and add unit test (#1408) * Reset column size * Fix clientInfo related test cases (#1407) * Create pdo_1391_string_truncation_after_short_string.phpt Regresssion tests: Use the same Statement to insert a row with short strings first, and longer strings second. - Issue also happens with VARCHAR( >=4002 ). Not just Max or NVARCHAR - Issues 1391, 1393 (and possibly 1371 ?) might all have the same root cause. * fetchAll() -> fetch(), we only want 1 row. * Revert trigger Co-authored-by: Maarten S <42799774+talkinnl@users.noreply.github.com> --- source/shared/core_stmt.cpp | 28 +++---- ..._string_truncation_after_short_string.phpt | 77 +++++++++++++++++++ 2 files changed, 91 insertions(+), 14 deletions(-) create mode 100644 test/functional/pdo_sqlsrv/pdo_1391_string_truncation_after_short_string.phpt diff --git a/source/shared/core_stmt.cpp b/source/shared/core_stmt.cpp index 92c7cfc7..95161c46 100644 --- a/source/shared/core_stmt.cpp +++ b/source/shared/core_stmt.cpp @@ -414,10 +414,22 @@ void core_sqlsrv_bind_param( _Inout_ sqlsrv_stmt* stmt, _In_ SQLUSMALLINT param_ } // If Always Encrypted is enabled, transfer the known param meta data if applicable, which might alter param_z for decimal types - if (stmt->conn->ce_option.enabled) { - if (param_ptr->sql_data_type == SQL_UNKNOWN_TYPE || param_ptr->column_size == SQLSRV_UNKNOWN_SIZE) { + if (stmt->conn->ce_option.enabled + && (param_ptr->sql_data_type == SQL_UNKNOWN_TYPE || param_ptr->column_size == SQLSRV_UNKNOWN_SIZE)) { // meta data parameters are always sorted based on parameter number param_ptr->copy_param_meta_ae(param_z, stmt->params_container.params_meta_ae[param_num]); + } + else { + if (Z_TYPE_P(param_z) == IS_STRING && column_size == SQLSRV_UNKNOWN_SIZE) { + size_t char_size = (encoding == SQLSRV_ENCODING_UTF8) ? sizeof(SQLWCHAR) : sizeof(char); + SQLULEN byte_len = Z_STRLEN_P(param_z) * char_size; + + if (byte_len > SQL_SERVER_MAX_FIELD_SIZE) { + param_ptr->column_size = SQL_SERVER_MAX_TYPE_SIZE; + } + else { + param_ptr->column_size = SQL_SERVER_MAX_FIELD_SIZE / char_size; + } } } @@ -2272,18 +2284,6 @@ bool sqlsrv_param::derive_string_types_sizes(_In_ zval* param_z) break; } - // Derive the column size also only if it is unknown - if (column_size == SQLSRV_UNKNOWN_SIZE) { - size_t char_size = (encoding == SQLSRV_ENCODING_UTF8) ? sizeof(SQLWCHAR) : sizeof(char); - SQLULEN byte_len = Z_STRLEN_P(param_z) * char_size; - - if (byte_len > SQL_SERVER_MAX_FIELD_SIZE) { - column_size = SQL_SERVER_MAX_TYPE_SIZE; - } else { - column_size = SQL_SERVER_MAX_FIELD_SIZE / char_size; - } - } - return is_numeric; } diff --git a/test/functional/pdo_sqlsrv/pdo_1391_string_truncation_after_short_string.phpt b/test/functional/pdo_sqlsrv/pdo_1391_string_truncation_after_short_string.phpt new file mode 100644 index 00000000..e11ffd48 --- /dev/null +++ b/test/functional/pdo_sqlsrv/pdo_1391_string_truncation_after_short_string.phpt @@ -0,0 +1,77 @@ +--TEST-- +GitHub issue 1391 - string truncation error when binding some parameters as longer strings the second time +--DESCRIPTION-- +The test shows the same parameters, though bound as short strings in the first insertion, can be bound as longer strings in the subsequent insertions. +--ENV-- +PHPT_EXEC=true +--SKIPIF-- + +--FILE-- +exec($drop); +} + +try { + $conn = new PDO("sqlsrv:server=$server; Database = $databaseName;", $uid, $pwd); + $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + + dropTable($conn, 'long_strings'); + +$tsql = <<exec($tsql); + +$tsql = <<prepare($tsql); + + // Bind and execute short string values first + $fourThousand = '4'; + $varMax = 'v'; + $nvarMax = 'n'; + $stmt->bindParam(1, $fourThousand); + $stmt->bindParam(2, $varMax); + $stmt->bindParam(3, $nvarMax); + $stmt->execute(); + + // Bind and execute long string values second, on same $stmt + $fourThousand = str_repeat('4', 4001); + $varMax = str_repeat('v', 4001); + $nvarMax = str_repeat('n', 4001); + $stmt->bindParam(1, $fourThousand); + $stmt->bindParam(2, $varMax); + $stmt->bindParam(3, $nvarMax); + $stmt->execute(); + + // fetch the data + $stmt = $conn->prepare("SELECT COUNT(*) FROM long_strings"); + $stmt->execute(); + $row = $stmt->fetch(PDO::FETCH_NUM); + echo $row[0]."\n"; + + dropTable($conn, 'long_strings'); + + echo "Done\n"; +} catch (PdoException $e) { + echo $e->getMessage(); +} + +?> +--EXPECT-- +2 +Done From 9ffcb9cb2e7837132e4fe950d2116ef762314712 Mon Sep 17 00:00:00 2001 From: Sicong Date: Sat, 17 Sep 2022 20:53:48 -0700 Subject: [PATCH 05/21] Print logfile to terminal (#1411) --- buildscripts/builddrivers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/buildscripts/builddrivers.py b/buildscripts/builddrivers.py index 26c91c1c..37b71efe 100644 --- a/buildscripts/builddrivers.py +++ b/buildscripts/builddrivers.py @@ -200,7 +200,11 @@ class BuildDriver(object): print('Something went wrong, launching log file', logfile) # display log file only when not testing if not self.testing: - os.startfile(os.path.join(root_dir, 'php-sdk', logfile)) + logfile_path = os.path.join(root_dir, 'php-sdk', logfile) + if os.path.isfile(logfile_path): + with open(logfile_path, 'r') as f: + f.seek(0) + print(f.read()) os.chdir(work_dir) exit(1) From 3a630fa8b099fcc3763729e857004cc782740a93 Mon Sep 17 00:00:00 2001 From: Sicong Date: Wed, 28 Sep 2022 06:25:52 -0700 Subject: [PATCH 06/21] Add pipeline trigger (#1410) --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c7b643f9..e4e5fb4a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -11,6 +11,7 @@ variables: trigger: - dev +- fix/* pr: - dev From efd594b8cf829f0655b65ea13d329047e5298ba0 Mon Sep 17 00:00:00 2001 From: v-makouz Date: Mon, 5 Dec 2022 10:48:34 -0800 Subject: [PATCH 07/21] Some test fixes for 8.2 --- test/functional/sqlsrv/TC45_FetchObject.phpt | 1 + test/functional/sqlsrv/sqlsrv_connect_driver.phpt | 4 ++-- test/functional/sqlsrv/sqlsrv_data_classification.phpt | 2 +- test/functional/sqlsrv/sqlsrv_data_classification_ranks.phpt | 2 +- test/functional/sqlsrv/sqlsrv_fetch_object.phpt | 2 ++ test/functional/sqlsrv/sqlsrv_fetch_object_2.phpt | 2 ++ test/functional/sqlsrv/sqlsrv_fetch_object_class.phpt | 2 ++ .../sqlsrv/sqlsrv_fetch_object_unicode_col_name1.phpt | 2 ++ .../sqlsrv/sqlsrv_fetch_object_unicode_col_name2.phpt | 2 ++ test/functional/sqlsrv/test_largeData.phpt | 2 ++ 10 files changed, 17 insertions(+), 4 deletions(-) diff --git a/test/functional/sqlsrv/TC45_FetchObject.phpt b/test/functional/sqlsrv/TC45_FetchObject.phpt index 589c4540..66791f88 100644 --- a/test/functional/sqlsrv/TC45_FetchObject.phpt +++ b/test/functional/sqlsrv/TC45_FetchObject.phpt @@ -12,6 +12,7 @@ require('skipif_versions_old.inc'); diff --git a/test/functional/sqlsrv/sqlsrv_data_classification.phpt b/test/functional/sqlsrv/sqlsrv_data_classification.phpt index ab06cce6..eab60269 100644 --- a/test/functional/sqlsrv/sqlsrv_data_classification.phpt +++ b/test/functional/sqlsrv/sqlsrv_data_classification.phpt @@ -61,7 +61,7 @@ function isDataClassSupported($conn, &$driverCapable) // ODBC Driver must be 17.2 or above $driverCapable = true; - if ($version[0] < 17 || $version[1] < 2) { + if ($version[0] < 17 || ($version[0] == 17 && $version[1] < 2)) { $driverCapable = false; return false; } diff --git a/test/functional/sqlsrv/sqlsrv_data_classification_ranks.phpt b/test/functional/sqlsrv/sqlsrv_data_classification_ranks.phpt index c79f302b..6763c300 100644 --- a/test/functional/sqlsrv/sqlsrv_data_classification_ranks.phpt +++ b/test/functional/sqlsrv/sqlsrv_data_classification_ranks.phpt @@ -63,7 +63,7 @@ function isDataClassSupported($conn, &$driverCapable) // ODBC Driver must be 17.2 or above $driverCapable = true; - if ($version[0] < 17 || $version[1] < 2) { + if ($version[0] < 17 || ($version[0] == 17 && $version[1] < 2)) { $driverCapable = false; return false; } diff --git a/test/functional/sqlsrv/sqlsrv_fetch_object.phpt b/test/functional/sqlsrv/sqlsrv_fetch_object.phpt index 857b645b..74501782 100644 --- a/test/functional/sqlsrv/sqlsrv_fetch_object.phpt +++ b/test/functional/sqlsrv/sqlsrv_fetch_object.phpt @@ -5,6 +5,7 @@ Test for fetch_object --FILE-- --FILE-- Date: Thu, 8 Dec 2022 10:16:14 -0800 Subject: [PATCH 08/21] Some PDO test fixes --- test/functional/pdo_sqlsrv/PDO31_Statement.phpt | 1 + test/functional/pdo_sqlsrv/PDO37_FetchMode.phpt | 1 + test/functional/pdo_sqlsrv/PDO47_FetchClass.phpt | 3 +++ test/functional/pdo_sqlsrv/PDO49_FetchFunc.phpt | 2 ++ test/functional/pdo_sqlsrv/PDO50_FetchObject.phpt | 1 + test/functional/pdo_sqlsrv/PDO94_Extend1.phpt | 2 ++ test/functional/pdo_sqlsrv/pdo_connect_driver.phpt | 4 ++-- .../functional/pdo_sqlsrv/pdo_fetch_fetchinto_query_args.phpt | 3 +++ test/functional/pdo_sqlsrv/pdo_simple_update_variants.phpt | 1 + 9 files changed, 16 insertions(+), 2 deletions(-) diff --git a/test/functional/pdo_sqlsrv/PDO31_Statement.phpt b/test/functional/pdo_sqlsrv/PDO31_Statement.phpt index f082113c..adb1ab2a 100644 --- a/test/functional/pdo_sqlsrv/PDO31_Statement.phpt +++ b/test/functional/pdo_sqlsrv/PDO31_Statement.phpt @@ -59,6 +59,7 @@ function ExecStmt() EndTest($testName); } +#[AllowDynamicProperties] class Test { function __construct($name = 'N/A') diff --git a/test/functional/pdo_sqlsrv/PDO37_FetchMode.phpt b/test/functional/pdo_sqlsrv/PDO37_FetchMode.phpt index 5067ea90..34e6c7d2 100644 --- a/test/functional/pdo_sqlsrv/PDO37_FetchMode.phpt +++ b/test/functional/pdo_sqlsrv/PDO37_FetchMode.phpt @@ -48,6 +48,7 @@ function FetchMode() EndTest($testName); } +#[AllowDynamicProperties] class Test { function __construct($name = 'N/A') diff --git a/test/functional/pdo_sqlsrv/PDO47_FetchClass.phpt b/test/functional/pdo_sqlsrv/PDO47_FetchClass.phpt index 3a40b5b6..f4c8b298 100644 --- a/test/functional/pdo_sqlsrv/PDO47_FetchClass.phpt +++ b/test/functional/pdo_sqlsrv/PDO47_FetchClass.phpt @@ -72,6 +72,7 @@ function FetchAll() EndTest($testName); } +#[AllowDynamicProperties] class Test1 { public function __construct() @@ -80,6 +81,7 @@ class Test1 } } +#[AllowDynamicProperties] class Test2 { public function __construct() @@ -88,6 +90,7 @@ class Test2 } } +#[AllowDynamicProperties] class Test3 { public function __construct() diff --git a/test/functional/pdo_sqlsrv/PDO49_FetchFunc.phpt b/test/functional/pdo_sqlsrv/PDO49_FetchFunc.phpt index 43e9b6c8..b9398ff6 100644 --- a/test/functional/pdo_sqlsrv/PDO49_FetchFunc.phpt +++ b/test/functional/pdo_sqlsrv/PDO49_FetchFunc.phpt @@ -64,6 +64,7 @@ function FetchAll() EndTest($testName); } +#[AllowDynamicProperties] class DerivedStatement extends PDOStatement { private function __construct($name, $conn) @@ -78,6 +79,7 @@ class DerivedStatement extends PDOStatement } } +#[AllowDynamicProperties] class Test1 { public function __construct($id, $val) diff --git a/test/functional/pdo_sqlsrv/PDO50_FetchObject.phpt b/test/functional/pdo_sqlsrv/PDO50_FetchObject.phpt index c925323b..ce777ac5 100644 --- a/test/functional/pdo_sqlsrv/PDO50_FetchObject.phpt +++ b/test/functional/pdo_sqlsrv/PDO50_FetchObject.phpt @@ -10,6 +10,7 @@ PHPT_EXEC=true diff --git a/test/functional/pdo_sqlsrv/pdo_fetch_fetchinto_query_args.phpt b/test/functional/pdo_sqlsrv/pdo_fetch_fetchinto_query_args.phpt index 50a5cf1a..0aa66410 100644 --- a/test/functional/pdo_sqlsrv/pdo_fetch_fetchinto_query_args.phpt +++ b/test/functional/pdo_sqlsrv/pdo_fetch_fetchinto_query_args.phpt @@ -8,6 +8,8 @@ This test should not use temporary table as it might occasionally cause deadlock Date: Thu, 8 Dec 2022 13:59:34 -0800 Subject: [PATCH 09/21] fix for callable deprecation --- test/functional/pdo_sqlsrv/PDO95_Extend2.phpt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/functional/pdo_sqlsrv/PDO95_Extend2.phpt b/test/functional/pdo_sqlsrv/PDO95_Extend2.phpt index 74530b7d..54b1f750 100644 --- a/test/functional/pdo_sqlsrv/PDO95_Extend2.phpt +++ b/test/functional/pdo_sqlsrv/PDO95_Extend2.phpt @@ -46,27 +46,31 @@ function Extend() EndTest($testName); } +#[AllowDynamicProperties] class ExPDO extends PDO { public function __construct() { $this->protocol(); $args = func_get_args(); - return (call_user_func_array(array($this, 'parent::__construct'), $args)); + $callable = parent::class . '::__construct'; + return (call_user_func_array($callable, $args)); } public function exec(string $args1) : int|false { $this->protocol(); $args = func_get_args(); - return (call_user_func_array(array($this, 'parent::exec'), $args)); + $callable = parent::class . '::exec'; + return (call_user_func_array($callable, $args)); } function query(string $sql, ?int $fetchMode = null, mixed ...$fetchModeArgs): PDOStatement|false { $this->protocol(); $args = func_get_args(); - return (call_user_func_array(array($this, 'parent::query'), $args)); + $callable = parent::class . '::query'; + return (call_user_func_array($callable, $args)); } public function __call($method, $args) From fd8457cd55960c9d16976911c484e40f3773ba9a Mon Sep 17 00:00:00 2001 From: v-makouz Date: Fri, 9 Dec 2022 13:20:31 -0800 Subject: [PATCH 10/21] Fix for utf8 test --- test/functional/pdo_sqlsrv/pdo_utf8_conn.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/pdo_sqlsrv/pdo_utf8_conn.phpt b/test/functional/pdo_sqlsrv/pdo_utf8_conn.phpt index 0c4f88f8..4c6de711 100644 --- a/test/functional/pdo_sqlsrv/pdo_utf8_conn.phpt +++ b/test/functional/pdo_sqlsrv/pdo_utf8_conn.phpt @@ -24,6 +24,6 @@ if ($c !== false) { Fatal error: Uncaught PDOException: SQLSTATE\[(28000|08001|HYT00)\]: .*\[Microsoft\]\[ODBC Driver 1[0-9] for SQL Server\](\[SQL Server\])?(Named Pipes Provider: Could not open a connection to SQL Server \[2\]\. |TCP Provider: Error code (0x2726|0x2AF9)|Login timeout expired|Login failed for user 'sa'\.) in .+(\/|\\)pdo_utf8_conn\.php:[0-9]+ Stack trace: -#0 .+(\/|\\)pdo_utf8_conn\.php\([0-9]+\): PDO->__construct(\(\)|\('sqlsrv:Server=l\.\.\.', 'sa', 'Sunshine4u'\)) +#0 .+(\/|\\)pdo_utf8_conn\.php\([0-9]+\): PDO->__construct(\(\)|\('sqlsrv:Server=l\.\.\.', 'sa', ('Sunshine4u'|Object\(SensitiveParameterValue\))\)) #1 {main} thrown in .+(\/|\\)pdo_utf8_conn\.php on line [0-9]+ From 36b48f02c112043a5ac84e20dcebd7163e022da3 Mon Sep 17 00:00:00 2001 From: v-makouz Date: Thu, 15 Dec 2022 15:20:30 -0800 Subject: [PATCH 11/21] Fix more deprecated issues --- test/functional/pdo_sqlsrv/MsCommon_mid-refactor.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/functional/pdo_sqlsrv/MsCommon_mid-refactor.inc b/test/functional/pdo_sqlsrv/MsCommon_mid-refactor.inc index 5c120200..f3e56994 100644 --- a/test/functional/pdo_sqlsrv/MsCommon_mid-refactor.inc +++ b/test/functional/pdo_sqlsrv/MsCommon_mid-refactor.inc @@ -203,9 +203,9 @@ class ColumnMeta // an identity column is not encrypted because a select query with identity column as the where clause is often run and the user want to have to bind parameter every time if (isColEncrypted() && ($this->encType == "deterministic" || $this->encType == "randomized") && $this->isEncryptableType() - && stripos($this->options, "identity") === false && stripos($this->options, "rowguidcol") === false) { + && ($this->options !== null && (stripos($this->options, "identity") === false && stripos($this->options, "rowguidcol") === false))) { $cekName = getCekName(); - if (stripos($this->dataType, "char") !== false) { + if ($this->dataType !== null && (stripos($this->dataType, "char") !== false)) { $append .= "COLLATE Latin1_General_BIN2 "; } $append .= sprintf("ENCRYPTED WITH (ENCRYPTION_TYPE = %s, ALGORITHM = 'AEAD_AES_256_CBC_HMAC_SHA_256', COLUMN_ENCRYPTION_KEY = $cekName) ", $this->encType); From e120fbc42257adaab9d5836d1a44a79b2eb0036b Mon Sep 17 00:00:00 2001 From: Sicong Date: Tue, 17 Jan 2023 13:34:56 -0800 Subject: [PATCH 12/21] Enable `ctype` in build scripts --- buildscripts/buildtools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildscripts/buildtools.py b/buildscripts/buildtools.py index 395cae1a..89bedad1 100644 --- a/buildscripts/buildtools.py +++ b/buildscripts/buildtools.py @@ -321,7 +321,7 @@ class BuildUtil(object): else: # pdo_sqlsrv cmd_line = ' --enable-pdo --with-pdo-sqlsrv=shared ' + cmd_line - cmd_line = 'cscript configure.js --disable-all --enable-cli --enable-cgi --enable-json --enable-embed --enable-mbstring' + cmd_line + cmd_line = 'cscript configure.js --disable-all --enable-cli --enable-cgi --enable-json --enable-embed --enable-mbstring --enable-ctype' + cmd_line if self.thread == 'nts': cmd_line = cmd_line + ' --disable-zts' return cmd_line From c72e0eb166a64d3d218297b20693c0b8cdbfd324 Mon Sep 17 00:00:00 2001 From: Sicong Date: Wed, 18 Jan 2023 17:41:39 -0800 Subject: [PATCH 13/21] Check null for stripos to avoid deprecated warning --- test/functional/pdo_sqlsrv/MsCommon_mid-refactor.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/functional/pdo_sqlsrv/MsCommon_mid-refactor.inc b/test/functional/pdo_sqlsrv/MsCommon_mid-refactor.inc index f3e56994..75379883 100644 --- a/test/functional/pdo_sqlsrv/MsCommon_mid-refactor.inc +++ b/test/functional/pdo_sqlsrv/MsCommon_mid-refactor.inc @@ -203,9 +203,9 @@ class ColumnMeta // an identity column is not encrypted because a select query with identity column as the where clause is often run and the user want to have to bind parameter every time if (isColEncrypted() && ($this->encType == "deterministic" || $this->encType == "randomized") && $this->isEncryptableType() - && ($this->options !== null && (stripos($this->options, "identity") === false && stripos($this->options, "rowguidcol") === false))) { + && ($this->options !== null && stripos($this->options, "identity") === false) && ($this->options !== null && stripos($this->options, "rowguidcol")) === false) { $cekName = getCekName(); - if ($this->dataType !== null && (stripos($this->dataType, "char") !== false)) { + if (stripos($this->dataType, "char") !== false) { $append .= "COLLATE Latin1_General_BIN2 "; } $append .= sprintf("ENCRYPTED WITH (ENCRYPTION_TYPE = %s, ALGORITHM = 'AEAD_AES_256_CBC_HMAC_SHA_256', COLUMN_ENCRYPTION_KEY = $cekName) ", $this->encType); From 35bf2a6bbd418bb7d192db6585196487df57c3a4 Mon Sep 17 00:00:00 2001 From: Sicong Date: Fri, 20 Jan 2023 14:38:37 -0800 Subject: [PATCH 14/21] Fix invalid precision value error --- source/shared/core_stmt.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/source/shared/core_stmt.cpp b/source/shared/core_stmt.cpp index 95161c46..2bf1556b 100644 --- a/source/shared/core_stmt.cpp +++ b/source/shared/core_stmt.cpp @@ -422,14 +422,15 @@ void core_sqlsrv_bind_param( _Inout_ sqlsrv_stmt* stmt, _In_ SQLUSMALLINT param_ else { if (Z_TYPE_P(param_z) == IS_STRING && column_size == SQLSRV_UNKNOWN_SIZE) { size_t char_size = (encoding == SQLSRV_ENCODING_UTF8) ? sizeof(SQLWCHAR) : sizeof(char); - SQLULEN byte_len = Z_STRLEN_P(param_z) * char_size; - - if (byte_len > SQL_SERVER_MAX_FIELD_SIZE) { - param_ptr->column_size = SQL_SERVER_MAX_TYPE_SIZE; - } - else { + SQLULEN byte_len = Z_STRLEN_P(param_z) * char_size; + if (byte_len > SQL_SERVER_MAX_FIELD_SIZE) { + param_ptr->column_size = SQL_SERVER_MAX_TYPE_SIZE; + } + else { + if (param_ptr->column_size == SQLSRV_UNKNOWN_SIZE) { param_ptr->column_size = SQL_SERVER_MAX_FIELD_SIZE / char_size; } + } } } From 2c606fe5d20ed57d646c186d0e7f234831c60c2e Mon Sep 17 00:00:00 2001 From: Sicong Date: Mon, 23 Jan 2023 12:24:11 -0800 Subject: [PATCH 15/21] Update pdo_azure_ad_managed_identity.phpt --- .../functional/pdo_sqlsrv/pdo_azure_ad_managed_identity.phpt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/functional/pdo_sqlsrv/pdo_azure_ad_managed_identity.phpt b/test/functional/pdo_sqlsrv/pdo_azure_ad_managed_identity.phpt index cf84d8a3..12748c35 100644 --- a/test/functional/pdo_sqlsrv/pdo_azure_ad_managed_identity.phpt +++ b/test/functional/pdo_sqlsrv/pdo_azure_ad_managed_identity.phpt @@ -90,10 +90,15 @@ function connectInvalidServerWithUser() require_once('MsSetup.inc'); // Make a connection to an invalid server +// Expect to get two error messages connectInvalidServer(); connectInvalidServerWithUser(); echo "Done\n"; ?> --EXPECT-- +Failed to connect +SQLSTATE[08001]: [Microsoft][ODBC Driver 17 for SQL Server]Named Pipes Provider: Could not open a connection to SQL Server [53]. +Failed to connect +SQLSTATE[08001]: [Microsoft][ODBC Driver 17 for SQL Server]Named Pipes Provider: Could not open a connection to SQL Server [53]. Done From ffafa4309576531117729f25f3960f3416f63215 Mon Sep 17 00:00:00 2001 From: absci Date: Mon, 23 Jan 2023 16:24:43 -0800 Subject: [PATCH 16/21] Slience warning to test --- test/functional/pdo_sqlsrv/MsCommon_mid-refactor.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/functional/pdo_sqlsrv/MsCommon_mid-refactor.inc b/test/functional/pdo_sqlsrv/MsCommon_mid-refactor.inc index 75379883..6d0c4c24 100644 --- a/test/functional/pdo_sqlsrv/MsCommon_mid-refactor.inc +++ b/test/functional/pdo_sqlsrv/MsCommon_mid-refactor.inc @@ -7,7 +7,7 @@ Common functions (shared by all tests). */ - +error_reporting( ~E_DEPRECATED ); $tvpIncPath = dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'inc'.DIRECTORY_SEPARATOR; require_once($tvpIncPath. 'test_tvp_data.php'); @@ -203,7 +203,7 @@ class ColumnMeta // an identity column is not encrypted because a select query with identity column as the where clause is often run and the user want to have to bind parameter every time if (isColEncrypted() && ($this->encType == "deterministic" || $this->encType == "randomized") && $this->isEncryptableType() - && ($this->options !== null && stripos($this->options, "identity") === false) && ($this->options !== null && stripos($this->options, "rowguidcol")) === false) { + && stripos($this->options, "identity") === false && stripos($this->options, "rowguidcol") === false) { $cekName = getCekName(); if (stripos($this->dataType, "char") !== false) { $append .= "COLLATE Latin1_General_BIN2 "; @@ -1840,4 +1840,4 @@ function compareResourceToInput($actual, $expected) } return $matched; -} +} \ No newline at end of file From cea2e8cc6980486242808746198b995d96dfb17f Mon Sep 17 00:00:00 2001 From: Sicong Date: Tue, 24 Jan 2023 11:33:28 -0800 Subject: [PATCH 17/21] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2f75d72e..e8c0c515 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ This release contains the SQLSRV and PDO_SQLSRV drivers for PHP 7.3+ with improv Thank you for taking the time to participate in the [sentiment survey](https://github.com/microsoft/msphpsql/wiki/Survey-Results). You can continue to help us improve by letting us know how we are doing and how you use [PHP][phpweb]: - +[**Click here to start the PHP survey**](https://aka.ms/mssqlphpsurvey) ### Status of Most Recent Builds | Azure Pipelines (Linux) | AppVeyor (Windows) | Coverage (Windows) | @@ -37,8 +37,8 @@ Please follow the [Getting started](https://docs.microsoft.com/sql/connect/php/g For full details on the system requirements for the drivers, see the [system requirements](https://docs.microsoft.com/sql/connect/php/system-requirements-for-the-php-sql-driver) on Microsoft Docs. On the client machine: -- 7.4.x, 8.0.x, 8.1.x -- [Microsoft ODBC Driver 17 or Microsoft ODBC Driver 13][odbcdoc] +- 7.4.x, 8.0.x, 8.1.x, 8.2.x +- [Microsoft ODBC Driver 18, 17 or 13][odbcdoc] - If using a Web server such as Internet Information Services (IIS) or Apache, it must be configured to run PHP On the server side, Microsoft SQL Server 2012 and above on Windows are supported, as are Microsoft SQL Server 2016 and above on Linux. From 86e3fbf4669440efb7b73b1e549cf45e37cdcfe5 Mon Sep 17 00:00:00 2001 From: absci Date: Tue, 24 Jan 2023 13:22:32 -0800 Subject: [PATCH 18/21] Remove test that expect an invalid driver error appveyor have ODBC 13 installed on their test agent --- test/functional/pdo_sqlsrv/pdo_connect_driver.phpt | 12 ------------ test/functional/sqlsrv/sqlsrv_connect_driver.phpt | 10 ---------- 2 files changed, 22 deletions(-) diff --git a/test/functional/pdo_sqlsrv/pdo_connect_driver.phpt b/test/functional/pdo_sqlsrv/pdo_connect_driver.phpt index 41180117..d5fa24e9 100644 --- a/test/functional/pdo_sqlsrv/pdo_connect_driver.phpt +++ b/test/functional/pdo_sqlsrv/pdo_connect_driver.phpt @@ -22,7 +22,6 @@ $conn = null; testValidValues(); testInvalidValues(); testEncryptedWithODBC(); -testWrongODBC(); echo "Done" . PHP_EOL; // end test @@ -118,17 +117,6 @@ function testEncryptedWithODBC() connectVerifyOutput($connectionOptions, "Using ODBC 13 for AE", $expected); } -function testWrongODBC() -{ - global $msodbcsqlMaj; - - $value = "ODBC Driver 13 for SQL Server"; - $connectionOptions = "Driver = $value;"; - $expected = "The specified ODBC Driver is not found."; - - connectVerifyOutput($connectionOptions, "Connect with ODBC 13", $expected); -} - ?> --EXPECT-- Done diff --git a/test/functional/sqlsrv/sqlsrv_connect_driver.phpt b/test/functional/sqlsrv/sqlsrv_connect_driver.phpt index a3f05e53..12a209fe 100644 --- a/test/functional/sqlsrv/sqlsrv_connect_driver.phpt +++ b/test/functional/sqlsrv/sqlsrv_connect_driver.phpt @@ -20,7 +20,6 @@ sqlsrv_close($conn); testValidValues($msodbcsqlMaj, $server, $connectionOptions); testInvalidValues($msodbcsqlMaj, $server, $connectionOptions); testEncryptedWithODBC($msodbcsqlMaj, $server, $connectionOptions); -testWrongODBC($msodbcsqlMaj, $server, $connectionOptions); echo "Done\n"; // end test @@ -115,15 +114,6 @@ function testEncryptedWithODBC($msodbcsqlMaj, $server, $connectionOptions) connectVerifyOutput($server, $connectionOptions, "Using ODBC 13 for AE", $expected); } -function testWrongODBC($msodbcsqlMaj, $server, $connectionOptions) -{ - $value = "ODBC Driver 13 for SQL Server"; - $connectionOptions['Driver']=$value; - $expected = "The specified ODBC Driver is not found."; - - connectVerifyOutput($server, $connectionOptions, "Connect with ODBC 13", $expected); -} - ?> --EXPECT-- Done From 04266af58cbda1397959a1b42a5db5e9cd9c6fc3 Mon Sep 17 00:00:00 2001 From: Sicong Date: Wed, 25 Jan 2023 10:14:40 -0800 Subject: [PATCH 19/21] Update changelog and version number (#1425) --- CHANGELOG.md | 27 ++++++++++++++++++++++++++ source/pdo_sqlsrv/config.m4 | 2 +- source/pdo_sqlsrv/config.w32 | 2 +- source/pdo_sqlsrv/pdo_dbh.cpp | 2 +- source/pdo_sqlsrv/pdo_init.cpp | 2 +- source/pdo_sqlsrv/pdo_parser.cpp | 2 +- source/pdo_sqlsrv/pdo_stmt.cpp | 2 +- source/pdo_sqlsrv/pdo_util.cpp | 2 +- source/pdo_sqlsrv/php_pdo_sqlsrv.h | 2 +- source/pdo_sqlsrv/php_pdo_sqlsrv_int.h | 2 +- source/pdo_sqlsrv/template.rc | 2 +- source/shared/FormattedPrint.cpp | 2 +- source/shared/FormattedPrint.h | 2 +- source/shared/StringFunctions.cpp | 2 +- source/shared/StringFunctions.h | 2 +- source/shared/core_conn.cpp | 2 +- source/shared/core_init.cpp | 2 +- source/shared/core_results.cpp | 2 +- source/shared/core_sqlsrv.h | 2 +- source/shared/core_stmt.cpp | 2 +- source/shared/core_stream.cpp | 2 +- source/shared/core_util.cpp | 2 +- source/shared/globalization.h | 2 +- source/shared/interlockedatomic.h | 2 +- source/shared/interlockedatomic_gcc.h | 2 +- source/shared/interlockedslist.h | 2 +- source/shared/localization.hpp | 2 +- source/shared/localizationimpl.cpp | 2 +- source/shared/msodbcsql.h | 2 +- source/shared/sal_def.h | 2 +- source/shared/typedefs_for_linux.h | 2 +- source/shared/version.h | 6 +++--- source/shared/xplat.h | 2 +- source/shared/xplat_intsafe.h | 2 +- source/shared/xplat_winerror.h | 2 +- source/shared/xplat_winnls.h | 2 +- source/sqlsrv/config.m4 | 2 +- source/sqlsrv/config.w32 | 2 +- source/sqlsrv/conn.cpp | 2 +- source/sqlsrv/init.cpp | 2 +- source/sqlsrv/php_sqlsrv.h | 2 +- source/sqlsrv/php_sqlsrv_int.h | 2 +- source/sqlsrv/stmt.cpp | 2 +- source/sqlsrv/template.rc | 2 +- source/sqlsrv/util.cpp | 2 +- 45 files changed, 73 insertions(+), 46 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3889d030..5f9183a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,33 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) +## 5.11.0-beta1 - 2023-01-25 +Updated PECL release packages. Here is the list of updates: + +### Added +- Support for PHP 8.2 + +### Fixed +- Pull request [#1408](https://github.com/microsoft/msphpsql/pull/1408) - Fixed right truncation issue, unit test added by talkinnl + +### 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 +- This release requires ODBC Driver 17.4.2 or above. Otherwise, a warning about failing to set an attribute may be suppressed when using an older ODBC driver. +- 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.10.1 - 2022-05-12 Updated PECL release packages. Here is the list of updates: diff --git a/source/pdo_sqlsrv/config.m4 b/source/pdo_sqlsrv/config.m4 index f91d84c0..4db1ec27 100644 --- a/source/pdo_sqlsrv/config.m4 +++ b/source/pdo_sqlsrv/config.m4 @@ -4,7 +4,7 @@ dnl dnl Contents: the code that will go into the configure script, indicating options, dnl external libraries and includes, and what source files are to be compiled. dnl -dnl Microsoft Drivers 5.10 for PHP for SQL Server +dnl Microsoft Drivers 5.11 for PHP for SQL Server dnl Copyright(c) Microsoft Corporation dnl All rights reserved. dnl MIT License diff --git a/source/pdo_sqlsrv/config.w32 b/source/pdo_sqlsrv/config.w32 index 0ec718f5..82e9c2c4 100644 --- a/source/pdo_sqlsrv/config.w32 +++ b/source/pdo_sqlsrv/config.w32 @@ -3,7 +3,7 @@ // // Contents: JScript build configuration used by buildconf.bat // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/pdo_sqlsrv/pdo_dbh.cpp b/source/pdo_sqlsrv/pdo_dbh.cpp index a21686d5..6473b2e3 100644 --- a/source/pdo_sqlsrv/pdo_dbh.cpp +++ b/source/pdo_sqlsrv/pdo_dbh.cpp @@ -3,7 +3,7 @@ // // Contents: Implements the PDO object for PDO_SQLSRV // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/pdo_sqlsrv/pdo_init.cpp b/source/pdo_sqlsrv/pdo_init.cpp index 3d7d2395..e9eee035 100644 --- a/source/pdo_sqlsrv/pdo_init.cpp +++ b/source/pdo_sqlsrv/pdo_init.cpp @@ -3,7 +3,7 @@ // // Contents: initialization routines for PDO_SQLSRV // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/pdo_sqlsrv/pdo_parser.cpp b/source/pdo_sqlsrv/pdo_parser.cpp index 2574a5ad..759ad94e 100644 --- a/source/pdo_sqlsrv/pdo_parser.cpp +++ b/source/pdo_sqlsrv/pdo_parser.cpp @@ -5,7 +5,7 @@ // // Copyright Microsoft Corporation // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/pdo_sqlsrv/pdo_stmt.cpp b/source/pdo_sqlsrv/pdo_stmt.cpp index 79bac4dd..b6a75045 100644 --- a/source/pdo_sqlsrv/pdo_stmt.cpp +++ b/source/pdo_sqlsrv/pdo_stmt.cpp @@ -3,7 +3,7 @@ // // Contents: Implements the PDOStatement object for the PDO_SQLSRV // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/pdo_sqlsrv/pdo_util.cpp b/source/pdo_sqlsrv/pdo_util.cpp index 1edec362..a1b131c8 100644 --- a/source/pdo_sqlsrv/pdo_util.cpp +++ b/source/pdo_sqlsrv/pdo_util.cpp @@ -3,7 +3,7 @@ // // Contents: Utility functions used by both connection or statement functions // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/pdo_sqlsrv/php_pdo_sqlsrv.h b/source/pdo_sqlsrv/php_pdo_sqlsrv.h index 923eb20d..acd68062 100644 --- a/source/pdo_sqlsrv/php_pdo_sqlsrv.h +++ b/source/pdo_sqlsrv/php_pdo_sqlsrv.h @@ -6,7 +6,7 @@ // // Contents: Declarations for the extension // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/pdo_sqlsrv/php_pdo_sqlsrv_int.h b/source/pdo_sqlsrv/php_pdo_sqlsrv_int.h index f4915de8..16957635 100644 --- a/source/pdo_sqlsrv/php_pdo_sqlsrv_int.h +++ b/source/pdo_sqlsrv/php_pdo_sqlsrv_int.h @@ -6,7 +6,7 @@ // // Contents: Internal declarations for the extension // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/pdo_sqlsrv/template.rc b/source/pdo_sqlsrv/template.rc index 82ca2f1e..8dac3221 100644 --- a/source/pdo_sqlsrv/template.rc +++ b/source/pdo_sqlsrv/template.rc @@ -3,7 +3,7 @@ // // Contents: Version resource // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/shared/FormattedPrint.cpp b/source/shared/FormattedPrint.cpp index 972aa243..d5044524 100644 --- a/source/shared/FormattedPrint.cpp +++ b/source/shared/FormattedPrint.cpp @@ -6,7 +6,7 @@ // Contents: Contains functions for handling Windows format strings // and UTF-16 on non-Windows platforms // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/shared/FormattedPrint.h b/source/shared/FormattedPrint.h index abf89395..c9005305 100644 --- a/source/shared/FormattedPrint.h +++ b/source/shared/FormattedPrint.h @@ -4,7 +4,7 @@ // Contents: Contains functions for handling Windows format strings // and UTF-16 on non-Windows platforms // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/shared/StringFunctions.cpp b/source/shared/StringFunctions.cpp index ff9d9e58..f4a3fa05 100644 --- a/source/shared/StringFunctions.cpp +++ b/source/shared/StringFunctions.cpp @@ -3,7 +3,7 @@ // // Contents: Contains functions for handling UTF-16 on non-Windows platforms // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/shared/StringFunctions.h b/source/shared/StringFunctions.h index 2af4afab..9fef95cc 100644 --- a/source/shared/StringFunctions.h +++ b/source/shared/StringFunctions.h @@ -3,7 +3,7 @@ // // Contents: Contains functions for handling UTF-16 on non-Windows platforms // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/shared/core_conn.cpp b/source/shared/core_conn.cpp index a5f87ba3..5133ede4 100644 --- a/source/shared/core_conn.cpp +++ b/source/shared/core_conn.cpp @@ -3,7 +3,7 @@ // // Contents: Core routines that use connection handles shared between sqlsrv and pdo_sqlsrv // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/shared/core_init.cpp b/source/shared/core_init.cpp index b42e4e34..6f372231 100644 --- a/source/shared/core_init.cpp +++ b/source/shared/core_init.cpp @@ -3,7 +3,7 @@ // // Contents: common initialization routines shared by PDO and sqlsrv // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/shared/core_results.cpp b/source/shared/core_results.cpp index 3b8a9d3a..447b1202 100644 --- a/source/shared/core_results.cpp +++ b/source/shared/core_results.cpp @@ -3,7 +3,7 @@ // // Contents: Result sets // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/shared/core_sqlsrv.h b/source/shared/core_sqlsrv.h index 40da6988..8a6661b7 100644 --- a/source/shared/core_sqlsrv.h +++ b/source/shared/core_sqlsrv.h @@ -6,7 +6,7 @@ // // Contents: Core routines and constants shared by the Microsoft Drivers for PHP for SQL Server // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/shared/core_stmt.cpp b/source/shared/core_stmt.cpp index 2bf1556b..4b673e27 100644 --- a/source/shared/core_stmt.cpp +++ b/source/shared/core_stmt.cpp @@ -3,7 +3,7 @@ // // Contents: Core routines that use statement handles shared between sqlsrv and pdo_sqlsrv // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/shared/core_stream.cpp b/source/shared/core_stream.cpp index f77e5e59..fda74b74 100644 --- a/source/shared/core_stream.cpp +++ b/source/shared/core_stream.cpp @@ -3,7 +3,7 @@ // // Contents: Implementation of PHP streams for reading SQL Server data // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/shared/core_util.cpp b/source/shared/core_util.cpp index 5c79e0b9..1a340f01 100644 --- a/source/shared/core_util.cpp +++ b/source/shared/core_util.cpp @@ -5,7 +5,7 @@ // // Comments: Mostly error handling and some type handling // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/shared/globalization.h b/source/shared/globalization.h index bacfe6bf..f0f2a7f4 100644 --- a/source/shared/globalization.h +++ b/source/shared/globalization.h @@ -4,7 +4,7 @@ // Contents: Contains functions for handling Windows format strings // and UTF-16 on non-Windows platforms // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/shared/interlockedatomic.h b/source/shared/interlockedatomic.h index 517a6729..162ef338 100644 --- a/source/shared/interlockedatomic.h +++ b/source/shared/interlockedatomic.h @@ -4,7 +4,7 @@ // Contents: Contains a portable abstraction for interlocked, atomic // operations on int32_t and pointer types. // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/shared/interlockedatomic_gcc.h b/source/shared/interlockedatomic_gcc.h index 582b6710..458d7e70 100644 --- a/source/shared/interlockedatomic_gcc.h +++ b/source/shared/interlockedatomic_gcc.h @@ -4,7 +4,7 @@ // Contents: Contains a portable abstraction for interlocked, atomic // operations on int32_t and pointer types. // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/shared/interlockedslist.h b/source/shared/interlockedslist.h index ad75f975..6ae2b691 100644 --- a/source/shared/interlockedslist.h +++ b/source/shared/interlockedslist.h @@ -4,7 +4,7 @@ // Contents: Contains a portable abstraction for interlocked, singly // linked list. // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/shared/localization.hpp b/source/shared/localization.hpp index a5b1c22f..4efd0b0c 100644 --- a/source/shared/localization.hpp +++ b/source/shared/localization.hpp @@ -3,7 +3,7 @@ // // Contents: Contains portable classes for localization // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/shared/localizationimpl.cpp b/source/shared/localizationimpl.cpp index 87ed39dc..a1aeef84 100644 --- a/source/shared/localizationimpl.cpp +++ b/source/shared/localizationimpl.cpp @@ -5,7 +5,7 @@ // Must be included in one c/cpp file per binary // A build error will occur if this inclusion policy is not followed // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/shared/msodbcsql.h b/source/shared/msodbcsql.h index b8ff4019..a0ad105e 100644 --- a/source/shared/msodbcsql.h +++ b/source/shared/msodbcsql.h @@ -20,7 +20,7 @@ // pecuniary loss) arising out of the use of or inability to use // this SDK, even if Microsoft has been advised of the possibility // of such damages. -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/shared/sal_def.h b/source/shared/sal_def.h index e87b63e9..37bb713a 100644 --- a/source/shared/sal_def.h +++ b/source/shared/sal_def.h @@ -3,7 +3,7 @@ // // Contents: Contains the minimal definitions to build on non-Windows platforms // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/shared/typedefs_for_linux.h b/source/shared/typedefs_for_linux.h index 72806f2c..7f645cd4 100644 --- a/source/shared/typedefs_for_linux.h +++ b/source/shared/typedefs_for_linux.h @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------------------------------------------------------- // File: typedefs_for_linux.h // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/shared/version.h b/source/shared/version.h index dacbd386..d1c19592 100644 --- a/source/shared/version.h +++ b/source/shared/version.h @@ -4,7 +4,7 @@ // File: version.h // Contents: Version number constants // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License @@ -59,7 +59,7 @@ #define _FILEVERSION SQLVERSION_MAJOR,SQLVERSION_MINOR,SQLVERSION_PATCH,SQLVERSION_BUILD // PECL package version ('-' or '+' is not allowed) - to support Pickle do not use macros below -#define PHP_SQLSRV_VERSION "5.10.1" -#define PHP_PDO_SQLSRV_VERSION "5.10.1" +#define PHP_SQLSRV_VERSION "5.11.0beta1" +#define PHP_PDO_SQLSRV_VERSION "5.11.0beta1" #endif // VERSION_H diff --git a/source/shared/xplat.h b/source/shared/xplat.h index ebdb20ed..f26a09ab 100644 --- a/source/shared/xplat.h +++ b/source/shared/xplat.h @@ -3,7 +3,7 @@ // // Contents: include for definition of Windows types for non-Windows platforms // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/shared/xplat_intsafe.h b/source/shared/xplat_intsafe.h index c4d93eeb..e9193d13 100644 --- a/source/shared/xplat_intsafe.h +++ b/source/shared/xplat_intsafe.h @@ -4,7 +4,7 @@ // Contents: This module defines helper functions to prevent // integer overflow bugs. // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/shared/xplat_winerror.h b/source/shared/xplat_winerror.h index 8aad6e23..3208dcfa 100644 --- a/source/shared/xplat_winerror.h +++ b/source/shared/xplat_winerror.h @@ -3,7 +3,7 @@ // // Contents: Contains the minimal definitions to build on non-Windows platforms // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/shared/xplat_winnls.h b/source/shared/xplat_winnls.h index 6cfc9071..576a65bb 100644 --- a/source/shared/xplat_winnls.h +++ b/source/shared/xplat_winnls.h @@ -3,7 +3,7 @@ // // Contents: Contains the minimal definitions to build on non-Windows platforms // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/sqlsrv/config.m4 b/source/sqlsrv/config.m4 index f06290ea..65823f3c 100644 --- a/source/sqlsrv/config.m4 +++ b/source/sqlsrv/config.m4 @@ -4,7 +4,7 @@ dnl dnl Contents: the code that will go into the configure script, indicating options, dnl external libraries and includes, and what source files are to be compiled. dnl -dnl Microsoft Drivers 5.10 for PHP for SQL Server +dnl Microsoft Drivers 5.11 for PHP for SQL Server dnl Copyright(c) Microsoft Corporation dnl All rights reserved. dnl MIT License diff --git a/source/sqlsrv/config.w32 b/source/sqlsrv/config.w32 index 68a2d220..445392e9 100644 --- a/source/sqlsrv/config.w32 +++ b/source/sqlsrv/config.w32 @@ -3,7 +3,7 @@ // // Contents: JScript build configuration used by buildconf.bat // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/sqlsrv/conn.cpp b/source/sqlsrv/conn.cpp index 4ae1a286..d3e6cf5d 100644 --- a/source/sqlsrv/conn.cpp +++ b/source/sqlsrv/conn.cpp @@ -3,7 +3,7 @@ // // Contents: Routines that use connection handles // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/sqlsrv/init.cpp b/source/sqlsrv/init.cpp index a6f6e711..45f89b5f 100644 --- a/source/sqlsrv/init.cpp +++ b/source/sqlsrv/init.cpp @@ -2,7 +2,7 @@ // File: init.cpp // Contents: initialization routines for the extension // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/sqlsrv/php_sqlsrv.h b/source/sqlsrv/php_sqlsrv.h index b30b41c6..16c02ca6 100644 --- a/source/sqlsrv/php_sqlsrv.h +++ b/source/sqlsrv/php_sqlsrv.h @@ -8,7 +8,7 @@ // // Comments: Also contains "internal" declarations shared across source files. // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/sqlsrv/php_sqlsrv_int.h b/source/sqlsrv/php_sqlsrv_int.h index d4011d20..e6acb845 100644 --- a/source/sqlsrv/php_sqlsrv_int.h +++ b/source/sqlsrv/php_sqlsrv_int.h @@ -8,7 +8,7 @@ // // Comments: Also contains "internal" declarations shared across source files. // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/sqlsrv/stmt.cpp b/source/sqlsrv/stmt.cpp index 100273fa..fe3b6dc2 100644 --- a/source/sqlsrv/stmt.cpp +++ b/source/sqlsrv/stmt.cpp @@ -3,7 +3,7 @@ // // Contents: Routines that use statement handles // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/sqlsrv/template.rc b/source/sqlsrv/template.rc index 4d8bcc32..58e99237 100644 --- a/source/sqlsrv/template.rc +++ b/source/sqlsrv/template.rc @@ -3,7 +3,7 @@ // // Contents: Version resource // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/sqlsrv/util.cpp b/source/sqlsrv/util.cpp index eaa801e0..0ab00969 100644 --- a/source/sqlsrv/util.cpp +++ b/source/sqlsrv/util.cpp @@ -5,7 +5,7 @@ // // Comments: Mostly error handling and some type handling // -// Microsoft Drivers 5.10 for PHP for SQL Server +// Microsoft Drivers 5.11 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License From d35c2b0f1bac57cbbdfbfbf2dfad46004c7aca04 Mon Sep 17 00:00:00 2001 From: Sicong Date: Wed, 25 Jan 2023 11:36:17 -0800 Subject: [PATCH 20/21] Update minor version (#1426) --- source/shared/version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/shared/version.h b/source/shared/version.h index d1c19592..5303b3ce 100644 --- a/source/shared/version.h +++ b/source/shared/version.h @@ -26,8 +26,8 @@ // Increase Minor with backward compatible new functionalities and API changes. // Increase Patch for backward compatible fixes. #define SQLVERSION_MAJOR 5 -#define SQLVERSION_MINOR 10 -#define SQLVERSION_PATCH 1 +#define SQLVERSION_MINOR 11 +#define SQLVERSION_PATCH 0 #define SQLVERSION_BUILD 0 // For previews, set this constant to 1, 2 and so on. Otherwise, set it to 0 From ee5baccde43ceb0b6457ab586fcef22ab2862974 Mon Sep 17 00:00:00 2001 From: Sicong Date: Thu, 26 Jan 2023 15:12:02 -0800 Subject: [PATCH 21/21] Update PHP version (#1428) --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e8c0c515..136284aa 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ The [Microsoft Drivers for PHP for Microsoft SQL Server][phpdoc] are PHP extensions that allow for the reading and writing of SQL Server data from within PHP scripts. The SQLSRV extension provides a procedural interface while the PDO_SQLSRV extension implements PHP Data Objects (PDO) for accessing data in all editions of SQL Server 2012 and later (including Azure SQL DB). These drivers rely on the [Microsoft ODBC Driver for SQL Server][odbcdoc] to handle the low-level communication with SQL Server. -This release contains the SQLSRV and PDO_SQLSRV drivers for PHP 7.3+ with improvements on both drivers and some limitations. Upcoming [releases][releases] will contain additional functionalities, bug fixes, and more. +This release contains the SQLSRV and PDO_SQLSRV drivers for PHP 8.0+ with improvements on both drivers and some limitations. Upcoming [releases][releases] will contain additional functionalities, bug fixes, and more. ## Take our survey @@ -37,7 +37,7 @@ Please follow the [Getting started](https://docs.microsoft.com/sql/connect/php/g For full details on the system requirements for the drivers, see the [system requirements](https://docs.microsoft.com/sql/connect/php/system-requirements-for-the-php-sql-driver) on Microsoft Docs. On the client machine: -- 7.4.x, 8.0.x, 8.1.x, 8.2.x +- 8.0.x, 8.1.x, 8.2.x - [Microsoft ODBC Driver 18, 17 or 13][odbcdoc] - If using a Web server such as Internet Information Services (IIS) or Apache, it must be configured to run PHP @@ -47,7 +47,7 @@ On the server side, Microsoft SQL Server 2012 and above on Windows are supported The drivers are distributed as pre-compiled extensions for PHP found on the [releases page][releases]. They are available in thread-safe and non-thread-safe versions, and in 32-bit (Windows only) and 64-bit versions. The source code for the drivers is also available, and you can compile them as thread safe or non-thread-safe versions. The thread safety configuration of your web server will determine which version you need. -If you choose to build the drivers, you must be able to build PHP 7.* or 8.* without including these extensions. For help building PHP on Windows, see the [official PHP website][phpbuild]. For details on compiling the drivers, see the [documentation](https://github.com/microsoft/msphpsql/blob/master/buildscripts/README.md) -- an example buildscript is provided, but you can also compile the drivers manually. +If you choose to build the drivers, you must be able to build PHP 8.* without including these extensions. For help building PHP on Windows, see the [official PHP website][phpbuild]. For details on compiling the drivers, see the [documentation](https://github.com/microsoft/msphpsql/blob/master/buildscripts/README.md) -- an example buildscript is provided, but you can also compile the drivers manually. To load the drivers, make sure that the driver is in your PHP extension directory and enable it in your PHP installation's php.ini file by adding `extension=php_sqlsrv.dll` and/or `extension=php_pdo_sqlsrv.dll` to the ini file. If necessary, specify the extension directory using `extension_dir`, for example: `extension_dir = "C:\PHP\ext"`. Note that the precompiled binaries have different names -- substitute accordingly in php.ini. For more details on loading the drivers, see [Loading the PHP SQL Driver](https://docs.microsoft.com/sql/connect/php/loading-the-php-sql-driver) on Microsoft Docs.