[asterisk-commits] tilghman: trunk r345643 - in /trunk: ./ main/db.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Nov 18 16:20:51 CST 2011


Author: tilghman
Date: Fri Nov 18 16:20:47 2011
New Revision: 345643

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=345643
Log:
Fix a regression in 'database show'.

In 1.8 and previous versions, one could use any fullword portion of the key
name, including the full key, to obtain the record.  Until this patch, this
did not work for the full key.

Patch: by tilghman
Review: by twilson (http://pastebin.com/7rtu6bpk) on #asterisk-dev
........

Merged revisions 345640 from http://svn.asterisk.org/svn/asterisk/branches/10

Modified:
    trunk/   (props changed)
    trunk/main/db.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.

Modified: trunk/main/db.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/db.c?view=diff&rev=345643&r1=345642&r2=345643
==============================================================================
--- trunk/main/db.c (original)
+++ trunk/main/db.c Fri Nov 18 16:20:47 2011
@@ -117,9 +117,9 @@
 DEFINE_SQL_STATEMENT(put_stmt, "INSERT OR REPLACE INTO astdb (key, value) VALUES (?, ?)")
 DEFINE_SQL_STATEMENT(get_stmt, "SELECT value FROM astdb WHERE key=?")
 DEFINE_SQL_STATEMENT(del_stmt, "DELETE FROM astdb WHERE key=?")
-DEFINE_SQL_STATEMENT(deltree_stmt, "DELETE FROM astdb WHERE key LIKE ? || '/' || '%'")
+DEFINE_SQL_STATEMENT(deltree_stmt, "DELETE FROM astdb WHERE key || '/' LIKE ? || '/' || '%'")
 DEFINE_SQL_STATEMENT(deltree_all_stmt, "DELETE FROM astdb")
-DEFINE_SQL_STATEMENT(gettree_stmt, "SELECT key, value FROM astdb WHERE key LIKE ? || '/' || '%'")
+DEFINE_SQL_STATEMENT(gettree_stmt, "SELECT key, value FROM astdb WHERE key || '/' LIKE ? || '/' || '%'")
 DEFINE_SQL_STATEMENT(gettree_all_stmt, "SELECT key, value FROM astdb")
 DEFINE_SQL_STATEMENT(showkey_stmt, "SELECT key, value FROM astdb WHERE key LIKE '%' || '/' || ?")
 DEFINE_SQL_STATEMENT(create_astdb_stmt, "CREATE TABLE IF NOT EXISTS astdb(key VARCHAR(256), value VARCHAR(256), PRIMARY KEY(key))")




More information about the asterisk-commits mailing list