returns a bunch of stuff but in >=5.0 it's going to return nothing.
select * from augeas where path LIKE '/etc/hosts%';
ASSERT_EQ( SQL("select * from augeas where path LIKE '/etc/hosts/%'").rows().size(), 0U);
, which totally works and does not return zero results.
and let sqlite filter the output. This presented two issues. The bigger issue was that there was no way to access things outside the files tree. (eg,
). Second, and smaller, was that the “return everything” approach just feels wrong to me. I think practically speaking the performance was okay, but it feels like there are dragons about. I’d usually rather call underlying APIs narrowly.
is a single level, and
is recursive. But in sql, wildcards are simple strings
is converted to `/files/etc/hosts/%’. So augeas returns data. But sql filters it. (because the augeas return is is missing that trailing slash) •
is converted to
which augeas has no matches for, because it’s a weird postfix search. •
is converted to
which is a full recursion return, and it will get passed back through the sql filter
I don’t think it’s very meaningful to wildcard a file. Wildcarding a directory is more meaningful. Compare
select * from augeas where path LIKE '/etc/%';
select * from augeas where path LIKE '/etc/%%';
^^ Why doesn't that get converted tois converted to `/files/etc/hosts/%’.
? Like, not "why did you make that decision?" but "where in the code does that happen?".
(because the augeas return is is missing that trailing slash)^^ I didn't follow that part at alll.
This seems reasonable but we should mark it as an API change due to change with queries like; do I correctly understand that that query currrently returns stuff (which I just checked) but it won't in 5.0 because it gets converted to, where before this would full-scan and have SQL apply the
select * from augeas where path LIKE '/etc/hosts%';filtering.
/etc/hosts/% is converted to `/files/etc/hosts/%’.
^^ Why doesn’t that get converted to /filles/etc/hosts/*? Like, not “why did you make that decision?” but “where in the code does that happen?”Typo, I mean to
And all the conversion is in
akin to the existing file pattern as single wild card, vs recursive. Thus breaking a couple of places
, it would map to
path like '/etc/hosts/%
might work. (don’t remember). But the data that the table implementation returns would be
which won’t match the sql expression.