Skip to content

sqlite3 reports parsing issues under free-threaded Python 3.13.2 #132370

@andfoy

Description

@andfoy

Bug report

Bug description:

The following set of sqlite instructions fail under free-threaded CPython 3.13.2t, whereas they are passing under standard 3.13.2

import sqlite3
conn = sqlite3.connect(":memory")
cursor = conn.cursor()
cursor.execute("""CREATE TABLE test3 (
                 s VARCHAR,
                 x INTEGER GENERATED ALWAYS AS (INSTR(s, ","))
             );""")

Traceback:

Traceback (most recent call last):
  File "<python-input-3>", line 1, in <module>
    cursor.execute("""CREATE TABLE test3 (
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
                    s VARCHAR,
                    ^^^^^^^^^^
                    x INTEGER GENERATED ALWAYS AS (INSTR(s, ","))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                );""")
                ^^^^^^
sqlite3.OperationalError: no such column: "," - should this be a string literal in single-quotes?

Passing interpreter:

Python 3.13.2 | packaged by conda-forge | (main, Feb 17 2025, 14:10:22) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
... conn = sqlite3.connect(":memory")
... cursor = conn.cursor()
... cursor.execute("""CREATE TABLE test3 (
...                  s VARCHAR,
...                  x INTEGER GENERATED ALWAYS AS (INSTR(s, ","))
...              );""")
... 
<sqlite3.Cursor object at 0x71ef99cc45c0>
>>> 

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions