ANSI mode not working, PHP 7
@williamdes đang làm issue này rồi.
Từ ngày 6/3/2020.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Hi,
while investigating issue https://github.com/phpmyadmin/phpmyadmin/issues/15821 i came to conclusion, that sql-parser does not work correctly in my environment.
I'm using php from sury.org, currently 2:7.4+72+0~20200122.20+debian10~1.gbpcd96c7
Using MySQL server version 8.0.18 with ANSI_QUOTES mode (full list of modes at the end of this comment https://github.com/phpmyadmin/phpmyadmin/issues/15821#issuecomment-578572914 ), yours lint-query fails to parse double-quotes correctly and complains (both table name and field names are escaped by double-quotes in ANSI mode)
#1: A symbol name was expected! (near ""id"" at position 29)
#2: At least one column definition was expected. (near ""id"" at position 29)
#3: Unexpected beginning of statement. (near "11" at position 38)
#4: Unrecognized statement type. (near "NOT NULL" at position 42)
I tried to tweak using ContextMySql80000 and/or ANSI or ANSI_QUOTES modes, but the behavior did not change, with any of my tries.
Test data are also in mentioned comment, the string is taken directly from phpmyadmin result of SHOW CREATE TABLE query executed from configured datasource.
Once I change manually double-quotes to backticks, everything works correctly.
However I've tried tokenzier CLI utility, and the output is the same, for sql query with double-quotes and with backticks (except for Token containing raw value with backticks/doublequotes), Token values, types and flags are correctly the same.
Please let me know, if I can provide you with more debug info for you to test/fix this
- Ngôn ngữ chính
- PHP
- Star
- 485
- Fork
- 119
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của phpmyadmin/sql-parser
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
phpmyadmin/sql-parser#655 · 1 reaction ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
phpmyadmin/sql-parser#666 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
phpmyadmin/sql-parser#662 · 2 reaction ·
-
MariaDB and MySQL contexts Đang mởkind/support
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
phpmyadmin/sql-parser#653 · 1 reaction ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 70/100
phpmyadmin/sql-parser#649 ·
Tất cả issue của phpmyadmin/sql-parser
Issue tương tự
-
sync-en
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 85/100
-
sync-en
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 85/100
-
Перевод устарел
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
-
[6.x]: "Cannot use object of type stdClass as array" loading Users index (regression of #19182) Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100