apecloud / myduckserver

MySQL & Postgres Analytics, Reimagined
184 stars 8 forks source link

fix(compatibility): resolve errors with aggregation queries lacking GROUP BY #59

Open GaoYusong opened 2 months ago

GaoYusong commented 2 months ago
--- FAIL: TestQueriesSimple/SELECT_pk1,_SUM(c1)_FROM_two_pk_WHERE_pk1_=_0 (0.06s)
        /Users/shannon/code/myduckserver/evaluation.go:351: 
                Error Trace:    /Users/shannon/go/pkg/mod/github.com/dolthub/go-mysql-server@v0.18.2-0.20240815142344-761713e36043/enginetest/evaluation.go:351
                Error:          Received unexpected error:
                                Binder Error: column "pk1" must appear in the GROUP BY clause or must be part of an aggregate function.
                                Either add it to the GROUP BY list, or use "ANY_VALUE(pk1)" if the exact value of "pk1" is not important.
                                LINE 1: SELECT pk1, SUM(c1) FROM two_pk WHERE pk1 = 0
                                               ^
                Test:           TestQueriesSimple/SELECT_pk1,_SUM(c1)_FROM_two_pk_WHERE_pk1_=_0
                Messages:       Unexpected error for query SELECT pk1, SUM(c1) FROM two_pk WHERE pk1 = 0: Binder Error: column "pk1" must appear in the GROUP BY clause or must be part of an aggregate function.
                                Either add it to the GROUP BY list, or use "ANY_VALUE(pk1)" if the exact value of "pk1" is not important.
                                LINE 1: SELECT pk1, SUM(c1) FROM two_pk WHERE pk1 =