1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Using more of Sql_mode_save. Adding a similar class for THD::abort_on_warnings.

This commit is contained in:
Alexander Barkov
2019-05-28 10:26:08 +04:00
parent c0cd662b98
commit d1d6fe9abf
17 changed files with 65 additions and 71 deletions

View File

@ -6677,6 +6677,45 @@ class Sql_mode_save
};
class Sql_mode_instant_set: public Sql_mode_save
{
public:
Sql_mode_instant_set(THD *thd, sql_mode_t temporary_value)
:Sql_mode_save(thd)
{
thd->variables.sql_mode= temporary_value;
}
};
class Sql_mode_instant_remove: public Sql_mode_save
{
public:
Sql_mode_instant_remove(THD *thd, sql_mode_t temporary_remove_flags)
:Sql_mode_save(thd)
{
thd->variables.sql_mode&= ~temporary_remove_flags;
}
};
class Abort_on_warning_instant_set
{
THD *m_thd;
bool m_save_abort_on_warning;
public:
Abort_on_warning_instant_set(THD *thd, bool temporary_value)
:m_thd(thd), m_save_abort_on_warning(thd->abort_on_warning)
{
thd->abort_on_warning= temporary_value;
}
~Abort_on_warning_instant_set()
{
m_thd->abort_on_warning= m_save_abort_on_warning;
}
};
/**
This class resembles the SQL Standard schema qualified object name:
<schema qualified name> ::= [ <schema name> <period> ] <qualified identifier>