Skip to content

ALTER TABLE RENAME TO on a missing table throws instead of returning 1 #2706

Open

Description

@mathiasrw

ALTER TABLE x RENAME TO y on a table x that does not exist returns 1 and adds a key y holding undefined to the database's tables. Nothing is renamed and there is no error.

alasql('ALTER TABLE nosuch RENAME TO y'); // 1
Object.keys(alasql.databases.alasql.tables); // [..., 'y'], value undefined

Code that renames a table "if it is there" may rely on the missing error, so this waits for 5.0 (decided 2026-10-21).

Direction for 5.0

Throw Can not rename a table "x" because it does not exist, as SQLite does (no such table: x), and add nothing to the database.

Related: #2201, #2704, #2705.

Activity

  1. added this to the Breaking change milestone on Oct 20, 2026
  2. changed the title [-]v5: ALTER TABLE RENAME TO on a missing table throws instead of returning 1[/-] [+]ALTER TABLE RENAME TO on a missing table throws instead of returning 1[/+] on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions