diff options
author | unknown <pem@mysql.comhem.se> | 2004-03-29 11:16:45 +0200 |
---|---|---|
committer | unknown <pem@mysql.comhem.se> | 2004-03-29 11:16:45 +0200 |
commit | 7456a3e92f94552bf22210e81d03a0708b66f721 (patch) | |
tree | b8768978c409114099e7b16e65cb887898711497 /sql/sp_head.h | |
parent | 220494bde06fe2c0b288845c9b027764341e443f (diff) | |
download | mariadb-git-7456a3e92f94552bf22210e81d03a0708b66f721.tar.gz |
Enforce standard declaration order in SPs.
Added new test cases for this, and adjusted old tests accordingly,
and new error codes and messages.
Fixed bugs in some tests (bug2673 and use test).
Added debug printing of instructions in SPs.
include/mysqld_error.h:
New error codes for non-standard declaration order in SPs.
include/sql_state.h:
New error codes for non-standard declaration order in SPs.
mysql-test/r/sp-error.result:
Enforce standard declaration order.
Fixed syntax error in use-test.
New test cases for wrong order.
mysql-test/r/sp.result:
Enforce strict declaration order.
Fixed platform dependent bug2673 test.
mysql-test/t/sp-error.test:
Enforce standard declaration order.
Fixed syntax error in use-test.
New test cases for wrong order.
mysql-test/t/sp.test:
Enforce strict declaration order.
Fixed platform dependent bug2673 test.
sql/share/czech/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/danish/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/dutch/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/english/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/estonian/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/french/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/german/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/greek/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/hungarian/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/italian/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/japanese/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/korean/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/norwegian-ny/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/norwegian/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/polish/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/portuguese/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/romanian/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/russian/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/serbian/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/slovak/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/spanish/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/swedish/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/ukrainian/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/sp_head.cc:
Debug printing of instructions in procedures.
New error instruction for future use.
sql/sp_head.h:
Debug printing of instructions in procedures.
New error instruction for future use.
sql/sql_string.cc:
New methods needed by debug printing of instruction in SPs.
sql/sql_string.h:
New methods needed by debug printing of instruction in SPs.
sql/sql_yacc.yy:
Check for standard order of declarations in SPs.
Diffstat (limited to 'sql/sp_head.h')
-rw-r--r-- | sql/sp_head.h | 62 |
1 files changed, 56 insertions, 6 deletions
diff --git a/sql/sp_head.h b/sql/sp_head.h index 791c6697693..19d1cb8254a 100644 --- a/sql/sp_head.h +++ b/sql/sp_head.h @@ -262,12 +262,9 @@ public: // instruction to execute. (For most instruction this will be the // instruction following this one.) // Returns 0 on success, non-zero if some error occured. - virtual int - execute(THD *thd, uint *nextp) - { // Default is a no-op. - *nextp = m_ip+1; // Next instruction - return 0; - } + virtual int execute(THD *thd, uint *nextp) = 0; + + virtual void print(String *str) = 0; protected: @@ -294,6 +291,8 @@ public: virtual int execute(THD *thd, uint *nextp); + virtual void print(String *str); + inline void set_lex(LEX *lex) { @@ -333,6 +332,8 @@ public: virtual int execute(THD *thd, uint *nextp); + virtual void print(String *str); + private: uint m_offset; // Frame offset @@ -362,6 +363,8 @@ public: virtual int execute(THD *thd, uint *nextp); + virtual void print(String *str); + virtual void set_destination(uint dest) { @@ -395,6 +398,8 @@ public: virtual int execute(THD *thd, uint *nextp); + virtual void print(String *str); + private: Item *m_expr; // The condition @@ -422,6 +427,8 @@ public: virtual int execute(THD *thd, uint *nextp); + virtual void print(String *str); + private: Item *m_expr; // The condition @@ -445,6 +452,8 @@ public: virtual int execute(THD *thd, uint *nextp); + virtual void print(String *str); + protected: Item *m_value; @@ -474,6 +483,8 @@ public: virtual int execute(THD *thd, uint *nextp); + virtual void print(String *str); + inline void add_condition(struct sp_cond_type *cond) { m_cond.push_front(cond); @@ -505,6 +516,8 @@ public: virtual int execute(THD *thd, uint *nextp); + virtual void print(String *str); + private: uint m_count; @@ -528,6 +541,8 @@ public: virtual int execute(THD *thd, uint *nextp); + virtual void print(String *str); + private: uint m_frame; @@ -550,6 +565,8 @@ public: virtual int execute(THD *thd, uint *nextp); + virtual void print(String *str); + private: LEX *m_lex; @@ -573,6 +590,8 @@ public: virtual int execute(THD *thd, uint *nextp); + virtual void print(String *str); + private: uint m_count; @@ -596,6 +615,8 @@ public: virtual int execute(THD *thd, uint *nextp); + virtual void print(String *str); + private: uint m_cursor; // Stack index @@ -619,6 +640,8 @@ public: virtual int execute(THD *thd, uint *nextp); + virtual void print(String *str); + private: uint m_cursor; @@ -644,6 +667,8 @@ public: virtual int execute(THD *thd, uint *nextp); + virtual void print(String *str); + void add_to_varlist(struct sp_pvar *var) { m_varlist.push_back(var); @@ -657,6 +682,31 @@ private: }; // class sp_instr_cfetch : public sp_instr +class sp_instr_error : public sp_instr +{ + sp_instr_error(const sp_instr_error &); /* Prevent use of these */ + void operator=(sp_instr_error &); + +public: + + sp_instr_error(uint ip, int errcode) + : sp_instr(ip), m_errcode(errcode) + {} + + virtual ~sp_instr_error() + {} + + virtual int execute(THD *thd, uint *nextp); + + virtual void print(String *str); + +private: + + int m_errcode; + +}; // class sp_instr_error : public sp_instr + + struct st_sp_security_context { bool changed; |