CodePhiliaX / Chat2DB

🔥🔥🔥AI-driven database tool and SQL client, The hottest GUI client, supporting MySQL, Oracle, PostgreSQL, DB2, SQL Server, DB2, SQLite, H2, ClickHouse, and more.
http://chat2db.ai
Apache License 2.0
16.58k stars 1.87k forks source link

Bug: Windows client cannot obtain table data after connecting to Mariadb normally #799

Closed JiangZongshi closed 5 months ago

JiangZongshi commented 1 year ago

Chat2DB Version

v3.0.10

Describe the bug

Connect to the local Mariadb database (TEST environment) normally. After selecting the database, double-click the table name or SQL query table content and it will prompt (conn=794) No database selected, and the conn parameter will increase randomly. The picture below shows the environment software and hardware information image The picture below shows the error reporting interface image The following is the log information 2023-11-10 16:53:36.558 INFO 3260 --- [http-nio-0.0.0.0-10824-exec-1] ai.chat2db.spi.sql.SQLExecutor .184 : 8024b1cbbec04cbe900414de800aa358 | execute:SELECT FROM busi_defence_model 2023-11-10 16:53:36.559 WARN 3260 --- [http-nio-0.0.0.0-10824-exec-1] a.c.s.d.core.impl.DlTemplateServiceImpl .441 : 8024b1cbbec04cbe900414de800aa358 | 执行sql:SELECT FROM busi_defence_model异常

java.sql.SQLTransientConnectionException: (conn=794) No database selected at org.mariadb.jdbc.export.ExceptionFactory.createException(ExceptionFactory.java:302) at org.mariadb.jdbc.export.ExceptionFactory.create(ExceptionFactory.java:370) at org.mariadb.jdbc.message.ClientMessage.readPacket(ClientMessage.java:137) at org.mariadb.jdbc.client.impl.StandardClient.readPacket(StandardClient.java:840) at org.mariadb.jdbc.client.impl.StandardClient.readResults(StandardClient.java:779) at org.mariadb.jdbc.client.impl.StandardClient.readResponse(StandardClient.java:698) at org.mariadb.jdbc.client.impl.StandardClient.execute(StandardClient.java:641) at org.mariadb.jdbc.Statement.executeInternal(Statement.java:935) at org.mariadb.jdbc.Statement.execute(Statement.java:1061) at org.mariadb.jdbc.Statement.execute(Statement.java:452) at ai.chat2db.spi.sql.SQLExecutor.execute(SQLExecutor.java:195) at ai.chat2db.server.domain.core.impl.DlTemplateServiceImpl.execute(DlTemplateServiceImpl.java:439) at ai.chat2db.server.domain.core.impl.DlTemplateServiceImpl.executeSQL(DlTemplateServiceImpl.java:161) at ai.chat2db.server.domain.core.impl.DlTemplateServiceImpl.execute(DlTemplateServiceImpl.java:83) at ai.chat2db.server.web.api.controller.rdb.RdbDmlController.manage(RdbDmlController.java:53) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750) at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89) at ai.chat2db.server.web.api.aspect.ConnectionInfoHandler.connectionInfoHandler(ConnectionInfoHandler.java:61) at jdk.internal.reflect.GeneratedMethodAccessor57.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:637) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:627) at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:71) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:702) at ai.chat2db.server.web.api.controller.rdb.RdbDmlController$$SpringCGLIB$$0.manage() at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:207) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:152) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:118) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:884) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1081) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:974) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1011) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:914) at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:547) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885) at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:614) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:205) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) at ai.chat2db.server.start.config.interceptor.CorsFilter.doFilter(CorsFilter.java:37) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) at org.zalando.logbook.servlet.LogbookFilter.doFilter(LogbookFilter.java:76) at org.zalando.logbook.servlet.HttpFilter.doFilter(HttpFilter.java:32) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) at ai.chat2db.server.start.log.LogOncePerRequestFilter.doFilterInternal(LogOncePerRequestFilter.java:32) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:166) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:341) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:390) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:894) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1741) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.base/java.lang.Thread.run(Unknown Source)

2023-11-10 16:53:36.564 DEBUG 3260 --- [http-nio-0.0.0.0-10824-exec-1] a.c.s.d.r.m.OperationLogMapper.insert .137 : 8024b1cbbec04cbe900414de800aa358 | ==> Preparing: INSERT INTO OPERATION_LOG ( gmt_create, gmt_modified, data_source_id, database_name, type, ddl, user_id, status ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) 2023-11-10 16:53:36.565 DEBUG 3260 --- [http-nio-0.0.0.0-10824-exec-1] a.c.s.d.r.m.OperationLogMapper.insert .137 : 8024b1cbbec04cbe900414de800aa358 | ==> Parameters: 2023-11-10T16:53:36.561562(LocalDateTime), 2023-11-10T16:53:36.561562(LocalDateTime), 2(Long), envi_control(String), MARIADB(String), SELECT FROM busi_defence_model(String), 1(Long), fail(String) 2023-11-10 16:53:36.567 DEBUG 3260 --- [http-nio-0.0.0.0-10824-exec-1] a.c.s.d.r.m.OperationLogMapper.insert .137 : 8024b1cbbec04cbe900414de800aa358 | <== Updates: 1 2023-11-10 16:53:36.577 INFO 3260 --- [http-nio-0.0.0.0-10824-exec-1] a.chat2db.server.start.log.EasyLogSink .73 : 8024b1cbbec04cbe900414de800aa358 | http : POST|/api/rdb/dml/execute|241|"sq":"ELE*T FRO `bsiefeceode;\*","*age*o":*,"p*geS*ze"*200*"to*al"*0,"*asN*xtP*ge"*tru*,"d*taS*urc*Id"*2,"*ata*our*eNa*e":*实验室*2环境*,"d*tab*seT*pe"*"MA*IAD*","*ata*ase*ame*:"e*vi_*ont*ol"*"sc*ema*ame*:nu*l}|*"su*ces*":t*ue,*err*rCo*e":*ull*"er*orM*ssa*e":*ull*"da*a":*{"s*l":*SEL*CT * FR*Musidefncemodl`""orginlSq":"ELE*T FRO `bsiefeceode",*des*rip*ion*:nu*l,"*ess*ge"*"(c*nn=*94)*No *ata*ase*sel*cte*","*ucc*ss"*fal*e,"*pda*eCo*nt"*nul*,"h*ade*Lis*":[*"da*aTy*e":*CHA*2DB*ROW*NUM*ER"*"na*e":*Row*Num*er"*"pr*mar*Key*:nu*l,"*omm*nt"*nul*,"d*fau*tVa*ue"*nul*,"a*toI*cre*ent*:nu*l,"*ull*ble*:nu*l,"*olu*nSi*e":*ull*"de*ima*Dig*ts"*nul*}],*dat*Lis*":n*ll,*sql*ype*:"S*LEC*","*asN*xtP*ge"*fal*e,"*age*o":*,"p*geS*ze"*200*"fu*zyT*tal*:"0*,"d*rat*on"*nul*,"c*nEd*t":*rue*"ta*leN*me"*"bsi_efece_ode`"},"taced":ull"erorDtai":nll,soltioLin":n*ll}

JiangZongshi commented 1 year ago

Replenish: The connection database version is as follows: image I just tested it and found that changing the database type to mysql works fine, but choosing mariadb does not work.

Chat2DB-Pro commented 1 year ago

The next version will be fixed in 3.0.12, please wait.

miahemu commented 5 months ago

try new version