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 2021/08/24 07:51:15 UTC

[GitHub] [shardingsphere] Comven opened a new issue #11978: The primary key is auto filled without configuring the snowflake ID

Comven opened a new issue #11978:
URL: https://github.com/apache/shardingsphere/issues/11978


   ## Bug Report
   
   shardingsphere-jdbc-core 5.0.0-beta
   
   logistic table 'order_info' divided by month,format just like  'order_info_yyyyMM',
   
   where I configured the actual node as `db1.order_info_20210${6..9},db1.order_info_2021${10..12}`, Executed SQL like this
   ```
   ==>  Preparing: insert into order_info ( order_no, user_id, add_time ) values ( ?, ?, ? )
   ==> Parameters: 20210824152041814(String), 张三(String), 2021-08-24 15:20:41.818(Timestamp)
   ```
   The actual SQL executed is like this
   ```
   Actual SQL: db1 ::: insert into order_info_202108
            ( order_no,
               
               
                   user_id,
               
               
                   add_time ) 
            values (?, ?, ?) ::: [20210824152041814, 张三, 2021-08-24 15:20:41.818]
   ```
   it's right。
   
   when I changed the actual node as `db1.order_info_20${21..25}0${1..9},db1.order_info_20${21..25}${10..12}`, Executed SQL like this
   ```
   ==>  Preparing: insert into order_info ( order_no, user_id, add_time ) values ( ?, ?, ? )
   ==> Parameters: 20210824152136055(String), 张三(String), 2021-08-24 15:21:36.058(Timestamp)
   ```
   But the actual SQL executed is like this
   ```
   Actual SQL: db1 ::: insert into order_info_202108
            ( order_no,
               
               
                   user_id,
               
               
                   add_time , id) 
            values (?, ?, ?, ?) ::: [20210824152136055, 张三, 2021-08-24 15:21:36.058, 636947412484620288]
   ```
   
   No other code changed,the  field `id` is automatically generated with snowflake. but we don't want to be like this. What's the reason ?
   By the way, we configured the shardingsphere by JAVA API instead of using properties or yaml.
   


-- 
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] Comven closed issue #11978: The primary key is auto filled without configuring the snowflake ID

Posted by GitBox <gi...@apache.org>.
Comven closed issue #11978:
URL: https://github.com/apache/shardingsphere/issues/11978


   


-- 
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] zjcnb edited a comment on issue #11978: The primary key is auto filled without configuring the snowflake ID

Posted by GitBox <gi...@apache.org>.
zjcnb edited a comment on issue #11978:
URL: https://github.com/apache/shardingsphere/issues/11978#issuecomment-904608427


   @Comven Hi, I think this question fixed at master branch. Can you use latest code try it? 


-- 
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] Comven commented on issue #11978: The primary key is auto filled without configuring the snowflake ID

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


   @zjcnb OK  TKS


-- 
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] zjcnb commented on issue #11978: The primary key is auto filled without configuring the snowflake ID

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


   @Comven Hi, Can you provider your part of code. It will automatically rewrite sql and append the id column If you used snowflake


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