summaryrefslogtreecommitdiff
path: root/sql/sp_head.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2017-03-03 15:02:08 +0400
committerAlexander Barkov <bar@mariadb.org>2017-04-05 15:02:59 +0400
commit1b8a0c879d80733e3c684080b8c7719c35642e0d (patch)
tree1a98d1e701ddde368b1b1b7c76346a76a2328f9e /sql/sp_head.h
parent400de202792246bc1f6f5cb8813ecd35dc923200 (diff)
downloadmariadb-git-1b8a0c879d80733e3c684080b8c7719c35642e0d.tar.gz
MDEV-12133 sql_mode=ORACLE: table%ROWTYPE in variable declarations
Diffstat (limited to 'sql/sp_head.h')
-rw-r--r--sql/sp_head.h39
1 files changed, 34 insertions, 5 deletions
diff --git a/sql/sp_head.h b/sql/sp_head.h
index 51e10492050..92f17884285 100644
--- a/sql/sp_head.h
+++ b/sql/sp_head.h
@@ -366,6 +366,10 @@ public:
bool set_local_variable_row_field(THD *thd, sp_pcontext *spcont,
sp_variable *spv, uint field_idx,
Item *val, LEX *lex);
+ bool set_local_variable_row_field_by_name(THD *thd, sp_pcontext *spcont,
+ sp_variable *spv,
+ const LEX_STRING &field_name,
+ Item *val, LEX *lex);
private:
/**
Generate a code to set a single cursor parameter variable.
@@ -1002,9 +1006,9 @@ class sp_instr_set : public sp_instr
public:
sp_instr_set(uint ip, sp_pcontext *ctx,
- uint offset, Item *val, enum enum_field_types type_arg,
+ uint offset, Item *val,
LEX *lex, bool lex_resp)
- : sp_instr(ip, ctx), m_offset(offset), m_value(val), m_type(type_arg),
+ : sp_instr(ip, ctx), m_offset(offset), m_value(val),
m_lex_keeper(lex, lex_resp)
{}
@@ -1021,7 +1025,6 @@ protected:
uint m_offset; ///< Frame offset
Item *m_value;
- enum enum_field_types m_type; ///< The declared type
sp_lex_keeper m_lex_keeper;
}; // class sp_instr_set : public sp_instr
@@ -1042,9 +1045,9 @@ public:
sp_instr_set_row_field(uint ip, sp_pcontext *ctx,
uint offset, uint field_offset,
- Item *val, enum enum_field_types type_arg,
+ Item *val,
LEX *lex, bool lex_resp)
- : sp_instr_set(ip, ctx, offset, val, type_arg, lex, lex_resp),
+ : sp_instr_set(ip, ctx, offset, val, lex, lex_resp),
m_field_offset(field_offset)
{}
@@ -1057,6 +1060,32 @@ public:
}; // class sp_instr_set_field : public sp_instr_set
+class sp_instr_set_row_field_by_name : public sp_instr_set
+{
+ // Prevent use of this
+ sp_instr_set_row_field_by_name(const sp_instr_set_row_field &);
+ void operator=(sp_instr_set_row_field_by_name &);
+ const LEX_STRING m_field_name;
+
+public:
+
+ sp_instr_set_row_field_by_name(uint ip, sp_pcontext *ctx,
+ uint offset, const LEX_STRING &field_name,
+ Item *val,
+ LEX *lex, bool lex_resp)
+ : sp_instr_set(ip, ctx, offset, val, lex, lex_resp),
+ m_field_name(field_name)
+ {}
+
+ virtual ~sp_instr_set_row_field_by_name()
+ {}
+
+ virtual int exec_core(THD *thd, uint *nextp);
+
+ virtual void print(String *str);
+}; // class sp_instr_set_field_by_name : public sp_instr_set
+
+
/**
Set NEW/OLD row field value instruction. Used in triggers.
*/