shardingsphere icon indicating copy to clipboard operation
shardingsphere copied to clipboard

View column type null leads to NPE

Open irwinai opened this issue 2 years ago • 1 comments

Bug Report

Which version of ShardingSphere did you use?

5.0.0 OR 5.1.1

Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?

ShardingSphere-JDBC

Expected behavior

load column meta data

Actual behavior

NPE

Reason analyze (If you can)

1.ColumnMetaData dataType type is int,I think should be Integer 2.SchemaMetaDataLoader#loadAllTableNames load view

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

1.create view such as ,so the information_schema.columns data_type can get null

 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`1.1.1.1` SQL SECURITY DEFINER VIEW `v_test` (
   `type`) AS
SELECT
 NULL AS `type`,
FROM
 `test` AS `f`

2.start project so you can get the NPE

Example codes for reproduce this issue (such as a github link).

irwinai avatar Sep 22 '22 07:09 irwinai

@irwinai Thank you for your feedback. Can you submit a pr to fix this bug?

strongduanmu avatar Sep 22 '22 09:09 strongduanmu

@irwinai Thank you for your feedback. Can you submit a pr to fix this bug?

I had communicate with zhang liang,this view null problem I had add issue to TIDB

irwinai avatar Sep 26 '22 11:09 irwinai

you can close this issue,thanks

irwinai avatar Sep 26 '22 11:09 irwinai