Fix SQL statement

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
Sebastian Ramacher 2017-05-02 21:38:30 +02:00
parent 39cdfdb99a
commit 39b54cddb3

View file

@ -766,7 +766,7 @@ sqlite_get_recent_files(zathura_database_t* db, int max, const char* basepath)
static const char SQL_HISTORY_GET[] =
"SELECT file FROM fileinfo ORDER BY time DESC LIMIT ?";
static const char SQL_HISTORY_GET_WITH_BASEPATH[] =
"SELECT file FROM fileinfo WHERE file LIKE '?%' ORDER BY time DESC LIMIT ?";
"SELECT file FROM fileinfo WHERE file LIKE ? || '%' ORDER BY time DESC LIMIT ?";
zathura_sqldatabase_private_t* priv = ZATHURA_SQLDATABASE_GET_PRIVATE(db);
sqlite3_stmt* stmt = prepare_statement(priv->session, basepath == NULL ? SQL_HISTORY_GET : SQL_HISTORY_GET_WITH_BASEPATH);