Skip to content

Commit f87e8d5

Browse files
committed
Don't duplicate all the parse_simple_select assertions in the LIMIT test
1 parent 3c073a4 commit f87e8d5

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

tests/sqlparser_common.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,10 @@ fn parse_simple_select() {
212212
}
213213

214214
#[test]
215-
fn parse_select_with_limit_but_no_where() {
216-
let sql = "SELECT id, fname, lname FROM customer LIMIT 5";
217-
let select = verified_only_select(sql);
218-
assert_eq!(false, select.distinct);
219-
assert_eq!(3, select.projection.len());
220-
let select = verified_query(sql);
221-
assert_eq!(Some(ASTNode::SQLValue(Value::Long(5))), select.limit);
215+
fn parse_limit_is_not_an_alias() {
216+
// In dialects supporting LIMIT it shouldn't be parsed as a table alias
217+
let ast = verified_query("SELECT id FROM customer LIMIT 1");
218+
assert_eq!(Some(ASTNode::SQLValue(Value::Long(1))), ast.limit);
222219
}
223220

224221
#[test]

0 commit comments

Comments
 (0)