(rel *ast.FuncName)
| 44 | } |
| 45 | |
| 46 | func (s *Schema) getFuncByName(rel *ast.FuncName) (*Function, int, error) { |
| 47 | idx := -1 |
| 48 | name := strings.ToLower(rel.Name) |
| 49 | for i := range s.Funcs { |
| 50 | lowered := strings.ToLower(s.Funcs[i].Name) |
| 51 | if lowered == name && idx >= 0 { |
| 52 | return nil, -1, sqlerr.FunctionNotUnique(rel.Name) |
| 53 | } |
| 54 | if lowered == name { |
| 55 | idx = i |
| 56 | } |
| 57 | } |
| 58 | if idx < 0 { |
| 59 | return nil, -1, sqlerr.RelationNotFound(rel.Name) |
| 60 | } |
| 61 | return s.Funcs[idx], idx, nil |
| 62 | } |
| 63 | |
| 64 | func (s *Schema) getTable(rel *ast.TableName) (*Table, int, error) { |
| 65 | for i := range s.Tables { |
no test coverage detected