weixin_39721924
2021-01-07 14:47 阅读 9

[BUG] 1.1.1版本初始化环境,后台组织相关的功能报错

MeterSphere 版本 您所使用的 MeterSphere 版本是? 1.1.1

Bug 描述 简要描述您碰到的问题 初始化的环境,组织相关的功能报错

Bug 重现步骤 1. 初始化一个1.1.1的metershpere 2. 进入系统管理员 3. 点击组织下的功能,报sql错误

期待的正确结果 正确情况下应该是什么样的? 不报错

截图 如果有截图,请附上截图.

报错信息

Error querying database. Cause: java.sql.SQLException: Expression #1 of ORDER BY clause is not in SELECT list, references column 'metersphere.user_role.update_time' which is not in SELECT list; this is incompatible with DISTINCT ### The error may exist in io/metersphere/base/mapper/ext/ExtUserRoleMapper.xml ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: SELECT distinct user.* FROM user_role JOIN user ON user_role.user_id = user.id WHERE user_role.source_id = ? AND user.name like CONCAT('%', ?,'%') order by user_role.update_time desc ### Cause: java.sql.SQLException: Expression #1 of ORDER BY clause is not in SELECT list, references column 'metersphere.user_role.update_time' which is not in SELECT list; this is incompatible with DISTINCT ; uncategorized SQLException; SQL state [HY000]; error code [3065]; Expression #1 of ORDER BY clause is not in SELECT list, references column 'metersphere.user_role.update_time' which is not in SELECT list; this is incompatible with DISTINCT; nested exception is java.sql.SQLException: Expression #1 of ORDER BY clause is not in SELECT list, references column 'metersphere.user_role.update_time' which is not in SELECT list; this is incompatible with DISTINCT

后台日志 Caused by: java.sql.SQLException: Expression #1 of ORDER BY clause is not in SELECT list, references column 'metersphere.user_role.update_time' which is not in SELECT list; this is incompatible with DISTINCT at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953) at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:370) at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44) at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java) at sun.reflect.GeneratedMethodAccessor116.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59) at com.sun.proxy.$Proxy183.execute(Unknown Source) at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64) at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63) at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) at com.github.pagehelper.PageInterceptor.intercept(PageInterceptor.java:142) at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61) at com.sun.proxy.$Proxy182.query(Unknown Source) at sun.reflect.GeneratedMethodAccessor114.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49) at io.metersphere.interceptor.MybatisInterceptor.intercept(MybatisInterceptor.java:38) at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61) at com.sun.proxy.$Proxy182.query(Unknown Source) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) at sun.reflect.GeneratedMethodAccessor129.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426) ... 138 common frames omitted

该提问来源于开源项目:metersphere/metersphere

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

5条回答 默认 最新

  • weixin_39789857 weixin_39789857 2021-01-07 14:47

    你好,请外你是用的外部的数据库吗

    点赞 评论 复制链接分享
  • weixin_39721924 weixin_39721924 2021-01-07 14:47

    你好,请外你是用的外部的数据库吗

    是的 外部数据库 mysql 5.7.25

    点赞 评论 复制链接分享
  • weixin_39789857 weixin_39789857 2021-01-07 14:47

    MeterSphere 对数据库部分配置项有要求,请参考下附的数据库配置,修改数据库配置文件

    
    [mysqld]
    default-storage-engine=INNODB
    lower_case_table_names=1
    table_open_cache=128
    max_connections=2000
    max_connect_errors=6000
    innodb_file_per_table=1
    innodb_buffer_pool_size=1G
    max_allowed_packet=64M
    transaction_isolation=READ-COMMITTED
    innodb_flush_method=O_DIRECT
    innodb_lock_wait_timeout=1800
    innodb_flush_log_at_trx_commit=0
    sync_binlog=0
    sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
    skip-name-resolve
    
    点赞 评论 复制链接分享
  • weixin_39789857 weixin_39789857 2021-01-07 14:47

    你好,请问问题解决了吗

    点赞 评论 复制链接分享
  • weixin_39721924 weixin_39721924 2021-01-07 14:47

    你好,请问问题解决了吗

    已解决

    点赞 评论 复制链接分享

相关推荐