[asterisk-commits] elguero: branch 11 r382943 - in /branches/11: ./ addons/res_config_mysql.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Mar 12 16:17:20 CDT 2013
Author: elguero
Date: Tue Mar 12 16:17:17 2013
New Revision: 382943
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=382943
Log:
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
Modified:
branches/11/ (props changed)
branches/11/addons/res_config_mysql.c
Propchange: branches/11/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.
Modified: branches/11/addons/res_config_mysql.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/addons/res_config_mysql.c?view=diff&rev=382943&r1=382942&r2=382943
==============================================================================
--- branches/11/addons/res_config_mysql.c (original)
+++ branches/11/addons/res_config_mysql.c Tue Mar 12 16:17:17 2013
@@ -937,7 +937,7 @@
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));
More information about the asterisk-commits
mailing list