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

   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub 
issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere 
Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more 
details. 
   If no response anymore and we cannot reproduce it on current information, we 
will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   we find java version: java8, full_version=1.8.0_342, 
full_path=/home/peilq_sharding/bisheng-jdk1.8.0_342//bin/java
   ShardingSphere-5.2.1-SNAPSHOT
   Commit ID: dirty-4114e7ee4cbe5923c2b403a3e86d1f23355cadf3
   Commit Message: Fix parse exception when execute insert statement with 
negative value (https://github.com/apache/shardingsphere/pull/21197)
   Branch: 
https://github.com/apache/shardingsphere/commit/4114e7ee4cbe5923c2b403a3e86d1f23355cadf3
   Build time: 2022-09-27T16:37:07+0800
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ### Expected behavior
   When the alter view name command is executed, "ATLER VIEW" is returned, the 
alter is successful.
   ### Actual behavior
   When the alter view name command is executed, "ERROR: String index out of 
range: -1" is returned, but the alter is actually successful.
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   ```
   --create rules 
   create sharding broadcast table rules 
(t_broadcast,t_broadcast_view,t_broadcast_view_new);
   select pg_sleep(2);
   show sharding broadcast table rules;
   --create table
   create table t_broadcast(id int,c_id int,a int,b char(10));
   insert into t_broadcast 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'),(4,4,40,'test4'),(5,5,50,'');
   --create view
   show sharding broadcast table rules;
   create view t_broadcast_view as select * from t_broadcast;
   select * from t_broadcast_view where id=4;
   --alter view
   alter view t_broadcast_view rename to t_broadcast_view_new;  --error
   select pg_sleep(2);
   --teardown
   drop view if exists t_broadcast_view;
   drop view if exists t_broadcast_view_new;
   drop table if exists t_broadcast;
   drop sharding broadcast table rules;
   ```
   
   test_db=> --alter view
   test_db=> alter view t_broadcast_view rename to t_broadcast_view_new;
   ERROR:  String index out of range: -1
   test_db=> select pg_sleep(2);
    pg_sleep
   ----------
   
   (1 row)
   
   test_db=> select * from t_broadcast_view_new;
    id | c_id | a  |     b
   ----+------+----+------------
     1 |    1 | 10 | test11
     1 |    2 | 10 | Test12
     1 |    2 |    | test12
     2 |    1 | 20 | test21
     2 |    2 | 20 | test22
     2 |    3 |    | Test22
     3 |    3 |    | test3
     3 |    3 |    | test3
     4 |    4 | 40 | test4
     5 |    5 | 50 |
   (10 rows)
   
   ### 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: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to