Files
greptimedb/tests/cases/standalone/common/promql/regex.result
Weny Xu 73c29bb482 fix(promql): unescape matcher values (#5521)
* fix(promql): unescape matcher values

* test: add sqlness tests

* chore: apply suggestions from CR

* feat: use unescaper
2025-02-13 09:42:25 +00:00

43 lines
1.2 KiB
Plaintext

CREATE TABLE test (
ts timestamp(3) time index,
host STRING,
val BIGINT,
PRIMARY KEY(host),
);
Affected Rows: 0
INSERT INTO TABLE test VALUES
(0, '10.0.160.237:8080', 1),
(0, '10.0.160.237:8081', 1);
Affected Rows: 2
SELECT * FROM test;
+---------------------+-------------------+-----+
| ts | host | val |
+---------------------+-------------------+-----+
| 1970-01-01T00:00:00 | 10.0.160.237:8080 | 1 |
| 1970-01-01T00:00:00 | 10.0.160.237:8081 | 1 |
+---------------------+-------------------+-----+
TQL EVAL (0, 100, '15s') test{host=~"(10\\.0\\.160\\.237:8080|10\\.0\\.160\\.237:9090)"};
+---------------------+-------------------+-----+
| ts | host | val |
+---------------------+-------------------+-----+
| 1970-01-01T00:00:00 | 10.0.160.237:8080 | 1 |
| 1970-01-01T00:00:15 | 10.0.160.237:8080 | 1 |
| 1970-01-01T00:00:30 | 10.0.160.237:8080 | 1 |
| 1970-01-01T00:00:45 | 10.0.160.237:8080 | 1 |
| 1970-01-01T00:01:00 | 10.0.160.237:8080 | 1 |
| 1970-01-01T00:01:15 | 10.0.160.237:8080 | 1 |
| 1970-01-01T00:01:30 | 10.0.160.237:8080 | 1 |
+---------------------+-------------------+-----+
DROP TABLE test;
Affected Rows: 0