Closed caicancai closed 11 months ago
I'll see if I can fill in the other tests tomorrow
@wangrunji0408 Hello, I am very sorry to bother you so late. I have also improved insert and other tests, but I am not sure whether the code should be submitted, because the prefix steps of the test code are the same, will it be very redundant
insert test:
#[cfg(test)]
mod tests {
use std::sync::Arc;
use super::*;
use crate::catalog::{ColumnCatalog, RootCatalog};
use crate::parser::parse;
use crate::binder::Binder;
#[test]
fn bind_drop_table() {
let catalog = Arc::new(RootCatalog::new());
let col_desc = DataTypeKind::Int32.not_null().to_column("a".into());
let col_catalog = ColumnCatalog::new(0, col_desc);
catalog
.add_table(0, "t".into(), vec![col_catalog], false, vec![])
.unwrap();
let stmts = parse("insert into t (a) values (1)").unwrap();
println!("{:?}", stmts);
let mut binder = Binder::new(catalog);
for stmt in stmts {
let plan = binder.bind(stmt).unwrap();
println!("{}", plan.pretty(10));
}
}
}
expr seems to have to write test to verify everything is a bit complicated. 🤪
@wangrunji0408 hi, excuse me. if you have time, could you review my two pr? I can close this pr if there is a problem
will take a look this weekend :)
I don't think these new tests are actually testing + comparing with some expected result? In this case, it looks better to make this test part of sqlplannertest, so that we can find regressions across commits.
thank your review and advice