Added ComputePool (#1342)

This commit is contained in:
Jenny Tam 2021-12-07 15:29:03 -08:00 committed by GitHub
parent 3e571bb384
commit c395539132
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 67 additions and 0 deletions

View file

@ -68,6 +68,7 @@ const char TrustServerCertificate[] = "TrustServerCertificate";
const char TransactionIsolation[] = "TransactionIsolation";
const char TransparentNetworkIPResolution[] = "TransparentNetworkIPResolution";
const char WSID[] = "WSID";
const char ComputePool[] = "ComputePool";
}
@ -468,6 +469,15 @@ const connection_option PDO_CONN_OPTS[] = {
CONN_ATTR_STRING,
conn_str_append_func::func
},
{
PDOConnOptionNames::ComputePool,
sizeof(PDOConnOptionNames::ComputePool),
SQLSRV_CONN_OPTION_COMPUTE_POOL,
ODBCConnOptions::ComputePool,
sizeof(ODBCConnOptions::ComputePool),
CONN_ATTR_STRING,
conn_str_append_func::func
},
{ NULL, 0, SQLSRV_CONN_OPTION_INVALID, NULL, 0 , CONN_ATTR_INVALID, NULL }, //terminate the table
};

View file

@ -1164,6 +1164,7 @@ const char WSID[] = "WSID";
const char UID[] = "UID";
const char PWD[] = "PWD";
const char SERVER[] = "Server";
const char ComputePool[] = "ComputePool";
}
@ -1201,6 +1202,7 @@ enum SQLSRV_CONN_OPTIONS {
SQLSRV_CONN_OPTION_TRANSPARENT_NETWORK_IP_RESOLUTION,
SQLSRV_CONN_OPTION_CONN_RETRY_COUNT,
SQLSRV_CONN_OPTION_CONN_RETRY_INTERVAL,
SQLSRV_CONN_OPTION_COMPUTE_POOL,
// Driver specific connection options
SQLSRV_CONN_OPTION_DRIVER_SPECIFIC = 1000,

View file

@ -258,6 +258,7 @@ const char TransactionIsolation[] = "TransactionIsolation";
const char TransparentNetworkIPResolution[] = "TransparentNetworkIPResolution";
const char UID[] = "UID";
const char WSID[] = "WSID";
const char ComputePool[] = "ComputePool";
}
@ -603,6 +604,16 @@ const connection_option SS_CONN_OPTS[] = {
CONN_ATTR_INT,
decimal_places_func::func
},
{
SSConnOptionNames::ComputePool,
sizeof(SSConnOptionNames::ComputePool),
SQLSRV_CONN_OPTION_COMPUTE_POOL,
ODBCConnOptions::ComputePool,
sizeof(ODBCConnOptions::ComputePool),
CONN_ATTR_STRING,
conn_str_append_func::func
},
{ NULL, 0, SQLSRV_CONN_OPTION_INVALID, NULL, 0 , CONN_ATTR_INVALID, NULL }, //terminate the table
};

View file

@ -0,0 +1,23 @@
--TEST--
Test ComputePool keyword
--DESCRIPTION--
This test does not test if any connection is successful but mainly test if the computepool keyword is recognized.
--SKIPIF--
<?php require('skipif.inc');?>
--FILE--
<?php
require_once 'MsSetup.inc';
try {
$connectionInfo = "ComputePool = pool1;";
$conn1 = new PDO("sqlsrv:server = $server; $connectionInfo", $uid, $pwd);
} catch (PDOException $e) {
// do nothing
}
unset($conn1);
echo 'Done' . PHP_EOL;
?>
--EXPECT--
Done

View file

@ -0,0 +1,21 @@
--TEST--
Test ComputePool keyword
--DESCRIPTION--
This test does not test if any connection is successful but mainly test if the computepool keyword is recognized.
--SKIPIF--
<?php require('skipif.inc');?>
--FILE--
<?php
require_once 'MsSetup.inc';
$connectionOptions = array('ComputePool' => 'pool1');
$conn = sqlsrv_connect($server, $connectionOptions);
if ($conn != false) {
sqlsrv_close($conn);
}
echo 'Done' . PHP_EOL;
?>
--EXPECT--
Done