Cross-DB query using temp doesn't work
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Start by reproducing the reported DELETE query and schema, including the temporary table, through this package's preparation path. Compare the behavior with modernc.org/sqlite, then investigate why a query combining regular and temporary tables cannot prepare. Done means the reported cross-database query prepares and runs successfully without regressing queries that use either table type alone.
Written by the indexing model from the issue text.
Description
Porting from modernc.org/sqlite to this package, one of my queries fail preparation, where it executed without issue on modernc:
sqlite.Prepare: SQLITE_ERROR: no such table: temp.seen (DELETE FROM dirty WHERE NOT EXISTS (SELECT 1 FROM temp.seen WHERE temp.seen.path = dirty.path))
Schema, for context:
CREATE TABLE IF NOT EXISTS dirty (
id INTEGER PRIMARY KEY,
path TEXT,
mtime DATETIME,
size INTEGER,
dev INTEGER,
inode INTEGER,
canread INTEGER,
dirty INTEGER
);
CREATE TEMPORARY TABLE temp.seen (path TEXT);
afaict, queries across regular and temporary tables should Just Work, but something about how this package sets things up makes it unable to query temporary tables in the same query as a non-temporary table (other queries that only touch the temporary table or non-temporary table work fine).
- Dominant language
- C
- Stars
- 225
- Forks
- 11
- Avg merge
- 20m
- Merged PRs (30d)
- 2
Contributor guide
No contributing guide indexed for this repository
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.
More from tailscale/sqlite
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
All issues in tailscale/sqlite
Similar issues
-
internal.h中,漏掉了1个定义。 Open
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
kovidgoyal/kitty#10516 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 80/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
zephyrproject-rtos/zephyr#120011 ·