Datart Version
The version of datart master 20220512的版本.
Describe the bug
添加数据源的时候,报错如下
[pool-3-thread-1] d.server.service.impl.SourceServiceImpl : source schema sync error
java.sql.SQLSyntaxErrorException: SHOW VIEW command denied to user 'root'@'ip' for table 'schema_table_statistics'
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120) ~[mysql-connector-java-8.0.23.jar:8.0.23]
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.23.jar:8.0.23]
at com.mysql.cj.jdbc.StatementImpl.executeQuery(StatementImpl.java:1198) ~[mysql-connector-java-8.0.23.jar:8.0.23]
at com.mysql.cj.jdbc.DatabaseMetaData.extractForeignKeyFromCreateTable(DatabaseMetaData.java:1175) ~[mysql-connector-java-8.0.23.jar:8.0.23]
at com.mysql.cj.jdbc.DatabaseMetaData$5.forEach(DatabaseMetaData.java:2636) ~[mysql-connector-java-8.0.23.jar:8.0.23]
at com.mysql.cj.jdbc.DatabaseMetaData$5.forEach(DatabaseMetaData.java:2625) ~[mysql-connector-java-8.0.23.jar:8.0.23]
at com.mysql.cj.jdbc.IterateBlock.doForAll(IterateBlock.java:56) ~[mysql-connector-java-8.0.23.jar:8.0.23]
at com.mysql.cj.jdbc.DatabaseMetaData.getImportedKeys(DatabaseMetaData.java:2674) ~[mysql-connector-java-8.0.23.jar:8.0.23]
at datart.data.provider.jdbc.adapters.JdbcDataProviderAdapter.getImportedKeys(JdbcDataProviderAdapter.java:177) ~[classes/:na]
at datart.data.provider.jdbc.adapters.JdbcDataProviderAdapter.readTableColumn(JdbcDataProviderAdapter.java:146) ~[classes/:na]
at datart.data.provider.JdbcDataProvider.readTableColumns(JdbcDataProvider.java:83) ~[classes/:na]
at datart.data.provider.ProviderManager.readTableColumns(ProviderManager.java:97) ~[classes/:na]
at datart.server.service.impl.DataProviderServiceImpl.readTableColumns(DataProviderServiceImpl.java:138) ~[classes/:na]
at datart.server.job.SchemaSyncJob.execute(SchemaSyncJob.java:94) ~[classes/:na]
at datart.server.service.impl.SourceServiceImpl.lambda$updateJdbcSourceSyncJob$2(SourceServiceImpl.java:372) ~[classes/:na]
Datart Version The version of
datart
master 20220512的版本.Describe the bug 添加数据源的时候,报错如下 [pool-3-thread-1] d.server.service.impl.SourceServiceImpl : source schema sync error java.sql.SQLSyntaxErrorException: SHOW VIEW command denied to user 'root'@'ip' for table 'schema_table_statistics' at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120) ~[mysql-connector-java-8.0.23.jar:8.0.23] at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.23.jar:8.0.23] at com.mysql.cj.jdbc.StatementImpl.executeQuery(StatementImpl.java:1198) ~[mysql-connector-java-8.0.23.jar:8.0.23] at com.mysql.cj.jdbc.DatabaseMetaData.extractForeignKeyFromCreateTable(DatabaseMetaData.java:1175) ~[mysql-connector-java-8.0.23.jar:8.0.23] at com.mysql.cj.jdbc.DatabaseMetaData$5.forEach(DatabaseMetaData.java:2636) ~[mysql-connector-java-8.0.23.jar:8.0.23] at com.mysql.cj.jdbc.DatabaseMetaData$5.forEach(DatabaseMetaData.java:2625) ~[mysql-connector-java-8.0.23.jar:8.0.23] at com.mysql.cj.jdbc.IterateBlock.doForAll(IterateBlock.java:56) ~[mysql-connector-java-8.0.23.jar:8.0.23] at com.mysql.cj.jdbc.DatabaseMetaData.getImportedKeys(DatabaseMetaData.java:2674) ~[mysql-connector-java-8.0.23.jar:8.0.23] at datart.data.provider.jdbc.adapters.JdbcDataProviderAdapter.getImportedKeys(JdbcDataProviderAdapter.java:177) ~[classes/:na] at datart.data.provider.jdbc.adapters.JdbcDataProviderAdapter.readTableColumn(JdbcDataProviderAdapter.java:146) ~[classes/:na] at datart.data.provider.JdbcDataProvider.readTableColumns(JdbcDataProvider.java:83) ~[classes/:na] at datart.data.provider.ProviderManager.readTableColumns(ProviderManager.java:97) ~[classes/:na] at datart.server.service.impl.DataProviderServiceImpl.readTableColumns(DataProviderServiceImpl.java:138) ~[classes/:na] at datart.server.job.SchemaSyncJob.execute(SchemaSyncJob.java:94) ~[classes/:na] at datart.server.service.impl.SourceServiceImpl.lambda$updateJdbcSourceSyncJob$2(SourceServiceImpl.java:372) ~[classes/:na]
是因为对sys库的视图schema_table_statistics没有编辑权限,导致报错,从而source_schemas中没有数据,数据视图中这个数据源就没有表结构信息了
navicat选择编辑这个view的时候,也是报错的