MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / TestParsePanic

Function TestParsePanic

pkg/sql/parser/parse_test.go:2950–2973  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2948}
2949
2950func TestParsePanic(t *testing.T) {
2951 // Replicates #1801.
2952 defer func() {
2953 if r := recover(); r != nil {
2954 t.Fatal(r)
2955 }
2956 }()
2957 s := "SELECT(F(F(F(F(F(F(F" +
2958 "(F(F(F(F(F(F(F(F(F(F" +
2959 "(F(F(F(F(F(F(F(F(F(F" +
2960 "(F(F(F(F(F(F(F(F(F(F" +
2961 "(F(F(F(F(F(F(F(F(F(T" +
2962 "(F(F(F(F(F(F(F(F(F(F" +
2963 "(F(F(F(F(F(F(F(F(F(F" +
2964 "(F(F(F(F(F(F(F(F(F(F" +
2965 "(F(F(F(F(F(F(F(F(F(F" +
2966 "(F(F(F(F(F(F(F(F(F((" +
2967 "F(0"
2968 _, err := parser.Parse(s)
2969 expected := `at or near "EOF": syntax error`
2970 if !testutils.IsError(err, expected) {
2971 t.Fatalf("expected %s, but found %v", expected, err)
2972 }
2973}
2974
2975func TestParsePrecedence(t *testing.T) {
2976 // Precedence levels (highest first):

Callers

nothing calls this directly

Calls 2

ParseFunction · 0.92
IsErrorFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…