Skip to content

Get E2e Tests working in Windows - #149

Open
Theekshna wants to merge 4 commits into
mainfrom
dev/tkotian/E2eInWindows
Open

Get E2e Tests working in Windows#149
Theekshna wants to merge 4 commits into
mainfrom
dev/tkotian/E2eInWindows

Conversation

@Theekshna

@Theekshna Theekshna commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Description

Summary

Expands the phase-1 mssql-odbc driver with the ODBC 3.x entry points the Windows Driver Manager requires during connection and statement setup, and aligns their behavior with the msodbcsql reference driver. All new handlers were verified against the msodbcsql source (headers + sqlcinfo.cpp/sqlcmisc.cpp) for constant values, bit-packing, and null-pointer semantics.

Changes

  • New API entry points: SQLConnectW, SQLGetFunctions, SQLGetInfoW, SQLGetEnvAttr/SQLSetEnvAttr, SQLGetStmtAttrW, SQLGetConnectAttrW, SQLGetDiagFieldW, and SQLGetDescFieldW (with a new desc descriptor handle type and the four implicit descriptors on StmtHandle).
  • msodbcsql parity fixes: SQLGetFunctions uses the reference's ODBC3 bit-packing (idx = id>>4, 1 << (id & 0xF), 250-word map) and reports a correct strict-subset of implemented functions (adds the previously-missing SQLConnect/SQLRowCount); SQLGetFunctions and SQLGetStmtAttrW now treat a null out-pointer as a benign SQL_SUCCESS no-op instead of returning HY009/SQL_ERROR.
  • Constants: ~80 new FFI constants in odbc_types.rs, all audited against sql.h/sqlext.h/sqlucode.h/sqlspi.h (fixed SQL_API_SQLCONNECT to 7); minor diagnostics/named-constant cleanups in get_diag.rs and get_info.rs.
  • E2E tests: added get_diag_field coverage, compareWith msodbcsql support in run_e2e.ps1, an optional UNICODE build toggle in CMake, and switched connection-less tests from GTEST_SKIP to a hard failure so missing config surfaces instead of silently passing.

Validation

Built clean and 343 lib tests pass under cargo +ms-stable. Note: local verification used +ms-stable rather than the pinned 1.95 toolchain (msrustup constraint), and coverage/nextest were substituted with cargo test/clippy — CI should re-confirm on the pinned toolchain.

Related Issues

closes AB#46564

Checklist

  • cargo bfmt passes
  • cargo bclippy passes
  • cargo btest passes
  • New/changed functionality has tests
  • Public API changes are documented

Theekshna Kotian and others added 2 commits July 24, 2026 03:31
SQL_DIAG_CLASS_ORIGIN and SQL_DIAG_SUBCLASS_ORIGIN are synthesized by the
Driver Manager, not the driver. unixODBC returns ODBC 3.0 for the 08001
connect error while the Windows DM returns ISO 9075, so the two tests only
passed when run against the Microsoft driver. The driver's own origin logic
is already covered by get_diag.rs unit tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Theekshna
Theekshna marked this pull request as ready for review July 24, 2026 06:56
@Theekshna
Theekshna requested a review from a team as a code owner July 24, 2026 06:56
Copilot AI review requested due to automatic review settings July 24, 2026 06:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds Windows Driver Manager compatibility for mssql-odbc and expands Windows E2E/parity testing.

Changes:

  • Adds required ODBC connection, metadata, environment, statement, and descriptor support.
  • Introduces implicit statement descriptors and diagnostic fields.
  • Adds Unicode Windows builds and msodbcsql parity runs.

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
mssql-odbc/tests/e2e/tests/smoke_test.cpp Fails when live configuration is missing.
mssql-odbc/tests/e2e/tests/num_result_cols_test.cpp Requires live configuration.
mssql-odbc/tests/e2e/tests/more_results_test.cpp Requires live configuration.
mssql-odbc/tests/e2e/tests/execute_test.cpp Requires live configuration.
mssql-odbc/tests/e2e/tests/exec_direct_test.cpp Requires live configuration.
mssql-odbc/tests/e2e/tests/driver_connect_test.cpp Improves diagnostic-state lookup.
mssql-odbc/tests/e2e/tests/describe_col_test.cpp Requires live configuration.
mssql-odbc/tests/e2e/tests/alloc_stmt_test.cpp Requires live configuration.
mssql-odbc/tests/e2e/tests/alloc_env_test.cpp Requires live configuration.
mssql-odbc/tests/e2e/run_e2e.sh Adds configurable Unicode mode.
mssql-odbc/tests/e2e/run_e2e.ps1 Adds Windows parity execution and reporting.
mssql-odbc/tests/e2e/README.md Documents Windows parity and Unicode builds.
mssql-odbc/tests/e2e/CMakeLists.txt Configures platform-specific Unicode compilation.
mssql-odbc/src/handles/stmt.rs Owns four implicit descriptors.
mssql-odbc/src/handles/mod.rs Registers the descriptor module.
mssql-odbc/src/handles/desc.rs Defines implicit descriptor handles.
mssql-odbc/src/api/set_connect_attr.rs Accepts SQL_ATTR_ANSI_APP.
mssql-odbc/src/api/odbc_types.rs Adds ODBC constants and identifiers.
mssql-odbc/src/api/mod.rs Registers new API modules.
mssql-odbc/src/api/get_stmt_attr.rs Returns implicit descriptor handles.
mssql-odbc/src/api/get_info.rs Implements driver capability metadata.
mssql-odbc/src/api/get_functions.rs Reports implemented ODBC functions.
mssql-odbc/src/api/get_env_attr.rs Retrieves ODBC environment version.
mssql-odbc/src/api/get_diag.rs Expands diagnostic-field support.
mssql-odbc/src/api/exports.rs Exports the new ODBC entry points.
mssql-odbc/src/api/driver_connect.rs Exposes the shared connection core.
mssql-odbc/src/api/connect.rs Adds SQLConnectW.
Comments suppressed due to low confidence (2)

mssql-odbc/src/api/exports.rs:642

  • This exported FFI entry point bypasses crate::ffi_entry!, so a panic can unwind across the C ABI boundary. Delegate to a separately wrapped implementation instead of implementing the stub directly in exports.rs.
    super::odbc_types::SQL_ERROR

mssql-odbc/src/api/exports.rs:673

  • This exported descriptor entry point also lacks the mandatory crate::ffi_entry! panic boundary. Put the validation/error logic in a wrapped implementation and keep this export as a tracing-initializing delegate, otherwise a panic may unwind into the Driver Manager.
    super::odbc_types::SQL_ERROR

Comment thread mssql-odbc/src/api/connect.rs Outdated
Comment thread mssql-odbc/src/api/connect.rs Outdated
Comment thread mssql-odbc/src/api/get_info.rs
Comment thread mssql-odbc/src/api/get_info.rs
Comment on lines +29 to +32
/// Reserved for future field-level descriptor access; unused while the
/// Driver Manager only requires the handles to exist.
#[allow(dead_code)]
pub(crate) inner: Mutex<DescState>,
Comment thread mssql-odbc/src/api/get_diag.rs
Comment thread mssql-odbc/src/api/get_diag.rs
Comment thread mssql-odbc/tests/e2e/run_e2e.ps1 Outdated
Comment thread mssql-odbc/tests/e2e/run_e2e.ps1
Comment thread mssql-odbc/tests/e2e/run_e2e.ps1
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

📊 Code Coverage Report

🔥 Diff Coverage

77%

🎯 Overall Coverage

90.1%

📦 Project: mssql-tds + mssql-odbc + mssql-py-core
ℹ️ Note: diff coverage is reported, not enforced.


Diff Coverage

Diff: main...HEAD, staged and unstaged changes

  • mssql-odbc/src/api/connect.rs (83.0%): Missing lines 76,78-79,85-87,89,91,93-96,99-102,104
  • mssql-odbc/src/api/driver_connect.rs (100%)
  • mssql-odbc/src/api/exports.rs (0.0%): Missing lines 77-84,86-91,94,104-110,112-116,119,128-135,137-142,145,153-158,160,162,170-177,179-184,187,274-283,285-292,295,602-606,609,617,629-632,635,642,656-661,664,673
  • mssql-odbc/src/api/get_diag.rs (100%)
  • mssql-odbc/src/api/get_env_attr.rs (0.0%): Missing lines 23-30,38-39,41,43-52,54-55,60-61,63-71,73,75,77-81,83-85,88-90,93
  • mssql-odbc/src/api/get_functions.rs (98.7%): Missing lines 72-73
  • mssql-odbc/src/api/get_info.rs (87.1%): Missing lines 94-95,114-119,121-126,144-149,151-156,158-163,173-178
  • mssql-odbc/src/api/get_stmt_attr.rs (98.3%): Missing lines 72-73
  • mssql-odbc/src/api/set_connect_attr.rs (100%)
  • mssql-odbc/src/api/sqlstate.rs (100%)
  • mssql-odbc/src/handles/desc.rs (50.0%): Missing lines 53-55,59-64
  • mssql-odbc/src/handles/stmt.rs (100%)

Summary

  • Total: 970 lines
  • Missing: 222 lines
  • Coverage: 77%

mssql-odbc/src/api/connect.rs

  72 ) -> SqlReturn {
  73     if connection_handle.is_null() {
  74         error!("SQLConnectW: connection_handle is null");
  75         return SQL_INVALID_HANDLE;
! 76     }
  77 
! 78     let dbc = unsafe { handle_from_raw::<DbcHandle>(connection_handle) };
! 79     debug_assert_eq!(
  80         dbc.object_type,
  81         HandleType::Dbc,
  82         "SQLConnectW: handle is not a DBC"
  83     );

   81         HandleType::Dbc,
   82         "SQLConnectW: handle is not a DBC"
   83     );
   84 
!  85     let read = |ptr: *const SqlWChar, len: SqlSmallInt| -> Option<String> {
!  86         if ptr.is_null() {
!  87             None
   88         } else {
!  89             Some(unsafe { read_utf16(ptr, len) })
   90         }
!  91     };
   92 
!  93     let conn_str = build_connection_string(
!  94         read(server_name, name_length_1),
!  95         read(user_name, name_length_2),
!  96         read(authentication, name_length_3),
   97     );
   98 
!  99     sql_driver_connect_w_safe(
! 100         dbc,
! 101         conn_str,
! 102         std::ptr::null_mut(),
  103         0,
! 104         std::ptr::null_mut(),
  105         SQL_DRIVER_NOPROMPT,
  106     )
  107 }

mssql-odbc/src/api/exports.rs

  73 /// # Safety
  74 /// - `environment_handle` must be a valid ENV handle.
  75 /// - Output pointers must be valid and writable for the requested attribute.
  76 #[unsafe(no_mangle)]
! 77 pub unsafe extern "C" fn SQLGetEnvAttr(
! 78     environment_handle: SqlHandle,
! 79     attribute: SqlInteger,
! 80     value_ptr: SqlPointer,
! 81     buffer_length: SqlInteger,
! 82     string_length_ptr: *mut SqlInteger,
! 83 ) -> SqlReturn {
! 84     crate::init_tracing();
  85     unsafe {
! 86         super::get_env_attr::sql_get_env_attr(
! 87             environment_handle,
! 88             attribute,
! 89             value_ptr,
! 90             buffer_length,
! 91             string_length_ptr,
  92         )
  93     }
! 94 }
  95 
  96 /// Sets a connection attribute.
  97 ///
  98 /// # Safety

  100 /// - `attribute` must be a valid connection attribute identifier.
  101 /// - `value_ptr` validity depends on the attribute type.
  102 /// - `string_length` is used only for string-type attributes.
  103 #[unsafe(no_mangle)]
! 104 pub unsafe extern "C" fn SQLSetConnectAttrW(
! 105     connection_handle: SqlHandle,
! 106     attribute: SqlInteger,
! 107     value_ptr: SqlPointer,
! 108     string_length: SqlInteger,
! 109 ) -> SqlReturn {
! 110     crate::init_tracing();
  111     unsafe {
! 112         super::set_connect_attr::sql_set_connect_attr_w(
! 113             connection_handle,
! 114             attribute,
! 115             value_ptr,
! 116             string_length,
  117         )
  118     }
! 119 }
  120 
  121 /// Retrieves a statement attribute.
  122 ///
  123 /// # Safety

  124 /// - `statement_handle` must be a valid STMT handle.
  125 /// - `attribute` must be a valid statement attribute identifier.
  126 /// - Output pointers must be valid and writable.
  127 #[unsafe(no_mangle)]
! 128 pub unsafe extern "C" fn SQLGetStmtAttrW(
! 129     statement_handle: SqlHandle,
! 130     attribute: SqlInteger,
! 131     value_ptr: SqlPointer,
! 132     buffer_length: SqlInteger,
! 133     string_length_ptr: *mut SqlInteger,
! 134 ) -> SqlReturn {
! 135     crate::init_tracing();
  136     unsafe {
! 137         super::get_stmt_attr::sql_get_stmt_attr_w(
! 138             statement_handle,
! 139             attribute,
! 140             value_ptr,
! 141             buffer_length,
! 142             string_length_ptr,
  143         )
  144     }
! 145 }
  146 
  147 /// Reports whether a specific ODBC function is supported by this driver.
  148 ///
  149 /// # Safety

  149 /// # Safety
  150 /// - `connection_handle` must be a valid DBC handle.
  151 /// - `supported_ptr` must be writable as required by `function_id`.
  152 #[unsafe(no_mangle)]
! 153 pub unsafe extern "C" fn SQLGetFunctions(
! 154     connection_handle: SqlHandle,
! 155     function_id: SqlUSmallInt,
! 156     supported_ptr: *mut SqlUSmallInt,
! 157 ) -> SqlReturn {
! 158     crate::init_tracing();
  159     unsafe {
! 160         super::get_functions::sql_get_functions(connection_handle, function_id, supported_ptr)
  161     }
! 162 }
  163 
  164 /// Retrieves driver/data-source capability information.
  165 ///
  166 /// # Safety

  166 /// # Safety
  167 /// - `connection_handle` must be a valid DBC handle.
  168 /// - Output pointers must be valid and writable for the requested info type.
  169 #[unsafe(no_mangle)]
! 170 pub unsafe extern "C" fn SQLGetInfoW(
! 171     connection_handle: SqlHandle,
! 172     info_type: SqlUSmallInt,
! 173     info_value_ptr: SqlPointer,
! 174     buffer_length: SqlSmallInt,
! 175     string_length_ptr: *mut SqlSmallInt,
! 176 ) -> SqlReturn {
! 177     crate::init_tracing();
  178     unsafe {
! 179         super::get_info::sql_get_info_w(
! 180             connection_handle,
! 181             info_type,
! 182             info_value_ptr,
! 183             buffer_length,
! 184             string_length_ptr,
  185         )
  186     }
! 187 }
  188 
  189 // ---- Diagnostics -----------------------------------------------------------
  190 
  191 /// Retrieves a diagnostic record (SQLSTATE, native error, message) previously

  270 /// - `server_name`, `user_name`, and `authentication` (if non-null) must each point
  271 ///   to a valid UTF-16 buffer of the corresponding length (or be null-terminated
  272 ///   when the length is `SQL_NTS`).
  273 #[unsafe(no_mangle)]
! 274 pub unsafe extern "C" fn SQLConnectW(
! 275     connection_handle: SqlHandle,
! 276     server_name: *const SqlWChar,
! 277     name_length1: SqlSmallInt,
! 278     user_name: *const SqlWChar,
! 279     name_length2: SqlSmallInt,
! 280     authentication: *const SqlWChar,
! 281     name_length3: SqlSmallInt,
! 282 ) -> SqlReturn {
! 283     crate::init_tracing();
  284     unsafe {
! 285         super::connect::sql_connect_w(
! 286             connection_handle,
! 287             server_name,
! 288             name_length1,
! 289             user_name,
! 290             name_length2,
! 291             authentication,
! 292             name_length3,
  293         )
  294     }
! 295 }
  296 
  297 /// Establishes a connection to a data source.
  298 ///
  299 /// # Safety

  598 /// - `attribute` must be a valid connection attribute identifier.
  599 /// - Output pointers must be valid and writable.
  600 #[unsafe(no_mangle)]
  601 pub unsafe extern "C" fn SQLGetConnectAttrW(
! 602     connection_handle: SqlHandle,
! 603     attribute: SqlInteger,
! 604     value_ptr: SqlPointer,
! 605     buffer_length: SqlInteger,
! 606     string_length_ptr: *mut SqlInteger,
  607 ) -> SqlReturn {
  608     crate::init_tracing();
! 609     tracing::debug!(
  610         ?connection_handle,
  611         attribute,
  612         ?value_ptr,
  613         buffer_length,

  613         buffer_length,
  614         ?string_length_ptr,
  615         "SQLGetConnectAttrW called (stub)",
  616     );
! 617     super::odbc_types::SQL_ERROR
  618 }
  619 
  620 /// Sets a statement attribute.
  621 ///

  625 /// - `value_ptr` validity depends on the attribute type.
  626 /// - `string_length` is used only for string-type attributes.
  627 #[unsafe(no_mangle)]
  628 pub unsafe extern "C" fn SQLSetStmtAttrW(
! 629     statement_handle: SqlHandle,
! 630     attribute: SqlInteger,
! 631     value_ptr: SqlPointer,
! 632     string_length: SqlInteger,
  633 ) -> SqlReturn {
  634     crate::init_tracing();
! 635     tracing::debug!(
  636         ?statement_handle,
  637         attribute,
  638         ?value_ptr,
  639         string_length,

  638         ?value_ptr,
  639         string_length,
  640         "SQLSetStmtAttrW called (stub)",
  641     );
! 642     super::odbc_types::SQL_ERROR
  643 }
  644 
  645 // ---- Descriptor and parameter management (TO-BE-IMPLEMENTED) -----------------

  652 /// - `field_identifier` must be a valid field identifier.
  653 /// - Output pointers must be valid and writable.
  654 #[unsafe(no_mangle)]
  655 pub unsafe extern "C" fn SQLGetDescFieldW(
! 656     descriptor_handle: SqlHandle,
! 657     record_number: SqlSmallInt,
! 658     field_identifier: SqlSmallInt,
! 659     value_ptr: SqlPointer,
! 660     buffer_length: SqlInteger,
! 661     string_length_ptr: *mut SqlInteger,
  662 ) -> SqlReturn {
  663     crate::init_tracing();
! 664     tracing::debug!(
  665         ?descriptor_handle,
  666         record_number,
  667         field_identifier,
  668         ?value_ptr,

  669         buffer_length,
  670         ?string_length_ptr,
  671         "SQLGetDescFieldW called (stub)",
  672     );
! 673     super::odbc_types::SQL_ERROR
  674 }
  675 
  676 /// Cancels the processing of the statement.
  677 ///

mssql-odbc/src/api/get_env_attr.rs

  19 /// # Safety
  20 /// - `environment_handle` must be a valid ENV handle.
  21 /// - `value_ptr` and `string_length_ptr` must satisfy ODBC output-pointer
  22 ///   requirements for the requested attribute.
! 23 pub(crate) unsafe fn sql_get_env_attr(
! 24     environment_handle: SqlHandle,
! 25     attribute: SqlInteger,
! 26     value_ptr: SqlPointer,
! 27     _buffer_length: SqlInteger,
! 28     string_length_ptr: *mut SqlInteger,
! 29 ) -> SqlReturn {
! 30     debug!(
  31         ?environment_handle,
  32         attribute,
  33         ?value_ptr,
  34         ?string_length_ptr,

  34         ?string_length_ptr,
  35         "SQLGetEnvAttr called",
  36     );
  37 
! 38     crate::ffi_entry!("SQLGetEnvAttr", unsafe {
! 39         sql_get_env_attr_impl(environment_handle, attribute, value_ptr, string_length_ptr)
  40     })
! 41 }
  42 
! 43 unsafe fn sql_get_env_attr_impl(
! 44     environment_handle: SqlHandle,
! 45     attribute: SqlInteger,
! 46     value_ptr: SqlPointer,
! 47     string_length_ptr: *mut SqlInteger,
! 48 ) -> SqlReturn {
! 49     if environment_handle.is_null() {
! 50         error!("SQLGetEnvAttr: environment_handle is null");
! 51         return SQL_INVALID_HANDLE;
! 52     }
  53 
! 54     let env = unsafe { handle_from_raw::<EnvHandle>(environment_handle) };
! 55     debug_assert_eq!(
  56         env.object_type,
  57         HandleType::Env,
  58         "SQLGetEnvAttr: handle is not an ENV"
  59     );
! 60     sql_get_env_attr_safe(env, attribute, value_ptr, string_length_ptr)
! 61 }
  62 
! 63 fn sql_get_env_attr_safe(
! 64     env: &EnvHandle,
! 65     attribute: SqlInteger,
! 66     value_ptr: SqlPointer,
! 67     string_length_ptr: *mut SqlInteger,
! 68 ) -> SqlReturn {
! 69     let Ok(mut state) = env.inner.lock() else {
! 70         error!("SQLGetEnvAttr: env mutex poisoned");
! 71         return SQL_ERROR;
  72     };
! 73     free_errors(&mut state);
  74 
! 75     match attribute {
  76         SQL_ATTR_ODBC_VERSION => {
! 77             let v = match state.odbc_version {
! 78                 OdbcVersion::Unset => 0u32,
! 79                 OdbcVersion::Odbc2 => crate::api::odbc_types::SQL_OV_ODBC2,
! 80                 OdbcVersion::Odbc3 => crate::api::odbc_types::SQL_OV_ODBC3,
! 81                 OdbcVersion::Odbc3_80 => crate::api::odbc_types::SQL_OV_ODBC3_80,
  82             };
! 83             unsafe { write_if_some(value_ptr as *mut u32, v) };
! 84             unsafe { write_if_some(string_length_ptr, std::mem::size_of::<u32>() as i32) };
! 85             SQL_SUCCESS
  86         }
  87         _ => {
! 88             error!(attribute, "SQLGetEnvAttr: unsupported env attribute");
! 89             post_diag(&mut state, ERR_INVALID_ATTRIBUTE_IDENTIFIER);
! 90             SQL_ERROR
  91         }
  92     }
! 93 }

mssql-odbc/src/api/get_functions.rs

  68     function_id: SqlUSmallInt,
  69     supported_ptr: *mut SqlUSmallInt,
  70 ) -> SqlReturn {
  71     let Ok(mut state) = dbc.inner.lock() else {
! 72         error!("SQLGetFunctions: dbc mutex poisoned");
! 73         return SQL_ERROR;
  74     };
  75     free_errors(&mut state);
  76 
  77     // Matches msodbcsql (sqlcinfo.cpp): a null SupportedPtr is a benign no-op

mssql-odbc/src/api/get_info.rs

  90     buffer_length: SqlSmallInt,
  91     string_length_ptr: *mut SqlSmallInt,
  92 ) -> SqlReturn {
  93     let Ok(mut state) = dbc.inner.lock() else {
! 94         error!("SQLGetInfoW: dbc mutex poisoned");
! 95         return SQL_ERROR;
  96     };
  97     free_errors(&mut state);
  98 
  99     unsafe { write_if_some(string_length_ptr, 0) };

  110             buffer_length,
  111             string_length_ptr,
  112             driver_name(),
  113         ),
! 114         SQL_DRIVER_VER => write_wide_str(
! 115             &mut state,
! 116             info_value_ptr,
! 117             buffer_length,
! 118             string_length_ptr,
! 119             "18.6.2.1",
  120         ),
! 121         SQL_DRIVER_ODBC_VER | SQL_ODBC_VER => write_wide_str(
! 122             &mut state,
! 123             info_value_ptr,
! 124             buffer_length,
! 125             string_length_ptr,
! 126             "03.80",
  127         ),
  128         SQL_ODBC_API_CONFORMANCE => write_u16(info_value_ptr, SQL_OAC_LEVEL2, string_length_ptr),
  129         SQL_ODBC_SQL_CONFORMANCE => write_u16(info_value_ptr, SQL_OSC_CORE, string_length_ptr),
  130         SQL_CURSOR_COMMIT_BEHAVIOR => write_u16(info_value_ptr, SQL_CB_CLOSE, string_length_ptr),

  140             buffer_length,
  141             string_length_ptr,
  142             "Microsoft SQL Server",
  143         ),
! 144         SQL_DBMS_VER => write_wide_str(
! 145             &mut state,
! 146             info_value_ptr,
! 147             buffer_length,
! 148             string_length_ptr,
! 149             "16.00.0000",
  150         ),
! 151         SQL_IDENTIFIER_QUOTE_CHAR => write_wide_str(
! 152             &mut state,
! 153             info_value_ptr,
! 154             buffer_length,
! 155             string_length_ptr,
! 156             "\"",
  157         ),
! 158         SQL_NEED_LONG_DATA_LEN => write_wide_str(
! 159             &mut state,
! 160             info_value_ptr,
! 161             buffer_length,
! 162             string_length_ptr,
! 163             "N",
  164         ),
  165         SQL_ASYNC_DBC_FUNCTIONS => {
  166             write_u32(info_value_ptr, SQL_ASYNC_DBC_NOT_CAPABLE, string_length_ptr)
  167         }

  169             info_value_ptr,
  170             SQL_ASYNC_NOTIFICATION_NOT_CAPABLE,
  171             string_length_ptr,
  172         ),
! 173         SQL_DM_VER => write_wide_str(
! 174             &mut state,
! 175             info_value_ptr,
! 176             buffer_length,
! 177             string_length_ptr,
! 178             "03.80.0000",
  179         ),
  180         _ => {
  181             error!(info_type, "SQLGetInfoW: unsupported info type");
  182             post_diag(&mut state, ERR_INVALID_INFO_TYPE);

mssql-odbc/src/api/get_stmt_attr.rs

  68     attribute: SqlInteger,
  69     value_ptr: SqlPointer,
  70 ) -> SqlReturn {
  71     let Ok(mut state) = stmt.inner.lock() else {
! 72         error!("SQLGetStmtAttrW: stmt mutex poisoned");
! 73         return SQL_ERROR;
  74     };
  75     free_errors(&mut state);
  76 
  77     let desc = match attribute {

mssql-odbc/src/handles/desc.rs

  49     }
  50 }
  51 
  52 impl HasObjectType for DescHandle {
! 53     fn object_type_mut(&mut self) -> &mut HandleType {
! 54         &mut self.object_type
! 55     }
  56 }
  57 
  58 impl HasDiagnostics for DescState {
! 59     fn diag_records(&self) -> &[DiagRecord] {
! 60         &self.diag_records
! 61     }
! 62     fn diag_records_mut(&mut self) -> &mut Vec<DiagRecord> {
! 63         &mut self.diag_records
! 64     }
  65 }


🔗 Quick Links

View Azure DevOps Build · Coverage Report

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ODBCTest::SetUp();
if (!ODBCTestConfig::Instance().HasConnection()) {
GTEST_SKIP() << "No connection configured – set ODBC_TEST_SERVER or ODBC_TEST_CONNSTR";
FAIL() << "No connection configured – set ODBC_TEST_SERVER or ODBC_TEST_CONNSTR";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we update the readme.md file https://github.com/microsoft/mssql-rs/pull/149/changes#:~:text=Tests%20that%20require,to%20enable%20them%3A , which still says connected tests are skipped when no connection is configured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants