]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
MIN is an aggregate function on MySQL
authorMathieu Parent <math.parent@gmail.com>
Tue, 26 Mar 2013 21:16:44 +0000 (22:16 +0100)
committerMathieu Parent <math.parent@gmail.com>
Tue, 26 Mar 2013 21:16:44 +0000 (22:16 +0100)
Closes: FS-5218 (Thanks to Nathan Neulinger for the patch)
src/mod/endpoints/mod_skinny/skinny_server.c

index 0f0b18d7f23a9547473ad878a76c01d83bbb35d5..7558c88f91cf17543dc058c64270a9e2a66c5b51 100644 (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);