loadFunction loads the given function
(ctx *sql.Context, id uint32)
| 109 | |
| 110 | // loadFunction loads the given function |
| 111 | func (r *functionRegistry) loadFunction(ctx *sql.Context, id uint32) QuickFunction { |
| 112 | // We make this check a second time (first in GetFunction) since the function may have been added while another |
| 113 | // function acquired the lock. |
| 114 | f := r.functions[id] |
| 115 | if f != nil { |
| 116 | return f |
| 117 | } |
| 118 | if LoadFunctionFromCatalog == nil { |
| 119 | return nil |
| 120 | } |
| 121 | functionID := r.revMapping[id] |
| 122 | if !functionID.IsValid() { |
| 123 | return nil |
| 124 | } |
| 125 | funcName, types := r.toFuncSignature(functionID) |
| 126 | potentialFunction := LoadFunctionFromCatalog(ctx, funcName, types) |
| 127 | if potentialFunction == nil { |
| 128 | return nil |
| 129 | } |
| 130 | f = potentialFunction.(QuickFunction) |
| 131 | r.functions[id] = f |
| 132 | return f |
| 133 | } |
| 134 | |
| 135 | // nameWithoutParams returns the name only from the given function string. |
| 136 | func (*functionRegistry) nameWithoutParams(functionID id.Function) string { |
no test coverage detected