You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "iamhucong (via GitHub)" <gi...@apache.org> on 2023/04/26 03:30:58 UTC

[GitHub] [shardingsphere] iamhucong opened a new pull request, #25330: support MySQL SET session variable (#24124)

iamhucong opened a new pull request, #25330:
URL: https://github.com/apache/shardingsphere/pull/25330

   Fixes #24124.
   
   Changes proposed in this pull request:
     -
   
   ---
   
   Before committing this PR, I'm sure that I have checked the following options:
   - [ ] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
   - [ ] I have self-reviewed the commit code.
   - [ ] I have (or in comment I request) added corresponding labels for the pull request.
   - [ ] I have passed maven check locally : `./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`.
   - [ ] I have made corresponding changes to the documentation.
   - [ ] I have added corresponding unit tests for my changes.
   


-- 
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] TeslaCN merged pull request #25330: support MySQL SET session variable (#24124)

Posted by "TeslaCN (via GitHub)" <gi...@apache.org>.
TeslaCN merged PR #25330:
URL: https://github.com/apache/shardingsphere/pull/25330


-- 
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] strongduanmu commented on pull request #25330: support MySQL SET session variable (#24124)

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on PR #25330:
URL: https://github.com/apache/shardingsphere/pull/25330#issuecomment-1522726667

   Hi @TeslaCN, can you help review this 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] TeslaCN commented on a diff in pull request #25330: support MySQL SET session variable (#24124)

Posted by "TeslaCN (via GitHub)" <gi...@apache.org>.
TeslaCN commented on code in PR #25330:
URL: https://github.com/apache/shardingsphere/pull/25330#discussion_r1178552626


##########
proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/executor/DefaultSessionVariableHandler.java:
##########
@@ -37,13 +37,18 @@ public abstract class DefaultSessionVariableHandler implements SessionVariableHa
     @Override
     public final void handle(final ConnectionSession connectionSession, final String variableName, final String assignValue) {
         if (TypedSPILoader.findService(ReplayedSessionVariablesProvider.class, databaseType).map(ReplayedSessionVariablesProvider::getVariables).orElseGet(Collections::emptySet)
-                .contains(variableName)) {
+                .contains(variableName)
+                || isNeedHandel(variableName)) {

Review Comment:
   Cound we join these lines?



##########
proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/executor/DefaultSessionVariableHandler.java:
##########
@@ -37,13 +37,18 @@ public abstract class DefaultSessionVariableHandler implements SessionVariableHa
     @Override
     public final void handle(final ConnectionSession connectionSession, final String variableName, final String assignValue) {
         if (TypedSPILoader.findService(ReplayedSessionVariablesProvider.class, databaseType).map(ReplayedSessionVariablesProvider::getVariables).orElseGet(Collections::emptySet)
-                .contains(variableName)) {
+                .contains(variableName)
+                || isNeedHandel(variableName)) {

Review Comment:
   Could we join these lines?



-- 
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] TeslaCN commented on a diff in pull request #25330: support MySQL SET session variable (#24124)

Posted by "TeslaCN (via GitHub)" <gi...@apache.org>.
TeslaCN commented on code in PR #25330:
URL: https://github.com/apache/shardingsphere/pull/25330#discussion_r1178552394


##########
proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/executor/DefaultSessionVariableHandler.java:
##########
@@ -37,13 +37,18 @@ public abstract class DefaultSessionVariableHandler implements SessionVariableHa
     @Override
     public final void handle(final ConnectionSession connectionSession, final String variableName, final String assignValue) {
         if (TypedSPILoader.findService(ReplayedSessionVariablesProvider.class, databaseType).map(ReplayedSessionVariablesProvider::getVariables).orElseGet(Collections::emptySet)
-                .contains(variableName)) {
+                .contains(variableName)
+                || isNeedHandel(variableName)) {
             connectionSession.getRequiredSessionVariableRecorder().setVariable(variableName, assignValue);
         } else {
             log.debug("Set statement {} = {} was discarded.", variableName, assignValue);
         }
     }
     
+    protected boolean isNeedHandel(final String variableName) {

Review Comment:
   `Handel` or `Handle`?



-- 
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] iamhucong commented on a diff in pull request #25330: support MySQL SET session variable (#24124)

Posted by "iamhucong (via GitHub)" <gi...@apache.org>.
iamhucong commented on code in PR #25330:
URL: https://github.com/apache/shardingsphere/pull/25330#discussion_r1178585065


##########
proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/executor/DefaultSessionVariableHandler.java:
##########
@@ -37,13 +37,18 @@ public abstract class DefaultSessionVariableHandler implements SessionVariableHa
     @Override
     public final void handle(final ConnectionSession connectionSession, final String variableName, final String assignValue) {
         if (TypedSPILoader.findService(ReplayedSessionVariablesProvider.class, databaseType).map(ReplayedSessionVariablesProvider::getVariables).orElseGet(Collections::emptySet)
-                .contains(variableName)) {
+                .contains(variableName)
+                || isNeedHandel(variableName)) {

Review Comment:
   Ok.



-- 
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] iamhucong commented on a diff in pull request #25330: support MySQL SET session variable (#24124)

Posted by "iamhucong (via GitHub)" <gi...@apache.org>.
iamhucong commented on code in PR #25330:
URL: https://github.com/apache/shardingsphere/pull/25330#discussion_r1178585628


##########
proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/executor/DefaultSessionVariableHandler.java:
##########
@@ -37,13 +37,18 @@ public abstract class DefaultSessionVariableHandler implements SessionVariableHa
     @Override
     public final void handle(final ConnectionSession connectionSession, final String variableName, final String assignValue) {
         if (TypedSPILoader.findService(ReplayedSessionVariablesProvider.class, databaseType).map(ReplayedSessionVariablesProvider::getVariables).orElseGet(Collections::emptySet)
-                .contains(variableName)) {
+                .contains(variableName)
+                || isNeedHandel(variableName)) {
             connectionSession.getRequiredSessionVariableRecorder().setVariable(variableName, assignValue);
         } else {
             log.debug("Set statement {} = {} was discarded.", variableName, assignValue);
         }
     }
     
+    protected boolean isNeedHandel(final String variableName) {

Review Comment:
   have been rectified.



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