datavane / datavines

Know your data better!Datavines is Next-gen Data Observability Platform, support metadata manage and data quality.
https://datavane.github.io/datavines-website/
Apache License 2.0
510 stars 157 forks source link

[Bug] [Server] Catalog 接口响应错误 #335

Closed AlexChen68 closed 10 months ago

AlexChen68 commented 10 months ago

Search before asking

What happened

/catalog/page/table-with-detail 接口当 "name" 参数为空时会导致 mybatisplus 拼接 sql 错误; 查看源码发现是CatalogEntityInstanceServiceImplgetCatalogEntityInstancePage 方法中的 queryWrapper 拼接 and 条件时未先判断参数为空

DataVines Version

1.0.0-SNAPSHOT

DataVines Config

Running Command

idea 源码启动

Error Exception

[ERROR] 2024-01-09 16:47:00.754 io.datavines.server.api.inteceptor.DataVinesExceptionHandler:[90] - Exception:
org.springframework.jdbc.BadSqlGrammarException: 
### Error querying database.  Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER BY id ASC) TOTAL' at line 3
### The error may exist in io/datavines/server/repository/mapper/CatalogEntityInstanceMapper.java (best guess)
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: SELECT COUNT(*) FROM (SELECT  id,uuid,datasource_id,type,fully_qualified_name,display_name,description,properties,owner,version,status,create_time,update_by,update_time  FROM dv_catalog_entity_instance     WHERE (uuid IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) AND status = ? AND ) ORDER BY id ASC) TOTAL
### Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER BY id ASC) TOTAL' at line 3

Engine Type

local

Java Version

1.8

Screenshots

截屏2024-01-09 16 50 46

Are you willing to submit PR?