@@ -13,11 +13,7 @@ use crate::odbc::{OdbcStatement, OdbcStatementMetadata};
1313use futures_core:: future:: BoxFuture ;
1414use futures_util:: future;
1515use odbc_api:: ConnectionTransitions ;
16- use odbc_api:: Error as OdbcApiError ;
17- use odbc_api:: {
18- handles:: { slice_to_cow_utf8, StatementConnection } ,
19- Prepared , ResultSetMetadata , SharedConnection ,
20- } ;
16+ use odbc_api:: { handles:: StatementConnection , Prepared , ResultSetMetadata , SharedConnection } ;
2117use odbc_bridge:: { establish_connection, execute_sql} ;
2218use std:: borrow:: Cow ;
2319use std:: sync:: { Arc , Mutex } ;
@@ -39,11 +35,7 @@ fn collect_columns(
3935) -> Result < CollectedColumns , Error > {
4036 let count = match prepared. num_result_cols ( ) {
4137 Ok ( count) => count,
42- Err ( error)
43- if allow_deferred_result_columns
44- && parameter_count > 0
45- && is_unbound_parameter_metadata_error ( & error) =>
46- {
38+ Err ( error) if allow_deferred_result_columns && parameter_count > 0 => {
4739 log:: debug!( "ODBC prepare deferred result columns until execution: {error}" ) ;
4840 return Ok ( CollectedColumns {
4941 columns : Vec :: new ( ) ,
@@ -80,16 +72,6 @@ fn collect_statement_metadata(
8072 ) )
8173}
8274
83- fn is_unbound_parameter_metadata_error ( error : & OdbcApiError ) -> bool {
84- match error {
85- OdbcApiError :: Diagnostics { record, .. } if record. state . as_str ( ) == "01000" => {
86- let message = slice_to_cow_utf8 ( & record. message ) . to_ascii_lowercase ( ) ;
87- message. contains ( "parameter" ) && message. contains ( "bound" )
88- }
89- _ => false ,
90- }
91- }
92-
9375pub ( super ) fn describe_column < S > ( stmt : & mut S , index : u16 ) -> Result < OdbcColumn , Error >
9476where
9577 S : ResultSetMetadata ,
0 commit comments