Skip to content

Commit d86b741

Browse files
committed
chore: fmt
1 parent bf1a7ff commit d86b741

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

src/ast/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ pub use self::operator::{BinaryOperator, UnaryOperator};
3636
pub use self::query::{
3737
Cte, ExceptSelectItem, ExcludeSelectItem, Fetch, IdentWithAlias, Join, JoinConstraint,
3838
JoinOperator, LateralView, LockClause, LockType, NonBlock, Offset, OffsetRows, OrderByExpr,
39-
Query, RenameSelectItem, ReplaceSelectItem, Select, SelectInto, SelectItem, SetExpr, SetOperator, SetQuantifier,
40-
Table, TableAlias, TableFactor, TableWithJoins, Top, Values, WildcardAdditionalOptions, With,
39+
Query, RenameSelectItem, ReplaceSelectItem, Select, SelectInto, SelectItem, SetExpr,
40+
SetOperator, SetQuantifier, Table, TableAlias, TableFactor, TableWithJoins, Top, Values,
41+
WildcardAdditionalOptions, With,
4142
};
4243
pub use self::value::{
4344
escape_quoted_string, DateTimeField, DollarQuotedString, TrimWhereField, Value,

src/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6248,7 +6248,7 @@ impl<'a> Parser<'a> {
62486248
Ok(opt_rename)
62496249
}
62506250

6251-
/// Parse a [`Replace](RepalceSelectItem) information for wildcard select items.
6251+
/// Parse a [`Replace`](ReplaceSelectItem) information for wildcard select items.
62526252
pub fn parse_optional_select_item_replace(
62536253
&mut self,
62546254
) -> Result<Option<ReplaceSelectItem>, ParserError> {

tests/sqlparser_bigquery.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ use sqlparser::ast::*;
1717
use sqlparser::dialect::{BigQueryDialect, GenericDialect};
1818
use test_utils::*;
1919

20+
#[cfg(feature = "bigdecimal")]
21+
use bigdecimal::*;
22+
#[cfg(feature = "bigdecimal")]
23+
use std::str::FromStr;
24+
2025
#[test]
2126
fn parse_literal_string() {
2227
let sql = r#"SELECT 'single', "double""#;
@@ -336,7 +341,13 @@ fn test_select_wildcard_with_replace() {
336341
expr: Expr::BinaryOp {
337342
left: Box::new(Expr::Identifier(Ident::new("quantity"))),
338343
op: BinaryOperator::Divide,
344+
#[cfg(not(feature = "bigdecimal"))]
339345
right: Box::new(Expr::Value(Value::Number("2".to_string(), false))),
346+
#[cfg(feature = "bigdecimal")]
347+
right: Box::new(Expr::Value(Value::Number(
348+
BigDecimal::from_str("2").unwrap(),
349+
false,
350+
))),
340351
},
341352
alias: Ident::new("quantity"),
342353
},

0 commit comments

Comments
 (0)