You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "zihaoAK47 (via GitHub)" <gi...@apache.org> on 2023/06/29 06:31:12 UTC

[GitHub] [shardingsphere] zihaoAK47 opened a new pull request, #26686: Fix values statement ClassCastException

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

   Fixes #25880.
   
   Changes proposed in this pull request:
     - Fix values statement ClassCastException
   
   ---
   
   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 commented on a diff in pull request #26686: Fix values statement ClassCastException

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


##########
test/e2e/sql/src/test/resources/cases/dql/dql-integration-select-expression.xml:
##########
@@ -117,4 +117,12 @@
     <test-case sql="SELECT n.nspname as &quot;Schema&quot;, c.relname as &quot;Name&quot;, CASE c.relkind WHEN 'r' THEN 'table' WHEN 'v' THEN 'view' WHEN 'i' THEN 'index' WHEN 'I' THEN 'global partition index' WHEN 'S' THEN 'sequence' WHEN 'L' THEN 'large sequence' WHEN 'f' THEN 'foreign table' WHEN 'm' THEN 'materialized view'  WHEN 'e' THEN 'stream' WHEN 'o' THEN 'contview' END as &quot;Type&quot;, pg_catalog.pg_get_userbyid(c.relowner) as &quot;Owner&quot;, c.reloptions as &quot;Storage&quot; FROM pg_catalog.pg_class c LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace WHERE c.relkind IN ('r','v','m','S','L','f','e','o','') AND n.nspname &lt;&gt; 'pg_catalog' AND n.nspname &lt;&gt; 'db4ai' AND n.nspname &lt;&gt; 'information_schema' AND n.nspname !~ '^pg_toast' AND c.relname not like 'matviewmap\_%' AND c.relname not like 'mlog\_%' AND pg_catalog.pg_table_is_visible(c.oid) ORDER BY 1,2;" db-types="openGauss" scenario-types="db,tbl">
         <assertion expected-data-file="select_sys_data_for_og.xml" />
     </test-case>
+
+    <test-case sql="VALUES ROW(1,1)" db-types="MySQL" scenario-types="db,tbl,dbtbl_with_readwrite_splitting,readwrite_splitting">
+        <assertion />
+    </test-case>
+
+    <test-case sql="VALUES ROW(1,-2,3), ROW(5,7,9), ROW(4,6,8) ORDER BY column_1 desc, column_0 desc limit ?" db-types="MySQL" scenario-types="db,tbl,dbtbl_with_readwrite_splitting,readwrite_splitting">
+        <assertion parameters="10:int" />
+    </test-case>

Review Comment:
   Until test cases support enabling for specific database version.



-- 
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] zihaoAK47 commented on pull request #26686: Fix values statement ClassCastException

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

   > Could you add `VALUES` statement to DQL E2E?
   
   Of course :blush: 
   Add VALUES statements in the shardingsphere-test-e2e-sql module? Can you give me some guidance? Thank you very much


-- 
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 pull request #26686: Fix values statement ClassCastException

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

   You can try clicking `sync fork` in https://github.com/zihaoAK47/shardingsphere/tree/dev_values to update codes and triggering checking again.
   
   ![image](https://github.com/apache/shardingsphere/assets/20503072/4c534da3-a229-427c-a1db-001d20d86d90)
   


-- 
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] zihaoAK47 commented on pull request #26686: Fix values statement ClassCastException

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

   @TeslaCN Please review thank.


-- 
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 #26686: Fix values statement ClassCastException

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


##########
test/e2e/sql/src/test/resources/cases/dql/dql-integration-select-expression.xml:
##########
@@ -117,4 +117,12 @@
     <test-case sql="SELECT n.nspname as &quot;Schema&quot;, c.relname as &quot;Name&quot;, CASE c.relkind WHEN 'r' THEN 'table' WHEN 'v' THEN 'view' WHEN 'i' THEN 'index' WHEN 'I' THEN 'global partition index' WHEN 'S' THEN 'sequence' WHEN 'L' THEN 'large sequence' WHEN 'f' THEN 'foreign table' WHEN 'm' THEN 'materialized view'  WHEN 'e' THEN 'stream' WHEN 'o' THEN 'contview' END as &quot;Type&quot;, pg_catalog.pg_get_userbyid(c.relowner) as &quot;Owner&quot;, c.reloptions as &quot;Storage&quot; FROM pg_catalog.pg_class c LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace WHERE c.relkind IN ('r','v','m','S','L','f','e','o','') AND n.nspname &lt;&gt; 'pg_catalog' AND n.nspname &lt;&gt; 'db4ai' AND n.nspname &lt;&gt; 'information_schema' AND n.nspname !~ '^pg_toast' AND c.relname not like 'matviewmap\_%' AND c.relname not like 'mlog\_%' AND pg_catalog.pg_table_is_visible(c.oid) ORDER BY 1,2;" db-types="openGauss" scenario-types="db,tbl">
         <assertion expected-data-file="select_sys_data_for_og.xml" />
     </test-case>
+
+    <test-case sql="VALUES ROW(1,1)" db-types="MySQL" scenario-types="db,tbl,dbtbl_with_readwrite_splitting,readwrite_splitting">
+        <assertion />
+    </test-case>
+
+    <test-case sql="VALUES ROW(1,-2,3), ROW(5,7,9), ROW(4,6,8) ORDER BY column_1 desc, column_0 desc limit ?" db-types="MySQL" scenario-types="db,tbl,dbtbl_with_readwrite_splitting,readwrite_splitting">
+        <assertion parameters="10:int" />
+    </test-case>

Review Comment:
   Maybe we need to comment this lines because these cases require MySQL 8.0.19.



-- 
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 pull request #26686: Fix values statement ClassCastException

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

   Could you add `VALUES` statement to DQL E2E?


-- 
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 #26686: Fix values statement ClassCastException

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


##########
test/e2e/sql/src/test/resources/cases/dql/dql-integration-select-expression.xml:
##########
@@ -117,4 +117,12 @@
     <test-case sql="SELECT n.nspname as &quot;Schema&quot;, c.relname as &quot;Name&quot;, CASE c.relkind WHEN 'r' THEN 'table' WHEN 'v' THEN 'view' WHEN 'i' THEN 'index' WHEN 'I' THEN 'global partition index' WHEN 'S' THEN 'sequence' WHEN 'L' THEN 'large sequence' WHEN 'f' THEN 'foreign table' WHEN 'm' THEN 'materialized view'  WHEN 'e' THEN 'stream' WHEN 'o' THEN 'contview' END as &quot;Type&quot;, pg_catalog.pg_get_userbyid(c.relowner) as &quot;Owner&quot;, c.reloptions as &quot;Storage&quot; FROM pg_catalog.pg_class c LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace WHERE c.relkind IN ('r','v','m','S','L','f','e','o','') AND n.nspname &lt;&gt; 'pg_catalog' AND n.nspname &lt;&gt; 'db4ai' AND n.nspname &lt;&gt; 'information_schema' AND n.nspname !~ '^pg_toast' AND c.relname not like 'matviewmap\_%' AND c.relname not like 'mlog\_%' AND pg_catalog.pg_table_is_visible(c.oid) ORDER BY 1,2;" db-types="openGauss" scenario-types="db,tbl">
         <assertion expected-data-file="select_sys_data_for_og.xml" />
     </test-case>
+
+    <test-case sql="VALUES ROW(1,1)" db-types="MySQL" scenario-types="db,tbl,dbtbl_with_readwrite_splitting,readwrite_splitting">
+        <assertion />
+    </test-case>
+
+    <test-case sql="VALUES ROW(1,-2,3), ROW(5,7,9), ROW(4,6,8) ORDER BY column_1 desc, column_0 desc limit ?" db-types="MySQL" scenario-types="db,tbl,dbtbl_with_readwrite_splitting,readwrite_splitting">
+        <assertion parameters="10:int" />
+    </test-case>

Review Comment:
   Maybe we need to comment these lines because these cases require MySQL 8.0.19.



-- 
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] zihaoAK47 commented on pull request #26686: Fix values statement ClassCastException

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

   @TeslaCN 
   Hi mentor, there has been an unknown CI error. I have completed the modifications
   
   `
   Error:  Failed to execute goal on project shardingsphere-test-e2e-sql: Could not resolve dependencies for project org.apache.shardingsphere:shardingsphere-test-e2e-sql:jar:5.3.3-SNAPSHOT: Could not find artifact org.apache.shardingsphere:shardingsphere-test-e2e-env:jar:tests:5.3.3-SNAPSHOT in apache.snapshots (https://repository.apache.org/snapshots) -> [Help 1]
   Error:  
   Error:  To see the full stack trace of the errors, re-run Maven with the -e switch.
   Error:  Re-run Maven using the -X switch to enable full debug logging.
   Error:  
   Error:  For more information about the errors and possible solutions, please read the following articles:
   Error:  [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
   Error: Process completed with exit code 1.
   `


-- 
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] zihaoAK47 commented on pull request #26686: Fix values statement ClassCastException

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

   > You can try clicking `sync fork` in https://github.com/zihaoAK47/shardingsphere/tree/dev_values to update codes and triggering checking again.
   > 
   > ![image](https://user-images.githubusercontent.com/20503072/249987082-4c534da3-a229-427c-a1db-001d20d86d90.png)
   
   Thank you very much for your guidance, ci has passed


-- 
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 #26686: Fix values statement ClassCastException

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


##########
parser/sql/dialect/mysql/src/main/antlr4/imports/mysql/DMLStatement.g4:
##########
@@ -231,7 +231,7 @@ tableStatement
     ;
 
 tableValueConstructor
-    : VALUES rowConstructorList
+    : VALUES rowConstructorList orderByClause? limitClause?

Review Comment:
   MySQL may not implement the "VALUES" statement in this way.
   https://github.com/mysql/mysql-server/blob/1bfe02bdad6604d54913c62614bde57a055c8332/sql/sql_yacc.yy#L10051-L10056



-- 
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 #26686: Fix values statement ClassCastException

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


-- 
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] zihaoAK47 commented on pull request #26686: Fix values statement ClassCastException

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

   @TeslaCN Thank you for your guidance. I have completed the modifications. Please review


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