Skip to main content

Module queries

Module queries 

Source
Expand description

Query allow-list for the live MySQL adapter.

This file is the MySQL analogue of src/live/queries.rs. Every SQL statement the live-mysql adapter can ever issue is enumerated by AllowedMySqlQuery and maps to a 'static SQL string via AllowedMySqlQuery::sql. The concatenated SQL texts are SHA-256-pinned by tests/live_query_allowlist_lock_mysql.rs: any edit — even an added comment — forces an intentional lock bump that must be co-authored with the paper’s §Live-Eval MySQL subsection and the spec/permissions.mysql.sql manifest.

All four variants are pure SELECT against performance_schema and information_schema. None touch user tables. None issue DDL, DML, or advisory locks. This is the statement-level layer of the code-audit contract documented in crate::live_mysql.

The residual-class mapping mirrors the PostgreSQL path:

  • DigestSnapshot -> PlanRegression / WorkloadPhase
  • ThreadsSnapshot -> Contention (wait-event samples)
  • MetadataLocksSnapshot -> Contention (per-object lock waits)
  • BufferPoolSnapshot -> CacheIo

Enums§

AllowedMySqlQuery
Closed enumeration of every SQL statement the live-mysql adapter will ever execute. Adding a variant is a reviewable change that simultaneously breaks Self::sql_concat_for_lock and therefore the allow-list lock test.