Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for evalSQLLike (0.08 sec)

  1. internal/s3select/sql/stringfuncs_test.go

    		{`a%__%\`, `a\%\_\__`, '\\', false, nil},
    		{`a%__%\`, `a\%\_\_%`, '\\', true, nil},
    		{`a%__%\`, `a?%?_?_?%\`, '?', true, nil},
    	}
    
    	for i, tc := range evalCases {
    		// fmt.Println("Case:", i)
    		res, err := evalSQLLike(tc.iText, tc.iPat, tc.iEsc)
    		if res != tc.matchExpected || err != tc.errExpected {
    			t.Errorf("Eval Case %d failed: %v %v", i, res, err)
    		}
    	}
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Jun 01 21:59:40 UTC 2021
    - 3.1K bytes
    - Viewed (0)
  2. internal/s3select/sql/stringfuncs.go

    	errInvalidSubstringIndexLen = errors.New("Substring start index or length falls outside the string")
    )
    
    const (
    	percent    rune = '%'
    	underscore rune = '_'
    	runeZero   rune = 0
    )
    
    func evalSQLLike(text, pattern string, escape rune) (match bool, err error) {
    	s := []rune{}
    	prev := runeZero
    	hasLeadingPercent := false
    	patLen := len([]rune(pattern))
    	for i, r := range pattern {
    		if i > 0 && prev == escape {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Jun 01 21:59:40 UTC 2021
    - 4.2K bytes
    - Viewed (0)
  3. internal/s3select/sql/evaluate.go

    			return nil, errLikeInvalidInputs(err)
    		}
    
    		if len([]rune(escapeStr)) > 1 {
    			err := errLikeInvalidEscape
    			return nil, errLikeInvalidInputs(err)
    		}
    	}
    
    	matchResult, err := evalSQLLike(s, patternStr, escape)
    	if err != nil {
    		return nil, err
    	}
    
    	if e.Not {
    		matchResult = !matchResult
    	}
    
    	return FromBool(matchResult), nil
    }
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Sep 23 19:35:41 UTC 2024
    - 12K bytes
    - Viewed (0)
Back to top