pub enum Modifier {
Show 13 variants
Distinct,
DistinctRow,
LowPriority,
HighPriority,
Delayed,
Quick,
Ignore,
StraightJoin,
SmallResult,
BigResult,
BufferResult,
NoCache,
CalcFoundRows,
}Expand description
One of MySQL’s statement modifiers — the keywords between a statement’s first word and its real content.
MySQL spreads these across four productions:
SELECT [ALL | DISTINCT | DISTINCTROW] [HIGH_PRIORITY] [STRAIGHT_JOIN]
[SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]
[SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS] …
INSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE] …
UPDATE [LOW_PRIORITY] [IGNORE] …
DELETE [LOW_PRIORITY] [QUICK] [IGNORE] …The order below is the grammar’s order, and Modifiers keeps its list
sorted by it. That is the whole reason this is an enum rather than bob’s
[]string: bob appends the keywords in whatever order the mods were written,
so im.Ignore(), im.HighPriority() produces INSERT IGNORE HIGH_PRIORITY,
which MySQL rejects. Here mod order cannot affect the output.
Which modifiers a statement permits is decided by which of them its mod module re-exports, exactly as with the clause traits.
ALL is the default in SELECT and adds nothing, so it is not representable —
the absence of Distinct is what it means.
Variants§
Distinct
DISTINCT — drop duplicate result rows.
DistinctRow
DISTINCTROW, MySQL’s synonym for DISTINCT.
LowPriority
LOW_PRIORITY — wait for readers before writing.
HighPriority
HIGH_PRIORITY — jump the queue ahead of pending writes.
Delayed
DELAYED — accepted and deprecated; MySQL treats it as INSERT and warns.
Quick
QUICK — do not merge index leaves while deleting.
Ignore
IGNORE — turn errors that would abort the statement into warnings.
StraightJoin
STRAIGHT_JOIN — join tables in the order they are written.
SmallResult
SQL_SMALL_RESULT — the result set is small; use an in-memory temp table.
BigResult
SQL_BIG_RESULT — the result set is large; sort rather than use an index.
BufferResult
SQL_BUFFER_RESULT — force the result into a temporary table.
NoCache
SQL_NO_CACHE — do not read or write the query cache.
CalcFoundRows
SQL_CALC_FOUND_ROWS — count the rows a LIMIT discarded.