pub struct LockTablesStatement {
pub plural: bool,
pub tables: ThinVec<TableLock>,
pub meta: Meta,
}Expand description
A MySQL LOCK {TABLES | TABLE} <tbl> [[AS] <alias>] <lock-kind> [, ...] explicit
table-locking statement (gated by
UtilitySyntax::lock_tables).
This is one of two distinct behaviours a dialect can attach to the leading LOCK
keyword, the split modelled the DoExpressionsStatement / DoStatement way (a
behaviour-named gate per reading, never both armed in one preset). MySQL’s LOCK TABLES
names a per-table lock kind (READ, READ LOCAL, WRITE) on each table in a list —
the shape captured here. PostgreSQL’s LOCK TABLE, by contrast, takes a single
statement-level lock mode clause (IN ACCESS SHARE MODE, NOWAIT, …) over a relation
list; that reading is not implemented, but when it is it takes its own node behind its own
LOCK-keyword gate, so the two never collide. The MySql/Lenient presets arm
lock_tables; every other preset leaves the
leading LOCK keyword undispatched (an unknown statement).
The grammar is LOCK table_or_tables table_lock_list (mysql sql_yacc.yy lock /
table_lock_list), so the TABLES (plural) and TABLE (singular) spellings are
interchangeable and preserved on plural to round-trip. Each
TableLock carries a mandatory lock kind — a bare LOCK TABLES t1 with no kind is
ER_PARSE_ERROR (engine-measured on mysql:8.4.10), which the parser enforces. The list is
non-empty. Non-generic, like UseStatement: a table lock carries no expressions or
extension nodes.
Fields§
§plural: boolThe keyword spelling: true for LOCK TABLES (plural), false for LOCK TABLE
(singular). Both are grammar-equal; preserved so the exact spelling round-trips.
tables: ThinVec<TableLock>The locked tables in source order; always non-empty.
meta: MetaSource location and node identity.
Trait Implementations§
Source§impl Clone for LockTablesStatement
impl Clone for LockTablesStatement
Source§fn clone(&self) -> LockTablesStatement
fn clone(&self) -> LockTablesStatement
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LockTablesStatement
impl Debug for LockTablesStatement
Source§impl<'de> Deserialize<'de> for LockTablesStatement
impl<'de> Deserialize<'de> for LockTablesStatement
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for LockTablesStatement
Source§impl Hash for LockTablesStatement
impl Hash for LockTablesStatement
Source§impl PartialEq for LockTablesStatement
impl PartialEq for LockTablesStatement
Source§impl Render for LockTablesStatement
impl Render for LockTablesStatement
Source§fn render(&self, ctx: &RenderCtx<'_>, f: &mut Formatter<'_>) -> Result
fn render(&self, ctx: &RenderCtx<'_>, f: &mut Formatter<'_>) -> Result
Source§fn operand_binding_power(&self) -> Option<BindingPower>
fn operand_binding_power(&self) -> Option<BindingPower>
None (the default) for a self-delimiting node — an atom, call, or
constructor — that never needs parentheses. Read moreSource§impl Serialize for LockTablesStatement
impl Serialize for LockTablesStatement
Source§impl Spanned for LockTablesStatement
impl Spanned for LockTablesStatement
impl StructuralPartialEq for LockTablesStatement
Auto Trait Implementations§
impl Freeze for LockTablesStatement
impl RefUnwindSafe for LockTablesStatement
impl Send for LockTablesStatement
impl Sync for LockTablesStatement
impl Unpin for LockTablesStatement
impl UnsafeUnpin for LockTablesStatement
impl UnwindSafe for LockTablesStatement
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> DynAstExt for T
impl<T> DynAstExt for T
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&dyn Any for downcasting a node back to its concrete type.Source§fn dyn_clone(&self) -> Box<dyn DynAstExt>
fn dyn_clone(&self) -> Box<dyn DynAstExt>
Clone (whose
Self-returning signature cannot go through a vtable).Source§fn dyn_eq(&self, other: &dyn DynAstExt) -> bool
fn dyn_eq(&self, other: &dyn DynAstExt) -> bool
PartialEq (whose &Self argument cannot go through a vtable). Equal
iff other holds the same concrete type and that type deems the values
equal; differently-typed nodes are never equal.