@@ -131,34 +131,34 @@ fn to_param(arg: OdbcArgumentValue) -> Box<dyn odbc_api::parameter::InputParamet
131131 use odbc_api:: DataType ;
132132
133133 match arg {
134- OdbcArgumentValue :: Int ( i) => Box :: new ( i . into_parameter ( ) ) ,
134+ OdbcArgumentValue :: Int ( i) => Box :: new ( Some ( i ) . into_parameter ( ) ) ,
135135 OdbcArgumentValue :: UInt ( u) => Box :: new (
136136 WithDataType {
137- value : u ,
137+ value : odbc_api :: Nullable :: new ( u ) ,
138138 data_type : DataType :: BigInt ,
139139 }
140140 . into_parameter ( ) ,
141141 ) ,
142- OdbcArgumentValue :: Float ( f) => Box :: new ( f . into_parameter ( ) ) ,
142+ OdbcArgumentValue :: Float ( f) => Box :: new ( Some ( f ) . into_parameter ( ) ) ,
143143 OdbcArgumentValue :: Text ( s) => Box :: new ( s. into_parameter ( ) ) ,
144144 OdbcArgumentValue :: Bytes ( b) => Box :: new ( b. into_parameter ( ) ) ,
145145 OdbcArgumentValue :: Date ( d) => Box :: new (
146146 WithDataType {
147- value : d ,
147+ value : odbc_api :: Nullable :: new ( d ) ,
148148 data_type : DataType :: Date ,
149149 }
150150 . into_parameter ( ) ,
151151 ) ,
152152 OdbcArgumentValue :: Time ( t) => Box :: new (
153153 WithDataType {
154- value : t ,
154+ value : odbc_api :: Nullable :: new ( t ) ,
155155 data_type : DataType :: Time { precision : 0 } ,
156156 }
157157 . into_parameter ( ) ,
158158 ) ,
159159 OdbcArgumentValue :: Timestamp ( ts) => Box :: new (
160160 WithDataType {
161- value : ts ,
161+ value : odbc_api :: Nullable :: new ( ts ) ,
162162 data_type : DataType :: Timestamp { precision : 6 } ,
163163 }
164164 . into_parameter ( ) ,
@@ -177,7 +177,7 @@ fn to_param(arg: OdbcArgumentValue) -> Box<dyn odbc_api::parameter::InputParamet
177177mod tests {
178178 use super :: * ;
179179 use crate :: arguments:: Arguments ;
180- use odbc_api:: handles:: HasDataType ;
180+ use odbc_api:: handles:: { CData , HasDataType } ;
181181
182182 #[ test]
183183 fn typed_none_parameter_preserves_non_string_data_type ( ) {
@@ -189,6 +189,17 @@ mod tests {
189189 assert_eq ! ( params. len( ) , 1 ) ;
190190 assert_eq ! ( params[ 0 ] . data_type( ) , odbc_api:: DataType :: Integer ) ;
191191 }
192+
193+ #[ test]
194+ fn fixed_sized_parameter_uses_explicit_non_null_indicator ( ) {
195+ let mut args = OdbcArguments :: default ( ) ;
196+
197+ args. add ( 5_i32 ) ;
198+
199+ let params = prepare_parameters ( Some ( args) ) ;
200+ assert_eq ! ( params. len( ) , 1 ) ;
201+ assert ! ( !params[ 0 ] . indicator_ptr( ) . is_null( ) ) ;
202+ }
192203}
193204
194205fn handle_result_sets < C : Cursor + ResultSetMetadata > (
0 commit comments