GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Native: more positional values than placeholders is a TypeError, not a silently dropped value (P-07) by tae898 · Pull Request #537 · humemai/arcadedb-embedded-python

This repository was archived by the owner on Nov 21, 2026. It is now read-only.

Conversation

@tae898

@tae898 tae898 commented Oct 25, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Backlog row P-07. db.query("sql", "SELECT FROM V WHERE @rid IN ?", [rid_a, rid_b]) reads the lone list as the positional-parameter list (the documented form, one element per ?). The statement has one ?, so the engine binds rid_a, drops rid_b without a word, and the query returns one row where two were meant. The engine does not count: it also ignores a second value for a ? and binds null for a missing one (verified on the 26.10.2 release jars and on a 26.11.1-SNAPSHOT build through the Java API, upstream issue drafted separately). The documented example in docs/api/database.md (query("sql", "... ?", [0.9, 0.1, 0.0]) binds ? to 0.9) was this silent case.

Native side of the JVM change (draft, into native-preview). Reproduced on both wheels before the change (rows returned against expected): @rid IN ? with [rid_a, rid_b], a tuple, or two arguments returned 1 of 2; k IN ? with [0, 1, 2] returned 1 of 3; the wrapped form [[a, b]] and the named form IN :ids returned all. Identical on the JVM wheel (main at 78e97b1cff) and the native image (nnext).

What changes: a call with more positional values than the SQL statement can bind raises TypeError before the statement runs, naming both ways out (wrap the list, [[a, b]], or bind it by name, IN :ids). A new module _params.py holds the check and both wheels call it from query()/command() (JVM) and _exec (native), so the behaviour is the same. The count is an upper bound taken from the ?, $ and : characters of the text, with SQL and SQLScript checked, not an exact count: the parsed statement's placeholder count is no public engine call, the native library would need a new entry point and an image rebuild, and named parameters carry positional numbers in the parser, so a count from the text that was exact would be a SQL tokenizer. The bound never refuses a call that binds (a ? inside a string literal counts as a placeholder, so such a statement is checked more loosely). Fewer values than placeholders are not checked. The documented API is unchanged: a lone list is still the positional list, and a call with one value per placeholder binds as before. The only calls refused are those that dropped a value.

One existing test changed: test_each_parameter_shape_reaches_one_java_overload passed values to SELECT 1 (no placeholder); it now uses SELECT ?, ? (it checks overload resolution only).

Tests first: test_positional_count.py was red on both wheels (9 of 20 failed, none raised) and is green after. Docs: docs/api/database.md (query and command), docs/guide/core/queries.md, docs/development/testing.md.

Checked: JVM wheel, full suite on the worktree source over the main wheel (1386 passed; the 5 failures and 2 errors are the subprocess tests that need the installed package, requests, and a Ctrl-C test, none touching parameters); native image nnext, full suite (895 passed; the 2 failures need setuptools in my throwaway environment). Not timed: the check costs one isinstance and a length compare on the one-value paths and a cached str.count on calls with two or more values; no timing claim is made.

Overlap: touches the same functions as #524 and #525 (query/command and _exec, one added if args: call each) and the parameter paragraph of docs/api/database.md that #529, #530 and #531 also edit; expect a trivial rebase.

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tae898 @claude
Native: more positional values than placeholders is a TypeError, not …
7dbc0b9
…a silently dropped value (P-07)

The same check as the JVM wheel, in _exec.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@tae898
tae898 marked this pull request as ready for review October 25, 2026 09:12
@tae898

tae898 commented Oct 25, 2026

Copy link
Copy Markdown
Author

Closing as superseded. The native build now ships from ArcadeData/arcadedb-python, so native fixes land there instead of on this repo's native-preview branch. This change is ported as ArcadeData/arcadedb-python@9ae92b3 (positional-count refusal), part of ArcadeData/arcadedb-python#66. The JVM side of P-07 is #536 here. native-preview is no longer synced with main (239 commits behind), which is why the JVM legs here fail the new tests.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tae898 tae898 closed this Oct 25, 2026
@tae898
tae898 deleted the fix/p05-native-positional-count branch November 8, 2026 11:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@tae898
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.