[asterisk-commits] elguero: trunk r382954 - in /trunk: ./ addons/res_config_mysql.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Mar 12 16:19:42 CDT 2013


Author: elguero
Date: Tue Mar 12 16:19:39 2013
New Revision: 382954

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=382954
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
........

Merged revisions 382943 from http://svn.asterisk.org/svn/asterisk/branches/11

Modified:
    trunk/   (props changed)
    trunk/addons/res_config_mysql.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: trunk/addons/res_config_mysql.c
URL: http://svnview.digium.com/svn/asterisk/trunk/addons/res_config_mysql.c?view=diff&rev=382954&r1=382953&r2=382954
==============================================================================
--- trunk/addons/res_config_mysql.c (original)
+++ trunk/addons/res_config_mysql.c Tue Mar 12 16:19:39 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