From 66f89dd2dae2a0148f50e22604e28d35805dea9a Mon Sep 17 00:00:00 2001 From: Andrey Koshchiy Date: Tue, 20 Aug 2024 22:17:17 +0300 Subject: [PATCH] build fix --- src/jni/duckdb_java.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/jni/duckdb_java.cpp b/src/jni/duckdb_java.cpp index 0293ba3c..bd445885 100644 --- a/src/jni/duckdb_java.cpp +++ b/src/jni/duckdb_java.cpp @@ -703,7 +703,8 @@ jobject _duckdb_jdbc_execute(JNIEnv *env, jclass, jobject stmt_ref_buf, jobjectA duckdb::vector duckdb_params; idx_t param_len = env->GetArrayLength(params); - if (param_len != stmt_ref->stmt->n_param) { + + if (param_len != stmt_ref->stmt->named_param_map.size()) { throw InvalidInputException("Parameter count mismatch"); } @@ -827,8 +828,9 @@ jobject _duckdb_jdbc_prepared_statement_meta(JNIEnv *env, jclass, jobject stmt_r } auto &stmt = stmt_ref->stmt; + auto n_param = stmt->named_param_map.size(); - return build_meta(env, stmt->ColumnCount(), stmt->n_param, stmt->GetNames(), stmt->GetTypes(), + return build_meta(env, stmt->ColumnCount(), n_param, stmt->GetNames(), stmt->GetTypes(), stmt->GetStatementProperties()); }