Updated list of supported processor architecture (#1290)
This commit is contained in:
parent
fffd63f3c7
commit
f66b2c3e8a
|
@ -383,7 +383,7 @@ pdo_error PDO_ERRORS[] = {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
SQLSRV_ERROR_CE_DRIVER_REQUIRED,
|
SQLSRV_ERROR_CE_DRIVER_REQUIRED,
|
||||||
{ IMSSP, (SQLCHAR*) "The Always Encrypted feature requires Microsoft ODBC Driver 17 for SQL Server.", -78, false }
|
{ IMSSP, (SQLCHAR*) "The Always Encrypted feature requires Microsoft ODBC Driver 17 for SQL Server (or above) for %1!s!.", -78, true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
SQLSRV_ERROR_CONNECT_INVALID_DRIVER,
|
SQLSRV_ERROR_CONNECT_INVALID_DRIVER,
|
||||||
|
|
|
@ -48,9 +48,6 @@ const int INFO_BUFFER_LEN = 256;
|
||||||
// length for name of keystore used in CEKeyStoreData
|
// length for name of keystore used in CEKeyStoreData
|
||||||
const int MAX_CE_NAME_LEN = 260;
|
const int MAX_CE_NAME_LEN = 260;
|
||||||
|
|
||||||
// processor architectures
|
|
||||||
const char* PROCESSOR_ARCH[] = { "x86", "x64", "ia64" };
|
|
||||||
|
|
||||||
// ODBC driver names.
|
// ODBC driver names.
|
||||||
// the order of this list should match the order of DRIVER_VERSION enum
|
// the order of this list should match the order of DRIVER_VERSION enum
|
||||||
std::vector<std::string> CONNECTION_STRING_DRIVER_NAME{ "Driver={ODBC Driver 17 for SQL Server};", "Driver={ODBC Driver 13 for SQL Server};", "Driver={ODBC Driver 11 for SQL Server};" };
|
std::vector<std::string> CONNECTION_STRING_DRIVER_NAME{ "Driver={ODBC Driver 17 for SQL Server};", "Driver={ODBC Driver 13 for SQL Server};", "Driver={ODBC Driver 11 for SQL Server};" };
|
||||||
|
@ -917,42 +914,28 @@ void build_connection_string_and_set_conn_attr( _Inout_ sqlsrv_conn* conn, _Inou
|
||||||
// and return the string of the processor name.
|
// and return the string of the processor name.
|
||||||
const char* get_processor_arch( void )
|
const char* get_processor_arch( void )
|
||||||
{
|
{
|
||||||
#ifndef _WIN32
|
// processor architectures
|
||||||
struct utsname sys_info;
|
const char* PROCESSOR_ARCH[] = {"x86", "x64", "arm64"};
|
||||||
if ( uname(&sys_info) == -1 )
|
#ifdef _WIN32
|
||||||
{
|
|
||||||
DIE( "Error retrieving system info" );
|
|
||||||
}
|
|
||||||
if( strcmp(sys_info.machine, "x86") == 0 ) {
|
|
||||||
return PROCESSOR_ARCH[0];
|
|
||||||
} else if ( strcmp(sys_info.machine, "x86_64") == 0) {
|
|
||||||
return PROCESSOR_ARCH[1];
|
|
||||||
} else if ( strcmp(sys_info.machine, "ia64") == 0 ) {
|
|
||||||
return PROCESSOR_ARCH[2];
|
|
||||||
} else {
|
|
||||||
DIE( "Unknown processor architecture." );
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
#else
|
|
||||||
SYSTEM_INFO sys_info;
|
SYSTEM_INFO sys_info;
|
||||||
GetSystemInfo( &sys_info);
|
GetSystemInfo(&sys_info);
|
||||||
switch( sys_info.wProcessorArchitecture ) {
|
switch (sys_info.wProcessorArchitecture) {
|
||||||
|
case PROCESSOR_ARCHITECTURE_INTEL:
|
||||||
case PROCESSOR_ARCHITECTURE_INTEL:
|
return PROCESSOR_ARCH[0];
|
||||||
return PROCESSOR_ARCH[0];
|
case PROCESSOR_ARCHITECTURE_AMD64:
|
||||||
|
return PROCESSOR_ARCH[1];
|
||||||
case PROCESSOR_ARCHITECTURE_AMD64:
|
default:
|
||||||
return PROCESSOR_ARCH[1];
|
DIE("Unsupported Windows processor architecture.");
|
||||||
|
return NULL;
|
||||||
case PROCESSOR_ARCHITECTURE_IA64:
|
|
||||||
return PROCESSOR_ARCH[2];
|
|
||||||
|
|
||||||
default:
|
|
||||||
DIE( "Unknown Windows processor architecture." );
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
#elif defined(__arm64__)
|
||||||
|
return PROCESSOR_ARCH[2];
|
||||||
|
#elif defined(__x86_64__)
|
||||||
|
return PROCESSOR_ARCH[1];
|
||||||
|
#else
|
||||||
|
DIE("Unsupported processor architecture.");
|
||||||
return NULL;
|
return NULL;
|
||||||
#endif // !_WIN32
|
#endif // _WIN32
|
||||||
}
|
}
|
||||||
|
|
||||||
// some features require a server of a certain version or later
|
// some features require a server of a certain version or later
|
||||||
|
|
|
@ -379,7 +379,7 @@ ss_error SS_ERRORS[] = {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
SQLSRV_ERROR_CE_DRIVER_REQUIRED,
|
SQLSRV_ERROR_CE_DRIVER_REQUIRED,
|
||||||
{ IMSSP, (SQLCHAR*) "The Always Encrypted feature requires Microsoft ODBC Driver 17 for SQL Server.", -105, false }
|
{ IMSSP, (SQLCHAR*) "The Always Encrypted feature requires Microsoft ODBC Driver 17 for SQL Server (or above) for %1!s!.", -105, true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
SQLSRV_ERROR_CONNECT_INVALID_DRIVER,
|
SQLSRV_ERROR_CONNECT_INVALID_DRIVER,
|
||||||
|
|
|
@ -109,7 +109,7 @@ function testEncryptedWithODBC()
|
||||||
$value = "ODBC Driver 13 for SQL Server";
|
$value = "ODBC Driver 13 for SQL Server";
|
||||||
$connectionOptions = "Driver = $value; ColumnEncryption = Enabled;";
|
$connectionOptions = "Driver = $value; ColumnEncryption = Enabled;";
|
||||||
|
|
||||||
$expected = "The Always Encrypted feature requires Microsoft ODBC Driver 17 for SQL Server.";
|
$expected = "The Always Encrypted feature requires Microsoft ODBC Driver 17 for SQL Server";
|
||||||
|
|
||||||
connectVerifyOutput($connectionOptions, $expected);
|
connectVerifyOutput($connectionOptions, $expected);
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,7 +106,7 @@ function testEncryptedWithODBC($msodbcsqlMaj, $server, $connectionOptions)
|
||||||
$connectionOptions['Driver']=$value;
|
$connectionOptions['Driver']=$value;
|
||||||
$connectionOptions['ColumnEncryption']='Enabled';
|
$connectionOptions['ColumnEncryption']='Enabled';
|
||||||
|
|
||||||
$expected = "The Always Encrypted feature requires Microsoft ODBC Driver 17 for SQL Server.";
|
$expected = "The Always Encrypted feature requires Microsoft ODBC Driver 17 for SQL Server";
|
||||||
|
|
||||||
connectVerifyOutput($server, $connectionOptions, $expected);
|
connectVerifyOutput($server, $connectionOptions, $expected);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue