session: fix the bug that may cause upgrading from v4.0.10 fail (#22448)
session: fix the bug that may cause upgrading from v4.0.10 fail (#22448)

 
c4pt0r/tidb,kyle-wang/tidb,c4pt0r/tidb,coocood/tidb,pingcap/tidb,pingcap/tidb,pingcap/tidb,ngaut/tidb,ngaut/tidb,c4pt0r/tidb,kyle-wang/tidb,pingcap/tidb,ngaut/tidb,kyle-wang/tidb,ngaut/tidb,pingcap/tidb,ngaut/tidb,kyle-wang/tidb,kyle-wang/tidb,coocood/tidb,ngaut/tidb,c4pt0r/tidb,c4pt0r/tidb,kyle-wang/tidb,pingcap/tidb,c4pt0r/tidb