remove to_upper_case in favor of eq_ignore_ascii_case

This commit is contained in:
themixednuts
2025-08-29 18:10:26 -05:00
parent f9b0c0aa27
commit eb93e4edc9

View File

@@ -1762,19 +1762,21 @@ pub fn op_type_check(
return Ok(());
}
let col_affinity = col.affinity();
let ty_str = col.ty_str.to_ascii_uppercase();
let ty_str = &col.ty_str;
let applied = apply_affinity_char(reg, col_affinity);
let value_type = reg.get_value().value_type();
match (ty_str.as_str(), value_type) {
("INTEGER" | "INT", ValueType::Integer) => {}
("REAL", ValueType::Float) => {}
("BLOB", ValueType::Blob) => {}
("TEXT", ValueType::Text) => {}
("ANY", _) => {}
(t, v) => bail_constraint_error!(
match value_type {
ValueType::Integer
if ty_str.eq_ignore_ascii_case("INTEGER")
|| ty_str.eq_ignore_ascii_case("INT") => {}
ValueType::Float if ty_str.eq_ignore_ascii_case("REAL") => {}
ValueType::Blob if ty_str.eq_ignore_ascii_case("BLOB") => {}
ValueType::Text if ty_str.eq_ignore_ascii_case("TEXT") => {}
_ if ty_str.eq_ignore_ascii_case("ANY") => {}
v => bail_constraint_error!(
"cannot store {} value in {} column {}.{} ({})",
v,
t,
ty_str,
&table_reference.name,
col.name.as_deref().unwrap_or(""),
SQLITE_CONSTRAINT