@@ -16032,13 +16032,10 @@ fn parse_create_procedure_with_parameter_modes() {
1603216032}
1603316033
1603416034#[test]
16035- fn parse_not_null_supported () {
16035+ fn parse_not_null () {
1603616036 let _ = all_dialects().expr_parses_to("x NOT NULL", "x IS NOT NULL");
1603716037 let _ = all_dialects().expr_parses_to("NULL NOT NULL", "NULL IS NOT NULL");
16038- }
1603916038
16040- #[test]
16041- fn test_not_null_precedence() {
1604216039 assert_matches!(
1604316040 all_dialects().expr_parses_to("NOT NULL NOT NULL", "NOT NULL IS NOT NULL"),
1604416041 Expr::UnaryOp {
@@ -16200,37 +16197,27 @@ fn test_identifier_unicode_start() {
1620016197}
1620116198
1620216199#[test]
16203- fn parse_notnull_unsupported() {
16204- // Only Postgres, DuckDB, and SQLite support `x NOTNULL` as an expression
16205- // All other dialects consider `x NOTNULL` like `x AS NOTNULL` and thus
16206- // consider `NOTNULL` an alias for x.
16207- let dialects = all_dialects_except(|d| d.supports_notnull_operator());
16208- let _ = dialects
16200+ fn parse_notnull() {
16201+ // Some dialects support `x NOTNULL` as an expression while others consider
16202+ // `x NOTNULL` like `x AS NOTNULL` and thus consider `NOTNULL` an alias for x.
16203+ let notnull_unsupported_dialects = all_dialects_except(|d| d.supports_notnull_operator());
16204+ let _ = notnull_unsupported_dialects
1620916205 .verified_only_select_with_canonical("SELECT NULL NOTNULL", "SELECT NULL AS NOTNULL");
16210- }
1621116206
16212- #[test]
16213- fn parse_notnull_supported() {
16214- // Postgres, DuckDB and SQLite support `x NOTNULL` as an alias for `x IS NOT NULL`
16215- let dialects = all_dialects_where(|d| d.supports_notnull_operator());
16216- let _ = dialects.expr_parses_to("x NOTNULL", "x IS NOT NULL");
16217- }
16207+ // Supported dialects consider `x NOTNULL` as an alias for `x IS NOT NULL`
16208+ let notnull_supported_dialects = all_dialects_where(|d| d.supports_notnull_operator());
16209+ let _ = notnull_supported_dialects.expr_parses_to("x NOTNULL", "x IS NOT NULL");
1621816210
16219- #[test]
16220- fn test_notnull_precedence() {
1622116211 // For dialects which support it, `NOT NULL NOTNULL` should
1622216212 // parse as `(NOT (NULL IS NOT NULL))`
16223- let supported_dialects = all_dialects_where(|d| d.supports_notnull_operator());
16224- let unsupported_dialects = all_dialects_except(|d| d.supports_notnull_operator());
16225-
1622616213 assert_matches!(
16227- supported_dialects .expr_parses_to("NOT NULL NOTNULL", "NOT NULL IS NOT NULL"),
16214+ notnull_supported_dialects .expr_parses_to("NOT NULL NOTNULL", "NOT NULL IS NOT NULL"),
1622816215 Expr::UnaryOp {
1622916216 op: UnaryOperator::Not,
1623016217 ..
1623116218 }
1623216219 );
1623316220
1623416221 // for unsupported dialects, parsing should stop at `NOT NULL`
16235- unsupported_dialects .expr_parses_to("NOT NULL NOTNULL", "NOT NULL");
16222+ notnull_unsupported_dialects .expr_parses_to("NOT NULL NOTNULL", "NOT NULL");
1623616223}
0 commit comments