tdengine的restfuljdbc使用alter会出现invalid variables的错误

tdengine’s restful jdbc using alter will have error of invalid variables

我在mybaits项目中使用了tdengine,使用Taos-jdbc的restful连接器来操作数据库。一切顺利,直到我使用 alter sql 尝试修改 table 的列。然后我遇到了一个错误,即“无效变量”,错误跟踪日志如下:

Caused by: java.sql.SQLException: ERROR (2303): invalid variables at com.taosdata.jdbc.TSDBError.createSQLException(TSDBError.java:71) at com.taosdata.jdbc.TSDBError.createSQLException(TSDBError.java:58) at com.taosdata.jdbc.rs.RestfulStatement.getAffectedRows(RestfulStatement.java:134) at com.taosdata.jdbc.rs.RestfulStatement.executeOneUpdate(RestfulStatement.java:125) at com.taosdata.jdbc.rs.RestfulStatement.execute(RestfulStatement.java:82) at com.taosdata.jdbc.rs.RestfulPreparedStatement.execute(RestfulPreparedStatement.java:218) at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44) at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java) at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:47) at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:64) at com.sun.proxy.$Proxy211.update(Unknown Source) at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50) at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117) at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 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 com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:106) at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:62) at com.sun.proxy.$Proxy210.update(Unknown Source) at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:194) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 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:427) ... 85 more

但是发生了错误,但是列已正确添加到 table 中。我不知道这有什么问题,有人可以帮助我吗?

您可以将 jdbc 更新到最新版本。这是因为TDengine服务器的“alter command”return值不是我的batis frame所期望的。 此问题已修复。