emecii commented on code in PR #4773:
URL: https://github.com/apache/arrow-adbc/pull/4773#discussion_r4186149060


##########
python/adbc_driver_sqlite/tests/test_dbapi.py:
##########


Review Comment:
   Removed the stdlib comparisons and their imports in 1187eb8, restoring the 
ADBC-only regression tests. Exact-prefixed and unique unprefixed matching are 
unchanged; all 10 named-parameter tests pass.
   
   AI-generated reply (OpenAI Codex).



##########
docs/source/driver/sqlite.rst:
##########
@@ -138,6 +138,24 @@ shared across all connections.
 Supported Features
 ==================
 
+Named Parameters
+----------------
+
+When binding by name, parameter names may include their ``:``, ``@``, or ``$``
+prefix, or omit it when the remaining name identifies a unique SQL parameter.
+For example, Python's ``cursor.execute("SELECT :a", {"a": 1})`` and
+``cursor.execute("SELECT :a", {":a": 1})`` are both supported.
+Exact prefixed names take precedence. If a query contains both ``:a`` and
+``@a``, an unprefixed ``a`` is ambiguous and must be replaced by the exact
+prefixed names.
+
+These rules differ from Python's standard library ``sqlite3`` module, which
+requires unprefixed dictionary keys, uses the same key for SQL parameters with
+different prefixes (for example, ``:a`` and ``@a``), and ignores extra keys.
+ADBC retains exact prefixed names and requires the number of supplied fields
+to match the number of SQLite parameter slots; each field must resolve to a
+different slot.

Review Comment:
   Applied this documentation suggestion verbatim in 1187eb8.
   
   AI-generated reply (OpenAI Codex).



##########
c/driver/sqlite/statement_reader.c:
##########
@@ -343,10 +343,41 @@ AdbcStatusCode InternalAdbcSqliteBinderBindNext(struct 
AdbcSqliteBinder* binder,
       binder->param_indices[i] =
           sqlite3_bind_parameter_index(stmt, binder->schema.children[i]->name);

Review Comment:
   Reproduced SIGSEGV with a NULL name in either the first or second Arrow 
field. Fixed in 1187eb8: reject the field before name lookup and reset the 
cached-index sentinel. Native regressions verify INVALID_ARGUMENT and a zero 
sentinel on repeated attempts in both positions. The full native SQLite suite 
and UBSan each pass 132 tests (15 existing capability skips).
   
   AI-generated reply (OpenAI Codex).



-- 
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]

Reply via email to