You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and the earlier lines escape: _ and let start_reg = program.alloc_registers(2); inside the same function.
It's important to note that The VDBE's step() function has support for executing LIKE with an escape character, it's just never used because arg_count is always set to 2 by the bytecode generator:
limbo> create table t (name text);
limbo> insert into t values('moh_amed');
limbo> insert into t values('mohxamed');
limbo> select * from t where name like 'moh\_amed' escape '\';
limbo>
This is the desired behavior in SQLite:
sqlite> create table t (name text);
sqlite> insert into t values('moh_amed');
sqlite> insert into t values('mohxamed');
sqlite> select * from t where name like 'moh\_amed' escape '\';
moh_amed
sqlite>
Limbo ignores the escape character in the
LIKE
scalar function and always generates a regularlike(2)
:Here is the equivalent in SQLite, notice the
like(3)
:This can be probably traced to
core/translate/expr.rs
in thetranslate_like_base()
function where thearg_count
is always set to2
:and the earlier lines
escape: _
andlet start_reg = program.alloc_registers(2);
inside the same function.It's important to note that The VDBE's
step()
function has support for executingLIKE
with an escape character, it's just never used becausearg_count
is always set to2
by the bytecode generator:The text was updated successfully, but these errors were encountered: