Skip to content

UPDATE with SELECT not supported #159

@gullij

Description

@gullij

Was using the php-sqllint package (says to report errors here) and got these errors on valid MySQL syntax:

Line 1, col 45 at "(": An expression was expected.
Line 1, col 45 at "(": Unexpected token.
Line 1, col 46 at "SELECT": A new statement was found, but no delimiter between it and the previous one.
Line 1, col 106 at ")": Unexpected token.
Line 1, col 108 at "src": Unexpected token.
Line 2, col 5 at "SET": A new statement was found, but no delimiter between it and the previous one.

The SQL to generate these errors is similar to this (table, column names and values are different):

UPDATE table1 t1, (SELECT `id` FROM table2 WHERE `unique_val` = 1) src
    SET t1.ref_to_t2 = src.id
    WHERE t1.unique_val = 'unique';

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions