Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Running the unit tests results in sqlite3.OperationalError: object name reserved for internal use: event_search_content #8996

Closed
@MadLittleMods

Description

When trying to run the unit tests, I see sqlite3.OperationalError: object name reserved for internal use: event_search_content which fails a bunch of the tests.

$ python -m twisted.trial tests
...
sqlite3.OperationalError: object name reserved for internal use: event_search_content

Ran 1412 tests in 57.728s

FAILED (skips=20, errors=1069, successes=323)

Looking at synapse/storage/databases/main/schema/full_schemas/54/full.sql.sqlite#L70, it has the following code which is the only reference to event_search_content.

CREATE TABLE IF NOT EXISTS 'event_search_content'(docid INTEGER PRIMARY KEY, 'c0event_id', 'c1room_id', 'c2sender', 'c3key', 'c4value');

Trying this syntax out directly in the postgres command line (not sqlite):
$ psql synapse

# The current code
synapse=# CREATE TABLE IF NOT EXISTS 'event_search_content'(docid INTEGER PRIMARY KEY, 'c0event_id', 'c1room_id', 'c2sender', 'c3key', 'c4value');
ERROR:  syntax error at or near "'event_search_content'"
LINE 1: CREATE TABLE IF NOT EXISTS 'event_search_content'(docid INTE...
                                   ^

# Replacing the table name single quotes to double quotes
synapse=# CREATE TABLE IF NOT EXISTS "event_search_content" (docid INTEGER PRIMARY KEY, 'c0event_id', 'c1room_id', 'c2sender', 'c3key', 'c4value');
ERROR:  syntax error at or near "'c0event_id'"
LINE 1: ...event_search_content" (docid INTEGER PRIMARY KEY, 'c0event_i...
                                                             ^
                                                             
# Replacing all single with double quotes
synapse=# CREATE TABLE IF NOT EXISTS "event_search_content"(docid INTEGER PRIMARY KEY, "c0event_id", "c1room_id", "c2sender", "c3key", "c4value");
ERROR:  syntax error at or near ","
LINE 1: ...h_content"(docid INTEGER PRIMARY KEY, "c0event_id", "c1room_...
                                                             ^

And the last piece seems to be missing the types for the columns, https://stackoverflow.com/a/14950544/796832


This is from a fresh clone and install on a new machine.

  • macOS 11.1
  • Python 3.8.6
  • SQLite version 3.32.3 2020-06-18 14:16:19
  • postgres (PostgreSQL) 13.1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

A-DatabaseDB stuff like queries, migrations, new/remove columns, indexes, unexpected entries in the dbA-TestingIssues related to testing in complement, synapse, etcT-DefectBugs, crashes, hangs, security vulnerabilities, or other reported issues.z-question(Deprecated Label)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions