mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-03 22:08:16 +00:00
Add LIMIT as RESERVED_FOR_TABLE_ALIAS, this closes Issue#67
This commit is contained in:
parent
908082d26f
commit
d263d285e2
3 changed files with 11 additions and 2 deletions
|
@ -124,6 +124,16 @@ fn parse_simple_select() {
|
|||
assert_eq!(Some(ASTNode::SQLValue(Value::Long(5))), select.limit);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_select_with_limit_but_no_where() {
|
||||
let sql = "SELECT id, fname, lname FROM customer LIMIT 5";
|
||||
let select = verified_only_select(sql);
|
||||
assert_eq!(false, select.distinct);
|
||||
assert_eq!(3, select.projection.len());
|
||||
let select = verified_query(sql);
|
||||
assert_eq!(Some(ASTNode::SQLValue(Value::Long(5))), select.limit);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_select_distinct() {
|
||||
let sql = "SELECT DISTINCT name FROM customer";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue