MIN is an aggregate function on MySQL

Closes: FS-5218 (Thanks to Nathan Neulinger for the patch)
This commit is contained in:
Mathieu Parent 2013-03-26 22:16:44 +01:00
parent bb3114e96b
commit c3b30a88e3
1 changed files with 1 additions and 2 deletions

View File

@ -1508,11 +1508,10 @@ switch_status_t skinny_handle_button_template_request(listener_t *listener, skin
/* Add buttons */
if ((sql = switch_mprintf(
"SELECT device_name, device_instance, position, MIN(type, %d) AS type "
"SELECT device_name, device_instance, position, type "
"FROM skinny_buttons "
"WHERE device_name='%s' AND device_instance=%d "
"ORDER BY position",
SKINNY_BUTTON_UNDEFINED,
listener->device_name, listener->device_instance
))) {
skinny_execute_sql_callback(profile, profile->sql_mutex, sql, skinny_handle_button_template_request_callback, &helper);