mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-31 11:17:23 +00:00
Merge pull request #53 from thomas-jeepe/master
Fix qualified wildcard stringifying
This commit is contained in:
commit
07d66a93ef
4 changed files with 47 additions and 3 deletions
|
@ -90,6 +90,13 @@ fn parse_select_wildcard() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_count_wildcard() {
|
||||
verified_only_select(
|
||||
"SELECT COUNT(Employee.*) FROM Order JOIN Employee ON Order.employee = Employee.id",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_column_aliases() {
|
||||
let sql = "SELECT a.col + 1 AS newname FROM foo AS a";
|
||||
|
@ -147,6 +154,25 @@ fn parse_projection_nested_type() {
|
|||
//TODO: add assertions
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_escaped_single_quote_string_predicate() {
|
||||
use self::ASTNode::*;
|
||||
use self::SQLOperator::*;
|
||||
let sql = "SELECT id, fname, lname FROM customer \
|
||||
WHERE salary != 'Jim''s salary'";
|
||||
let ast = verified_only_select(sql);
|
||||
assert_eq!(
|
||||
Some(SQLBinaryExpr {
|
||||
left: Box::new(SQLIdentifier("salary".to_string())),
|
||||
op: NotEq,
|
||||
right: Box::new(SQLValue(Value::SingleQuotedString(
|
||||
"Jim's salary".to_string()
|
||||
)))
|
||||
}),
|
||||
ast.selection,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_compound_expr_1() {
|
||||
use self::ASTNode::*;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue