You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/10/10 06:37:54 UTC

[GitHub] [shardingsphere] FlyingZC opened a new issue, #18697: When multiple back quotation marks are used as a table name, the back quotation marks will be removed all

FlyingZC opened a new issue, #18697:
URL: https://github.com/apache/shardingsphere/issues/18697

   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   `master`
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   `ShardingSphere-JDBC`
   
   ### Expected behavior
   keep correct quotation marks.
   
   ### Actual behavior
   When I want to support create table sql with multiple back quotes, like `CREATE TABLE ```ab````cd``` (i INT);`,the table name is resolved to `abcd`.
   
   ### Reason analyze (If you can)
   `org.apache.shardingsphere.sql.parser.sql.common.value.identifier.IdentifierValue#IdentifierValue(java.lang.String)` uses the method `org.apache.shardingsphere.sql.parser.sql.common.util.SQLUtil#getExactlyValue(java.lang.String)` to handle table name,this method removes all back quotes.
   
   Before:
   <img width="1217" alt="image" src="https://user-images.githubusercontent.com/19788130/176399071-232fc5cc-38cb-417b-83dd-d46adba27152.png">
   
   After:
   <img width="1265" alt="image" src="https://user-images.githubusercontent.com/19788130/176399199-a6d5478b-e34e-46fd-ad99-1ca3d28ff090.png">
   
   The execution result of this sql in mysql:
   <img width="602" alt="image" src="https://user-images.githubusercontent.com/19788130/176399540-ac8c81b3-8ece-42a8-8ddd-0c5521b1ac27.png">
   
   StackTrace:
   
   ```
   <init>:31, IdentifierValue (org.apache.shardingsphere.sql.parser.sql.common.value.identifier)
   <init>:41, IdentifierValue (org.apache.shardingsphere.sql.parser.sql.common.value.identifier)
   visitTableName:322, MySQLStatementSQLVisitor (org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl)
   visitTableName:223, MySQLStatementSQLVisitor (org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl)
   accept:31379, MySQLStatementParser$TableNameContext (org.apache.shardingsphere.sql.parser.autogen)
   visit:18, AbstractParseTreeVisitor (org.antlr.v4.runtime.tree)
   visitCreateTable:238, MySQLDDLStatementSQLVisitor (org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl)
   visitCreateTable:182, MySQLDDLStatementSQLVisitor (org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl)
   accept:1931, MySQLStatementParser$CreateTableContext (org.apache.shardingsphere.sql.parser.autogen)
   visit:55, SQLVisitorEngine (org.apache.shardingsphere.sql.parser.api)
   parseSQLStatement:78, SQLParserParameterizedTest (org.apache.shardingsphere.test.sql.parser.parameterized.engine)
   assertSupportedSQL:72, SQLParserParameterizedTest (org.apache.shardingsphere.test.sql.parser.parameterized.engine)
   invoke:-1, GeneratedMethodAccessor5 (sun.reflect)
   invoke:43, DelegatingMethodAccessorImpl (sun.reflect)
   invoke:498, Method (java.lang.reflect)
   runReflectiveCall:50, FrameworkMethod$1 (org.junit.runners.model)
   run:12, ReflectiveCallable (org.junit.internal.runners.model)
   invokeExplosively:47, FrameworkMethod (org.junit.runners.model)
   evaluate:17, InvokeMethod (org.junit.internal.runners.statements)
   runLeaf:325, ParentRunner (org.junit.runners)
   runChild:78, BlockJUnit4ClassRunner (org.junit.runners)
   runChild:57, BlockJUnit4ClassRunner (org.junit.runners)
   run:290, ParentRunner$3 (org.junit.runners)
   schedule:71, ParentRunner$1 (org.junit.runners)
   runChildren:288, ParentRunner (org.junit.runners)
   access$000:58, ParentRunner (org.junit.runners)
   evaluate:268, ParentRunner$2 (org.junit.runners)
   run:363, ParentRunner (org.junit.runners)
   runChild:128, Suite (org.junit.runners)
   runChild:27, Suite (org.junit.runners)
   run:290, ParentRunner$3 (org.junit.runners)
   schedule:71, ParentRunner$1 (org.junit.runners)
   runChildren:288, ParentRunner (org.junit.runners)
   access$000:58, ParentRunner (org.junit.runners)
   evaluate:268, ParentRunner$2 (org.junit.runners)
   run:363, ParentRunner (org.junit.runners)
   run:137, JUnitCore (org.junit.runner)
   startRunnerWithArgs:69, JUnit4IdeaTestRunner (com.intellij.junit4)
   execute:38, IdeaTestRunner$Repeater$1 (com.intellij.rt.junit)
   repeat:11, TestsRepeater (com.intellij.rt.execution.junit)
   startRunnerWithArgs:35, IdeaTestRunner$Repeater (com.intellij.rt.junit)
   prepareStreamsAndStart:235, JUnitStarter (com.intellij.rt.junit)
   main:54, JUnitStarter (com.intellij.rt.junit)
   ```
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   ### Example codes for reproduce this issue (such as a github link).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu commented on issue #18697: When multiple back quotation marks are used as a table name, the back quotation marks will be removed all

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #18697:
URL: https://github.com/apache/shardingsphere/issues/18697#issuecomment-1179841274

   @chakkk309 Welcome, I will assign this issue to you.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] RaigorJiang commented on issue #18697: When multiple back quotation marks are used as a table name, the back quotation marks will be removed all

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #18697:
URL: https://github.com/apache/shardingsphere/issues/18697#issuecomment-1407570874

   Hi @chakkk309 ,
   Is there an update?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] chakkk309 commented on issue #18697: When multiple back quotation marks are used as a table name, the back quotation marks will be removed all

Posted by "chakkk309 (via GitHub)" <gi...@apache.org>.
chakkk309 commented on issue #18697:
URL: https://github.com/apache/shardingsphere/issues/18697#issuecomment-1407683960

   > 
   
   Not yet, please feel free to pick it up.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] github-actions[bot] commented on issue #18697: When multiple back quotation marks are used as a table name, the back quotation marks will be removed all

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #18697:
URL: https://github.com/apache/shardingsphere/issues/18697#issuecomment-1272349540

   Hello , this issue has not received a reply for several days.
   This issue is supposed to be closed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] csonezp commented on issue #18697: When multiple back quotation marks are used as a table name, the back quotation marks will be removed all

Posted by GitBox <gi...@apache.org>.
csonezp commented on issue #18697:
URL: https://github.com/apache/shardingsphere/issues/18697#issuecomment-1173395738

   I'd like to try that, please assign it to me


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] terrymanu commented on issue #18697: When multiple back quotation marks are used as a table name, the back quotation marks will be removed all

Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #18697:
URL: https://github.com/apache/shardingsphere/issues/18697#issuecomment-1172238235

   It looks like not very important issue, I just set it as `good amateur issue`, please free to collect this issue if anybody interest it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] chakkk309 commented on issue #18697: When multiple back quotation marks are used as a table name, the back quotation marks will be removed all

Posted by "chakkk309 (via GitHub)" <gi...@apache.org>.
chakkk309 commented on issue #18697:
URL: https://github.com/apache/shardingsphere/issues/18697#issuecomment-1407684105

   > Hi @chakkk309 , Is there an update?
   
   Not yet, please feel free to pick it up.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] RaigorJiang commented on issue #18697: When multiple back quotation marks are used as a table name, the back quotation marks will be removed all

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #18697:
URL: https://github.com/apache/shardingsphere/issues/18697#issuecomment-1408053261

   > Not yet, please feel free to pick it up.
   
   OK, thank you!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] github-actions[bot] closed issue #18697: When multiple back quotation marks are used as a table name, the back quotation marks will be removed all

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #18697: When multiple back quotation marks are used as a table name, the back quotation marks will be removed all
URL: https://github.com/apache/shardingsphere/issues/18697


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] chakkk309 commented on issue #18697: When multiple back quotation marks are used as a table name, the back quotation marks will be removed all

Posted by GitBox <gi...@apache.org>.
chakkk309 commented on issue #18697:
URL: https://github.com/apache/shardingsphere/issues/18697#issuecomment-1179749112

   Hi, I want to try it.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org