MIN is an aggregate function on MySQL
Closes: FS-5218 (Thanks to Nathan Neulinger for the patch)
This commit is contained in:
parent
bb3114e96b
commit
c3b30a88e3
|
@ -1508,11 +1508,10 @@ switch_status_t skinny_handle_button_template_request(listener_t *listener, skin
|
||||||
|
|
||||||
/* Add buttons */
|
/* Add buttons */
|
||||||
if ((sql = switch_mprintf(
|
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 "
|
"FROM skinny_buttons "
|
||||||
"WHERE device_name='%s' AND device_instance=%d "
|
"WHERE device_name='%s' AND device_instance=%d "
|
||||||
"ORDER BY position",
|
"ORDER BY position",
|
||||||
SKINNY_BUTTON_UNDEFINED,
|
|
||||||
listener->device_name, listener->device_instance
|
listener->device_name, listener->device_instance
|
||||||
))) {
|
))) {
|
||||||
skinny_execute_sql_callback(profile, profile->sql_mutex, sql, skinny_handle_button_template_request_callback, &helper);
|
skinny_execute_sql_callback(profile, profile->sql_mutex, sql, skinny_handle_button_template_request_callback, &helper);
|
||||||
|
|
Loading…
Reference in New Issue