fix sql parsing bug