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/09/29 03:39:36 UTC

[GitHub] [shardingsphere] c1258445690 opened a new issue, #21259: auto-unboxing NullPointerException

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

   ## Bug Report
   
   project: ShardingSphere-JDBC
   version: 5.2.0
   database: mysql-8.0.28
   
   ### reason
   In method org.apache.shardingsphere.infra.metadata.database.schema.loader.dialect.MySQLSchemaMetaDataLoader.loadColumnMetaData, 
   when a table contains column of linestring or geomcollection type, dataTypeMap.get(dataType) will return null which causes auto-unboxing NullPointerException
   
   ### Steps to reproduce the behavior
   ```sql
   CREATE TABLE `student_1` (
     `id` int NOT NULL,
     `name` varchar(255) DEFAULT NULL,
     `age` int DEFAULT NULL,
     PRIMARY KEY (`id`)
   );
   CREATE TABLE `student_2` (
     `id` int NOT NULL,
     `name` varchar(255) DEFAULT NULL,
     `age` int DEFAULT NULL,
     PRIMARY KEY (`id`)
   );
   CREATE TABLE `geom` (
     `a` geometry NOT NULL,
     `b` point DEFAULT NULL,
     `d` polygon DEFAULT NULL,
     `e` geomcollection DEFAULT NULL,
     `c` linestring DEFAULT NULL
   ) ;
   ```
   ```xml
   <dependency>
               <groupId>org.apache.shardingsphere</groupId>
               <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
               <version>5.2.0</version>
           </dependency>
           <dependency>
               <groupId>mysql</groupId>
               <artifactId>mysql-connector-java</artifactId>
               <scope>runtime</scope>
           </dependency>
           <dependency>
               <groupId>org.mybatis.spring.boot</groupId>
               <artifactId>mybatis-spring-boot-starter</artifactId>
               <version>2.2.2</version>
           </dependency>
   ```
   ``` properties
   spring:
     shardingsphere:
       datasource:
         names: ds_1, ds_2
         ds_1:
           type: com.zaxxer.hikari.HikariDataSource
           driverClassName: com.mysql.cj.jdbc.Driver
           jdbcUrl: jdbc:mysql://192.168.1.66:3306/test?useUnicode=true&allowMultiQueries=true&characterEncoding=utf-8&useSSL=false
           username: root
           password: Ebupt#2016
         ds_2:
           type: com.zaxxer.hikari.HikariDataSource
           driverClassName: com.mysql.cj.jdbc.Driver
           jdbcUrl: jdbc:mysql://192.168.7.65:3306/test?useUnicode=true&allowMultiQueries=true&characterEncoding=utf-8&useSSL=false
           username: root
           password: 6
       rules:
         sharding:
           tables:
             student:
               #YamlTableRuleConfiguration
               actual-data-nodes: ds_$->{1..2}.student_$->{1..2}
               key-generate-strategy:
                 column: id
                 key-generator-name: snowflake
               database-strategy:
                 standard:
                   sharding-column: id
                   sharding-algorithm-name: database-inline
               table-strategy:
                 standard:
                   sharding-column: id
                   sharding-algorithm-name: table-inline
           key-generators:
             snowflake:
               type:
                 SNOWFLAKE
           sharding-algorithms:
             database-inline:
               type: INLINE
               props:
                 algorithm-expression: ds_$->{id%2+1}
             table-inline:
               type: INLINE
               props:
                 algorithm-expression: student_$->{id%2+1}
       props:
         sql:
           show: true
   mybatis:
     mapper-locations:
       - mybatis-mapper/*.xml
   logging.level:
     com.example.shardingjdbcdemo: debug
   ```
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   


-- 
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] RaigorJiang commented on issue #21259: auto-unboxing NullPointerException

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

   Hi @c1258445690 
   Thanks for your feedback, we will investigate this problem.


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


Re: [I] auto-unboxing NullPointerException [shardingsphere]

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

   `shardingsphere-jdbc-core-spring-boot-starter` is deprecated and removed in 5.3.0, please try new version and use ShardingSphere Driver.


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


Re: [I] auto-unboxing NullPointerException [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu closed issue #21259: auto-unboxing NullPointerException
URL: https://github.com/apache/shardingsphere/issues/21259


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