diff --git a/source/pdo_sqlsrv/config.w32 b/source/pdo_sqlsrv/config.w32 index 14eb7205..9b8dbd5f 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 3fd3e53a..80a99b7f 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 afa47b3c..7d46b5d8 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 e7194160..b724bea2 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 85d726fd..78828a02 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 4a22a92f..4ac83d99 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 73ca9ac2..da9024e9 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 9ccfc835..35ae7fcb 100644 --- a/source/pdo_sqlsrv/template.rc +++ b/source/pdo_sqlsrv/template.rc @@ -3,7 +3,7 @@ // // Contents: Version resource // -// Microsoft Drivers 5.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 5ddfdfa6..ecffe8f7 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 c5ee154e..64719df7 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 d8e1caf2..72d9859a 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 1cd765cf..2199d655 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 5952ffb1..350a0e34 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 29bb9ec7..e7f85514 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 5558e3fd..34e5b708 100644 --- a/source/shared/core_results.cpp +++ b/source/shared/core_results.cpp @@ -3,7 +3,7 @@ // // Contents: Result sets // -// Microsoft Drivers 5.0 for PHP for SQL Server +// Microsoft Drivers 5.1 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License @@ -342,12 +342,12 @@ struct row_dtor_closure { sqlsrv_error* odbc_get_diag_rec( _In_ sqlsrv_stmt* odbc, _In_ SQLSMALLINT record_number ) { SQLWCHAR wsql_state[ SQL_SQLSTATE_BUFSIZE ]; - SQLWCHAR wnative_message[ SQL_MAX_MESSAGE_LENGTH + 1 ]; + SQLWCHAR wnative_message[ SQL_MAX_ERROR_MESSAGE_LENGTH + 1 ]; SQLINTEGER native_code; SQLSMALLINT wnative_message_len = 0; SQLRETURN r = SQLGetDiagRecW( SQL_HANDLE_STMT, odbc->handle(), record_number, wsql_state, &native_code, wnative_message, - SQL_MAX_MESSAGE_LENGTH + 1, &wnative_message_len ); + SQL_MAX_ERROR_MESSAGE_LENGTH + 1, &wnative_message_len ); if( !SQL_SUCCEEDED( r ) || r == SQL_NO_DATA ) { return NULL; } diff --git a/source/shared/core_sqlsrv.h b/source/shared/core_sqlsrv.h index 71d5c4de..1fd9de23 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License @@ -173,6 +173,8 @@ const int SQL_SERVER_MAX_FIELD_SIZE = 8000; const int SQL_SERVER_MAX_PRECISION = 38; const int SQL_SERVER_MAX_TYPE_SIZE = 0; const int SQL_SERVER_MAX_PARAMS = 2100; +// increase the maximum message length to accommodate for the long error returned for operand type clash +const int SQL_MAX_ERROR_MESSAGE_LENGTH = SQL_MAX_MESSAGE_LENGTH * 4; // max size of a date time string when converting from a DateTime object to a string const int MAX_DATETIME_STRING_LEN = 256; @@ -773,9 +775,9 @@ struct sqlsrv_error : public sqlsrv_error_const { sqlsrv_error( _In_ SQLCHAR* sql_state, _In_ SQLCHAR* message, _In_ SQLINTEGER code, _In_ bool printf_format = false ) { sqlstate = reinterpret_cast( sqlsrv_malloc( SQL_SQLSTATE_BUFSIZE )); - native_message = reinterpret_cast( sqlsrv_malloc( SQL_MAX_MESSAGE_LENGTH + 1 )); + native_message = reinterpret_cast( sqlsrv_malloc( SQL_MAX_ERROR_MESSAGE_LENGTH + 1 )); strcpy_s( reinterpret_cast( sqlstate ), SQL_SQLSTATE_BUFSIZE, reinterpret_cast( sql_state )); - strcpy_s( reinterpret_cast( native_message ), SQL_MAX_MESSAGE_LENGTH + 1, reinterpret_cast( message )); + strcpy_s( reinterpret_cast( native_message ), SQL_MAX_ERROR_MESSAGE_LENGTH + 1, reinterpret_cast( message )); native_code = code; format = printf_format; } @@ -1849,11 +1851,11 @@ namespace core { // and return a more helpful message prepended to the ODBC errors if that error occurs if( !SQL_SUCCEEDED( r )) { - SQLCHAR err_msg[ SQL_MAX_MESSAGE_LENGTH + 1 ] = { '\0' }; + SQLCHAR err_msg[ SQL_MAX_ERROR_MESSAGE_LENGTH + 1 ] = { '\0' }; SQLSMALLINT len = 0; SQLRETURN rtemp = ::SQLGetDiagField( stmt->handle_type(), stmt->handle(), 1, SQL_DIAG_MESSAGE_TEXT, - err_msg, SQL_MAX_MESSAGE_LENGTH, &len ); + err_msg, SQL_MAX_ERROR_MESSAGE_LENGTH, &len ); CHECK_SQL_ERROR_OR_WARNING( rtemp, stmt ) { @@ -1983,6 +1985,17 @@ namespace core { } } + inline void SQLDescribeParam( _Inout_ sqlsrv_stmt* stmt, _In_ SQLSMALLINT paramno, _Out_opt_ SQLSMALLINT* data_type, _Out_opt_ SQLULEN* col_size, + _Out_opt_ SQLSMALLINT* decimal_digits, _Out_opt_ SQLSMALLINT* nullable TSRMLS_DC ) + { + SQLRETURN r; + r = ::SQLDescribeParam( stmt->handle(), paramno, data_type, col_size, decimal_digits, nullable ); + + CHECK_SQL_ERROR_OR_WARNING( r, stmt ) { + throw CoreException(); + } + } + inline void SQLEndTran( _In_ SQLSMALLINT handleType, _Inout_ sqlsrv_conn* conn, _In_ SQLSMALLINT completionType TSRMLS_DC ) { SQLRETURN r = ::SQLEndTran( handleType, conn->handle(), completionType ); @@ -2202,6 +2215,17 @@ namespace core { } } + inline void SQLSetDescField( _Inout_ sqlsrv_stmt* stmt, _In_ SQLSMALLINT rec_num, _In_ SQLSMALLINT fld_id, _In_reads_bytes_opt_( str_len ) SQLPOINTER value_ptr, _In_ SQLINTEGER str_len TSRMLS_DC ) + { + SQLRETURN r; + SQLHDESC hIpd = NULL; + core::SQLGetStmtAttr( stmt, SQL_ATTR_IMP_PARAM_DESC, &hIpd, 0, 0 ); + r = ::SQLSetDescField( hIpd, rec_num, fld_id, value_ptr, str_len ); + + CHECK_SQL_ERROR_OR_WARNING( r, stmt ) { + throw CoreException(); + } + } inline void SQLSetEnvAttr( _Inout_ sqlsrv_context& ctx, _In_ SQLINTEGER attr, _In_reads_bytes_opt_(str_len) SQLPOINTER value_ptr, _In_ SQLINTEGER str_len TSRMLS_DC ) { diff --git a/source/shared/core_stmt.cpp b/source/shared/core_stmt.cpp index 5e3883de..cb24cb18 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License @@ -101,6 +101,8 @@ void default_sql_size_and_scale( _Inout_ sqlsrv_stmt* stmt, _In_opt_ unsigned in // given a zval and encoding, determine the appropriate sql type, column size, and decimal scale (if appropriate) void default_sql_type( _Inout_ sqlsrv_stmt* stmt, _In_opt_ SQLULEN paramno, _In_ zval* param_z, _In_ SQLSRV_ENCODING encoding, _Out_ SQLSMALLINT& sql_type TSRMLS_DC ); +void ae_get_sql_type_info( _Inout_ sqlsrv_stmt* stmt, _In_opt_ SQLULEN paramno, _In_ SQLSMALLINT direction, _In_ zval* param_z, _In_ SQLSRV_ENCODING encoding, + _Out_ SQLSMALLINT& sql_type, _Out_ SQLULEN& column_size, _Out_ SQLSMALLINT& decimal_digits TSRMLS_DC ); void col_cache_dtor( _Inout_ zval* data_z ); void field_cache_dtor( _Inout_ zval* data_z ); void finalize_output_parameters( _Inout_ sqlsrv_stmt* stmt TSRMLS_DC ); @@ -110,8 +112,8 @@ stmt_option const* get_stmt_option( sqlsrv_conn const* conn, _In_ zend_ulong key bool is_valid_sqlsrv_phptype( _In_ sqlsrv_phptype type ); // assure there is enough space for the output parameter string void resize_output_buffer_if_necessary( _Inout_ sqlsrv_stmt* stmt, _Inout_ zval* param_z, _In_ SQLULEN paramno, SQLSRV_ENCODING encoding, - _In_ SQLSMALLINT c_type, _In_ SQLSMALLINT sql_type, _In_ SQLULEN column_size, _Out_writes_(buffer_len) SQLPOINTER& buffer, - _Out_ SQLLEN& buffer_len TSRMLS_DC ); + _In_ SQLSMALLINT c_type, _In_ SQLSMALLINT sql_type, _In_ SQLULEN column_size, _In_ SQLSMALLINT decimal_digits, + _Out_writes_(buffer_len) SQLPOINTER& buffer, _Out_ SQLLEN& buffer_len TSRMLS_DC ); bool reset_ae_stream_cursor( _Inout_ sqlsrv_stmt* stmt ); void save_output_param_for_later( _Inout_ sqlsrv_stmt* stmt, _Inout_ sqlsrv_output_param& param TSRMLS_DC ); // send all the stream data @@ -436,16 +438,20 @@ void core_sqlsrv_bind_param( _Inout_ sqlsrv_stmt* stmt, _In_ SQLUSMALLINT param_ ( encoding == SQLSRV_ENCODING_SYSTEM || encoding == SQLSRV_ENCODING_UTF8 || encoding == SQLSRV_ENCODING_BINARY ), "core_sqlsrv_bind_param: invalid encoding" ); - // if the sql type is unknown, then set the default based on the PHP type passed in - if( sql_type == SQL_UNKNOWN_TYPE ) { - default_sql_type( stmt, param_num, param_z, encoding, sql_type TSRMLS_CC ); + if ( stmt->conn->ce_option.enabled && ( sql_type == SQL_UNKNOWN_TYPE || column_size == SQLSRV_UNKNOWN_SIZE )) { + ae_get_sql_type_info( stmt, param_num, direction, param_z, encoding, sql_type, column_size, decimal_digits TSRMLS_CC ); } + else { + // if the sql type is unknown, then set the default based on the PHP type passed in + if ( sql_type == SQL_UNKNOWN_TYPE ) { + default_sql_type( stmt, param_num, param_z, encoding, sql_type TSRMLS_CC ); + } - // if the size is unknown, then set the default based on the PHP type passed in - if( column_size == SQLSRV_UNKNOWN_SIZE ) { - default_sql_size_and_scale( stmt, static_cast( param_num ), param_z, encoding, column_size, decimal_digits TSRMLS_CC ); + // if the size is unknown, then set the default based on the PHP type passed in + if ( column_size == SQLSRV_UNKNOWN_SIZE ) { + default_sql_size_and_scale( stmt, static_cast(param_num), param_z, encoding, column_size, decimal_digits TSRMLS_CC ); + } } - // determine the ODBC C type c_type = default_c_type( stmt, param_num, param_z, encoding TSRMLS_CC ); @@ -538,7 +544,7 @@ void core_sqlsrv_bind_param( _Inout_ sqlsrv_stmt* stmt, _In_ SQLUSMALLINT param_ // since this is an output string, assure there is enough space to hold the requested size and // set all the variables necessary (param_z, buffer, buffer_len, and ind_ptr) - resize_output_buffer_if_necessary( stmt, param_z, param_num, encoding, c_type, sql_type, column_size, + resize_output_buffer_if_necessary( stmt, param_z, param_num, encoding, c_type, sql_type, column_size, decimal_digits, buffer, buffer_len TSRMLS_CC ); // save the parameter to be adjusted and/or converted after the results are processed @@ -552,7 +558,8 @@ void core_sqlsrv_bind_param( _Inout_ sqlsrv_stmt* stmt, _In_ SQLUSMALLINT param_ // avoid this silent truncation, we set the column_size to be "MAX" size for // string types. This will guarantee that there is no silent truncation for // output parameters. - if( direction == SQL_PARAM_OUTPUT ) { + // if column encryption is enabled, at this point the correct column size has been set by SQLDescribeParam + if( direction == SQL_PARAM_OUTPUT && !stmt->conn->ce_option.enabled ) { switch( sql_type ) { @@ -663,6 +670,13 @@ void core_sqlsrv_bind_param( _Inout_ sqlsrv_stmt* stmt, _In_ SQLUSMALLINT param_ core::SQLBindParameter( stmt, param_num + 1, direction, c_type, sql_type, column_size, decimal_digits, buffer, buffer_len, &ind_ptr TSRMLS_CC ); + if ( stmt->conn->ce_option.enabled && sql_type == SQL_TYPE_TIMESTAMP ) + { + if ( decimal_digits == 3 ) + core::SQLSetDescField( stmt, param_num + 1, SQL_CA_SS_SERVER_TYPE, (SQLPOINTER)SQL_SS_TYPE_DATETIME, 0 ); + else if (decimal_digits == 0) + core::SQLSetDescField( stmt, param_num + 1, SQL_CA_SS_SERVER_TYPE, (SQLPOINTER)SQL_SS_TYPE_SMALLDATETIME, 0 ); + } } catch( core::CoreException& e ) { stmt->free_param_data( TSRMLS_C ); @@ -2004,6 +2018,13 @@ void default_sql_size_and_scale( _Inout_ sqlsrv_stmt* stmt, _In_opt_ unsigned in } } +void ae_get_sql_type_info( _Inout_ sqlsrv_stmt* stmt, _In_opt_ SQLULEN paramno, _In_ SQLSMALLINT direction, _In_ zval* param_z, _In_ SQLSRV_ENCODING encoding, + _Out_ SQLSMALLINT& sql_type, _Out_ SQLULEN& column_size, _Out_ SQLSMALLINT& decimal_digits TSRMLS_DC ) +{ + SQLSMALLINT Nullable; + core::SQLDescribeParam( stmt, paramno + 1, &sql_type, &column_size, &decimal_digits, &Nullable ); +} + void col_cache_dtor( _Inout_ zval* data_z ) { col_cache* cache = static_cast( Z_PTR_P( data_z )); @@ -2485,8 +2506,8 @@ bool is_valid_sqlsrv_phptype( _In_ sqlsrv_phptype type ) // stmt->param_ind_ptrs are modified to hold the correct values for SQLBindParameter void resize_output_buffer_if_necessary( _Inout_ sqlsrv_stmt* stmt, _Inout_ zval* param_z, _In_ SQLULEN paramno, SQLSRV_ENCODING encoding, - _In_ SQLSMALLINT c_type, _In_ SQLSMALLINT sql_type, _In_ SQLULEN column_size, _Out_writes_(buffer_len) SQLPOINTER& buffer, - _Out_ SQLLEN& buffer_len TSRMLS_DC ) + _In_ SQLSMALLINT c_type, _In_ SQLSMALLINT sql_type, _In_ SQLULEN column_size, _In_ SQLSMALLINT decimal_digits, + _Out_writes_(buffer_len) SQLPOINTER& buffer, _Out_ SQLLEN& buffer_len TSRMLS_DC ) { SQLSRV_ASSERT( column_size != SQLSRV_UNKNOWN_SIZE, "column size should be set to a known value." ); buffer_len = Z_STRLEN_P( param_z ); @@ -2501,6 +2522,12 @@ void resize_output_buffer_if_necessary( _Inout_ sqlsrv_stmt* stmt, _Inout_ zval* // account for the NULL terminator returned by ODBC and needed by Zend to avoid a "String not null terminated" debug warning SQLULEN field_size = column_size; + // with AE on, when column_size is retrieved from SQLDescribeParam, column_size does not include the decimal place + // include the decimal for output params by adding elem_size + if ( stmt->conn->ce_option.enabled && decimal_digits > 0 ) + { + field_size += elem_size; + } if (column_size == SQL_SS_LENGTH_UNLIMITED) { field_size = SQL_SERVER_MAX_FIELD_SIZE / elem_size; } diff --git a/source/shared/core_stream.cpp b/source/shared/core_stream.cpp index c19b14f9..72461df3 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 da64d42a..8453a6b8 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License @@ -220,7 +220,7 @@ bool core_sqlsrv_get_odbc_error( _Inout_ sqlsrv_context& ctx, _In_ int record_nu SQLRETURN r = SQL_SUCCESS; SQLSMALLINT wmessage_len = 0; SQLWCHAR wsqlstate[ SQL_SQLSTATE_BUFSIZE ] = { L'\0' }; - SQLWCHAR wnative_message[ SQL_MAX_MESSAGE_LENGTH + 1 ] = { L'\0' }; + SQLWCHAR wnative_message[ SQL_MAX_ERROR_MESSAGE_LENGTH + 1 ] = { L'\0' }; SQLSRV_ENCODING enc = ctx.encoding(); switch( h_type ) { @@ -245,7 +245,7 @@ bool core_sqlsrv_get_odbc_error( _Inout_ sqlsrv_context& ctx, _In_ int record_nu default: error = new ( sqlsrv_malloc( sizeof( sqlsrv_error ))) sqlsrv_error(); r = SQLGetDiagRecW( h_type, h, record_number, wsqlstate, &error->native_code, wnative_message, - SQL_MAX_MESSAGE_LENGTH + 1, &wmessage_len ); + SQL_MAX_ERROR_MESSAGE_LENGTH + 1, &wmessage_len ); // don't use the CHECK* macros here since it will trigger reentry into the error handling system // Workaround for a bug in unixODBC 2.3.4 when connection pooling is enabled (PDO SQLSRV). // Instead of returning false, we return an empty error message to prevent the driver from throwing an exception. @@ -290,12 +290,12 @@ void core_sqlsrv_format_driver_error( _In_ sqlsrv_context& ctx, _In_ sqlsrv_erro // allocate space for the formatted message formatted_error = new (sqlsrv_malloc( sizeof( sqlsrv_error ))) sqlsrv_error(); formatted_error->sqlstate = reinterpret_cast( sqlsrv_malloc( SQL_SQLSTATE_BUFSIZE )); - formatted_error->native_message = reinterpret_cast( sqlsrv_malloc( SQL_MAX_MESSAGE_LENGTH + 1 )); + formatted_error->native_message = reinterpret_cast( sqlsrv_malloc( SQL_MAX_ERROR_MESSAGE_LENGTH + 1 )); DWORD rc = FormatMessage( FORMAT_MESSAGE_FROM_STRING, reinterpret_cast( custom_error->native_message ), 0, 0, - reinterpret_cast( formatted_error->native_message ), SQL_MAX_MESSAGE_LENGTH, args ); + reinterpret_cast( formatted_error->native_message ), SQL_MAX_ERROR_MESSAGE_LENGTH, args ); if( rc == 0 ) { - strcpy_s( reinterpret_cast( formatted_error->native_message ), SQL_MAX_MESSAGE_LENGTH, + strcpy_s( reinterpret_cast( formatted_error->native_message ), SQL_MAX_ERROR_MESSAGE_LENGTH, reinterpret_cast( INTERNAL_FORMAT_ERROR )); } diff --git a/source/shared/globalization.h b/source/shared/globalization.h index 0781d607..d5fb5723 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 2642e5a5..da8e5701 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 8f54ad46..cefa45cb 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 1af301b0..9f8d0740 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 c2709a46..ecb4f936 100644 --- a/source/shared/localization.hpp +++ b/source/shared/localization.hpp @@ -3,7 +3,7 @@ // // Contents: Contains portable classes for localization // -// Microsoft Drivers 5.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 59a58fa9..94c8e676 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 ce120089..f4efbd29 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 13fd73ab..fbfb0629 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 531d637d..461cfcef 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 98eebfae..565b2dc0 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License @@ -27,7 +27,7 @@ // Increase Minor with backward compatible new functionalities and API changes. // Increase Patch for backward compatible fixes. #define SQLVERSION_MAJOR 5 -#define SQLVERSION_MINOR 0 +#define SQLVERSION_MINOR 1 #define SQLVERSION_PATCH 0 #define SQLVERSION_BUILD 0 diff --git a/source/shared/xplat.h b/source/shared/xplat.h index 2032a164..8cfcdd4d 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 56f2eed8..a720492b 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 a6078c6e..2ba22237 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 d80367f9..8e7efc63 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/source/sqlsrv/config.w32 b/source/sqlsrv/config.w32 index 81b3d019..4a17c934 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 bc0ca386..5a2870ca 100644 --- a/source/sqlsrv/conn.cpp +++ b/source/sqlsrv/conn.cpp @@ -3,7 +3,7 @@ // // Contents: Routines that use connection handles // -// Microsoft Drivers 5.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 12a02f0e..8055934d 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 1147f539..f2e128c7 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 015dddfc..a515b394 100644 --- a/source/sqlsrv/stmt.cpp +++ b/source/sqlsrv/stmt.cpp @@ -3,7 +3,7 @@ // // Contents: Routines that use statement handles // -// Microsoft Drivers 5.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 2dd474e3..15fc2e66 100644 --- a/source/sqlsrv/template.rc +++ b/source/sqlsrv/template.rc @@ -3,7 +3,7 @@ // // Contents: Version resource // -// Microsoft Drivers 5.0 for PHP for SQL Server +// Microsoft Drivers 5.1 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 5e28c8a4..6941410a 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.0 for PHP for SQL Server +// Microsoft Drivers 5.1 for PHP for SQL Server // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License diff --git a/test/bvt/sqlsrv/msdn_sqlsrv_cancel.phpt b/test/bvt/sqlsrv/msdn_sqlsrv_cancel.phpt index 382c58d6..9e60a486 100644 --- a/test/bvt/sqlsrv/msdn_sqlsrv_cancel.phpt +++ b/test/bvt/sqlsrv/msdn_sqlsrv_cancel.phpt @@ -45,5 +45,5 @@ echo "$count sales accounted for the first $$salesTotal in revenue.\n"; /* Cancel the pending results. The statement can be reused. */ sqlsrv_cancel( $stmt); ?> ---EXPECT-- -57 sales accounted for the first $104171.7607 in revenue. +--EXPECTREGEX-- +[3-5][0-9] sales accounted for the first \$10[0-9]{4}\.[0-9]{2,4} in revenue. diff --git a/test/functional/pdo_sqlsrv/pdo_040_error_information.phpt b/test/functional/pdo_sqlsrv/pdo_040_error_information.phpt index 33f4ace2..c2e10320 100644 --- a/test/functional/pdo_sqlsrv/pdo_040_error_information.phpt +++ b/test/functional/pdo_sqlsrv/pdo_040_error_information.phpt @@ -31,11 +31,11 @@ $conn = null; print "Done"; ?> ---EXPECT-- +--EXPECTREGEX-- Array -( - [0] => 21S01 - [1] => 213 - [2] => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Column name or number of supplied values does not match table definition. -) +\( + \[0\] => 21S01 + \[1\] => 213 + \[2\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]\[SQL Server\]Column name or number of supplied values does not match table definition\. +\) Done diff --git a/test/functional/pdo_sqlsrv/pdo_connect_encrypted.phpt b/test/functional/pdo_sqlsrv/pdo_connect_encrypted.phpt index ffff90f7..a89cfcc9 100644 --- a/test/functional/pdo_sqlsrv/pdo_connect_encrypted.phpt +++ b/test/functional/pdo_sqlsrv/pdo_connect_encrypted.phpt @@ -102,9 +102,7 @@ function test_ColumnEncryption( $server, $uid, $pwd, $msodbcsql_maj ) $expected = "Invalid value specified for connection string attribute 'ColumnEncryption'"; verify_output( $e, $expected ); } -} - - +} ?> --EXPECTF-- Done \ No newline at end of file diff --git a/test/functional/pdo_sqlsrv/pdo_connect_encrypted_ksp_errors.phpt b/test/functional/pdo_sqlsrv/pdo_connect_encrypted_ksp_errors.phpt index afb58464..01ceabe5 100644 --- a/test/functional/pdo_sqlsrv/pdo_connect_encrypted_ksp_errors.phpt +++ b/test/functional/pdo_sqlsrv/pdo_connect_encrypted_ksp_errors.phpt @@ -71,30 +71,30 @@ Connect using a custom keystore provider with some required inputs missing echo "Done\n"; ?> ---EXPECT-- -Connecting... with column encryption -Connected successfully with ColumnEncryption enabled and KSP specified. +--EXPECTREGEX-- +Connecting\.\.\. with column encryption +Connected successfully with ColumnEncryption enabled and KSP specified\. -Connecting... with an invalid input to CEKeystoreProvider +Connecting\.\.\. with an invalid input to CEKeystoreProvider Failed to connect. -SQLSTATE[HY024]: [Microsoft][ODBC Driver 13 for SQL Server]Invalid attribute value +SQLSTATE\[HY024\]: \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Invalid attribute value -Connecting... with an empty path +Connecting\.\.\. with an empty path Failed to connect. -SQLSTATE[IMSSP]: Invalid value for loading a custom keystore provider. +SQLSTATE\[IMSSP\]: Invalid value for loading a custom keystore provider\. -Connecting... without a path +Connecting\.\.\. without a path Failed to connect. -SQLSTATE[IMSSP]: The path to the custom keystore provider is missing. +SQLSTATE\[IMSSP\]: The path to the custom keystore provider is missing\. -Connecting... without a name +Connecting\.\.\. without a name Failed to connect. -SQLSTATE[IMSSP]: The name of the custom keystore provider is missing. +SQLSTATE\[IMSSP\]: The name of the custom keystore provider is missing\. -Connecting... without a key +Connecting\.\.\. without a key Failed to connect. -SQLSTATE[IMSSP]: The encryption key for the custom keystore provider is missing. +SQLSTATE\[IMSSP\]: The encryption key for the custom keystore provider is missing\. -Connecting... with all required inputs -Connected successfully with ColumnEncryption enabled and KSP specified. +Connecting\.\.\. with all required inputs +Connected successfully with ColumnEncryption enabled and KSP specified\. Done \ No newline at end of file diff --git a/test/functional/pdo_sqlsrv/pdo_error.phpt b/test/functional/pdo_sqlsrv/pdo_error.phpt index 1c804e5a..efbb6ca5 100644 --- a/test/functional/pdo_sqlsrv/pdo_error.phpt +++ b/test/functional/pdo_sqlsrv/pdo_error.phpt @@ -29,5 +29,5 @@ Array \( \[0\] => 42S22 \[1\] => 207 - \[2\] => \[Microsoft\]\[ODBC Driver (09|10|11|12|13) for SQL Server\]\[SQL Server\]Invalid column name 'IntColX'\. + \[2\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]\[SQL Server\]Invalid column name 'IntColX'\. \) \ No newline at end of file diff --git a/test/functional/pdo_sqlsrv/pdo_errorinfo_emulateprepare.phpt b/test/functional/pdo_sqlsrv/pdo_errorinfo_emulateprepare.phpt index 9d040ebf..19e7f8f4 100644 --- a/test/functional/pdo_sqlsrv/pdo_errorinfo_emulateprepare.phpt +++ b/test/functional/pdo_sqlsrv/pdo_errorinfo_emulateprepare.phpt @@ -91,13 +91,13 @@ conn native code and native message are NULL\. Warning: PDOStatement::bindParam\(\): SQLSTATE\[HY093\]: Invalid parameter number: parameter was not defined in .+(\/|\\)pdo_errorinfo_emulateprepare\.php on line [0-9]+ -Warning: PDOStatement::execute\(\): SQLSTATE\[07002\]: COUNT field incorrect: 0 \[Microsoft\]\[ODBC Driver 1[0-9] for SQL Server\]COUNT field incorrect or syntax error in .+(\/|\\)pdo_errorinfo_emulateprepare\.php on line [0-9]+ +Warning: PDOStatement::execute\(\): SQLSTATE\[07002\]: COUNT field incorrect: 0 \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]COUNT field incorrect or syntax error in .+(\/|\\)pdo_errorinfo_emulateprepare\.php on line [0-9]+ Statement error info: Array \( \[0\] => 07002 \[1\] => 0 - \[2\] => \[Microsoft\]\[ODBC Driver 1[0-9] for SQL Server\]COUNT field incorrect or syntax error + \[2\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]COUNT field incorrect or syntax error \) Connection error info: Array diff --git a/test/functional/pdo_sqlsrv/pdo_param_output_select_variant.phpt b/test/functional/pdo_sqlsrv/pdo_param_output_select_variant.phpt index 9f45cf8a..9c3dfff3 100644 --- a/test/functional/pdo_sqlsrv/pdo_param_output_select_variant.phpt +++ b/test/functional/pdo_sqlsrv/pdo_param_output_select_variant.phpt @@ -77,9 +77,9 @@ function RunTest() RunTest(); ?> ---EXPECT-- +--EXPECTREGEX--  Number of rows: 1 -SQLSTATE[42000]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Implicit conversion from data type sql_variant to nvarchar(max) is not allowed. Use the CONVERT function to run this query. +SQLSTATE\[42000\]: \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]\[SQL Server\]Implicit conversion from data type sql_variant to nvarchar\(max\) is not allowed. Use the CONVERT function to run this query. Done -Test "pdo_param_output_select_variant" completed successfully. +Test \"pdo_param_output_select_variant\" completed successfully\. diff --git a/test/functional/pdo_sqlsrv/pdo_param_output_variants.phpt b/test/functional/pdo_sqlsrv/pdo_param_output_variants.phpt index b81ba6cb..0749c1e1 100644 --- a/test/functional/pdo_sqlsrv/pdo_param_output_variants.phpt +++ b/test/functional/pdo_sqlsrv/pdo_param_output_variants.phpt @@ -131,10 +131,10 @@ function RunTest() RunTest(); ?> ---EXPECT-- +--EXPECTREGEX--  -SQLSTATE[22018]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Operand type clash: nvarchar(max) is incompatible with sql_variant -SQLSTATE[22018]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Operand type clash: nvarchar(max) is incompatible with sql_variant +SQLSTATE\[22018\]: \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]\[SQL Server\]Operand type clash: nvarchar\(max\) is incompatible with sql_variant +SQLSTATE\[22018\]: \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]\[SQL Server\]Operand type clash: nvarchar\(max\) is incompatible with sql_variant Done -Test "pdo_param_output_variants" completed successfully. +Test \"pdo_param_output_variants\" completed successfully\. diff --git a/test/functional/pdo_sqlsrv/pdo_prepare_emulatePrepare_binary.phpt b/test/functional/pdo_sqlsrv/pdo_prepare_emulatePrepare_binary.phpt index 4cd28510..ebd52447 100644 --- a/test/functional/pdo_sqlsrv/pdo_prepare_emulatePrepare_binary.phpt +++ b/test/functional/pdo_sqlsrv/pdo_prepare_emulatePrepare_binary.phpt @@ -79,7 +79,7 @@ Array \) Prepare with emulate prepare and no bindparam options: -Fatal error: Uncaught PDOException: SQLSTATE\[42000\]: \[Microsoft\]\[ODBC Driver 1[0-9] for SQL Server\]\[SQL Server\]Implicit conversion from data type varchar to varbinary\(max\) is not allowed\. Use the CONVERT function to run this query\. in .+(\/|\\)pdo_prepare_emulatePrepare_binary\.php:[0-9]+ +Fatal error: Uncaught PDOException: SQLSTATE\[42000\]: \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]\[SQL Server\]Implicit conversion from data type varchar to varbinary\(max\) is not allowed\. Use the CONVERT function to run this query\. in .+(\/|\\)pdo_prepare_emulatePrepare_binary\.php:[0-9]+ Stack trace: #0 .+(\/|\\)pdo_prepare_emulatePrepare_binary\.php\([0-9]+\): PDOStatement->execute\(\) #1 {main} diff --git a/test/functional/pdo_sqlsrv/pdo_query_timeout.phpt b/test/functional/pdo_sqlsrv/pdo_query_timeout.phpt index 45da1f9d..ade9e96c 100644 --- a/test/functional/pdo_sqlsrv/pdo_query_timeout.phpt +++ b/test/functional/pdo_sqlsrv/pdo_query_timeout.phpt @@ -66,27 +66,27 @@ function RunTest() RunTest(); ?> ---EXPECT-- +--EXPECTREGEX-- -Starting test... +Starting test\.\.\. Setting query timeout as an attribute in connection -array(3) { - [0]=> - string(5) "HYT00" - [1]=> - int(0) - [2]=> - string(63) "[Microsoft][ODBC Driver 13 for SQL Server]Query timeout expired" -} +array\(3\) \{ + \[0\]=> + string\(5\) \"HYT00\" + \[1\]=> + int\(0\) + \[2\]=> + string\(63\) \"\[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Query timeout expired\" +\} Setting query timeout in the statement -array(3) { - [0]=> - string(5) "HYT00" - [1]=> - int(0) - [2]=> - string(63) "[Microsoft][ODBC Driver 13 for SQL Server]Query timeout expired" -} +array\(3\) \{ + \[0\]=> + string\(5\) \"HYT00\" + \[1\]=> + int\(0\) + \[2\]=> + string\(63\) \"\[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Query timeout expired\" +\} Done -Test "pdo_query_timeout" completed successfully. +Test \"pdo_query_timeout\" completed successfully\. diff --git a/test/functional/pdo_sqlsrv/pdo_utf8_conn.phpt b/test/functional/pdo_sqlsrv/pdo_utf8_conn.phpt index 8ec2a3ae..e616f401 100644 --- a/test/functional/pdo_sqlsrv/pdo_utf8_conn.phpt +++ b/test/functional/pdo_sqlsrv/pdo_utf8_conn.phpt @@ -20,7 +20,7 @@ UTF-8 connection strings ?> --EXPECTREGEX-- -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\]\. |Login timeout expired|Login failed for user 'sa'\.) in .+(\/|\\)pdo_utf8_conn\.php:[0-9]+ +Fatal error: Uncaught PDOException: SQLSTATE\[(28000|08001|HYT00)\]: .*\[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\](\[SQL Server\])?(Named Pipes Provider: Could not open a connection to SQL Server \[2\]\. |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'\) #1 {main} diff --git a/test/functional/pdo_sqlsrv/pdo_warnings.phpt b/test/functional/pdo_sqlsrv/pdo_warnings.phpt index 9d345007..18891d62 100644 --- a/test/functional/pdo_sqlsrv/pdo_warnings.phpt +++ b/test/functional/pdo_sqlsrv/pdo_warnings.phpt @@ -35,4 +35,4 @@ Error Message: An unsupported attribute was designated on the PDO object\. Warning: PDO::getAttribute\(\): SQLSTATE\[IM001\]: Driver does not support this function: driver does not support that attribute in .+(\/|\\)pdo_warnings\.php on line [0-9]+ -Warning: PDOStatement::execute\(\): SQLSTATE\[42000\]: Syntax error or access violation: 156 \[Microsoft\]\[ODBC Driver [0-9]+ for SQL Server\]\[SQL Server\]Incorrect syntax near the keyword 'TABLE'\. in .+(\/|\\)pdo_warnings\.php on line [0-9]+ \ No newline at end of file +Warning: PDOStatement::execute\(\): SQLSTATE\[42000\]: Syntax error or access violation: 156 \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]\[SQL Server\]Incorrect syntax near the keyword 'TABLE'\. in .+(\/|\\)pdo_warnings\.php on line [0-9]+ \ No newline at end of file diff --git a/test/functional/sqlsrv/0068.phpt b/test/functional/sqlsrv/0068.phpt index 6563db9d..805fe4df 100644 --- a/test/functional/sqlsrv/0068.phpt +++ b/test/functional/sqlsrv/0068.phpt @@ -50,8 +50,8 @@ Array \[SQLSTATE\] => 42000 \[1\] => 257 \[code\] => 257 - \[2\] => \[Microsoft\]\[ODBC Driver 1[0-9] for SQL Server\]\[SQL Server\]Implicit conversion from data type varchar\(max\) to varbinary\(max\) is not allowed\. Use the CONVERT function to run this query\. - \[message\] => \[Microsoft\]\[ODBC Driver 1[0-9] for SQL Server\]\[SQL Server\]Implicit conversion from data type varchar\(max\) to varbinary\(max\) is not allowed\. Use the CONVERT function to run this query\. + \[2\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]\[SQL Server\]Implicit conversion from data type varchar\(max\) to varbinary\(max\) is not allowed\. Use the CONVERT function to run this query\. + \[message\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]\[SQL Server\]Implicit conversion from data type varchar\(max\) to varbinary\(max\) is not allowed\. Use the CONVERT function to run this query\. \) \[1\] => Array @@ -60,8 +60,8 @@ Array \[SQLSTATE\] => 42000 \[1\] => 8180 \[code\] => 8180 - \[2\] => \[Microsoft\]\[ODBC Driver 1[0-9] for SQL Server\]\[SQL Server\]Statement\(s\) could not be prepared\. - \[message\] => \[Microsoft\]\[ODBC Driver 1[0-9] for SQL Server\]\[SQL Server\]Statement\(s\) could not be prepared\. + \[2\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]\[SQL Server\]Statement\(s\) could not be prepared\. + \[message\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]\[SQL Server\]Statement\(s\) could not be prepared\. \) \) \ No newline at end of file diff --git a/test/functional/sqlsrv/sqlsrv_complex_query.phpt b/test/functional/sqlsrv/sqlsrv_complex_query.phpt index 136fc287..8f0c90b4 100644 --- a/test/functional/sqlsrv/sqlsrv_complex_query.phpt +++ b/test/functional/sqlsrv/sqlsrv_complex_query.phpt @@ -90,12 +90,12 @@ Repro(); ?> --EXPECTREGEX--  -Test begins... -\[Microsoft\]\[ODBC Driver 13 for SQL Server\]\[SQL Server\]Cannot insert explicit value for identity column in table '.+' when IDENTITY_INSERT is set to OFF. +Test begins\.\.\. +\[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]\[SQL Server\]Cannot insert explicit value for identity column in table '.+' when IDENTITY_INSERT is set to OFF\. 544 23000 Number of rows inserted: 2 Number of rows fetched: 2 Done -Test "sqlsrv_statement_complex_query" completed successfully. +Test \"sqlsrv_statement_complex_query\" completed successfully\. diff --git a/test/functional/sqlsrv/sqlsrv_encrypted_patients_ksp.phpt b/test/functional/sqlsrv/sqlsrv_encrypted_patients_ksp.phpt index d5ca65d4..7bc0b621 100644 --- a/test/functional/sqlsrv/sqlsrv_encrypted_patients_ksp.phpt +++ b/test/functional/sqlsrv/sqlsrv_encrypted_patients_ksp.phpt @@ -167,7 +167,8 @@ Test simple insert, fetch and update with ColumnEncryption enabled and a custome sqlsrv_free_stmt($stmt); $callResult = '1900-01-01'; - $params = array( array( 1, SQLSRV_PARAM_IN ), array( &$callResult, SQLSRV_PARAM_OUT, null, SQLSRV_SQLTYPE_DATE)); + //when binding parameter using sqlsrv_query in a column encryption enabled connection, need to provide the sql_type in all parameters + $params = array( array( 1, SQLSRV_PARAM_IN, null, SQLSRV_SQLTYPE_INT ), array( &$callResult, SQLSRV_PARAM_OUT, null, SQLSRV_SQLTYPE_DATE)); $callArgs = "?, ?"; $stmt = sqlsrv_query($conn, "{ CALL [$procName] ($callArgs)}", $params); if (! $stmt ) @@ -187,7 +188,8 @@ Test simple insert, fetch and update with ColumnEncryption enabled and a custome sqlsrv_free_stmt($stmt); $callResult = '000-00-0000'; - $params = array( array( 1, SQLSRV_PARAM_IN ), array( &$callResult, SQLSRV_PARAM_OUT, null, SQLSRV_SQLTYPE_CHAR(11))); + //when binding parameter using sqlsrv_query in a column encryption enabled connection, need to provide the sql_type in all parameters + $params = array( array( 1, SQLSRV_PARAM_IN, null, SQLSRV_SQLTYPE_INT ), array( &$callResult, SQLSRV_PARAM_OUT, null, SQLSRV_SQLTYPE_CHAR(11))); $callArgs = "?, ?"; $stmt = sqlsrv_query($conn, "{ CALL [$procName] ($callArgs)}", $params); if (! $stmt ) diff --git a/test/functional/sqlsrv/sqlsrv_get_field.phpt b/test/functional/sqlsrv/sqlsrv_get_field.phpt index 5b389940..df68d4be 100644 --- a/test/functional/sqlsrv/sqlsrv_get_field.phpt +++ b/test/functional/sqlsrv/sqlsrv_get_field.phpt @@ -254,9 +254,9 @@ array\(1\) \{ \["code"\]=> int\(0\) \[2\]=> - string\(68\) "\[Microsoft\]\[ODBC Driver 1[0-9] for SQL Server\]Numeric value out of range" + string\(68\) "\[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Numeric value out of range" \["message"\]=> - string\(68\) "\[Microsoft\]\[ODBC Driver 1[0-9] for SQL Server\]Numeric value out of range" + string\(68\) "\[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Numeric value out of range" \} \} NULL @@ -292,9 +292,9 @@ array\(1\) \{ \["code"\]=> int\(0\) \[2\]=> - string\(68\) "\[Microsoft\]\[ODBC Driver 1[0-9] for SQL Server\]Numeric value out of range" + string\(68\) "\[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Numeric value out of range" \["message"\]=> - string\(68\) "\[Microsoft\]\[ODBC Driver 1[0-9] for SQL Server\]Numeric value out of range" + string\(68\) "\[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Numeric value out of range" \} \} NULL diff --git a/test/functional/sqlsrv/sqlsrv_param_output_variants.phpt b/test/functional/sqlsrv/sqlsrv_param_output_variants.phpt index 930c35ce..162dfa24 100644 --- a/test/functional/sqlsrv/sqlsrv_param_output_variants.phpt +++ b/test/functional/sqlsrv/sqlsrv_param_output_variants.phpt @@ -129,11 +129,11 @@ function RunTest() RunTest(); ?> ---EXPECT-- +--EXPECTREGEX--  -[Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Operand type clash: varchar(max) is incompatible with sql_variant +\[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]\[SQL Server\]Operand type clash: varchar\(max\) is incompatible with sql_variant -[Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Operand type clash: varchar(max) is incompatible with sql_variant +\[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]\[SQL Server\]Operand type clash: varchar\(max\) is incompatible with sql_variant Done -Test "sqlsrv_param_output_variants" completed successfully. \ No newline at end of file +Test \"sqlsrv_param_output_variants\" completed successfully\. \ No newline at end of file diff --git a/test/functional/sqlsrv/sqlsrv_statement_cancel.phpt b/test/functional/sqlsrv/sqlsrv_statement_cancel.phpt index 45a325d0..5e820660 100644 --- a/test/functional/sqlsrv/sqlsrv_statement_cancel.phpt +++ b/test/functional/sqlsrv/sqlsrv_statement_cancel.phpt @@ -94,9 +94,9 @@ Repro(); --EXPECTREGEX--  Test begins... -(.*\[Driver Manager\]|\[Microsoft\](\[ODBC Driver 13 for SQL Server\]|\[ODBC Driver Manager\]))([ ]{0,1}Function sequence error) +(.*\[Driver Manager\]|\[Microsoft\](\[ODBC Driver 1[1-9] for SQL Server\]|\[ODBC Driver Manager\]))([ ]{0,1}Function sequence error) 0 (HY010) Done -Test "sqlsrv_statement_cancel" completed successfully. +Test \"sqlsrv_statement_cancel\" completed successfully\. diff --git a/test/functional/sqlsrv/sqlsrv_statement_query_timeout.phpt b/test/functional/sqlsrv/sqlsrv_statement_query_timeout.phpt index 31a21880..66f30f02 100644 --- a/test/functional/sqlsrv/sqlsrv_statement_query_timeout.phpt +++ b/test/functional/sqlsrv/sqlsrv_statement_query_timeout.phpt @@ -60,15 +60,15 @@ function Repro() Repro(); ?> ---EXPECT-- +--EXPECTREGEX--  Test begins... -[Microsoft][ODBC Driver 13 for SQL Server]Query timeout expired +\[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Query timeout expired 0 HYT00 -[Microsoft][ODBC Driver 13 for SQL Server]Query timeout expired +\[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Query timeout expired 0 HYT00 Done -Test "sqlsrv_statement_query_timeout" completed successfully. +Test \"sqlsrv_statement_query_timeout\" completed successfully\. diff --git a/test/functional/sqlsrv/sqlsrv_statement_query_timeout_transaction.phpt b/test/functional/sqlsrv/sqlsrv_statement_query_timeout_transaction.phpt index 4d103ffe..81fdf2fa 100644 --- a/test/functional/sqlsrv/sqlsrv_statement_query_timeout_transaction.phpt +++ b/test/functional/sqlsrv/sqlsrv_statement_query_timeout_transaction.phpt @@ -74,15 +74,15 @@ function Repro() Repro(); ?> ---EXPECT-- +--EXPECTREGEX--  Test begins... -[Microsoft][ODBC Driver 13 for SQL Server]Query timeout expired +\[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Query timeout expired 0 HYT00 -[Microsoft][ODBC Driver 13 for SQL Server]Query timeout expired +\[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Query timeout expired 0 HYT00 Done -Test "sqlsrv_statement_query_timeout_transaction" completed successfully. +Test \"sqlsrv_statement_query_timeout_transaction\" completed successfully\. diff --git a/test/functional/sqlsrv/srv_050_error_conversion_varchar_int.phpt b/test/functional/sqlsrv/srv_050_error_conversion_varchar_int.phpt index bf657961..66661b9f 100644 --- a/test/functional/sqlsrv/srv_050_error_conversion_varchar_int.phpt +++ b/test/functional/sqlsrv/srv_050_error_conversion_varchar_int.phpt @@ -32,14 +32,14 @@ sqlsrv_close($conn); print "Done" ?> ---EXPECT-- +--EXPECTREGEX-- Array -( - [0] => 22018 - [SQLSTATE] => 22018 - [1] => 245 - [code] => 245 - [2] => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Conversion failed when converting the varchar value 'null' to data type int. - [message] => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Conversion failed when converting the varchar value 'null' to data type int. -) +\( + \[0\] => 22018 + \[SQLSTATE\] => 22018 + \[1\] => 245 + \[code\] => 245 + \[2\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]\[SQL Server\]Conversion failed when converting the varchar value 'null' to data type int\. + \[message\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]\[SQL Server\]Conversion failed when converting the varchar value 'null' to data type int\. +\) Done \ No newline at end of file diff --git a/test/functional/sqlsrv/srv_051_error_conversion_nchar.phpt b/test/functional/sqlsrv/srv_051_error_conversion_nchar.phpt index 09957a47..2295180f 100644 --- a/test/functional/sqlsrv/srv_051_error_conversion_nchar.phpt +++ b/test/functional/sqlsrv/srv_051_error_conversion_nchar.phpt @@ -32,14 +32,14 @@ sqlsrv_close($conn); print "Done" ?> ---EXPECT-- +--EXPECTREGEX-- Array -( - [0] => 22018 - [SQLSTATE] => 22018 - [1] => 245 - [code] => 245 - [2] => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Conversion failed when converting the nvarchar value '银河' to data type int. - [message] => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Conversion failed when converting the nvarchar value '银河' to data type int. -) +\( + \[0\] => 22018 + \[SQLSTATE\] => 22018 + \[1\] => 245 + \[code\] => 245 + \[2\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]\[SQL Server\]Conversion failed when converting the nvarchar value '银河' to data type int\. + \[message\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]\[SQL Server\]Conversion failed when converting the nvarchar value '银河' to data type int\. +\) Done diff --git a/test/functional/sqlsrv/srv_053_mars_disabled_error_checks.phpt b/test/functional/sqlsrv/srv_053_mars_disabled_error_checks.phpt index 0121f075..34a8d59b 100644 --- a/test/functional/sqlsrv/srv_053_mars_disabled_error_checks.phpt +++ b/test/functional/sqlsrv/srv_053_mars_disabled_error_checks.phpt @@ -32,27 +32,27 @@ sqlsrv_close($conn); print "Done" ?> ---EXPECT-- +--EXPECTREGEX-- Array -( - [0] => Array - ( - [0] => IMSSP - [SQLSTATE] => IMSSP - [1] => -44 - [code] => -44 - [2] => 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. - [message] => 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. - ) +\( + \[0\] => Array + \( + \[0\] => IMSSP + \[SQLSTATE\] => IMSSP + \[1\] => -44 + \[code\] => -44 + \[2\] => 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\. + \[message\] => 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\. + \) - [1] => Array - ( - [0] => HY000 - [SQLSTATE] => HY000 - [1] => 0 - [code] => 0 - [2] => [Microsoft][ODBC Driver 13 for SQL Server]Connection is busy with results for another command - [message] => [Microsoft][ODBC Driver 13 for SQL Server]Connection is busy with results for another command - ) + \[1\] => Array + \( + \[0\] => HY000 + \[SQLSTATE\] => HY000 + \[1\] => 0 + \[code\] => 0 + \[2\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Connection is busy with results for another command + \[message\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Connection is busy with results for another command + \) -) +\) diff --git a/test/functional/sqlsrv/srv_075_database_wide_string.phpt b/test/functional/sqlsrv/srv_075_database_wide_string.phpt index eb1800ec..2737a1cf 100644 --- a/test/functional/sqlsrv/srv_075_database_wide_string.phpt +++ b/test/functional/sqlsrv/srv_075_database_wide_string.phpt @@ -41,5 +41,5 @@ print "Done"; bool\(false\) string\(5\) "(42S02|08004)" int\((3701|911)\) -string\([0-9]+\) "\[Microsoft\]\[ODBC Driver 13 for SQL Server\]\[SQL Server\](Cannot drop the database 'uniqueDB01_银河系', because it does not exist or you do not have permission\.|Database 'uniqueDB01_银河系' does not exist. Make sure that the name is entered correctly\.)" +string\([0-9]+\) "\[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]\[SQL Server\](Cannot drop the database 'uniqueDB01_银河系', because it does not exist or you do not have permission\.|Database 'uniqueDB01_银河系' does not exist. Make sure that the name is entered correctly\.)" Done diff --git a/test/functional/sqlsrv/test_connectionOption.phpt b/test/functional/sqlsrv/test_connectionOption.phpt index 30da4c52..981a17cc 100644 --- a/test/functional/sqlsrv/test_connectionOption.phpt +++ b/test/functional/sqlsrv/test_connectionOption.phpt @@ -49,8 +49,8 @@ Array \[SQLSTATE\] => HY000 \[1\] => 0 \[code\] => 0 - \[2\] => \[Microsoft\]\[ODBC Driver 1[0-9] for SQL Server\]Connection is busy with results for another command - \[message\] => \[Microsoft\]\[ODBC Driver 1[0-9] for SQL Server\]Connection is busy with results for another command + \[2\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Connection is busy with results for another command + \[message\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Connection is busy with results for another command \) \) diff --git a/test/functional/sqlsrv/test_scrollable.phpt b/test/functional/sqlsrv/test_scrollable.phpt index 2f72f419..00543d4f 100644 --- a/test/functional/sqlsrv/test_scrollable.phpt +++ b/test/functional/sqlsrv/test_scrollable.phpt @@ -236,8 +236,8 @@ Array \[SQLSTATE\] => HY109 \[1\] => 0 \[code\] => 0 - \[2\] => \[Microsoft\]\[ODBC Driver 1[0-9] for SQL Server\]Invalid cursor position - \[message\] => \[Microsoft\]\[ODBC Driver 1[0-9] for SQL Server\]Invalid cursor position + \[2\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Invalid cursor position + \[message\] => \[Microsoft\]\[ODBC Driver 1[1-9] for SQL Server\]Invalid cursor position \) \)