MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / test_explain_timestamp_json

Function test_explain_timestamp_json

src/environmentd/tests/sql.rs:1304–1315  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1302#[mz_ore::test]
1303#[allow(clippy::disallowed_methods)]
1304fn test_explain_timestamp_json() {
1305 let server = test_util::TestHarness::default().start_blocking();
1306 let mut client = server.connect(postgres::NoTls).unwrap();
1307 client.batch_execute("CREATE TABLE t1 (i1 int)").unwrap();
1308
1309 let row = client
1310 .query_one("EXPLAIN TIMESTAMP AS JSON FOR SELECT * FROM t1;", &[])
1311 .unwrap();
1312 let explain: String = row.get(0);
1313 // Just check that we can round-trip to the original type
1314 let _explain: TimestampExplanation = serde_json::from_str(&explain).unwrap();
1315}
1316
1317// Verify that `EXPLAIN TIMESTAMP ...` within acts like a peek within a transaction.
1318// That is, ensure the following:

Callers

nothing calls this directly

Calls 6

start_blockingMethod · 0.80
unwrapMethod · 0.80
batch_executeMethod · 0.80
connectMethod · 0.45
query_oneMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected