phpmyadmin / phpmyadmin/sql-parser

unrecognised keyword 'CASE'

Đang mở
#262 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

bug help wanted
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

Mô tả

$ ./lint-query --query 'SELECT * FROM `Caracteristiques` WHERE CASE `an` WHEN 86400 THEN 4 WHEN 604800 THEN 5 WHEN 2419200 THEN 6 WHEN 31536000 THEN 7 ELSE -1 END < 0;'
#1: Unrecognised keyword. (near "CASE" at position 39)
#2: Unexpected token. (near "`an`" at position 44)
#3: Unrecognised keyword. (near "WHEN" at position 49)
#4: Unexpected token. (near "86400" at position 54)
#5: Unrecognised keyword. (near "THEN" at position 60)
#6: Unexpected token. (near "4" at position 65)
#7: Unrecognised keyword. (near "WHEN" at position 67)
#8: Unexpected token. (near "604800" at position 72)
#9: Unrecognised keyword. (near "THEN" at position 79)
#10: Unexpected token. (near "5" at position 84)
#11: Unrecognised keyword. (near "WHEN" at position 86)
#12: Unexpected token. (near "2419200" at position 91)
#13: Unrecognised keyword. (near "THEN" at position 99)
#14: Unexpected token. (near "6" at position 104)
#15: Unrecognised keyword. (near "WHEN" at position 106)
#16: Unexpected token. (near "31536000" at position 111)
#17: Unrecognised keyword. (near "THEN" at position 120)
#18: Unexpected token. (near "7" at position 125)
#19: Unrecognised keyword. (near "ELSE" at position 127)
#20: Unexpected token. (near "-1" at position 132)
#21: Unrecognised keyword. (near "END" at position 135)
#22: Unexpected token. (near "&lt;" at position 139)
#23: Unexpected token. (near "0" at position 141)

I am using the version shipped with phpMyAdmin 4.9.1. The query works.

SELECT VERSION();
5.7.27-30-57-log

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện truy vấn với entry point lint-query và kiểm tra cách trình phân tích cú pháp SQL xử lý các token CASE, WHEN, THEN, ELSE và END. Thêm coverage cho truy vấn này và xác nhận rằng các biểu thức CASE hợp lệ của MySQL không còn tạo ra các lỗi đã được báo cáo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
mysql, php, sql
Lĩnh vực
databases, tooling
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.