From: Sean Bright Date: Mon, 16 Jan 2012 14:27:57 +0000 (+0000) Subject: Sort the output of 'database show' by key. X-Git-Tag: 10.2.0-rc1~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e41fe0f2f37a43ab4fb97d6e1ec2997f847fb0b;p=thirdparty%2Fasterisk.git Sort the output of 'database show' by key. This more closely mimics the behavior of 'database show' before the conversion to sqlite3. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@350938 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/db.c b/main/db.c index 75f6eafabe..e4135821fd 100644 --- a/main/db.c +++ b/main/db.c @@ -119,8 +119,8 @@ 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_all_stmt, "DELETE FROM astdb") -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(gettree_stmt, "SELECT key, value FROM astdb WHERE key || '/' LIKE ? || '/' || '%' ORDER BY key") +DEFINE_SQL_STATEMENT(gettree_all_stmt, "SELECT key, value FROM astdb ORDER BY key") 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))")