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/04/07 08:14:28 UTC

[GitHub] [shardingsphere] azexcy opened a new issue, #16634: PostgreSQL grammar of DROP INDEX IF EXISTS

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

   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   
   master b5435f0fcd2ed6d65854e608425b659daa590d30 
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ShardingSphere-Proxy
   
   ### Expected behavior
   
   support PostgreSQL grammar of `DROP INDEX IF EXISTS `, such as 
   `DROP INDEX IF EXISTS public.t_order_status_idx_t_order`
   
   ### Actual behavior
   
   <img width="1090" alt="image" src="https://user-images.githubusercontent.com/101622833/162151773-56998896-d161-467b-a87a-5f7ab332303c.png">
   
   
   ```
   四月 07, 2022 4:06:03 下午 com.google.common.eventbus.EventBus$LoggingHandler handleException
   严重: Exception thrown by subscriber method update(org.apache.shardingsphere.infra.metadata.schema.event.SchemaAlteredEvent) on subscriber org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.metadata.subscriber.SchemaMetaDataRegistrySubscriber@5f9b2141 when dispatching event: org.apache.shardingsphere.infra.metadata.schema.event.SchemaAlteredEvent@56f533a1
   java.lang.NullPointerException
   	at org.apache.shardingsphere.mode.metadata.persist.service.SchemaMetaDataPersistService.persist(SchemaMetaDataPersistService.java:68)
   	at org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.metadata.subscriber.SchemaMetaDataRegistrySubscriber.lambda$update$0(SchemaMetaDataRegistrySubscriber.java:45)
   	at java.util.ArrayList.forEach(ArrayList.java:1259)
   	at org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.metadata.subscriber.SchemaMetaDataRegistrySubscriber.update(SchemaMetaDataRegistrySubscriber.java:45)
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   	at java.lang.reflect.Method.invoke(Method.java:498)
   	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:87)
   	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:144)
   	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:72)
   	at com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:30)
   	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:67)
   	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:108)
   	at com.google.common.eventbus.EventBus.post(EventBus.java:212)
   	at org.apache.shardingsphere.infra.context.refresher.type.DropIndexStatementSchemaRefresher.post(DropIndexStatementSchemaRefresher.java:89)
   ```
   
   ### Reason analyze (If you can)
   
   at `DropIndexStatementHandler.getSimpleTableSegment()`, it's seems  no handled `PostgreSQLDropIndexStatement` 
   
   ```
       /**
        * Get simple table segment.
        *
        * @param dropIndexStatement drop index statement
        * @return simple table segment
        */
       public static Optional<SimpleTableSegment> getSimpleTableSegment(final DropIndexStatement dropIndexStatement) {
           if (dropIndexStatement instanceof MySQLStatement) {
               return ((MySQLDropIndexStatement) dropIndexStatement).getTable();
           }
           if (dropIndexStatement instanceof SQLServerStatement) {
               return ((SQLServerDropIndexStatement) dropIndexStatement).getTable();
           }
           return Optional.empty();
       }
   ```
   
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   
   
   ### 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] tuichenchuxin closed issue #16634: PostgreSQL grammar of DROP INDEX IF EXISTS

Posted by GitBox <gi...@apache.org>.
tuichenchuxin closed issue #16634: PostgreSQL grammar of DROP INDEX IF EXISTS
URL: https://github.com/apache/shardingsphere/issues/16634


-- 
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 #16634: PostgreSQL grammar of DROP INDEX IF EXISTS

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

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