MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / checkStrictEmpty

Method checkStrictEmpty

pkg/sql/parser/parser.go:829–838  ·  view source on GitHub ↗

checkStrictEmpty returns an error if strict mode is enabled and no statements were parsed. This consolidates the repeated strict empty-statement check pattern.

()

Source from the content-addressed store, hash-verified

827// checkStrictEmpty returns an error if strict mode is enabled and no statements were parsed.
828// This consolidates the repeated strict empty-statement check pattern.
829func (p *Parser) checkStrictEmpty() error {
830 if p.strict {
831 return goerrors.InvalidSyntaxError(
832 "empty statement not allowed in strict mode",
833 p.currentLocation(),
834 "provide at least one SQL statement",
835 )
836 }
837 return nil
838}
839
840// checkStrictEmptySemicolon returns an error if strict mode is enabled and a bare semicolon is encountered.
841func (p *Parser) checkStrictEmptySemicolon() error {

Callers 1

parseTokensMethod · 0.95

Calls 1

currentLocationMethod · 0.95

Tested by

no test coverage detected