summaryrefslogtreecommitdiff
path: root/sql/sql_class.h
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-11-01 15:23:18 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2019-11-01 15:23:18 +0200
commitec40980ddd921a3a765c23cc430c9c219e48ea85 (patch)
tree6553832d3d3fb4b2cb39aea6a1d69e54275f6eb2 /sql/sql_class.h
parent6801f80aface011811d2978f86c03a25ca7b9165 (diff)
parent9c72963d2aef783cae652b5b8ac01f7aa2bcb43a (diff)
downloadmariadb-git-ec40980ddd921a3a765c23cc430c9c219e48ea85.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r--sql/sql_class.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index c98c0e4621c..3f732a76e53 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -1617,12 +1617,16 @@ public:
/**
@class Sub_statement_state
@brief Used to save context when executing a function or trigger
+
+ operations on stat tables aren't technically a sub-statement, but they are
+ similar in a sense that they cannot change the transaction status.
*/
/* Defines used for Sub_statement_state::in_sub_stmt */
#define SUB_STMT_TRIGGER 1
#define SUB_STMT_FUNCTION 2
+#define SUB_STMT_STAT_TABLES 4
class Sub_statement_state
@@ -6474,6 +6478,11 @@ public:
/* Bits in server_command_flags */
/**
+ Statement that deletes existing rows (DELETE, DELETE_MULTI)
+*/
+#define CF_DELETES_DATA (1U << 24)
+
+/**
Skip the increase of the global query id counter. Commonly set for
commands that are stateless (won't cause any change on the server
internal states).
@@ -6678,6 +6687,22 @@ class Sql_mode_save
sql_mode_t old_mode; // SQL mode saved at construction time.
};
+class Switch_to_definer_security_ctx
+{
+ public:
+ Switch_to_definer_security_ctx(THD *thd, TABLE_LIST *table) :
+ m_thd(thd), m_sctx(thd->security_ctx)
+ {
+ if (table->security_ctx)
+ thd->security_ctx= table->security_ctx;
+ }
+ ~Switch_to_definer_security_ctx() { m_thd->security_ctx = m_sctx; }
+
+ private:
+ THD *m_thd;
+ Security_context *m_sctx;
+};
+
/**
This class resembles the SQL Standard schema qualified object name: