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

userDirectoryService.searchUsers makes an errornous SQL query

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: CLOSED
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.6.x, 2.7.x
    • Fix Version/s: None
    • Component/s: Kernel
    • Labels:
    • Environment:
      Sakai 2.7.x rev r79753, Profile2 1.3.10, JDK 1.6.0_21, tomcat 5.5.30, mysql-connector 5.1.12, Using CAS and ldap
    • Previous Issue Keys:
      KNL-564

      Description

      After brief discussion on sakai-dev

      Stewe:

      return userDirectoryService.searchUsers(search, ProfileConstants.FIRST_RECORD,ProfileConstants.MAX_RECORDS);

      where those numbers are 0 and 99 respectively.

      Looks like it's in the Kernel. Can you file a JIRA?

      Johan:
      2010-08-18 15:48:18,069 WARN http-8080-Processor18 org.sakaiproject.db.impl.BasicSqlService - Sql.dbRead: sql: select SAKAI_USER.USER_ID,SAKAI_USER.EMAIL,SAKAI_USER.EMAIL_LC,SAKAI_USER.FIRST_NAME,SAKAI_USER.LAST_NAME,SAKAI_USER.TYPE,SAKAI_USER.PW,SAKAI_USER.CREATEDBY,SAKAI_USER.MODIFIEDBY,SAKAI_USER.CREATEDON,SAKAI_USER.MODIFIEDON from SAKAI_USER,SAKAI_USER_ID_MAP where SAKAI_USER.USER_ID = SAKAI_USER_ID_MAP.USER_ID AND (SAKAI_USER.USER_ID = ? OR UPPER(EID) LIKE UPPER OR EMAIL_LC LIKE ? OR UPPER(FIRST_NAME) LIKE UPPER OR UPPER(LAST_NAME) LIKE UPPER) order by SAKAI_USER_ID_MAP.EID,SAKAI_USER.LAST_NAME,SAKAI_USER.FIRST_NAME limit 100 offset -1 linda %linda% %linda% %linda% %linda%
      com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1' at line 1
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
      at com.mysql.jdbc.Util.getInstance(Util.java:384)
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3562)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3494)
      at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1960)
      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2114)
      at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2696)
      at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2105)
      at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2264)
      at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
      at org.sakaiproject.db.impl.BasicSqlService.dbRead(BasicSqlService.java:545)
      at org.sakaiproject.db.impl.BasicSqlService.dbRead(BasicSqlService.java:464)
      at org.sakaiproject.util.BaseDbFlatStorage.getSelectedResources(BaseDbFlatStorage.java:619)
      at org.sakaiproject.user.impl.DbUserService$DbStorage.search(DbUserService.java:329)
      at org.sakaiproject.user.impl.BaseUserDirectoryService.searchUsers(BaseUserDirectoryService.java:1218)
      at org.sakaiproject.profile2.logic.SakaiProxyImpl.searchUsers(SakaiProxyImpl.java:496)
      at org.sakaiproject.profile2.logic.ProfileLogicImpl.findUsersByNameOrEmail(ProfileLogicImpl.java:1887)
      at org.sakaiproject.profile2.logic.ProfileLogicImpl.findUsersByNameOrEmail(ProfileLogicImpl.java:531)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      at $Proxy21.findUsersByNameOrEmail(Unknown Source)
      at org.sakaiproject.profile2.tool.pages.MySearch$3.onSubmit(MySearch.java:384)
      at org.apache.wicket.ajax.markup.html.form.AjaxButton$1.onSubmit(AjaxButton.java:115)
      at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:128)
      at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:163)
      at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:297)
      at org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:104)
      at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:91)
      at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1220)
      at org.apache.wicket.RequestCycle.step(RequestCycle.java:1297)
      at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1399)
      at org.apache.wicket.RequestCycle.request(RequestCycle.java:529)
      at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:356)
      at org.apache.wicket.protocol.http.WicketServlet.doPost(WicketServlet.java:145)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      at org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:585)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:659)
      at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:457)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:359)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:311)
      at org.sakaiproject.tool.impl.ActiveToolComponent$MyActiveTool.forward(ActiveToolComponent.java:500)
      at org.sakaiproject.portal.charon.SkinnableCharonPortal.forwardTool(SkinnableCharonPortal.java:1221)
      at org.sakaiproject.portal.charon.handlers.ToolHandler.doTool(ToolHandler.java:204)
      at org.sakaiproject.portal.charon.handlers.ToolHandler.doGet(ToolHandler.java:96)
      at org.sakaiproject.portal.charon.handlers.ToolHandler.doPost(ToolHandler.java:73)
      at org.sakaiproject.portal.charon.SkinnableCharonPortal.doPost(SkinnableCharonPortal.java:1064)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      at org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:646)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:879)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
      at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
      at java.lang.Thread.run(Thread.java:619)

      If you need anything more just ask.

      Regars
      Johan Zaxmy

        Gliffy Diagrams

          Zeplin

            Attachments

              Issue Links

                Activity

                  People

                  Assignee:
                  k1team KERNEL TEAM (Inactive)
                  Reporter:
                  zaxmy Johan Zaxmy
                  Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                    Dates

                    Created:
                    Updated:
                    Resolved:

                      Git Integration