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/10/10 06:37:34 UTC

[GitHub] [shardingsphere] chenzhikun12 opened a new issue, #19235: Keygenerators configured but not effective

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

   ### Which version of ShardingSphere did you use?
          shardingsphere-jdbc-core-spring-boot-starter-5.1.2
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
          shardingsphere-jdbc
   ### Expected behavior
          When inserting data into the database, sharding JDBC automatically generates the ID and successfully inserts it
   ### Actual behavior
          When inserting data in the databse,  the system throw exception:  Field 'id' doesn't have a default value
   ### Reason analyze (If you can)
           Maybe my configuration is not effective, but my configuration is based on the example
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
          `server.port=8888
           spring.main.allow-bean-definition-overriding=true
           spring.application.name=sharding-sphere-demo
           spring.shardingsphere.datasource.names=ds0
           spring.shardingsphere.datasource.ds0.url=jdbc:mysql://192.168.20.177/sharding_demo?useSSL=false&serverTimezone=UTC
           spring.shardingsphere.datasource.ds0.type=com.alibaba.druid.pool.DruidDataSource
           spring.shardingsphere.datasource.ds0.driver-class-name=com.mysql.cj.jdbc.Driver
           spring.shardingsphere.datasource.ds0.username=root
           spring.shardingsphere.datasource.ds0.password=
           spring.shardingsphere.mode.type=Memory
           spring.shardingsphere.rules.sharding.binding-tables=admin_email
           spring.shardingsphere.rules.sharding.sharding-algorithms.eat-auto-interval.type=auto_interval
           spring.shardingsphere.rules.sharding.sharding-algorithms.eat-auto-interval.props.datetime-lower=2022-06-01 00:00:00
           spring.shardingsphere.rules.sharding.sharding-algorithms.eat-auto-interval.props.datetime-upper=2022-09-01 00:00:00
           spring.shardingsphere.rules.sharding.sharding-algorithms.eat-auto-interval.props.sharding-seconds=2592000
           spring.shardingsphere.rules.sharding.auto-tables.admin_email.sharding-strategy.standard.sharding-column=created_at
           spring.shardingsphere.rules.sharding.auto-tables.admin_email.sharding-strategy.standard.sharding-algorithm-name=eat-auto-interval
           spring.shardingsphere.rules.sharding.auto-tables.admin_email.key-generate-strategy.column=id
           spring.shardingsphere.rules.sharding.auto-tables.admin_email.key-generate-strategy.key-generator-name=snowflake
           spring.shardingsphere.rules.sharding.auto-tables.admin_email.actualDataSources=ds0
           spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
           spring.shardingsphere.props.sql.show=true
           mybatis.type-aliases-package=com.example.eatshardingsphere.admin.mapper
           mybatis.mapper-locations=classpath:mapper/*.xml,classpath*:sdk/mapper/*.xml
           mybatis.configuration.map-underscore-to-camel-case=true
           mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl `
   
   ## My excute sql ##
   insert into admin_email(`email`, `type`, `created_at`) value (#{email.email}, #{email.type}, #{email.createdAt})
   
   ![image](https://user-images.githubusercontent.com/33413445/179190170-fda59ae3-383b-4799-9075-8745142029d0.png)
   
   ### 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] chenzhikun12 commented on issue #19235: Keygenerators configured but not effective

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

   > Can you use text to show your log? It is difficult to copy, search and investigate.
   
   Sorry, this problem has been solved. it should be that I confused the configuration items of the old version and the new version


-- 
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] terrymanu commented on issue #19235: Keygenerators configured but not effective

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

   Can you provide the `sql-show` log?


-- 
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] github-actions[bot] closed issue #19235: Keygenerators configured but not effective

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #19235: Keygenerators configured but not effective
URL: https://github.com/apache/shardingsphere/issues/19235


-- 
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] terrymanu commented on issue #19235: Keygenerators configured but not effective

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

   Can you use text to show your log? It is different to copy, search and investigate.


-- 
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] TeslaCN closed issue #19235: Keygenerators configured but not effective

Posted by GitBox <gi...@apache.org>.
TeslaCN closed issue #19235: Keygenerators configured but not effective
URL: https://github.com/apache/shardingsphere/issues/19235


-- 
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] chenzhikun12 commented on issue #19235: Keygenerators configured but not effective

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

   ![image](https://user-images.githubusercontent.com/33413445/179432314-b374260f-1237-404f-bb85-e841a9357143.png)
   


-- 
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] github-actions[bot] commented on issue #19235: Keygenerators configured but not effective

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #19235:
URL: https://github.com/apache/shardingsphere/issues/19235#issuecomment-1272349351

   Hello , this issue has not received a reply for several days.
   This issue is supposed to be closed.


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