question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why does the INSERT SQL have no routing

See original GitHub issue

Question

sql:
INSERT INTO LDPerson(PersonID,CustomerNo,Name,Sex,Birthday,IDType,IDNo,Password,NativePlace,Nationality,RgtAddress,Marriage,MarriageDate,Health,Stature,Avoirdupois,Degree,CreditGrade,OthIDType,OthIDNo,ICNo,GrpNo,JoinCompanyDate,StartWorkDate,Position,Salary,OccupationType,OccupationCode,WorkType,PluralityType,DeathDate,SmokeFlag,BlacklistFlag,Proterty,Remark,State,VIPValue,Operator,MakeDate,MakeTime,ModifyDate,ModifyTime,GrpName,License,LicenseType,IDValidate,Socialinsuno) VALUES(101802,'12323123' ,'jason', 0 ,'1999-01-01',0, '22232223' , null , null , null , null , null , null , null , 0.0 , 0.0 , null , null , null , null , null , null , null , null , null , 0.0 , null , null , null , null , null , null , null , null , null , '1' , null , 'cbs' , '2019-12-30' , '18:26:52' , '2019-12-30' , '18:26:52' , null , null , null , null , null); sharding-config: LDPerson:   actualDataNodes: ds${0…1}.LDPerson   databaseStrategy:     inline:       shardingColumn: PersonID       algorithmExpression: ds${PersonID % 2}

description:   No matter which field is used as the route key,the data exists in ds0 and ds1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
beijixicommented, Dec 31, 2019

version:4.0.0-RC1

sql.show: Logic SQL: INSERT INTO LDPerson(PersonID,CustomerNo,Name,Sex,Birthday,IDType,IDNo,Password,NativePlace,Nationality,RgtAddress,Marriage,MarriageDate,Health,Stature,Avoirdupois,Degree,CreditGrade,OthIDType,OthIDNo,ICNo,GrpNo,JoinCompanyDate,StartWorkDate,Position,Salary,OccupationType,OccupationCode,WorkType,PluralityType,DeathDate,SmokeFlag,BlacklistFlag,Proterty,Remark,State,VIPValue,Operator,MakeDate,MakeTime,ModifyDate,ModifyTime,GrpName,License,LicenseType,IDValidate,Socialinsuno) VALUES( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?)

SQLStatement: InsertStatement(super=DMLStatement(super=AbstractSQLStatement(type=DML, tables=Tables(tables=[Table(name=LDPerson, alias=Optional.absent())]), routeConditions=Conditions(orCondition=OrCondition(andConditions=[])), encryptConditions=Conditions(orCondition=OrCondition(andConditions=[])), sqlTokens=[TableToken(tableName=LDPerson, quoteCharacter=NONE, schemaNameLength=0)], parametersIndex=0, logicSQL=INSERT INTO LDPerson(PersonID,CustomerNo,Name,Sex,Birthday,IDType,IDNo,Password,NativePlace,Nationality,RgtAddress,Marriage,MarriageDate,Health,Stature,Avoirdupois,Degree,CreditGrade,OthIDType,OthIDNo,ICNo,GrpNo,JoinCompanyDate,StartWorkDate,Position,Salary,OccupationType,OccupationCode,WorkType,PluralityType,DeathDate,SmokeFlag,BlacklistFlag,Proterty,Remark,State,VIPValue,Operator,MakeDate,MakeTime,ModifyDate,ModifyTime,GrpName,License,LicenseType,IDValidate,Socialinsuno) VALUES( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?)), deleteStatement=false, updateTableAlias={}, updateColumnValues={}, whereStartIndex=0, whereStopIndex=0, whereParameterStartIndex=0, whereParameterEndIndex=0), columnNames=[], values=[])

Actual SQL: ds0 ::: INSERT INTO LDPerson(PersonID,CustomerNo,Name,Sex,Birthday,IDType,IDNo,Password,NativePlace,Nationality,RgtAddress,Marriage,MarriageDate,Health,Stature,Avoirdupois,Degree,CreditGrade,OthIDType,OthIDNo,ICNo,GrpNo,JoinCompanyDate,StartWorkDate,Position,Salary,OccupationType,OccupationCode,WorkType,PluralityType,DeathDate,SmokeFlag,BlacklistFlag,Proterty,Remark,State,VIPValue,Operator,MakeDate,MakeTime,ModifyDate,ModifyTime,GrpName,License,LicenseType,IDValidate,Socialinsuno) VALUES( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?) ::: [101901, 0000050380, Jason, 0, 1999-01-01T00:00:00.000+0800, 0, 212365432, null, null, null, null, null, null, null, 0.0, 0.0, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, 1, null, cbs, 2019-12-31T00:00:00.000+0800, 12:14:10, 2019-12-31T00:00:00.000+0800, 12:14:10, null, null, null, null, null]

Actual SQL: ds1 ::: INSERT INTO LDPerson(PersonID,CustomerNo,Name,Sex,Birthday,IDType,IDNo,Password,NativePlace,Nationality,RgtAddress,Marriage,MarriageDate,Health,Stature,Avoirdupois,Degree,CreditGrade,OthIDType,OthIDNo,ICNo,GrpNo,JoinCompanyDate,StartWorkDate,Position,Salary,OccupationType,OccupationCode,WorkType,PluralityType,DeathDate,SmokeFlag,BlacklistFlag,Proterty,Remark,State,VIPValue,Operator,MakeDate,MakeTime,ModifyDate,ModifyTime,GrpName,License,LicenseType,IDValidate,Socialinsuno) VALUES( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?) ::: [101901, 0000050380, Jason, 0, 1999-01-01T00:00:00.000+0800, 0, 212365432, null, null, null, null, null, null, null, 0.0, 0.0, null, null, null, null, null, null, null, null, null, 0.0, null, null, null, null, null, null, null, null, null, 1, null, cbs, 2019-12-31T00:00:00.000+0800, 12:14:10, 2019-12-31T00:00:00.000+0800, 12:14:10, null, null, null, null, null]

2reactions
terrymanucommented, Dec 31, 2019

What is your version? Can you provide your sql.show?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manufacturign Routing - using SQL insert statements - GPUG
I am trying to insert routing sequence entries using SQL. ... Normally, I do not insert Routing Headers directly into the RT010001 table....
Read more >
Solutions for INSERT OR UPDATE on SQL Server
Having said that, Using MERGE, or UPDATE then INSERT is easier on your server and less error prone since you don't have to...
Read more >
CREATE ROUTE (Transact-SQL) - SQL Server - Microsoft Learn
A route that matches any broker instance has higher priority for matching than routes with an explicit broker instance when the conversation ...
Read more >
Documentation: 15: INSERT - PostgreSQL
INSERT into tables that lack unique indexes will not be blocked by concurrent activity. Tables with unique indexes might block if concurrent sessions ......
Read more >
MySQL 8.0 Reference Manual :: 13.2.7 INSERT Statement
SELECT statements are handled the same way as multiple-row inserts because the server does not examine the result set from the SELECT to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found