https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r62796 | kpfleming | 2007-05-02 19:53:46 -0400 (Wed, 02 May 2007) | 7 lines
increase reliability and efficiency of static Realtime config loading via ODBC:
don't request fields we aren't going to use
don't request sorting on fields that are pointless to sort on
explicitly request the fields we want, because we can't expect the database to always return them in the order they were created
(reported by blitzrage in person (!), patch by me)
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
snprintf(sql,sizeof(sql),"SELECT * FROM %s WHERE filename='%s' and commented=0 ORDER BY filename,cat_metric desc,var_metric asc,category,var_name,var_val,id",table,file);
q.sql=sql;
ast_build_string(&sql,&sqlleft,"SELECT cat_metric, category, var_name, var_val FROM %s ",table);
ast_build_string(&sql,&sqlleft,"WHERE filename='%s' AND commented=0 ",file);
ast_build_string(&sql,&sqlleft,"ORDER BY cat_metric DESC, var_metric ASC, category, var_name ");