SetValue implements sql.SystemVariable.
(val any, global bool)
| 121 | |
| 122 | // SetValue implements sql.SystemVariable. |
| 123 | func (p *Parameter) SetValue(ctx *sql.Context, val any, global bool) (sql.SystemVarValue, error) { |
| 124 | if global { |
| 125 | // This shouldn't happen, but sanity check |
| 126 | return sql.SystemVarValue{}, sql.ErrSystemVariableSessionOnly.New(p.Name) |
| 127 | } |
| 128 | if p.IsReadOnly() { |
| 129 | return sql.SystemVarValue{}, ErrCannotChangeAtRuntime.New(p.Name) |
| 130 | } |
| 131 | // TODO: Do parsing of units for memory and time parameters |
| 132 | return p.InitValue(ctx, val, global) |
| 133 | } |
| 134 | |
| 135 | // IsReadOnly implements sql.SystemVariable. |
| 136 | func (p *Parameter) IsReadOnly() bool { |
no test coverage detected