File tree Expand file tree Collapse file tree 4 files changed +7
-27
lines changed
Expand file tree Collapse file tree 4 files changed +7
-27
lines changed Original file line number Diff line number Diff line change @@ -1451,16 +1451,6 @@ pub trait Dialect: Debug + Any {
14511451 false
14521452 }
14531453
1454- /// Returns true if the dialect supports parenthesized modifiers for the `TEXT` data type.
1455- ///
1456- /// Example:
1457- /// ```sql
1458- /// SELECT col::TEXT(16777216)
1459- /// ```
1460- fn supports_text_type_modifiers ( & self ) -> bool {
1461- false
1462- }
1463-
14641454 /// Returns true if the dialect supports the `INTERVAL` data type with [Postgres]-style options.
14651455 ///
14661456 /// Examples:
Original file line number Diff line number Diff line change @@ -235,11 +235,6 @@ impl Dialect for SnowflakeDialect {
235235 true
236236 }
237237
238- /// See [doc](https://docs.snowflake.com/en/sql-reference/data-types-text)
239- fn supports_text_type_modifiers ( & self ) -> bool {
240- true
241- }
242-
243238 /// See [doc](https://docs.snowflake.com/en/sql-reference/constructs/from)
244239 fn supports_parens_around_table_factor ( & self ) -> bool {
245240 true
Original file line number Diff line number Diff line change @@ -12556,15 +12556,11 @@ impl<'a> Parser<'a> {
1255612556 Ok(DataType::FixedString(character_length))
1255712557 }
1255812558 Keyword::TEXT => {
12559- if dialect.supports_text_type_modifiers() {
12560- if let Some(modifiers) = self.parse_optional_type_modifiers()? {
12561- Ok(DataType::Custom(
12562- ObjectName::from(vec![Ident::new("TEXT")]),
12563- modifiers,
12564- ))
12565- } else {
12566- Ok(DataType::Text)
12567- }
12559+ if let Some(modifiers) = self.parse_optional_type_modifiers()? {
12560+ Ok(DataType::Custom(
12561+ ObjectName::from(vec![Ident::new("TEXT")]),
12562+ modifiers,
12563+ ))
1256812564 } else {
1256912565 Ok(DataType::Text)
1257012566 }
Original file line number Diff line number Diff line change @@ -6588,13 +6588,12 @@ fn interval_disallow_interval_expr_double_colon() {
65886588
65896589#[test]
65906590fn parse_text_type_modifier_double_colon_cast() {
6591- let dialects = all_dialects_where(|d| d.supports_text_type_modifiers());
6592- let expr = dialects.verified_expr("_ID::TEXT(16777216)");
6591+ let expr = verified_expr("ID::TEXT(16777216)");
65936592 assert_eq!(
65946593 expr,
65956594 Expr::Cast {
65966595 kind: CastKind::DoubleColon,
6597- expr: Box::new(Expr::Identifier(Ident::new("_ID "))),
6596+ expr: Box::new(Expr::Identifier(Ident::new("ID "))),
65986597 data_type: DataType::Custom(
65996598 ObjectName::from(vec![Ident::new("TEXT")]),
66006599 vec!["16777216".to_string()]
You can’t perform that action at this time.
0 commit comments