Skip to content

Commit a179a21

Browse files
committed
Fixed unit tests after moving to sql common
1 parent 5d2a4c0 commit a179a21

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/ast/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ pub enum Expr {
669669
/// CONVERT a value to a different data type or character encoding. e.g. `CONVERT(foo USING utf8mb4)`
670670
Convert {
671671
/// CONVERT (false) or TRY_CONVERT (true)
672-
/// [MSSQL]: <https://learn.microsoft.com/en-us/sql/t-sql/functions/try-convert-transact-sql?view=sql-server-ver16>
672+
/// <https://learn.microsoft.com/en-us/sql/t-sql/functions/try-convert-transact-sql?view=sql-server-ver16>
673673
is_try: bool,
674674
/// The expression to convert
675675
expr: Box<Expr>,

tests/sqlparser_common.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -11435,6 +11435,11 @@ fn test_any_some_all_comparison() {
1143511435

1143611436
#[test]
1143711437
fn test_try_convert() {
11438-
let dialects = all_dialects_where(|d| d.supports_try_convert());
11438+
let dialects =
11439+
all_dialects_where(|d| d.supports_try_convert() && d.convert_type_before_value());
1143911440
dialects.verified_expr("TRY_CONVERT(VARCHAR(MAX), 'foo')");
11440-
}
11441+
11442+
let dialects =
11443+
all_dialects_where(|d| d.supports_try_convert() && !d.convert_type_before_value());
11444+
dialects.verified_expr("TRY_CONVERT('foo', VARCHAR(MAX))");
11445+
}

0 commit comments

Comments
 (0)