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:33:40 UTC

[GitHub] [shardingsphere] huangxinjian opened a new issue, #19766: Sql Syntax Error

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

   ## Feature Request
   
   I think the class `H2Repository` can change internal sql
   ```sql
   CREATE TABLE repository(id varchar(36) PRIMARY KEY, key TEXT, value TEXT, parent TEXT);
   ``` 
   to
   ```sql
   CREATE TABLE repository(id_ varchar(36) PRIMARY KEY, key_ TEXT, value_ TEXT, parent_ TEXT)
   ```
   
   because `key` is key word on mysql / mariadb that can't execute successful. 
   
   Why I use H2Repository with mysql, because the class has args `props`, So I can access mysql like this and found the problem.
   
   ```sql
    return new ModeConfiguration("Standalone", new StandalonePersistRepositoryConfiguration("H2", new Properties(){{
               put(JDBCRepositoryPropertyKey.JDBC_URL.getKey(), "your mysql jdbc url");
               put(JDBCRepositoryPropertyKey.USER.getKey(), "your jdbc name");
               put(JDBCRepositoryPropertyKey.PASSWORD.getKey(), "your jdbc password");
           }}), true);
   ```
   


-- 
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] terrymanu commented on issue #19766: Sql Syntax Error

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

   Here is the issue #19655


-- 
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] huangxinjian commented on issue #19766: Sql Syntax Error

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

   BUT the sql problem can't solve despite add `MySQLRepository`. Because class `JDBCRespository` hava hard code for get value
   ```sql
   try (ResultSet resultSet = preparedStatement.executeQuery()) {
                   List<String> resultChildren = new LinkedList<>();
                   while (resultSet.next()) {
                       String childrenKey = resultSet.getString("key");  // hard code
                       if (Strings.isNullOrEmpty(childrenKey)) {
                           continue;
                       }
                       int lastIndexOf = childrenKey.lastIndexOf(SEPARATOR);
                       resultChildren.add(childrenKey.substring(lastIndexOf + 1));
                   }
                   return new ArrayList<>(resultChildren);
               }
   ```


-- 
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 #19766: Sql Syntax Error

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

   If you want use MySQL, please add `MySQLRepository` implemented by SPI


-- 
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 #19766: Sql Syntax Error

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #19766: Sql Syntax Error
URL: https://github.com/apache/shardingsphere/issues/19766


-- 
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] huangxinjian commented on issue #19766: Sql Syntax Error

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

   > > BUT the sql problem can't solve despite add `MySQLRepository`. Because class `JDBCRespository` hava hard code for get value
   > > ```sql
   > > try (ResultSet resultSet = preparedStatement.executeQuery()) {
   > >                 List<String> resultChildren = new LinkedList<>();
   > >                 while (resultSet.next()) {
   > >                     String childrenKey = resultSet.getString("key");  // hard code
   > >                     if (Strings.isNullOrEmpty(childrenKey)) {
   > >                         continue;
   > >                     }
   > >                     int lastIndexOf = childrenKey.lastIndexOf(SEPARATOR);
   > >                     resultChildren.add(childrenKey.substring(lastIndexOf + 1));
   > >                 }
   > >                 return new ArrayList<>(resultChildren);
   > >             }
   > > ```
   > 
   > Does some work need to go to #19655?
   
   yep.It seems to be what #19655 describes


-- 
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] linghengqian commented on issue #19766: Sql Syntax Error

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

   @huangxinjian It looks like JDBCRespository already allows for SPI extensions.


-- 
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 #19766: Sql Syntax Error

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

   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] zhaojinchao95 closed issue #19766: Sql Syntax Error

Posted by GitBox <gi...@apache.org>.
zhaojinchao95 closed issue #19766: Sql Syntax Error
URL: https://github.com/apache/shardingsphere/issues/19766


-- 
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] linghengqian commented on issue #19766: Sql Syntax Error

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

   - I'm working on this issue. It appears that only a MySQL implementation of `org.apache.shardingsphere.mode.repository.standalone.StandalonePersistRepository` is required.


-- 
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] linghengqian commented on issue #19766: Sql Syntax Error

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

   - This seems to be a problem with the GPL V2 LICENSE of the mysql driver. But it’s not a big problem. I can use Apache V2’s `org.mariadb:r2dbc-mariadb:1.1.3` to ensure that the final product can connect to MySQL through the R2DBC Driver without violating the ASF policy.


-- 
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] huangxinjian commented on issue #19766: Sql Syntax Error

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

   Aha ! Actually I want and I think many developer use mysql in their computer on China. I will try to commit a PR later. Is there any specification for submitting PR?


-- 
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] linghengqian commented on issue #19766: Sql Syntax Error

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

   > BUT the sql problem can't solve despite add `MySQLRepository`. Because class `JDBCRespository` hava hard code for get value
   > ```sql
   > try (ResultSet resultSet = preparedStatement.executeQuery()) {
   >                 List<String> resultChildren = new LinkedList<>();
   >                 while (resultSet.next()) {
   >                     String childrenKey = resultSet.getString("key");  // hard code
   >                     if (Strings.isNullOrEmpty(childrenKey)) {
   >                         continue;
   >                     }
   >                     int lastIndexOf = childrenKey.lastIndexOf(SEPARATOR);
   >                     resultChildren.add(childrenKey.substring(lastIndexOf + 1));
   >                 }
   >                 return new ArrayList<>(resultChildren);
   >             }
   > ```
   
   Does some work need to go to https://github.com/apache/shardingsphere/issues/19655?


-- 
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] linghengqian commented on issue #19766: Sql Syntax Error

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

   Just a synchronous comment: key is also a keyword in H2Database 2.x, I think this needs to be avoided, otherwise the ShardingSphere Standalone mode cannot be used under H2Database 2.x. Also affects https://github.com/apache /shardingsphere/issues/15327.


-- 
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