fix create view columns length check

This commit is contained in:
Levy A.
2025-08-19 15:53:46 -03:00
parent a86a066a91
commit 8f198a3086

View File

@@ -135,14 +135,17 @@ impl Stmt {
}
}
}
// SQLite3 engine raises this error later (not while parsing):
match select.column_count() {
ColumnCount::Fixed(n) if n != columns.len() => Err(Error::Custom(format!(
"expected {} columns for {} but got {}",
columns.len(),
view_name,
n
))),
match (select.column_count(), columns.is_empty()) {
(ColumnCount::Fixed(n), false) if n != columns.len() => {
Err(Error::Custom(format!(
"expected {} columns for {} but got {}",
columns.len(),
view_name,
n
)))
}
_ => Ok(()),
}
}