-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] missing feature description show create table my_table #1790
Comments
It seems to be MySQL specific and is not supported. |
Thanks for your reply. |
Ok, I get it and see your point. For your particular use-case I would like to suggest a slightly different approach (assuming you will want to verify a long list of various statements from a text file):
The following 2 Regular expressions may be a good start: public static final Pattern COMMENT_PATTERN = Pattern.compile("(?:'[^']*+')|(?:\\\"[^\\\"]*+\\\")"
+ "|(^/\\*[^*]*\\*+(?:[^/*][^*]*\\*+)*/\\s?\\n?|/\\*[^*]*\\*+(?:[^/*][^*]*\\*+)*/|--.*?\\r?[\\n])",
Pattern.DOTALL | Pattern.MULTILINE | Pattern.UNIX_LINES);
public static final Pattern SQL_DELIMITER_SPLIT =
Pattern.compile("((?:(?:'[^']*+')|(?:\"[^\"]*+\")|[^;])*+);"); Good luck! |
Okay, what we are doing is a permission interception, which intercepts permissions through certain keywords in the statement. Although we can use exception handling methods, we are concerned about security issues that may arise.I should be able to find the best solution, thank you |
Solved via @Test
void testShowCreateTable() throws JSQLParserException {
String sqlStr =
"show create table my_table";
Statement statement = assertSqlCanBeParsedAndDeparsed(sqlStr, true);
Assertions.assertTrue( statement instanceof UnsupportedStatement);
} |
I got it! Thank you very much. Although I have found other solutions, your support has still helped me a lot. |
Grammar or Syntax Description
show create table my_table
SQL Example
show create table my_table
Additional context
The used JSQLParser Version (4.6).
net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "TABLE" "TABLE"
at line 1, column 13.
Was expecting one of:
The text was updated successfully, but these errors were encountered: