()
| 1263 | #[mz_ore::test] |
| 1264 | #[allow(clippy::disallowed_methods)] |
| 1265 | fn test_explain_timestamp_table() { |
| 1266 | let server = test_util::TestHarness::default().start_blocking(); |
| 1267 | let mut client = server.connect(postgres::NoTls).unwrap(); |
| 1268 | let timestamp_re = Regex::new(r"\s*(\d+) \(\d+-\d\d-\d\d \d\d:\d\d:\d\d.\d\d\d\)").unwrap(); |
| 1269 | |
| 1270 | client.batch_execute("CREATE TABLE t1 (i1 int)").unwrap(); |
| 1271 | |
| 1272 | let expect = " query timestamp:<TIMESTAMP> |
| 1273 | oracle read timestamp:<TIMESTAMP> |
| 1274 | largest not in advance of upper:<TIMESTAMP> |
| 1275 | upper:[<TIMESTAMP>] |
| 1276 | since:[<TIMESTAMP>] |
| 1277 | can respond immediately: true |
| 1278 | timeline: Some(EpochMilliseconds) |
| 1279 | session wall time:<TIMESTAMP> |
| 1280 | |
| 1281 | source materialize.public.t1 (u1, storage): |
| 1282 | read frontier:[<TIMESTAMP>] |
| 1283 | write frontier:[<TIMESTAMP>] |
| 1284 | |
| 1285 | binding constraints: |
| 1286 | lower: |
| 1287 | (Isolation level: StrictSerializable): [<TIMESTAMP>]\n"; |
| 1288 | |
| 1289 | let row = client |
| 1290 | .query_one("EXPLAIN TIMESTAMP FOR SELECT * FROM t1;", &[]) |
| 1291 | .unwrap(); |
| 1292 | let explain: String = row.get(0); |
| 1293 | let explain = timestamp_re.replace_all(&explain, "<TIMESTAMP>"); |
| 1294 | // The storage inputs constraint appears non-deterministically depending on |
| 1295 | // whether the storage frontier has advanced before the query runs. |
| 1296 | let storage_inputs_re = Regex::new(r" \(Storage inputs: \[.*\]\): \[<TIMESTAMP>\]\n").unwrap(); |
| 1297 | let explain = storage_inputs_re.replace_all(&explain, ""); |
| 1298 | assert_eq!(explain, expect, "{explain}\n\n{expect}"); |
| 1299 | } |
| 1300 | |
| 1301 | // Test `EXPLAIN TIMESTAMP AS JSON` |
| 1302 | #[mz_ore::test] |
nothing calls this directly
no test coverage detected