list_keys: consistent ESCAPE usage across DB types
commit461b1e3bbac954e3c99a3ef33622a446341d092a
authorEric Wong <normalperson@yhbt.net>
Thu, 7 Feb 2013 03:36:07 +0000 (7 03:36 +0000)
committerEric Wong <normalperson@yhbt.net>
Thu, 7 Feb 2013 20:07:46 +0000 (7 20:07 +0000)
treea31fc099335a068757fc28d0cb2555662455f1ba
parent221808c482aa9ed32fa08985432e0ab142ebd113
list_keys: consistent ESCAPE usage across DB types

Without specifying an ESCAPE character for LIKE queries, the '\'
we use for escaping is treated as a literal and improperly
matched keys with '\' in them under SQLite.

This is only needed for SQLite, as the SQLite language reference
makes no reference of a default ESCAPE character in
http://www.sqlite.org/lang_expr.html

ESCAPE is supported in MySQL and Postgres, too; and defaults to
'\'.  We specify it anyways to reduce code differences between
different databases.

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
t/00-startup.t