Hi list.
I recently upgraded my H2.jar from .138 to .144 and started receiving
the error message in $subject. After some investigation I thought, I
had it narrowed down to when I was using a database created by .138
and connecting with the new .144, but it seems that I get the error
intermittently even on databases created with .144. In short, I get
the error consistently when querying a database created with .138
using .144, and intermittently when querying a database created with .
144 using .144.
The causing stack trace says:
-----------
Caused by: org.h2.jdbc.JdbcSQLException: Column "ME.M_TYPE_ID" must be
in the GROUP BY list; SQL statement: [..SNIP.. (see below)]
[90016-144]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:
327)
at org.h2.message.DbException.get(DbException.java:167)
at org.h2.message.DbException.get(DbException.java:144)
at org.h2.expression.ExpressionColumn.getValue(ExpressionColumn.java:
169)
at org.h2.index.IndexCondition.getCurrentValue(IndexCondition.java:
120)
at org.h2.index.IndexCursor.find(IndexCursor.java:99)
at org.h2.table.TableFilter.next(TableFilter.java:310)
at org.h2.command.dml.Select.queryFlat(Select.java:498)
at org.h2.command.dml.Select.queryWithoutCache(Select.java:597)
at org.h2.command.dml.Query.query(Query.java:257)
at org.h2.command.dml.Query.query(Query.java:227)
at org.h2.expression.Subquery.getValue(Subquery.java:36)
at org.h2.index.IndexCondition.getCurrentValue(IndexCondition.java:
120)
at org.h2.index.IndexCursor.find(IndexCursor.java:99)
at org.h2.table.TableFilter.next(TableFilter.java:310)
at org.h2.command.dml.Update.update(Update.java:86)
at org.h2.command.CommandContainer.update(CommandContainer.java:69)
at org.h2.command.Command.executeUpdate(Command.java:201)
at
org.h2.jdbc.JdbcPreparedStatement.execute(JdbcPreparedStatement.java:
181)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:
45)
at $Proxy17.execute(Unknown Source)
at
org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:
22)
at
org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:
51)
at
org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:
29)
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:
73)
at
org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:
43)
at
org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:
102)
... 12 more
-----------
The query I'm trying to execute is:
-----------
UPDATE measurements SET
value = value + ?
WHERE metric_id = (
SELECT
me.id
FROM metrics me
INNER JOIN measurement_types mt ON
mt.id = me.m_type_id
WHERE
me.name = ?
AND
mt.name = ?)
AND time_stamp = ?
-----------
Where measurement_types is:
- id (PK)
- Name
and metrics is:
- id (PK)
- m_type_id (FK)
- name
and measurements is:
- metric_id (FK)
- value
- time_stamp
I don't understand this error as the executing query doesn't contain a
group by clause and it worked when using .138 to query a database
created by .138.
Looking through the changelog; it doesn't seem like there has been any
changes to GROUP between .138 and .144. Does anybody have an idea as
to what is happening here?
- Steffen