list_keys: escape in Store, allow [%\\] as prefix
commit0889c79890ad75326030b389f1f18adf6aab2a15
authorEric Wong <normalperson@yhbt.net>
Thu, 7 Feb 2013 04:27:20 +0000 (7 04:27 +0000)
committerEric Wong <normalperson@yhbt.net>
Thu, 7 Feb 2013 20:11:16 +0000 (7 20:11 +0000)
tree054ff93e321c798e75a6d36718abdda7bf9132d0
parent461b1e3bbac954e3c99a3ef33622a446341d092a
list_keys: escape in Store, allow [%\\] as prefix

If we support non-SQL DBs in the future, escaping rules could
become store-specific, so Worker/Query is not the right place for
it.

Since '%' and '\' may be escaped just like any other character,
we may also allow these characters as prefixes by properly
escaping them.

Tested on MySQL 5.1.66 and Postgres 8.4.13 on Debian 6.0
and SQLite 3.7.13 on Debian 7.0
lib/MogileFS/Store.pm
lib/MogileFS/Worker/Query.pm
t/00-startup.t