[asterisk-commits] elguero: branch 1.8 r382942 - /branches/1.8/addons/res_config_mysql.c

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


Author: elguero
Date: Tue Mar 12 16:15:52 2013
New Revision: 382942

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

Modified:
    branches/1.8/addons/res_config_mysql.c

Modified: branches/1.8/addons/res_config_mysql.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/addons/res_config_mysql.c?view=diff&rev=382942&r1=382941&r2=382942
==============================================================================
--- branches/1.8/addons/res_config_mysql.c (original)
+++ branches/1.8/addons/res_config_mysql.c Tue Mar 12 16:15:52 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