From d239b31dfc0bf78a7e5cf6e92276d5bc6b72826f Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 6 Jul 2010 12:02:50 -0500 Subject: [PATCH] sort the complete sql stmts to get proper ordering on tab complete --- src/switch_console.c | 2 +- src/switch_core_sqldb.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/switch_console.c b/src/switch_console.c index 9f8a15c0ec..353a30319d 100644 --- a/src/switch_console.c +++ b/src/switch_console.c @@ -756,7 +756,7 @@ SWITCH_DECLARE(unsigned char) switch_console_complete(const char *line, const ch } } - stream.write_function(&stream, " and hostname='%s'", switch_core_get_variable("hostname")); + stream.write_function(&stream, " and hostname='%s' order by a1,a2,a3,a4,a5,a6,a7,a8,a9,a10", switch_core_get_variable("hostname")); switch_cache_db_execute_sql_callback(db, stream.data, comp_callback, &h, &errmsg); if (errmsg) { diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c index e9849502be..7fc32c0a3f 100644 --- a/src/switch_core_sqldb.c +++ b/src/switch_core_sqldb.c @@ -1491,6 +1491,7 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_ switch_cache_db_execute_sql(dbh, "create index complete8 on complete (a8,hostname)", NULL); switch_cache_db_execute_sql(dbh, "create index complete9 on complete (a9,hostname)", NULL); switch_cache_db_execute_sql(dbh, "create index complete10 on complete (a10,hostname)", NULL); + switch_cache_db_execute_sql(dbh, "create index complete11 on complete (a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,hostname)", NULL); switch_cache_db_execute_sql(dbh, "create index nat_map_port_proto on nat (port,proto,hostname)", NULL); switch_cache_db_execute_sql(dbh, "create index channels1 on channels(hostname)", NULL); switch_cache_db_execute_sql(dbh, "create index calls1 on calls(hostname)", NULL);