Skip to content

Commit f1f138b

Browse files
committed
Fix: Add missing placeholder for TABLE_NAME in MariaDB table existence check
Signed-off-by: vker <[email protected]>
1 parent 4fc6edd commit f1f138b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

vector-stores/spring-ai-mariadb-store/src/main/java/org/springframework/ai/vectorstore/mariadb/MariaDBSchemaValidator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public MariaDBSchemaValidator(JdbcTemplate jdbcTemplate) {
4545

4646
private boolean isTableExists(String schemaName, String tableName) {
4747
// schema and table are expected to be escaped
48-
String sql = String.format("SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = %s AND TABLE_NAME = ",
48+
String sql = String.format("SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = %s AND TABLE_NAME = %s",
4949
(schemaName == null) ? "SCHEMA()" : schemaName, tableName);
5050
try {
5151
// Query for a single integer value, if it exists, table exists

0 commit comments

Comments
 (0)