Title: Re-formating LIMIT destroys DELETE and UPDATE queries · Issue #252 · phpmyadmin/sql-parser · GitHub
Open Graph Title: Re-formating LIMIT destroys DELETE and UPDATE queries · Issue #252 · phpmyadmin/sql-parser
X Title: Re-formating LIMIT destroys DELETE and UPDATE queries · Issue #252 · phpmyadmin/sql-parser
Description: When building queries, the LIMIT is re-formatted. For example SELECT * FROM tbl LIMIT 1 is changed to SELECT * FROM tbl LIMIT 0, 1. This works just fine for SELECT queries, but not for DELETE or UPDATE queries. Example: $query1 = "DELETE...
Open Graph Description: When building queries, the LIMIT is re-formatted. For example SELECT * FROM tbl LIMIT 1 is changed to SELECT * FROM tbl LIMIT 0, 1. This works just fine for SELECT queries, but not for DELETE or UP...
X Description: When building queries, the LIMIT is re-formatted. For example SELECT * FROM tbl LIMIT 1 is changed to SELECT * FROM tbl LIMIT 0, 1. This works just fine for SELECT queries, but not for DELETE or UP...
Opengraph URL: https://github.com/phpmyadmin/sql-parser/issues/252
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Re-formating LIMIT destroys DELETE and UPDATE queries","articleBody":"When building queries, the LIMIT is re-formatted. For example `SELECT * FROM tbl LIMIT 1` is changed to `SELECT * FROM tbl LIMIT 0, 1`. This works just fine for SELECT queries, but not for DELETE or UPDATE queries.\r\n\r\nExample:\r\n\r\n```php\r\n$query1 = \"DELETE FROM a LIMIT 1\";\r\n$parser = new PhpMyAdmin\\SqlParser\\Parser($query1);\r\n$statement = $parser->statements[0];\r\n\r\n$table2 = new \\PhpMyAdmin\\SqlParser\\Components\\Expression(\"\", \"b\", \"\", \"\");\r\n$statement->from[0] = $table2;\r\n\r\necho $statement->build();\r\n```\r\n\r\nresults in\r\n```sql\r\nDELETE FROM `b` LIMIT 0, 1\r\n```\r\n\r\nThe changed query fails, while the original query is perfect SQL.\r\n","author":{"url":"https://github.com/werner-freytag","@type":"Person","name":"werner-freytag"},"datePublished":"2019-06-28T12:40:46Z","url":"https://github.com/phpmyadmin/sql-parser/issues/252"}
| 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:10e0375d-0d9d-86d0-926e-3a834a8c6c7a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8E8E:14CE41:3D56CD:554B22:6B043E00 |
| html-safe-nonce | 7288fb2e92cdaebecce9895289f1c5c0b7ca36995336ec254df820f780116828 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RThFOjE0Q0U0MTozRDU2Q0Q6NTU0QjIyOjZCMDQzRTAwIiwidmlzaXRvcl9pZCI6IjYxODE2NzgzNzI4NzY0Njc3MTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 326d9884e592b452667003de06ed3c56a744a1bbe8c03eb9baeb3822fdff91cb |
| hovercard-subject-tag | issue:462015765 |
| 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/252/issue_layout |
| twitter:image | https://opengraph.githubassets.com/16699ae6ef7fae62d747d5a3aee352e060ff81ec26c7d79e270505563c407632/phpmyadmin/sql-parser/issues/252 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/16699ae6ef7fae62d747d5a3aee352e060ff81ec26c7d79e270505563c407632/phpmyadmin/sql-parser/issues/252 |
| og:image:alt | When building queries, the LIMIT is re-formatted. For example SELECT * FROM tbl LIMIT 1 is changed to SELECT * FROM tbl LIMIT 0, 1. This works just fine for SELECT queries, but not for DELETE or UP... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | werner-freytag |
| 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