summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorMichael L. Young <elgueromexicano@gmail.com>2013-03-12 21:19:39 +0000
committerMichael L. Young <elgueromexicano@gmail.com>2013-03-12 21:19:39 +0000
commitba7ee9bfc97aa11f4c72e5f64891f51412553570 (patch)
tree679261a2c14f4128a5dae8058d1293c7e0f53076 /addons
parent6a57a36d288c55cdc2b793a5386bc28ca6dbe8f1 (diff)
Fix Sorting Order For Parking Lots Stored In Static Realtime
When retrieving the parking lots from a MySQL database table, the current order is "filename, cat_metric desc, var_metric asc, category". If there are multiple parking lots with the same cat_metric but different categories, everything is being sorted on cat_metric first resulting in errors when loading the parking lots. This patch fixes the problem by sorting on the category field first, then the cat_metric field. (closes issue ASTERISK-21035) Reported by: Alex Epshteyn Patches: asterisk-21035-orderby.diff Michael L. Young (license 5026) ........ Merged revisions 382942 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 382943 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382954 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'addons')
-rw-r--r--addons/res_config_mysql.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/res_config_mysql.c b/addons/res_config_mysql.c
index 7b1f058ec..71f21db46 100644
--- a/addons/res_config_mysql.c
+++ b/addons/res_config_mysql.c
@@ -937,7 +937,7 @@ static struct ast_config *config_mysql(const char *database, const char *table,
return NULL;
}
- ast_str_set(&sql, 0, "SELECT category, var_name, var_val, cat_metric 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);
+ ast_str_set(&sql, 0, "SELECT category, var_name, var_val, cat_metric FROM %s WHERE filename='%s' and commented=0 ORDER BY filename, category, cat_metric desc, var_metric asc, var_name, var_val, id", table, file);
ast_debug(1, "MySQL RealTime: Static SQL: %s\n", ast_str_buffer(sql));