pub struct MySqlModeFlags {
pub pipes_as_concat: bool,
pub ansi_quotes: bool,
pub strict_mode: bool,
pub sqlite_division_semantics: bool,
}Expand description
MySQL-specific mode flags (similar to MySQL’s sql_mode variable)
These flags control various MySQL-specific behaviors that differ from standard SQL or other database implementations.
§References
Fields§
§pipes_as_concat: boolWhether || acts as string concat (vs OR operator)
Corresponds to MySQL PIPES_AS_CONCAT mode.
true:'a' || 'b'returns'ab'(string concatenation)false(default):'a' || 'b'returns1or0(logical OR)
ansi_quotes: boolWhether “ acts as identifier quote (vs string literal)
Corresponds to MySQL ANSI_QUOTES mode.
true:"col"is an identifier (like backticks)false(default):"col"is a string literal (like single quotes)
strict_mode: boolStrict mode for type coercion and errors
Corresponds to MySQL STRICT_TRANS_TABLES.
true: Strict type checking, errors on invalid datafalse(default): Permissive mode with warnings
sqlite_division_semantics: boolUse SQLite division semantics (INTEGER / INTEGER → INTEGER)
This flag is used when MySQL syntax is needed (e.g., CAST...AS SIGNED)
but SQLite division semantics are required for compatibility with test
suites that were generated using SQLite.
true:5 / 2 = 2(truncated integer division, SQLite behavior)false(default):5 / 2 = 2.5(exact decimal division, MySQL behavior)
This is particularly useful for SQLLogicTest compatibility where tests
are tagged onlyif mysql for syntax reasons but expect SQLite division
results.
Implementations§
Source§impl MySqlModeFlags
impl MySqlModeFlags
Sourcepub fn with_pipes_as_concat() -> Self
pub fn with_pipes_as_concat() -> Self
Create MySqlModeFlags with PIPES_AS_CONCAT enabled
Sourcepub fn with_ansi_quotes() -> Self
pub fn with_ansi_quotes() -> Self
Create MySqlModeFlags with ANSI_QUOTES enabled
Sourcepub fn with_strict_mode() -> Self
pub fn with_strict_mode() -> Self
Create MySqlModeFlags with STRICT_MODE enabled
Sourcepub fn ansi() -> Self
pub fn ansi() -> Self
Create MySqlModeFlags with ANSI mode (combination of ANSI_QUOTES and PIPES_AS_CONCAT)
Sourcepub fn with_sqlite_division_semantics() -> Self
pub fn with_sqlite_division_semantics() -> Self
Create MySqlModeFlags with SQLite division semantics enabled
This is useful for SQLLogicTest compatibility where MySQL syntax is needed but division should behave like SQLite (INTEGER / INTEGER → INTEGER).
Trait Implementations§
Source§impl Clone for MySqlModeFlags
impl Clone for MySqlModeFlags
Source§fn clone(&self) -> MySqlModeFlags
fn clone(&self) -> MySqlModeFlags
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more