Skip to content

Update pipeline #1482

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 2 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
21 changes: 10 additions & 11 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@ environment:
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
BUILD_PLATFORM: x64
TEST_PHP_SQL_SERVER: (local)\SQL2017
SQL_INSTANCE: SQL2017
PHP_VC: vc15
PHP_MAJOR_VER: 7.4
PHP_MINOR_VER: latest
PHP_EXE_PATH: x64\Release_TS
THREAD: ts
platform: x64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
BUILD_PLATFORM: x86
TEST_PHP_SQL_SERVER: (local)\SQL2019
Expand All @@ -35,7 +25,16 @@ environment:
PHP_EXE_PATH: Release
THREAD: nts
platform: x86

- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
BUILD_PLATFORM: x86
TEST_PHP_SQL_SERVER: (local)\SQL2019
SQL_INSTANCE: SQL2019
PHP_VC: vs16
PHP_MAJOR_VER: 8.1
PHP_MINOR_VER: latest
PHP_EXE_PATH: Release
THREAD: nts
platform: x86
# PHP_MAJOR_VER is PHP major version to build (7.4, 7.3)
# PHP_MINOR_VER is PHP point release number (or latest for latest release)
# PHP_VC is the Visual C++ version
Expand Down
7 changes: 4 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:

- job: Linux
variables:
phpver: 8.0
phpver: 8.1
pool:
vmImage: 'ubuntu-20.04'
steps:
Expand Down Expand Up @@ -185,7 +185,7 @@ jobs:
sed -i -e 's/TARGET_PASSWORD/'"$(pwd)"'/g' MsSetup.inc

export LC_ALL='en_US.UTF-8'
php run-tests.php -P ./*.phpt --no-color 2>&1 | tee ../sqlsrv.log
php run-tests.php -P ./*.phpt --no-color --show-diff 2>&1 | tee ../sqlsrv.log
displayName: 'Run sqlsrv functional tests'

- script: |
Expand All @@ -196,7 +196,7 @@ jobs:
sed -i -e 's/TARGET_PASSWORD/'"$(pwd)"'/g' MsSetup.inc

export LC_ALL='en_US.UTF-8'
php run-tests.php -P ./*.phpt --no-color 2>&1 | tee ../pdo_sqlsrv.log
php run-tests.php -P ./*.phpt --no-color --show-diff 2>&1 | tee ../pdo_sqlsrv.log
displayName: 'Run pdo_sqlsrv functional tests'

- script: |
Expand All @@ -213,6 +213,7 @@ jobs:
PYTHONWARNINGS: ignore::yaml.YAMLLoadWarning

- script: |
docker logs -t $(host)
cd $(Build.SourcesDirectory)/test/functional/
for f in sqlsrv/*.diff; do ls $f 2>/dev/null; cat $f 2>/dev/null; echo ''; done || true
for f in pdo_sqlsrv/*.diff; do ls $f 2>/dev/null; cat $f 2>/dev/null; echo ''; done || true
Expand Down
77 changes: 39 additions & 38 deletions test/functional/pdo_sqlsrv/pdo_678_conn_resiliency_pooling.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
GitHub issue #678 - Idle Connection Resiliency doesn't work with Connection Pooling
--DESCRIPTION--
Verifies that the issue has been fixed with ODBC 17.1
--FLAKY--
--ENV--
PHPT_EXEC=true
--SKIPIF--
Expand All @@ -23,21 +24,21 @@ function checkODBCVersion($conn)
}
}

function breakConnection($conn, $conn_break)
function breakConnection($conn, $conn_break)
{
try {
$stmt1 = $conn->query("SELECT @@SPID");
try {
$stmt1 = $conn->query("SELECT @@SPID");
$obj = $stmt1->fetch(PDO::FETCH_NUM);
$spid = $obj[0];

$stmt2 = $conn_break->prepare("KILL $spid");
$stmt2->execute();
$stmt2 = $conn_break->prepare("KILL $spid");
$stmt2->execute();
sleep(1);
} catch (Exception $e) {
print_r($e->getMessage());
}
}

}
// create a connection for create the table and breaking other connections
$conn_break = connect();

Expand All @@ -49,65 +50,65 @@ if (! checkODBCVersion($conn_break)) {
$tableName = "test_connres";
dropTable($conn_break, $tableName);

try {

$sql = "CREATE TABLE $tableName (c1 INT, c2 VARCHAR(40))";
$stmt = $conn_break->query($sql);

$sql = "INSERT INTO $tableName VALUES (?, ?)";
try {
$sql = "CREATE TABLE $tableName (c1 INT, c2 VARCHAR(40))";
$stmt = $conn_break->query($sql);
$sql = "INSERT INTO $tableName VALUES (?, ?)";
$stmt = $conn_break->prepare($sql);
for ($t = 200; $t < 209; $t++) {
for ($t = 200; $t < 209; $t++) {
$ts = substr(sha1($t), 0, 5);
$stmt->bindValue(1, $t);
$stmt->bindValue(1, $t);
$stmt->bindValue(2, $ts);
$stmt->execute();
}
$stmt->execute();
}
} catch (PDOException $e) {
echo "Could not connect.\n";
print_r($e->getMessage());
}

// first connection
$connectionInfo = "ConnectRetryCount = 10; ConnectRetryInterval = 10; ConnectionPooling = 1;";
// first connection
$connectionInfo = "ConnectRetryCount = 20; ConnectRetryInterval = 10; ConnectionPooling = 1;";
try {
$conn = connect($connectionInfo, array(), PDO::ERRMODE_EXCEPTION, true);
} catch (PDOException $e) {
echo "Error in connection 1.\n";
print_r($e->getMessage());
}

breakConnection($conn, $conn_break);
breakConnection($conn, $conn_break);

$query = "SELECT * FROM $tableName";
try {
try {
$stmt = $conn->prepare($query, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL, PDO::SQLSRV_ATTR_CURSOR_SCROLL_TYPE => PDO::SQLSRV_CURSOR_BUFFERED));
if (!$stmt || !$stmt->execute()) {
echo "Statement 1 failed.\n";
}

$row_count = $stmt->rowCount();
$row_count = $stmt->rowCount();
if ($row_count != 9) {
echo "Unexpected $row_count rows in result set.\n";
}
} catch (PDOException $e) {
echo "Error executing query with connection 1.\n";
print_r($e->getMessage());
}

}
unset($stmt);
unset($conn);

// second connection
unset($conn);
// second connection
try {
$conn = connect($connectionInfo, array(), PDO::ERRMODE_EXCEPTION, true);
} catch (PDOException $e) {
echo "Error in connection 2.\n";
print_r($e->getMessage());
}

breakConnection($conn, $conn_break);

// would connection be able to resume here if connection pooling is enabled?
breakConnection($conn, $conn_break);
// would connection be able to resume here if connection pooling is enabled?
try {
$stmt2 = $conn->query($query);
if (!$stmt2) {
Expand All @@ -122,15 +123,15 @@ try {
echo "Error executing query with connection 2.\n";
print_r($e->getMessage());
}

dropTable($conn, $tableName);

echo "Done\n";

unset($stmt2);
unset($stmt2);
unset($conn);
unset($conn_break);

?>
--EXPECT--
Done
Loading