mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-30 13:24:22 +01:00
Cast the matching value into TEXT before matching
This commit is contained in:
@@ -2104,7 +2104,7 @@ impl Program {
|
||||
}
|
||||
ScalarFunc::Like => {
|
||||
let pattern = &state.registers[*start_reg];
|
||||
let text = &state.registers[*start_reg + 1];
|
||||
let text = exec_cast(&state.registers[*start_reg + 1], "TEXT");
|
||||
|
||||
let result = match (pattern, text) {
|
||||
(OwnedValue::Text(pattern), OwnedValue::Text(text))
|
||||
@@ -2137,19 +2137,6 @@ impl Program {
|
||||
)
|
||||
as i64)
|
||||
}
|
||||
(OwnedValue::Text(pattern), OwnedValue::Integer(text)) => {
|
||||
let cache = if *constant_mask > 0 {
|
||||
Some(&mut state.regex_cache.like)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
OwnedValue::Integer(exec_like(
|
||||
cache,
|
||||
&pattern.as_str(),
|
||||
&text.to_string(),
|
||||
)
|
||||
as i64)
|
||||
}
|
||||
_ => {
|
||||
unreachable!("Like on non-text registers");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user