@@ -667,7 +667,7 @@ func TestActionInfoWithTabletAlias(t *testing.T) {
667667 assert .Equal (t , tabletAlias , info .alias )
668668 })
669669
670- t .Run ("existing transaction with tablet alias" , func (t * testing.T ) {
670+ t .Run ("existing transaction with different tablet alias errors " , func (t * testing.T ) {
671671 session := econtext .NewSafeSession (& vtgatepb.Session {
672672 InTransaction : true ,
673673 ShardSessions : []* vtgatepb.Session_ShardSession {{
@@ -676,15 +676,11 @@ func TestActionInfoWithTabletAlias(t *testing.T) {
676676 TabletAlias : & topodatapb.TabletAlias {Cell : "zone1" , Uid : 50 },
677677 }},
678678 })
679- session .SetTargetTabletAlias (tabletAlias )
679+ session .SetTargetTabletAlias (tabletAlias ) // zone1-100, different from zone1-50
680680
681- info , shardSession , err := actionInfo (ctx , target , session , false , vtgatepb .TransactionMode_MULTI )
682- require .NoError (t , err )
683- assert .NotNil (t , shardSession )
684- assert .Equal (t , int64 (12345 ), info .transactionID )
685- assert .Equal (t , nothing , info .actionNeeded )
686- // Tablet alias should be overridden
687- assert .Equal (t , tabletAlias , info .alias )
681+ _ , _ , err := actionInfo (ctx , target , session , false , vtgatepb .TransactionMode_MULTI )
682+ require .Error (t , err )
683+ require .Contains (t , err .Error (), "cannot change tablet target mid-transaction" )
688684 })
689685
690686 t .Run ("no tablet alias - existing behavior" , func (t * testing.T ) {
0 commit comments