Skip to content

A parsing error that occurred on sqlite3 for "NOT NULL ORDER BY 1;" expression. #6334

Closed

Description

@VLDB2026

Fully reproducible code snippet

When I'm trying to parse the query below, a ParseError occurs:

import sqlglot
query = """SELECT a , b  FROM t1 WHERE b+a NOT NULL ORDER BY 1;"""
sqlglot.parse_one(query, read="sqlite")

error messages:

sqlglot.errors.ParseError: Invalid expression / Unexpected token. Line 1, Col: 40.
  SELECT a , b  FROM t1 WHERE b+a NOT NULL ORDER BY 1;

Additional messages

When I execute the following statement on sqlite3:

CREATE TABLE t1(a,b,c,d);
CREATE TABLE t2(e, f);
SELECT a , b  FROM t1 WHERE b+a NOT NULL ORDER BY 1;

It can be executed normally.

Activity

  1. added a commit that references this issue on Nov 15, 2025
    6725217
  2. added a commit that references this issue on May 3, 2026
    d8386fe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions