Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-15771

SQL R1008010 migrate error "not contained in either an aggregate function or the GROUP BY clause"

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Duplicate
    • Affects Version/s: 10.8.1
    • Fix Version/s: None
    • Component/s: Old Core
    • Labels:
    • Environment:
      Windows Server 2016
      Tomcat 9
      MSSQL 2016
    • Difficulty:
      Hard
    • Similar issues:

      Description

      Schema update fails upgrading to 10.8.1 on MSSQL with MS JDBC 6.4.0

       

      2018-10-26 15:50:49,561 [XWiki initialization] DEBUG o.h.SQL                        - 
          /* select
              obj 
          from
              BaseObject as obj,
              BaseProperty as prop 
          where
              obj.id = prop.id.id 
              and obj.className = :className 
              and prop.id.name in :expectedProperties 
          group by
              obj 
          having
              count(prop) < :expectedPropertyCount */ select
                  baseobject0_.XWO_ID as XWO1_20_,
                  baseobject0_.XWO_NUMBER as XWO2_20_,
                  baseobject0_.XWO_NAME as XWO3_20_,
                  baseobject0_.XWO_CLASSNAME as XWO4_20_,
                  baseobject0_.XWO_GUID as XWO5_20_ 
              from
                  xwikiobjects baseobject0_ cross 
              join
                  xwikiproperties baseproper1_ 
              where
                  baseobject0_.XWO_ID=baseproper1_.XWP_ID 
                  and baseobject0_.XWO_CLASSNAME=? 
                  and (
                      baseproper1_.XWP_NAME in (
                          ? , ? , ? , ? , ? , ? , ? , ? , ?
                      )
                  ) 
              group by
                  baseobject0_.XWO_ID 
              having
                  count(baseproper1_.XWP_ID)<? 
      Hibernate: 
          /* select
              obj 
          from
              BaseObject as obj,
              BaseProperty as prop 
          where
              obj.id = prop.id.id 
              and obj.className = :className 
              and prop.id.name in :expectedProperties 
          group by
              obj 
          having
              count(prop) < :expectedPropertyCount */ select
                  baseobject0_.XWO_ID as XWO1_20_,
                  baseobject0_.XWO_NUMBER as XWO2_20_,
                  baseobject0_.XWO_NAME as XWO3_20_,
                  baseobject0_.XWO_CLASSNAME as XWO4_20_,
                  baseobject0_.XWO_GUID as XWO5_20_ 
              from
                  xwikiobjects baseobject0_ cross 
              join
                  xwikiproperties baseproper1_ 
              where
                  baseobject0_.XWO_ID=baseproper1_.XWP_ID 
                  and baseobject0_.XWO_CLASSNAME=? 
                  and (
                      baseproper1_.XWP_NAME in (
                          ? , ? , ? , ? , ? , ? , ? , ? , ?
                      )
                  ) 
              group by
                  baseobject0_.XWO_ID 
              having
                  count(baseproper1_.XWP_ID)<?
      2018-10-26 15:50:49,561 [XWiki initialization] TRACE o.h.t.d.s.BasicBinder          - binding parameter [1] as [VARCHAR] - AnnotationCode.AnnotationClass 
      2018-10-26 15:50:49,561 [XWiki initialization] TRACE o.h.t.d.s.BasicBinder          - binding parameter [2] as [VARCHAR] - annotation 
      2018-10-26 15:50:49,561 [XWiki initialization] TRACE o.h.t.d.s.BasicBinder          - binding parameter [3] as [VARCHAR] - author 
      2018-10-26 15:50:49,561 [XWiki initialization] TRACE o.h.t.d.s.BasicBinder          - binding parameter [4] as [VARCHAR] - date 
      2018-10-26 15:50:49,561 [XWiki initialization] TRACE o.h.t.d.s.BasicBinder          - binding parameter [5] as [VARCHAR] - originalSelection 
      2018-10-26 15:50:49,561 [XWiki initialization] TRACE o.h.t.d.s.BasicBinder          - binding parameter [6] as [VARCHAR] - selection 
      2018-10-26 15:50:49,561 [XWiki initialization] TRACE o.h.t.d.s.BasicBinder          - binding parameter [7] as [VARCHAR] - selectionLeftContext 
      2018-10-26 15:50:49,561 [XWiki initialization] TRACE o.h.t.d.s.BasicBinder          - binding parameter [8] as [VARCHAR] - selectionRightContext 
      2018-10-26 15:50:49,561 [XWiki initialization] TRACE o.h.t.d.s.BasicBinder          - binding parameter [9] as [VARCHAR] - state 
      2018-10-26 15:50:49,561 [XWiki initialization] TRACE o.h.t.d.s.BasicBinder          - binding parameter [10] as [VARCHAR] - target 
      2018-10-26 15:50:49,561 [XWiki initialization] TRACE o.h.t.d.s.BasicBinder          - binding parameter [11] as [BIGINT] - 9 
      2018-10-26 15:50:49,561 [XWiki initialization] DEBUG o.h.j.AbstractBatcher          - about to close PreparedStatement (open PreparedStatements: 1, globally: 1) 
      2018-10-26 15:50:49,561 [XWiki initialization] WARN  o.h.u.JDBCExceptionReporter    - SQL Error: 8120, SQLState: S0001 
      2018-10-26 15:50:49,561 [XWiki initialization] ERROR o.h.u.JDBCExceptionReporter    - Column 'xwikiobjects.XWO_NUMBER' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause. 
      2018-10-26 15:50:49,561 [XWiki initialization] DEBUG o.h.j.ConnectionManager        - aggressively releasing JDBC connection 
      

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tmortagne Thomas Mortagne
                Reporter:
                reighnman Jared O.
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Date of First Response: