spawpaw / mybatis-generator-gui-extension

图形化MBG,内置丰富插件,可生成Service、Controller、View,配置简单。 A powerful GUI tool for MyBatisGenerator(MBG)
Other
642 stars 233 forks source link

在双击选择表的时候出现错误?正常吗? #30

Closed trumansdo closed 6 years ago

trumansdo commented 6 years ago

I'm submitting a...

Current behavior

双击连接,选择表的时候出现:

Non-grouping field 'TABLE_TYPE' is used in HAVING clause. 提示

测试连接是成功的

Expected behavior

Minimal reproduction of the problem with instructions

Environment

JDK Version:

Database:

Others:

spawpaw commented 6 years ago

在本地测试没有出现这个问题。 能否提供更详细的信息,比如数据库的版本和错误截图?

trumansdo commented 6 years ago

1imxnr1qr49 r oeb b m asby y_gih4 _yr 2w9 z dv 8 1cwa afe f9 d0m 2018-10-17 22:16:22.529 [JavaFX Application Thread] INFO DatabaseConfig.java->getConnection, line71: using connection url:jdbc:mysql://192.168.0.2:3306/ncts?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=UTC


没有什么异常信息输出。。。测试连接也正常。mysql版本已附上。

spawpaw commented 6 years ago

这个应该是数据库配置的原因,参考一下这个:stackoverflow: non-grouping-field-used-in-having-clause-with-sub-query

我在mysql5.7.18上测试没有出现任何问题...

trumansdo commented 6 years ago

这个参考只是告诉我自己在做SQL查询的时候出现这个问题是什么原因。。这和我数据库配置有什么关系呢??

spawpaw commented 6 years ago

我用mysql-5.7.18-winx64mysql-8.0.12-winx64的默认配置进行测试都没有复现这个情况(工具用的是最新的release)。在代码里,获取数据库表信息的语句也都是通过jdbc的DatabaseMetaData获取的,所以理论上也只有数据库的配置不一样才会导致出现这个问题...

另外我看了一下代码...那个完整的错误信息要在关掉提示框之后才会打印出来,不如我们再截个图。。

trumansdo commented 6 years ago

emmmmmm。。。。忘了问一下,这个程序支持对远程数据库的连接嘛???我连的是远程数据库,但是账号是root,可以有全部权限。 异常信息:

java.sql.SQLSyntaxErrorException: Non-grouping field 'TABLE_TYPE' is used in HAVING clause
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
    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:975)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeQuery(ClientPreparedStatement.java:1025)
    at com.mysql.cj.jdbc.DatabaseMetaDataUsingInfoSchema.executeMetadataQuery(DatabaseMetaDataUsingInfoSchema.java:70)
    at com.mysql.cj.jdbc.DatabaseMetaDataUsingInfoSchema.getTables(DatabaseMetaDataUsingInfoSchema.java:843)
    at com.spawpaw.mybatis.generator.gui.DatabaseConfig.connect(DatabaseConfig.java:112)
    at com.spawpaw.mybatis.generator.gui.controller.MainController.lambda$refreshDatabaseConfigList$5(MainController.java:186)
    at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
    at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
    at javafx.event.Event.fireEvent(Event.java:198)
    at javafx.scene.Scene$ClickGenerator.postProcess(Scene.java:3470)
    at javafx.scene.Scene$ClickGenerator.access$8100(Scene.java:3398)
    at javafx.scene.Scene$MouseHandler.process(Scene.java:3766)
    at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3485)
    at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762)
    at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2494)
    at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:394)
    at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$353(GlassViewEventHandler.java:432)
    at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
    at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:431)
    at com.sun.glass.ui.View.handleMouseEvent(View.java:555)
    at com.sun.glass.ui.View.notifyMouse(View.java:937)
    at com.sun.glass.ui.win.WinApplication._runLoop(WinApplication.java)
    at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177)
    at java.lang.Thread.run(Thread.java:748)

我debug发现connect连接信息都是正确的。

spawpaw commented 6 years ago

远程肯定连得上的,我用5.5.57-0+deb8u1连接也没有问题。。

spawpaw commented 6 years ago

如果没有其他问题我就先把issue关了。如果还有问题可以随时把这个issue重新打开