Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/tds/codec/type_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ impl Encode<BytesMut> for VarLenContext {
// length
match self.r#type {
#[cfg(feature = "tds73")]
VarLenType::Daten
| VarLenType::Timen
VarLenType::Daten => {}
VarLenType::Timen
| VarLenType::DatetimeOffsetn
| VarLenType::Datetime2 => {
dst.put_u8(self.len() as u8);
Expand Down
11 changes: 8 additions & 3 deletions tests/bulk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ use std::sync::Once;
use tiberius::{IntoSql, Result, TokenRow};

#[cfg(all(feature = "tds73", feature = "chrono"))]
use chrono::DateTime;
#[cfg(all(feature = "tds73", feature = "chrono"))]
use chrono::NaiveDateTime;
use chrono::{NaiveDateTime, DateTime, NaiveDate};

use runtimes_macro::test_on_runtimes;

Expand Down Expand Up @@ -218,3 +216,10 @@ test_bulk_type!(datetime2_7(
100,
vec![DateTime::from_timestamp(1658524194, 123456789); 100].into_iter()
));

#[cfg(all(feature = "tds73", feature = "chrono"))]
test_bulk_type!(date(
"DATE",
100,
vec![NaiveDate::from_ymd_opt(2020, 4, 20).unwrap(); 100].into_iter()
));