phpmyadmin / phpmyadmin/sql-parser

UPDATE with SELECT not supported

Offen
#159 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug
Vorherrschende Sprache
PHP
Sterne
485
Forks
119
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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';

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Es wird keine Repository-Datei oder kein Test genannt. Reproduziere die gemeldete Abfrage über php-sqllint, verfolge anschließend das UPDATE-Parsing rund um das eingeklammerte SELECT und überprüfe, dass diese gültige MySQL-Syntax ohne die gemeldeten Fehler akzeptiert wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
mysql, php
Bereich
databases
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.