Skip to content

C++: DataProvider::GetAssignmentFull is back (#94) - #126

Merged
DraTeots merged 1 commit into
v2-mainfrom
fix-94-get-assignment-full
Nov 3, 2026
Merged

DraTeots merged 1 commit into
v2-mainfrom
fix-94-get-assignment-full

Conversation

@DraTeots

@DraTeots DraTeots commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

GetAssignmentFull(run, path, variation="default", timeMicro=0) resolves as GetAssignmentShortMicro (variation chain and time limit included) and loads the rest: run range (min, max, name), the variation the data came from, comment, creation and modification times. GetAssignmentFullByTag(run, path, tag) uses a tag's variation and time.

  • The SQLite and MySQL providers implement a protected LoadAssignmentDetails (one query by assignment id). The base default loads nothing, so a provider written for 2.4 still compiles.
  • Assignment owns a run range the provider created (SetRunRange(rr, true)), so no leak.
  • C++11, no ABI concern beyond the 2.5 rebuild already required.

Tests: the MySQL case #94 left commented out is real again; SQLite gets the same case (data, run range, variation, comment, time; fallback to the parent variation; a variation's own data). C++ suite: SQLite 55 cases / 908 assertions (v2-main 54 / 888 on the same machine), MySQL 8.3 and MariaDB 10.5 65 / 1204 each. Example in docs/apis/cpp.md.

Closes #94

🤖 Generated with Claude Code

GetAssignmentFull(run, path, variation="default", timeMicro=0) resolves as GetAssignmentShortMicro (the variation
chain and the time limit included) and loads the rest of the assignment: its run range (min, max, name), the
variation the data came from, its comment, and its creation and modification times. GetAssignmentFullByTag(run,
path, tag) does the same with a tag's variation and time. The providers implement a protected
LoadAssignmentDetails (one query by assignment id on SQLite and MySQL); the base class default loads nothing, so
a provider written for 2.4 still compiles. Assignment owns a run range the provider created for it
(SetRunRange(rr, true)).

Tests: the MySQL test that issue #94 left commented out is real again, and SQLite has the same case: the data,
run range, variation, comment and time of /test/test_vars/test_table:100, the fallback from a variation without
data to its parent, a variation's own data. C++ suite: SQLite 55 cases / 908 assertions (v2-main 54 / 888 on
this machine), MySQL 8.3 and MariaDB 10.5 65 / 1204 each. docs/apis/cpp.md has an example.

Closes #94

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DraTeots
DraTeots merged commit b16f3b6 into v2-main Nov 3, 2026
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C++] Reimplement GetAssignmentFull in V2

1 participant