Title: SQL cannot be parsed · Issue #1342 · JSQLParser/JSqlParser · GitHub
Open Graph Title: SQL cannot be parsed · Issue #1342 · JSQLParser/JSqlParser
X Title: SQL cannot be parsed · Issue #1342 · JSQLParser/JSqlParser
Description: Describe the bug ALTER TABLE ... DROP FOREIGN KEY ... not implemented To Reproduce Steps to reproduce the behavior: Example SQL ALTER TABLE rcp_dev_application . qweqwe DROP FOREIGN KEY wqewqe Parsing this SQL using JSqlParser with this ...
Open Graph Description: Describe the bug ALTER TABLE ... DROP FOREIGN KEY ... not implemented To Reproduce Steps to reproduce the behavior: Example SQL ALTER TABLE rcp_dev_application . qweqwe DROP FOREIGN KEY wqewqe Pars...
X Description: Describe the bug ALTER TABLE ... DROP FOREIGN KEY ... not implemented To Reproduce Steps to reproduce the behavior: Example SQL ALTER TABLE rcp_dev_application . qweqwe DROP FOREIGN KEY wqewqe Pars...
Opengraph URL: https://github.com/JSQLParser/JSqlParser/issues/1342
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":" SQL cannot be parsed","articleBody":"**Describe the bug**\r\n ALTER TABLE ... DROP FOREIGN KEY ... not implemented\r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior:\r\n1. Example SQL\r\n ```ALTER TABLE rcp_dev_application . qweqwe DROP FOREIGN KEY wqewqe ```\r\n2. Parsing this SQL using JSqlParser with this statements\r\n \r\n3. Exception\r\n ```\r\nnet.sf.jsqlparser.JSQLParserException: Encountered unexpected token: \"FOREIGN\" \"FOREIGN\"\r\n at line 1, column 49.\r\n\r\nWas expecting one of:\r\n\r\n \"COLUMN\"\r\n \"CONSTRAINT\"\r\n \"INDEX\"\r\n \u003cS_IDENTIFIER>\r\n \u003cS_QUOTED_IDENTIFIER>\r\n\r\n\r\n\tat net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatement(CCJSqlParserUtil.java:190)\r\n\tat net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:63)\r\n\tat net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:38)\r\n\tat cn.bobmao.pro.data.SqlGeneraterTest.sqlGenerater(SqlGeneraterTest.java:76)\r\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.base/java.lang.reflect.Method.invoke(Method.java:566)\r\n\tat org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:686)\r\n\tat org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)\r\n\tat org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)\r\n\tat org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)\r\n\tat org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140)\r\n\tat org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84)\r\n\tat org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)\r\n\tat org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)\r\n\tat org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)\r\n\tat org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)\r\n\tat org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)\r\n\tat org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)\r\n\tat org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)\r\n\tat org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)\r\n\tat org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:212)\r\n\tat org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)\r\n\tat org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:208)\r\n\tat org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:137)\r\n\tat org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:71)\r\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:135)\r\n\tat org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)\r\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)\r\n\tat org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)\r\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)\r\n\tat org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)\r\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)\r\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)\r\n\tat java.base/java.util.ArrayList.forEach(ArrayList.java:1540)\r\n\tat org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)\r\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)\r\n\tat org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)\r\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)\r\n\tat org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)\r\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)\r\n\tat org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)\r\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)\r\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)\r\n\tat java.base/java.util.ArrayList.forEach(ArrayList.java:1540)\r\n\tat org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)\r\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)\r\n\tat org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)\r\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)\r\n\tat org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)\r\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)\r\n\tat org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)\r\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)\r\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)\r\n\tat org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)\r\n\tat org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)\r\n\tat org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)\r\n\tat org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:248)\r\n\tat org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$5(DefaultLauncher.java:211)\r\n\tat org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:226)\r\n\tat org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:199)\r\n\tat org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:132)\r\n\tat com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:71)\r\n\tat com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)\r\n\tat com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)\r\n\tat com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)\r\nCaused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: \"FOREIGN\" \"FOREIGN\"\r\n at line 1, column 49.\r\n\r\nWas expecting one of:\r\n\r\n \"COLUMN\"\r\n \"CONSTRAINT\"\r\n \"INDEX\"\r\n \u003cS_IDENTIFIER>\r\n \u003cS_QUOTED_IDENTIFIER>\r\n\r\n\tat net.sf.jsqlparser.parser.CCJSqlParser.generateParseException(CCJSqlParser.java:30694)\r\n\tat net.sf.jsqlparser.parser.CCJSqlParser.jj_consume_token(CCJSqlParser.java:30527)\r\n\tat net.sf.jsqlparser.parser.CCJSqlParser.AlterExpression(CCJSqlParser.java:17353)\r\n\tat net.sf.jsqlparser.parser.CCJSqlParser.AlterTable(CCJSqlParser.java:17457)\r\n\tat net.sf.jsqlparser.parser.CCJSqlParser.SingleStatement(CCJSqlParser.java:267)\r\n\tat net.sf.jsqlparser.parser.CCJSqlParser.Statement(CCJSqlParser.java:153)\r\n\tat net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatement(CCJSqlParserUtil.java:188)\r\n\t... 66 more\r\n\r\n\r\n```\r\n\r\n**Expected behavior**\r\nA clear and concise description of what you expected to happen.\r\n\r\n**System**\r\n win10 x64\r\n - Database you are using\r\n - mysql 8.0\r\n- Java Version\r\n- 11\r\n- JSqlParser version\r\n- 4.2\r\n","author":{"url":"https://github.com/coderstory","@type":"Person","name":"coderstory"},"datePublished":"2021-09-22T06:53:21Z","url":"https://github.com/JSQLParser/JSqlParser/issues/1342"}
| 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:a763cbea-a3e9-b708-9ba8-f70bb114ff3b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A8DE:233A2B:100A0:1543B:6B048F74 |
| html-safe-nonce | 057f0638ecf8fb616fd73e767979b65a2e7880dbb8c7c06cfb4633d0c2a9db79 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOERFOjIzM0EyQjoxMDBBMDoxNTQzQjo2QjA0OEY3NCIsInZpc2l0b3JfaWQiOiIyNTk5OTUyMTU2OTg2Mjg0NjgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0926efc419fbc58e7384101402b162802d2dd16c93f2baf47fbc00e593d6f855 |
| hovercard-subject-tag | issue:1003897387 |
| 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/JSQLParser/JSqlParser/1342/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7b3c592a42b413c1f420188f06fadf7c8fe379b7b1e8e0006575cbb04bb13e3d/JSQLParser/JSqlParser/issues/1342 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7b3c592a42b413c1f420188f06fadf7c8fe379b7b1e8e0006575cbb04bb13e3d/JSQLParser/JSqlParser/issues/1342 |
| og:image:alt | Describe the bug ALTER TABLE ... DROP FOREIGN KEY ... not implemented To Reproduce Steps to reproduce the behavior: Example SQL ALTER TABLE rcp_dev_application . qweqwe DROP FOREIGN KEY wqewqe Pars... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | coderstory |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9b297275a74a2c9a35898175c9477837c635d4f579277ebff3b2d6ebd012e247 |
| turbo-cache-control | no-preview |
| go-import | github.com/JSQLParser/JSqlParser git https://github.com/JSQLParser/JSqlParser.git |
| octolytics-dimension-user_id | 4643847 |
| octolytics-dimension-user_login | JSQLParser |
| octolytics-dimension-repository_id | 1944709 |
| octolytics-dimension-repository_nwo | JSQLParser/JSqlParser |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1944709 |
| octolytics-dimension-repository_network_root_nwo | JSQLParser/JSqlParser |
| 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 | b51ce57ca6d4565a42856fc1c9897077c794597f |
| 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