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

[GitHub] [shardingsphere] peilinqian opened a new issue, #24619: In the federation scenario, it is not supported to use char (10) field as a filter condition to query view.

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

   ### Which version of ShardingSphere did you use?
   ShardingSphere-5.3.1
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-Proxy
   ### Expected behavior
   In the federation scenario, it is supported to use char (10) field as a filter condition to query view.
   ### Actual behavior
   In the federation scenario, it is not supported to use char (10) field as a filter condition to query view.
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   ```
   drop view if exists t_view ;
   drop table if exists t_table;
   --create table
   create table t_table(id int,c_id int,a int,b char(10));
   select pg_sleep(1);
   insert into t_table values (1,1,10,'test11'),(1,2,10,'Test12'),(1,2,null,'test12'),
   (2,1,20,'test21'),(2,2,20,'test22'),(2,3,null,'Test22'),
   (3,3,null,'test3'),(3,3,null,'test3'),(3,1,null,'test31'),(4,4,40,'test4'),(5,5,50,'Test5');
   --create view
   create or replace view t_view as select id,c_id,a,b from t_ssdb_tb;
   --select view with char field
   select * from t_view where b='test11';
   --select table with char field
   select * from t_table where b='test11';
   ```
   
   ```
   test_db=> drop view if exists t_view ;
   DROP VIEW
   test_db=> drop table if exists t_table;
   DROP TABLE
   test_db=> --create table
   test_db=> create table t_table(id int,c_id int,a int,b char(10));
   CREATE TABLE
   test_db=> select pg_sleep(1);
    pg_sleep
   ----------
   
   (1 row)
   
   test_db=> insert into t_table values (1,1,10,'test11'),(1,2,10,'Test12'),(1,2,null,'test12'),
   test_db-> (2,1,20,'test21'),(2,2,20,'test22'),(2,3,null,'Test22'),
   test_db-> (3,3,null,'test3'),(3,3,null,'test3'),(3,1,null,'test31'),(4,4,40,'test4'),(5,5,50,'Test5');
   INSERT 0 11
   test_db=> --create view
   test_db=> create or replace view t_view as select id,c_id,a,b from t_ssdb_tb;
   CREATE VIEW
   test_db=> --select view with char field         **---error**
   test_db=> select * from t_view where b='test11';
    id | c_id | a | b
   ----+------+---+---
   (0 rows)
   
   test_db=> --select table with char field
   test_db=> select * from t_table where b='test11';
    id | c_id | a  |     b
   ----+------+----+------------
     1 |    1 | 10 | test11
   (1 row)
   
   test_db=>
   ```
   
   
   ### 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 #24619: In the federation scenario, it is not supported to use char (10) field as a filter condition to query view.

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

   Hi @peilinqian, I have test it with master branch, this sql can execute successfully.
   
   ```sql
   sharding_db=> sharding_db=>
   sharding_db=> drop view if exists t_view ;
   DROP VIEW
   sharding_db=> drop table if exists t_table;
   DROP TABLE
   sharding_db=> create table t_table(id int,c_id int,a int,b char(10));
   CREATE TABLE
   sharding_db=>
   sharding_db=> insert into t_table values (1,1,10,'test11'),(1,2,10,'Test12'),(1,2,null,'test12'),
   sharding_db->
   sharding_db-> (2,1,20,'test21'),(2,2,20,'test22'),(2,3,null,'Test22'),
   sharding_db-> (3,3,null,'test3'),(3,3,null,'test3'),(3,1,null,'test31'),(4,4,40,'test4'),(5,5,50,'Test5');
   INSERT 0 11
   sharding_db=> create or replace view t_view as select id,c_id,a,b from t_ssdb_tb;
   ERROR:  relation "t_ssdb_tb" does not exist on gaussdb
   LINE 1: ...or replace view t_view as select id,c_id,a,b from t_ssdb_tb;
                                                                ^
   sharding_db=> create or replace view t_view as select id,c_id,a,b from t_ssdb_tb;
   ERROR:  relation "t_ssdb_tb" does not exist on gaussdb
   LINE 1: ...or replace view t_view as select id,c_id,a,b from t_ssdb_tb;
                                                                ^
   sharding_db=> create or replace view t_view as select id,c_id,a,b from t_ssdb_tb;
   ERROR:  relation "t_ssdb_tb" does not exist on gaussdb
   LINE 1: ...or replace view t_view as select id,c_id,a,b from t_ssdb_tb;
                                                                ^
   sharding_db=> create or replace view t_view as select id,c_id,a,b from t_table;
   CREATE VIEW
   sharding_db=> select * from t_view where b='test11';
    id | c_id | a  |     b
   ----+------+----+------------
     1 |    1 | 10 | test11
   (1 row)
   
   sharding_db=> select * from t_table where b='test11';
    id | c_id | a  |     b
   ----+------+----+------------
     1 |    1 | 10 | test11
   (1 row)
   ```


-- 
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 issue #24619: In the federation scenario, it is not supported to use char (10) field as a filter condition to query view.

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

   @peilinqian Thank you for your feedback, I will investigate this issue.


-- 
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 issue #24619: In the federation scenario, it is not supported to use char (10) field as a filter condition to query view.

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

   Since this exception can not be reproduced, I will close it now. If you have any question, please submit new issues.


-- 
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 closed issue #24619: In the federation scenario, it is not supported to use char (10) field as a filter condition to query view.

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu closed issue #24619: In the federation scenario, it is not supported to use char (10) field as a filter condition to query view.
URL: https://github.com/apache/shardingsphere/issues/24619


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