Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-40877

Kernel > inappropriate sort option causes kernel code to create broken SQL statement

    Details

    • Type: Bug
    • Status: Verified
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.8 [Tentative], 11.4, 12.4, 19.0, 20.0 [Tentative]
    • Fix Version/s: 19.0, 20.0 [Tentative]
    • Component/s: Kernel
    • Labels:
      None
    • 19 status:
      Resolved
    • 12 status:
      Please Merge
    • Test Plan:
      Hide

      As admin, perform the following:

      1. Go to Worksite Setup
      2. Change items viewed per page to 5
      3. Go to the 2nd page
      4. Click the 'Creator' column header to sort by this column
      5. Verify you're taken back to the 1st page, and that the sort worked as expected
      6. If bug is present, you'll see the stacktrace in the logs
      7. If bug is fixed, no stacktrace in the logs
      Show
      As admin, perform the following: Go to Worksite Setup Change items viewed per page to 5 Go to the 2nd page Click the 'Creator' column header to sort by this column Verify you're taken back to the 1st page, and that the sort worked as expected If bug is present , you'll see the stacktrace in the logs If bug is fixed , no stacktrace in the logs

      Description

      Log errors result from SQL statement errors when ORDER BY states a column whose table is not part of the SELECT. The sort order results from user choices in the UI.

      Stacktrace:

      03-Nov-2018 11:37:23.294 WARN [https-jsse-nio-8452-exec-11] org.sakaiproject.db.impl.BasicSqlService.dbRead Sql.dbRead: sql: select SAKAI_SITE.SITE_ID,SAKAI_SITE.TITLE,SAKAI_SITE.TYPE,SAKAI_SITE.SHORT_DESC,SAKAI_SITE.DESCRIPTION,SAKAI_SITE.ICON_URL,SAKAI_SITE.INFO_URL,S\
      AKAI_SITE.SKIN,SAKAI_SITE.PUBLISHED,SAKAI_SITE.JOINABLE,SAKAI_SITE.PUBVIEW,SAKAI_SITE.JOIN_ROLE,SAKAI_SITE.IS_SPECIAL,SAKAI_SITE.IS_USER,SAKAI_SITE.CREATEDBY,SAKAI_SITE.MODIFIEDBY,SAKAI_SITE.CREATEDON,SAKAI_SITE.MODIFIEDON,SAKAI_SITE.CUSTOM_PAGE_ORDERED,SAKAI_SITE.IS_SO\
      FTLY_DELETED,SAKAI_SITE.SOFTLY_DELETED_DATE from SAKAI_SITE where SAKAI_SITE.SITE_ID IN (?,?,?,?,?,?,?,?,?,?) order by SAKAI_USER_ID_MAP.EID ASC !user null null null null null null null null null
      com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'SAKAI_USER_ID_MAP.EID' in 'order clause'
              at sun.reflect.GeneratedConstructorAccessor84.newInstance(Unknown Source)
              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
              at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
              at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
              at com.mysql.jdbc.Util.getInstance(Util.java:386)
              at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1053)
              at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4096)
              at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4028)
              at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2490)
              at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2651)
              at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2734)
              at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)
              at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2313)
              at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
              at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
              at org.sakaiproject.db.impl.BasicSqlService.dbRead(BasicSqlService.java:551)
              at org.sakaiproject.db.impl.BasicSqlService.dbRead(BasicSqlService.java:469)
              at org.sakaiproject.util.BaseDbFlatStorage.getSelectedResources(BaseDbFlatStorage.java:477)
              at org.sakaiproject.site.impl.DbSiteService$DbStorage.getSites(DbSiteService.java:1220)
              at org.sakaiproject.site.impl.DbSiteService$DbStorage.getSites(DbSiteService.java:1268)
              at org.sakaiproject.site.impl.BaseSiteService.getSites(BaseSiteService.java:2236)
              at org.sakaiproject.site.impl.BaseSiteService.getSites(BaseSiteService.java:2227)
              at org.sakaiproject.site.impl.BaseSiteService.getSites(BaseSiteService.java:2218)
              at org.sakaiproject.site.cover.SiteService.getSites(SiteService.java:469)
              at org.sakaiproject.site.tool.SiteAction.readResourcesPage(SiteAction.java:5149)
              at org.sakaiproject.cheftool.PagedResourceActionII.prepPage(PagedResourceActionII.java:387)
              at org.sakaiproject.site.tool.SiteAction.buildContextForTemplate(SiteAction.java:1642)
              at org.sakaiproject.site.tool.SiteAction.buildMainPanelContext(SiteAction.java:1351)
              at org.sakaiproject.site.tool.SiteAction.buildMainPanelContext(SiteAction.java:1284)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.sakaiproject.cheftool.VelocityPortletPaneledAction.toolModeDispatch(VelocityPortletPaneledAction.java:399)
              at org.sakaiproject.site.tool.SiteAction.toolModeDispatch(SiteAction.java:14796)
              at org.sakaiproject.cheftool.ToolServlet.doGet(ToolServlet.java:234)
              at org.sakaiproject.cheftool.VelocityPortletPaneledAction.doGet(VelocityPortletPaneledAction.java:1152)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
              at org.sakaiproject.vm.ComponentServlet.service(ComponentServlet.java:56)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
              at org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:426)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
              at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:728)
              at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:470)
              at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:356)
              at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:316)
              at org.sakaiproject.tool.impl.ActiveToolComponent$MyActiveTool.forward(ActiveToolComponent.java:513)
              at org.sakaiproject.portal.charon.SkinnableCharonPortal.forwardTool(SkinnableCharonPortal.java:1487)
              at org.sakaiproject.portal.charon.handlers.SiteHandler.doToolBuffer(SiteHandler.java:1228)
              at org.sakaiproject.portal.charon.handlers.SiteHandler.bufferContent(SiteHandler.java:1062)
              at org.sakaiproject.portal.charon.handlers.SiteHandler.doSite(SiteHandler.java:491)
              at org.sakaiproject.portal.charon.handlers.SiteHandler.doGet(SiteHandler.java:267)
              at org.sakaiproject.portal.charon.handlers.SiteHandler.doGet(SiteHandler.java:155)
              at org.sakaiproject.portal.charon.SkinnableCharonPortal.doGet(SkinnableCharonPortal.java:856)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
              at org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:475)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
              at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
              at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
              at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
              at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
              at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:800)
              at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1471)
              at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
              at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
              at java.lang.Thread.run(Thread.java:748)
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                bjones86 Brian Jones
                Reporter:
                bjones86 Brian Jones
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Git Source Code