WillAyd commented on code in PR #906:
URL: https://github.com/apache/arrow-adbc/pull/906#discussion_r1264222756
##########
c/driver/sqlite/sqlite.c:
##########
@@ -1048,15 +1056,17 @@ AdbcStatusCode SqliteStatementInitIngest(struct
SqliteStatement* stmt,
sqlite3_stmt* create = NULL;
if (!stmt->append) {
// Create table
- int rc = sqlite3_prepare_v2(stmt->conn, create_query.buffer,
(int)create_query.size,
- &create, /*pzTail=*/NULL);
+ int rc =
+ sqlite3_prepare_v2(stmt->conn, sqlite3_str_value(create_query),
+ sqlite3_str_length(create_query), &create,
/*pzTail=*/NULL);
if (rc == SQLITE_OK) {
rc = sqlite3_step(create);
}
if (rc != SQLITE_OK && rc != SQLITE_DONE) {
- SetError(error, "[SQLite] Failed to create table: %s (executed '%s')",
- sqlite3_errmsg(stmt->conn), create_query.buffer);
+ SetError(error, "[SQLite] Failed to create table: %s (executed '%.*s')",
Review Comment:
I think this was previously trying to pass along a non-NULL terminated
buffer to the `%s` format specifier; here we are explicit about the length of
the buffer
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]