Skip to content

Commit 2294c5a

Browse files
91wangmengilayaperumalg
authored andcommitted
Fix: Add missing placeholder for TABLE_NAME in MariaDB table existence check
Signed-off-by: vker <6492178@gmail.com>
1 parent c02430e commit 2294c5a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ 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(
49+
"SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = %s AND TABLE_NAME = %s",
4950
(schemaName == null) ? "SCHEMA()" : schemaName, tableName);
5051
try {
5152
// Query for a single integer value, if it exists, table exists

0 commit comments

Comments
 (0)