diff --git a/parser/lexer.go b/parser/lexer.go index 526ed2eb74ede..dcfae1d1f5f54 100644 --- a/parser/lexer.go +++ b/parser/lexer.go @@ -101,7 +101,7 @@ func (s *Scanner) reset(sql string) { s.stmtStartPos = 0 s.inBangComment = false s.lastKeyword = 0 - s.identifierDot = true + s.identifierDot = false } func (s *Scanner) stmtText() string { diff --git a/parser/parser_test.go b/parser/parser_test.go index 8e6184ca316b9..3857cba90f60a 100644 --- a/parser/parser_test.go +++ b/parser/parser_test.go @@ -7398,7 +7398,7 @@ func TestIssue45898(t *testing.T) { restoreCtx := NewRestoreCtx(DefaultRestoreFlags, &sb) sb.Reset() stmts[0].Restore(restoreCtx) - require.Equal(t, sb.String(), "SELECT COUNT(1) FROM `t`") + require.Equal(t, "SELECT COUNT(1) FROM `t`", sb.String()) } func TestMultiStmt(t *testing.T) {