mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-23 17:05:36 +01:00
remove to_upper_case in favor of eq_ignore_ascii_case
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user