Return-Path: X-Original-To: apmail-incubator-cloudstack-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E50A5E576 for ; Thu, 24 Jan 2013 21:57:13 +0000 (UTC) Received: (qmail 31983 invoked by uid 500); 24 Jan 2013 21:57:13 -0000 Delivered-To: apmail-incubator-cloudstack-dev-archive@incubator.apache.org Received: (qmail 31915 invoked by uid 500); 24 Jan 2013 21:57:13 -0000 Mailing-List: contact cloudstack-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cloudstack-dev@incubator.apache.org Delivered-To: mailing list cloudstack-dev@incubator.apache.org Received: (qmail 31834 invoked by uid 99); 24 Jan 2013 21:57:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Jan 2013 21:57:13 +0000 Date: Thu, 24 Jan 2013 21:57:12 +0000 (UTC) From: "Rohit Yadav (JIRA)" To: cloudstack-dev@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CLOUDSTACK-974) listServiceOfferings doesn't sort by sortKey for non-root users MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CLOUDSTACK-974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13562029#comment-13562029 ] Rohit Yadav commented on CLOUDSTACK-974: ---------------------------------------- filter should filter by sort key, man, let's ask Prachi again :) > listServiceOfferings doesn't sort by sortKey for non-root users > --------------------------------------------------------------- > > Key: CLOUDSTACK-974 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-974 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the default.) > Components: API > Affects Versions: 4.0.0, 4.0.1 > Reporter: Wido den Hollander > Priority: Minor > Fix For: 4.0.2 > > > I was just notified by a colleague that there is different behaviour between the Admin UI and User UI. > When you list all Service Offerings in the Admin interface they get sorted by sortKey descending. > If you go and create an Instance as a user through the wizard the Service Offerings aren't sorted, they are in the order like they are in the database. > I logged the MySQL queries and they are: > ** ADMIN ** > SELECT disk_offering.id, disk_offering.domain_id, disk_offering.unique_name, disk_offering.name, disk_offering.display_text, disk_offering.disk_size, disk_offering.tags, disk_offering.type, disk_offering.removed, disk_offering.created, disk_offering.recreatable, disk_offering.use_local_storage, disk_offering.system_use, disk_offering.customized, disk_offering.uuid, disk_offering.sort_key, service_offering.cpu, service_offering.speed, service_offering.ram_size, service_offering.nw_rate, service_offering.mc_rate, service_offering.ha_enabled, service_offering.limit_cpu_use, service_offering.host_tag, service_offering.default_use, service_offering.vm_type, service_offering.sort_key > FROM service_offering INNER JOIN disk_offering ON service_offering.id=disk_offering.id > WHERE disk_offering.type='Service' > AND disk_offering.system_use = 0 > AND disk_offering.system_use = 0 > AND disk_offering.removed IS NULL > ORDER BY service_offering.sort_key DESC > ** USER ** > SELECT disk_offering.id, disk_offering.domain_id, disk_offering.unique_name, disk_offering.name, disk_offering.display_text, disk_offering.disk_size, disk_offering.tags, disk_offering.type, disk_offering.removed, disk_offering.created, disk_offering.recreatable, disk_offering.use_local_storage, disk_offering.system_use, disk_offering.customized, disk_offering.uuid, disk_offering.sort_key, service_offering.cpu, service_offering.speed, service_offering.ram_size, service_offering.nw_rate, service_offering.mc_rate, service_offering.ha_enabled, service_offering.limit_cpu_use, service_offering.host_tag, service_offering.default_use, service_offering.vm_type, service_offering.sort_key > FROM service_offering INNER JOIN disk_offering ON service_offering.id=disk_offering.id > WHERE disk_offering.type='Service' > AND disk_offering.domain_id IS NULL > AND disk_offering.system_use = 0 > AND disk_offering.removed IS NULL > To me it seems this goes wrong in ManagementServerImpl.searchForServiceOfferings: > Filter searchFilter = new Filter(ServiceOfferingVO.class, "sortKey", isAscending, cmd.getStartIndex(), cmd.getPageSizeVal()); > getStartIndex and getPageSizeVal are both NULL since the user UI doesn't add page nor pagesize to the API request. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira