Title: Parser mistakes with comments · Issue #156 · phpmyadmin/sql-parser · GitHub
Open Graph Title: Parser mistakes with comments · Issue #156 · phpmyadmin/sql-parser
X Title: Parser mistakes with comments · Issue #156 · phpmyadmin/sql-parser
Description: The parser may not well deal with the comments. Here is an example, as it treat -- as a part of table alias. Give sql as SELECT * FROM ecshop.ecs_order_info -- LIMIT 0, 30 -- process by PhpMyAdmin\SqlParser\Parser object(PhpMyAdmin\SqlPa...
Open Graph Description: The parser may not well deal with the comments. Here is an example, as it treat -- as a part of table alias. Give sql as SELECT * FROM ecshop.ecs_order_info -- LIMIT 0, 30 -- process by PhpMyAdmin\...
X Description: The parser may not well deal with the comments. Here is an example, as it treat -- as a part of table alias. Give sql as SELECT * FROM ecshop.ecs_order_info -- LIMIT 0, 30 -- process by PhpMyAdmin\...
Opengraph URL: https://github.com/phpmyadmin/sql-parser/issues/156
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Parser mistakes with comments","articleBody":"The parser may not well deal with the comments.\r\nHere is an example, as it treat `--` as a part of table alias.\r\n\r\nGive sql as \r\n\r\n```sql\r\nSELECT * FROM ecshop.ecs_order_info \r\n-- LIMIT 0, 30 \r\n--\r\n```\r\n\r\nprocess by PhpMyAdmin\\SqlParser\\Parser \r\n```\r\nobject(PhpMyAdmin\\SqlParser\\Statements\\SelectStatement)#28 (16) {\r\n [\"expr\"]=>\r\n array(1) {\r\n [0]=>\r\n object(PhpMyAdmin\\SqlParser\\Components\\Expression)#13 (7) {\r\n [\"database\"]=>\r\n NULL\r\n [\"table\"]=>\r\n NULL\r\n [\"column\"]=>\r\n NULL\r\n [\"expr\"]=>\r\n string(1) \"*\"\r\n [\"alias\"]=>\r\n NULL\r\n [\"function\"]=>\r\n NULL\r\n [\"subquery\"]=>\r\n NULL\r\n }\r\n }\r\n [\"from\"]=>\r\n array(1) {\r\n [0]=>\r\n object(PhpMyAdmin\\SqlParser\\Components\\Expression)#11 (7) {\r\n [\"database\"]=>\r\n string(6) \"ecshop\"\r\n [\"table\"]=>\r\n string(14) \"ecs_order_info\"\r\n [\"column\"]=>\r\n NULL\r\n [\"expr\"]=>\r\n string(23) \"ecshop.ecs_order_info--\"\r\n [\"alias\"]=>\r\n NULL\r\n [\"function\"]=>\r\n NULL\r\n [\"subquery\"]=>\r\n NULL\r\n }\r\n }\r\n [\"partition\"]=>\r\n NULL\r\n [\"where\"]=>\r\n NULL\r\n [\"group\"]=>\r\n NULL\r\n [\"having\"]=>\r\n NULL\r\n [\"order\"]=>\r\n NULL\r\n [\"limit\"]=>\r\n object(PhpMyAdmin\\SqlParser\\Components\\Limit)#27 (2) {\r\n [\"offset\"]=>\r\n int(0)\r\n [\"rowCount\"]=>\r\n int(30)\r\n }\r\n [\"procedure\"]=>\r\n NULL\r\n [\"into\"]=>\r\n NULL\r\n [\"join\"]=>\r\n NULL\r\n [\"union\"]=>\r\n array(0) {\r\n }\r\n [\"end_options\"]=>\r\n NULL\r\n [\"options\"]=>\r\n object(PhpMyAdmin\\SqlParser\\Components\\OptionsArray)#30 (1) {\r\n [\"options\"]=>\r\n array(0) {\r\n }\r\n }\r\n [\"first\"]=>\r\n int(0)\r\n [\"last\"]=>\r\n int(12)\r\n}\r\n```\r\n\r\nand rebuild after ensuring the limit expression is appended (by check the statement->limit property, and add it if lack), would get\r\n\r\n```sql\r\nSELECT * FROM ecshop.ecs_order_info-- LIMIT 0, 30 \r\n```","author":{"url":"https://github.com/sinri","@type":"Person","name":"sinri"},"datePublished":"2017-06-07T14:12:54Z","url":"https://github.com/phpmyadmin/sql-parser/issues/156"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:725f1ada-4f1f-2099-87bf-94050e35c073 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9930:1B4D88:335F85:47BC45:6B043C8B |
| html-safe-nonce | 0a3448026abf1ce80eae6aaec42534b8a775803ba87e47e9bec7323d8580af73 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTMwOjFCNEQ4ODozMzVGODU6NDdCQzQ1OjZCMDQzQzhCIiwidmlzaXRvcl9pZCI6Ijg5MzE4MDI5ODY4NTA4Mjc0MDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b941cb611ab6514e732a65f4b1760eedd88b5ab56dc3a508a381e995c4a5a849 |
| hovercard-subject-tag | issue:234223543 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/phpmyadmin/sql-parser/156/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e42eaac6aabcab372295c6971db49c34ec1cbbd884c1b9691b27b4baef6e9cb5/phpmyadmin/sql-parser/issues/156 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e42eaac6aabcab372295c6971db49c34ec1cbbd884c1b9691b27b4baef6e9cb5/phpmyadmin/sql-parser/issues/156 |
| og:image:alt | The parser may not well deal with the comments. Here is an example, as it treat -- as a part of table alias. Give sql as SELECT * FROM ecshop.ecs_order_info -- LIMIT 0, 30 -- process by PhpMyAdmin\... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sinri |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9185ccfefd80c1ff2d9ddcdb0cd2becf46b5a1efbbf30741a895e4bb8de25e64 |
| turbo-cache-control | no-preview |
| go-import | github.com/phpmyadmin/sql-parser git https://github.com/phpmyadmin/sql-parser.git |
| octolytics-dimension-user_id | 1351977 |
| octolytics-dimension-user_login | phpmyadmin |
| octolytics-dimension-repository_id | 36256604 |
| octolytics-dimension-repository_nwo | phpmyadmin/sql-parser |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36256604 |
| octolytics-dimension-repository_network_root_nwo | phpmyadmin/sql-parser |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 06dc448a76fe4751ac1db26524aefa3aa3e889a8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width