mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-30 10:47:22 +00:00
Boxed Query body to save some stack space (#540)
This commit is contained in:
parent
5363d4e399
commit
dea7666086
6 changed files with 24 additions and 24 deletions
|
@ -85,7 +85,7 @@ fn parse_insert_values() {
|
|||
for (index, column) in columns.iter().enumerate() {
|
||||
assert_eq!(column, &Ident::new(expected_columns[index].clone()));
|
||||
}
|
||||
match &source.body {
|
||||
match &*source.body {
|
||||
SetExpr::Values(Values(values)) => assert_eq!(values.as_slice(), expected_rows),
|
||||
_ => unreachable!(),
|
||||
}
|
||||
|
@ -3988,7 +3988,7 @@ fn parse_offset() {
|
|||
assert_eq!(ast.offset, expect);
|
||||
let ast = verified_query("SELECT foo FROM (SELECT * FROM bar OFFSET 2 ROWS) OFFSET 2 ROWS");
|
||||
assert_eq!(ast.offset, expect);
|
||||
match ast.body {
|
||||
match *ast.body {
|
||||
SetExpr::Select(s) => match only(s.from).relation {
|
||||
TableFactor::Derived { subquery, .. } => {
|
||||
assert_eq!(subquery.offset, expect);
|
||||
|
@ -4082,7 +4082,7 @@ fn parse_fetch() {
|
|||
"SELECT foo FROM (SELECT * FROM bar FETCH FIRST 2 ROWS ONLY) FETCH FIRST 2 ROWS ONLY",
|
||||
);
|
||||
assert_eq!(ast.fetch, fetch_first_two_rows_only);
|
||||
match ast.body {
|
||||
match *ast.body {
|
||||
SetExpr::Select(s) => match only(s.from).relation {
|
||||
TableFactor::Derived { subquery, .. } => {
|
||||
assert_eq!(subquery.fetch, fetch_first_two_rows_only);
|
||||
|
@ -4100,7 +4100,7 @@ fn parse_fetch() {
|
|||
})
|
||||
);
|
||||
assert_eq!(ast.fetch, fetch_first_two_rows_only);
|
||||
match ast.body {
|
||||
match *ast.body {
|
||||
SetExpr::Select(s) => match only(s.from).relation {
|
||||
TableFactor::Derived { subquery, .. } => {
|
||||
assert_eq!(
|
||||
|
@ -4638,7 +4638,7 @@ fn parse_merge() {
|
|||
lateral: false,
|
||||
subquery: Box::new(Query {
|
||||
with: None,
|
||||
body: SetExpr::Select(Box::new(Select {
|
||||
body: Box::new(SetExpr::Select(Box::new(Select {
|
||||
distinct: false,
|
||||
top: None,
|
||||
projection: vec![SelectItem::Wildcard],
|
||||
|
@ -4660,7 +4660,7 @@ fn parse_merge() {
|
|||
sort_by: vec![],
|
||||
having: None,
|
||||
qualify: None,
|
||||
})),
|
||||
}))),
|
||||
order_by: vec![],
|
||||
limit: None,
|
||||
offset: None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue