(ctx context.Context, varName string)
| 99 | } |
| 100 | |
| 101 | func (d *Driver) getServerVariable(ctx context.Context, varName string) (string, error) { |
| 102 | db := d.GetDB() |
| 103 | query := fmt.Sprintf("SHOW VARIABLES LIKE '%s'", varName) |
| 104 | var varNameFound, value string |
| 105 | if err := db.QueryRowContext(ctx, query).Scan(&varNameFound, &value); err != nil { |
| 106 | if err == sql.ErrNoRows { |
| 107 | return "", common.FormatDBErrorEmptyRowWithQuery(query) |
| 108 | } |
| 109 | return "", util.FormatErrorWithQuery(err, query) |
| 110 | } |
| 111 | if varName != varNameFound { |
| 112 | return "", errors.Errorf("expecting variable %s, but got %s", varName, varNameFound) |
| 113 | } |
| 114 | return value, nil |
| 115 | } |
| 116 | |
| 117 | // isSyncRollup reports whether a StarRocks information_schema.materialized_views row |
| 118 | // describes a synchronous rollup rather than a standalone (async) materialized view. |
no test coverage detected