plancodec: fix a miss case in conversion (#35957)

close pingcap/tidb#35956
This commit is contained in:
Zhenchi
2022-07-05 17:43:01 +08:00
committed by GitHub
parent 0483c4c7f6
commit d617ba2a82
2 changed files with 8 additions and 0 deletions

View File

@ -394,6 +394,8 @@ func PhysicalIDToTypeString(id int) string {
return TypeBatchPointGet
case typeClusterMemTableReader:
return TypeClusterMemTableReader
case typeDataSourceID:
return TypeDataSource
case typeLoadDataID:
return TypeLoadData
case typeTableSampleID:

View File

@ -87,3 +87,9 @@ func TestPlanIDChanged(t *testing.T) {
require.Equal(t, testcase.Expected, testcase.Value)
}
}
func TestReverse(t *testing.T) {
for i := 1; i <= 55; i++ {
require.Equal(t, TypeStringToPhysicalID(PhysicalIDToTypeString(i)), i)
}
}