mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-23 00:45:37 +01:00
Handle FunctionCallStar in analyze_expr
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
use core::panic;
|
||||
|
||||
use crate::{function::JsonFunc, Result};
|
||||
use sqlite3_parser::ast::{self, Expr, UnaryOperator};
|
||||
|
||||
@@ -582,7 +584,21 @@ pub fn analyze_expr<'a>(expr: &'a Expr, column_info_out: &mut ColumnInfo<'a>) {
|
||||
column_info_out.args = args;
|
||||
}
|
||||
}
|
||||
ast::Expr::FunctionCallStar { .. } => todo!(),
|
||||
ast::Expr::FunctionCallStar {
|
||||
name,
|
||||
filter_over: _,
|
||||
} => {
|
||||
let func_type =
|
||||
match Func::resolve_function(normalize_ident(name.0.as_str()).as_str(), 1) {
|
||||
Ok(func) => Some(func),
|
||||
Err(_) => None,
|
||||
};
|
||||
if func_type.is_none() {
|
||||
panic!("Function not found");
|
||||
} else {
|
||||
column_info_out.func = func_type;
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,10 @@ do_execsql_test select-count {
|
||||
SELECT count(id) FROM users;
|
||||
} {10000}
|
||||
|
||||
do_execsql_test select-count {
|
||||
SELECT count(*) FROM users;
|
||||
} {10000}
|
||||
|
||||
do_execsql_test select-max {
|
||||
SELECT max(age) FROM users;
|
||||
} {100}
|
||||
|
||||
Reference in New Issue
Block a user