Skip to content
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

Odbc 172 update for connres and appveyor #814

Merged
merged 7 commits into from
Jul 13, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ install:
} Else {
$env:PHP_VERSION=$env:PHP_MAJOR_VER + '.' + $env:PHP_MINOR_VER;
}
- echo Downloading MSODBCSQL 17.1
- echo Downloading MSODBCSQL 17.2
# 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/msodbcsql_17.1.0.1_x64.msi', 'c:\projects\msodbcsql_17.1.0.1_x64.msi')
- cmd /c start /wait msiexec /i "c:\projects\msodbcsql_17.1.0.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/msodbcsql_17.2.0.1_x64.msi', 'c:\projects\msodbcsql_17.2.0.1_x64.msi')
- cmd /c start /wait msiexec /i "c:\projects\msodbcsql_17.2.0.1_x64.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
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ do not need to be encrypted
--ENV--
PHPT_EXEC=true
--SKIPIF--
<?php require('skipif_unix.inc'); ?>
<?php require('skipif_mid-refactor.inc'); ?>
--FILE--
<?php
require_once("MsSetup.inc");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Test the Authentication keyword and three options: SqlPassword, ActiveDirectoryIntegrated, and ActiveDirectoryPassword.
--SKIPIF--
<?php require('skipif.inc');
require('skipif_unix.phpt');
require('skipif_version_less_than_2k16.inc'); ?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think starting with ODBC 17 Azure AD works outside Windows too.

--FILE--
<?php
Expand Down
2 changes: 1 addition & 1 deletion test/functional/pdo_sqlsrv/pdo_connect_encrypted.phpt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--TEST--
Test new connection keyword ColumnEncryption
--SKIPIF--
<?php require('skipif_unix.inc'); ?>
<?php require('skipif_mid-refactor.inc'); ?>
--FILE--
<?php
require_once("MsSetup.inc");
Expand Down
33 changes: 17 additions & 16 deletions test/functional/pdo_sqlsrv/pdo_connection_resiliency.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ killing the connection and then not freeing it. The latter case is the only one
that should fail. Finally, execute two queries in two threads on a recovered
non-MARS connection. This should fail too.
--SKIPIF--
<?php require('skipif_protocol_not_tcp.inc');
<?php require('skipif_mid-refactor.inc');
require('skipif_protocol_not_tcp.inc');
require('skipif_version_less_than_2k14.inc'); ?>
--FILE--
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe put skipif_mid-refactor.inc to the end? because it skips sql server < 2016?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skipif_mid-refactor doesn't skip any SQL Server unless AE is set, in which case it will skip versions < 2016. That's what we want isn't it?

<?php
Expand Down Expand Up @@ -208,18 +209,18 @@ unset($conn_break);

?>
--EXPECTREGEX--
Statement 1 successful.
16 rows in result set.
Statement 2 successful.
9 rows in result set.
Statement 3 successful.
-1 rows in result set.
Statement 4 successful.
-1 rows in result set.
Statement 5 successful.
-1 rows in result set.
Error executing statement 6.
SQLSTATE\[08S02\]: \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]TCP Provider: An existing connection was forcibly closed by the remote host.
Statement 7 successful.
Error executing statement 8.
SQLSTATE\[IMSSP\]: The connection cannot process this operation because there is a statement with pending results. To make the connection available for other queries, either fetch all results or cancel or free the statement. For more information, see the product documentation about the MultipleActiveResultSets connection option.
Statement 1 successful\.
16 rows in result set\.
Statement 2 successful\.
9 rows in result set\.
Statement 3 successful\.
-1 rows in result set\.
Statement 4 successful\.
-1 rows in result set\.
Statement 5 successful\.
-1 rows in result set\.
Error executing statement 6\.
SQLSTATE\[08S02\]: \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]TCP Provider: (An existing connection was forcibly closed by the remote host\.|Error code 0x20)
Statement 7 successful\.
Error executing statement 8\.
SQLSTATE\[IMSSP\]: The connection cannot process this operation because there is a statement with pending results\. To make the connection available for other queries, either fetch all results or cancel or free the statement. For more information, see the product documentation about the MultipleActiveResultSets connection option.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--TEST--
Test the connection resiliency keywords ConnectRetryCount and ConnectRetryInterval and their ranges of acceptable values
--SKIPIF--
<?php require('skipif_unix.inc');
<?php require('skipif_mid-refactor.inc');
require('skipif_version_less_than_2k14.inc'); ?>
--FILE--
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment earlier about skipif_mid-refactor.inc

<?php
Expand Down Expand Up @@ -70,15 +70,15 @@ catch( PDOException $e )
Connected successfully on first attempt.
Connected successfully on second attempt.
Could not connect on third attempt.
SQLSTATE\[08001\]: \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Invalid value specified for connection string attribute 'ConnectRetryCount'
SQLSTATE\[08001\]: (\[unixODBC\]|)\[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Invalid value specified for connection string attribute 'ConnectRetryCount'
Could not connect on fourth attempt.
SQLSTATE\[08001\]: \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Invalid value specified for connection string attribute 'ConnectRetryInterval'
SQLSTATE\[08001\]: (\[unixODBC\]|)\[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Invalid value specified for connection string attribute 'ConnectRetryInterval'
Could not connect on fifth attempt.
SQLSTATE\[08001\]: \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Invalid value specified for connection string attribute 'ConnectRetryCount'
SQLSTATE\[08001\]: (\[unixODBC\]|)\[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Invalid value specified for connection string attribute 'ConnectRetryCount'
Could not connect on sixth attempt.
SQLSTATE\[08001\]: \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Invalid value specified for connection string attribute 'ConnectRetryCount'
SQLSTATE\[08001\]: (\[unixODBC\]|)\[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Invalid value specified for connection string attribute 'ConnectRetryCount'
Could not connect on seventh attempt.
SQLSTATE\[08001\]: \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Invalid value specified for connection string attribute 'ConnectRetryInterval'
SQLSTATE\[08001\]: (\[unixODBC\]|)\[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Invalid value specified for connection string attribute 'ConnectRetryInterval'
Could not connect on eighth attempt.
SQLSTATE\[IMSSP\]: The DSN string ended unexpectedly.
Could not connect on ninth attempt.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Prepare a statement, break the connection, and execute the statement. Then
test transactions by breaking the connection before beginning a transaction
and in the middle of the transaction. The latter case should fail.
--SKIPIF--
<?php require('skipif_protocol_not_tcp.inc');
<?php require('skipif_mid-refactor.inc');
require('skipif_protocol_not_tcp.inc');
require('skipif_version_less_than_2k14.inc'); ?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here... otherwise, this test will be skipped even when running against sql server 2014

--FILE--
<?php
Expand Down Expand Up @@ -208,10 +209,10 @@ $conn_break = null;

?>
--EXPECTREGEX--
Statement 1 prepared.
Statement 1 executed.
Transaction begun.
Transaction was committed.
Transaction begun.
SQLSTATE\[08S02\]: \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]TCP Provider: An existing connection was forcibly closed by the remote host.
Statement 1 prepared\.
Statement 1 executed\.
Transaction begun\.
Transaction was committed\.
Transaction begun\.
SQLSTATE\[08S02\]: \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]TCP Provider: (An existing connection was forcibly closed by the remote host\.|Error code 0x20)
SQLSTATE\[08S01\]: \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Communication link failure
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Test connection resiliency timeouts
1. Connect with ConnectRetryCount equal to 0.
2. Reconnect with the default value of ConnectRetryCount(1).
--SKIPIF--
<?php require('skipif_protocol_not_tcp.inc');
<?php require('skipif_mid-refactor.inc');
require('skipif_protocol_not_tcp.inc');
require('skipif_version_less_than_2k14.inc'); ?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again this one too

--FILE--
<?php
Expand Down Expand Up @@ -83,6 +84,6 @@ DropTables( $server, $uid, $pwd, $tableName1, $tableName2 );

?>
--EXPECTREGEX--
Error executing statement 1.
SQLSTATE\[08S02\]: \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]TCP Provider: An existing connection was forcibly closed by the remote host.
Query successfully executed.
Error executing statement 1\.
SQLSTATE\[08S02\]: \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]TCP Provider: [An existing connection was forcibly closed by the remote host\.|Error code 0x20]
Query successfully executed\.
2 changes: 0 additions & 2 deletions test/functional/pdo_sqlsrv/skipif_protocol_not_tcp.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<?php
if ( !( strtoupper( substr( php_uname( 's' ),0,3 ) ) === 'WIN' ) ) die( "Skip Test on windows only." );

if (!extension_loaded("pdo_sqlsrv")) {
die("skip Extension not loaded");
}
Expand Down
23 changes: 12 additions & 11 deletions test/functional/pdo_sqlsrv/skipif_version_less_than_2k14.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<?php
if ( !( strtoupper( substr( php_uname( 's' ),0,3 ) ) === 'WIN' ) ) die( "Skip Test on windows only." );

if (!extension_loaded("pdo_sqlsrv")) {
die("skip Extension not loaded");
}
Expand All @@ -13,16 +11,19 @@ if ($conn === false) {
}

// Get SQL Server Version
$stmt = $conn->query( "SELECT @@VERSION" );
if ($stmt) {
$ver_string = $stmt->fetch(PDO::FETCH_NUM)[0];
} else {
die( "skip Could not fetch SQL Server version during SKIPIF.");
}
// Exclude this check if running on Azure
if (!$daasMode) {
$stmt = $conn->query( "SELECT @@VERSION" );
if ($stmt) {
$ver_string = $stmt->fetch(PDO::FETCH_NUM)[0];
} else {
die( "skip Could not fetch SQL Server version during SKIPIF.");
}

$version = explode(' ', $ver_string);
$version = explode(' ', $ver_string);

if ($version[3] < '2014') {
die("skip Wrong version of SQL Server, 2014 or later required");
if ($version[3] < '2014') {
die("skip Wrong version of SQL Server, 2014 or later required");
}
}
?>
2 changes: 0 additions & 2 deletions test/functional/pdo_sqlsrv/skipif_version_less_than_2k16.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<?php
if ( !( strtoupper( substr( php_uname( 's' ),0,3 ) ) === 'WIN' ) ) die( "Skip Test on windows only." );

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this one and the equivalent one for 2k14 need to check ODBC version? only works for 17.2 right?

if (!extension_loaded("pdo_sqlsrv")) {
die("skip Extension not loaded");
}
Expand Down
14 changes: 6 additions & 8 deletions test/functional/sqlsrv/connection_resiliency.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -217,20 +217,18 @@ Array
\(
\[0\] => 08S01
\[SQLSTATE\] => 08S01
\[1\] => 10054
\[code\] => 10054
\[2\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]TCP Provider: An existing connection was forcibly closed by the remote host.

\[message\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]TCP Provider: An existing connection was forcibly closed by the remote host.

\[1\] => (10054|104)
\[code\] => (10054|104)
\[2\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]TCP Provider: (An existing connection was forcibly closed by the remote host\.\n|Error code 0x68)
\[message\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]TCP Provider: (An existing connection was forcibly closed by the remote host\.\n|Error code 0x68)
\)

\[1\] => Array
\(
\[0\] => 08S01
\[SQLSTATE\] => 08S01
\[1\] => 10054
\[code\] => 10054
\[1\] => (10054|104)
\[code\] => (10054|104)
\[2\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Communication link failure
\[message\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Communication link failure
\)
Expand Down
15 changes: 7 additions & 8 deletions test/functional/sqlsrv/connection_resiliency_keywords.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ Test the connection resiliency keywords
--DESCRIPTION--
Test the connection resiliency keywords ConnectRetryCount and ConnectRetryInterval and their ranges of acceptable values
--SKIPIF--
<?php require('skipif_unix.inc');
require('skipif_version_less_than_2k14.inc'); ?>
<?php require('skipif_version_less_than_2k14.inc'); ?>
--FILE--
<?php
require_once( "MsSetup.inc" );
Expand Down Expand Up @@ -76,8 +75,8 @@ Array
\[SQLSTATE\] => 08001
\[1\] => 0
\[code\] => 0
\[2\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Invalid value specified for connection string attribute 'ConnectRetryCount'
\[message\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Invalid value specified for connection string attribute 'ConnectRetryCount'
\[2\] => (\[unixODBC\]|)\[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Invalid value specified for connection string attribute 'ConnectRetryCount'
\[message\] => (\[unixODBC\]|)\[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Invalid value specified for connection string attribute 'ConnectRetryCount'
\)

\)
Expand All @@ -90,8 +89,8 @@ Array
\[SQLSTATE\] => 08001
\[1\] => 0
\[code\] => 0
\[2\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Invalid value specified for connection string attribute 'ConnectRetryInterval'
\[message\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Invalid value specified for connection string attribute 'ConnectRetryInterval'
\[2\] => (\[unixODBC\]|)\[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Invalid value specified for connection string attribute 'ConnectRetryInterval'
\[message\] => (\[unixODBC\]|)\[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Invalid value specified for connection string attribute 'ConnectRetryInterval'
\)

\)
Expand All @@ -104,8 +103,8 @@ Array
\[SQLSTATE\] => 08001
\[1\] => 0
\[code\] => 0
\[2\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Invalid value specified for connection string attribute 'ConnectRetryCount'
\[message\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Invalid value specified for connection string attribute 'ConnectRetryCount'
\[2\] => (\[unixODBC\]|)\[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Invalid value specified for connection string attribute 'ConnectRetryCount'
\[message\] => (\[unixODBC\]|)\[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Invalid value specified for connection string attribute 'ConnectRetryCount'
\)

\)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,20 +187,18 @@ Array
\(
\[0\] => 08S02
\[SQLSTATE\] => 08S02
\[1\] => 10054
\[code\] => 10054
\[2\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]TCP Provider: An existing connection was forcibly closed by the remote host.

\[message\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]TCP Provider: An existing connection was forcibly closed by the remote host.

\[1\] => (10054|-1)
\[code\] => (10054|-1)
\[2\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\](TCP Provider: An existing connection was forcibly closed by the remote host\.\n|SMux Provider: Physical connection is not usable \[xFFFFFFFF\])\.
\[message\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\](TCP Provider: An existing connection was forcibly closed by the remote host\.\n|SMux Provider: Physical connection is not usable \[xFFFFFFFF\])\.
\)

\[1\] => Array
\(
\[0\] => 08S02
\[SQLSTATE\] => 08S02
\[1\] => 10054
\[code\] => 10054
\[1\] => (10054|-1)
\[code\] => (10054|-1)
\[2\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Unable to open a logical session
\[message\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Unable to open a logical session
\)
Expand Down
14 changes: 6 additions & 8 deletions test/functional/sqlsrv/connection_resiliency_timeouts.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,18 @@ Array
\(
\[0\] => 08S01
\[SQLSTATE\] => 08S01
\[1\] => 10054
\[code\] => 10054
\[2\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]TCP Provider: An existing connection was forcibly closed by the remote host.

\[message\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]TCP Provider: An existing connection was forcibly closed by the remote host.

\[1\] => (10054|104)
\[code\] => (10054|104)
\[2\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]TCP Provider: (An existing connection was forcibly closed by the remote host\.\n|Error code 0x68)
\[message\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]TCP Provider: (An existing connection was forcibly closed by the remote host\.\n|Error code 0x68)
\)

\[1\] => Array
\(
\[0\] => 08S01
\[SQLSTATE\] => 08S01
\[1\] => 10054
\[code\] => 10054
\[1\] => (10054|104)
\[code\] => (10054|104)
\[2\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Communication link failure
\[message\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Communication link failure
\)
Expand Down
2 changes: 0 additions & 2 deletions test/functional/sqlsrv/skipif_protocol_not_tcp.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<?php
if ( !( strtoupper( substr( php_uname( 's' ),0,3 ) ) === 'WIN' ) ) die( "Skip Test on windows only." );

if (!extension_loaded("sqlsrv")) {
die("skip Extension not loaded");
}
Expand Down
2 changes: 0 additions & 2 deletions test/functional/sqlsrv/skipif_version_less_than_2k14.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<?php
if ( !( strtoupper( substr( php_uname( 's' ),0,3 ) ) === 'WIN' ) ) die( "Skip Test on windows only." );

if (!extension_loaded("sqlsrv")) {
die("skip Extension not loaded");
}
Expand Down
2 changes: 0 additions & 2 deletions test/functional/sqlsrv/skipif_version_less_than_2k16.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<?php
if ( !( strtoupper( substr( php_uname( 's' ),0,3 ) ) === 'WIN' ) ) die( "Skip Test on windows only." );

if (!extension_loaded("sqlsrv")) {
die("skip Extension not loaded");
}
Expand Down
1 change: 1 addition & 0 deletions test/functional/sqlsrv/sqlsrv_azure_ad_authentication.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Test the Authentication keyword and three options: SqlPassword, ActiveDirectoryIntegrated, and ActiveDirectoryPassword.
--SKIPIF--
<?php require('skipif.inc');
require('skipif_unix.inc');
require('skipif_version_less_than_2k16.inc'); ?>
--FILE--
<?php
Expand Down