optimizer: Fix a bug in resolve having identifier
optimizer: Fix a bug in resolve having identifier

Fix sqllogic test failure

8cbx/tidb,pingcap/tidb,c4pt0r/tidb,andelf/tidb,louishust/tidb,gaocegege/tidb,zs634134578/tidb,qiuyesuifeng/tidb,pingcap/tidb,ueizhou/tidb,liyu4/tidb,yangwenmai/tidb,tiancaiamao/tidb,astaxie/tidb,ngaut/tidb,ming-relax/tidb,yangwenmai/tidb,ngaut/tidb,ueizhou/tidb,simon-xia/tidb,liyu4/tidb,silentred/tidb,c4pt0r/tidb,EvilMcJerkface/tidb,wusphinx/tidb,ngaut/tidb,XuHuaiyu/tidb,anywhy/tidb,yuanwhy/tidb,anywhy/tidb,zs634134578/tidb,EvilMcJerkface/tidb,ngaut/tidb,pingcap/tidb,kyle-wang/tidb,mccxj/tidb,silenceper/tidb,c4pt0r/tidb,cosmtrek/tidb,pingcap/tidb,yuanwhy/tidb,coocood/tidb,kyle-wang/tidb,pingcap/tidb,CodeRushing/tidb,CodeRushing/tidb,cosmtrek/tidb,c4pt0r/tidb,Cofyc/tidb,louishust/tidb,8cbx/tidb,Nify/tidb,kyle-wang/tidb,silentred/tidb,Cofyc/tidb,pingcap/tidb,qhsong/tidb,astaxie/tidb,c4pt0r/tidb,qhsong/tidb,kyle-wang/tidb,andelf/tidb,JinheLin/tidb,ngaut/tidb,ming-relax/tidb,qiuyesuifeng/tidb,zimulala/tidb,gaocegege/tidb,c4pt0r/tidb,mccxj/tidb,myrice/tidb,wusphinx/tidb,coocood/tidb,kyle-wang/tidb,ngaut/tidb,simon-xia/tidb,zimulala/tidb,JinheLin/tidb,tiancaiamao/tidb,XuHuaiyu/tidb,kyle-wang/tidb,spongedu/tidb,myrice/tidb,silenceper/tidb,Nify/tidb,spongedu/tidb