Skip to content

Commit 82200a5

Browse files
authored
Add assertion for RowDescription in slice deploy (#1604)
1 parent 8adb22a commit 82200a5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

router/relay/executor.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,8 +727,12 @@ func (s *QueryStateExecutorImpl) ExecuteSlice(qd *QueryDesc, mgr meta.EntityMgr,
727727
}
728728
}
729729

730+
/* XXX: refactor this */
731+
expectRowDesc := false
732+
730733
switch qd.Msg.(type) {
731734
case *pgproto3.Query:
735+
expectRowDesc = true
732736
// ok
733737
case *pgproto3.Sync:
734738
// ok
@@ -798,6 +802,17 @@ func (s *QueryStateExecutorImpl) ExecuteSlice(qd *QueryDesc, mgr meta.EntityMgr,
798802
return err
799803
}
800804
}
805+
case *pgproto3.RowDescription:
806+
if expectRowDesc {
807+
if replyCl {
808+
err = s.Client().Send(msg)
809+
if err != nil {
810+
return err
811+
}
812+
}
813+
} else {
814+
return fmt.Errorf("unexpected row description in slice deploy")
815+
}
801816
default:
802817

803818
if replyCl {

0 commit comments

Comments
 (0)