tursodatabase / tursodatabase/libsql
Dereference of opaque `sqlite3_context` type.
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 17.2k
- Forks
- 531
- Avg merge
- 1h 12m
- Merged PRs (30d)
- 1
Description
sqlite3_context is a opaque type when used out of vdbe.c and should not be dereferenced, since it's definition is incomplete at comptime.
This goes under the radar because of the "amalgamation" aproach to build the source. (Yet another drawback https://github.com/tursodatabase/libsql/issues/1028#issuecomment-2185625330). The solution is to #include "vdbeInt.h", but this is very smelly. If the type should be known by the whole source, better add it to sqlite3Int.h.
The func.c includes vdbeInt.h already.
Here is some docs:
https://github.com/tursodatabase/libsql/blob/be6a38fbd4d620b3d0f0d4c8962c9d5bdc339796/libsql-sqlite3/src/vdbeInt.h#L374-L398
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect the dereference in libsql-sqlite3/src/alter.c at lines 1868-1870, then compare the declarations in sqlite3Int.h and vdbeInt.h with the existing include in libsql-sqlite3/src/func.c. Check how a non-amalgamated build exposes sqlite3_context and determine which header should own its definition. Done means the source compiles without relying on amalgamation while preserving the intended opaque-type boundary.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, sqlite
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100