MDEV-5816: Stored programs: validation of stored program statements

This is the prerequisite patch to move the sp_instr class and classes derived
from it into the files sp_instr.cc/sp_instr.h. The classes sp_lex_cursor and
sp_lex_keeper are also moved to the files files sp_instr.cc/sp_instr.h.

Additionally,
  * all occurrences of macroses NULL, FALSE, TRUE are replaced
    with the corresponding C++ keywords nullptr, false, true.
  * the keyword 'override' is added in and the keyword 'virtual' is removed
    from signatures of every virtual method implemented in classes derived
    from the base class sp_instr.
  * the keyword 'final' is added into declaration of the class sp_lex_keeper
    since this class shouldn't have a derived class by design.
  * the function cmp_rqp_locations is made static since it is not called
    outside the file sp_instr.cc.
  * the function subst_spvars() is moved into the file sp_instr.cc since this
    function used only by the method sp_instr_stmt::execute
This commit is contained in:
Dmitry Shulga 2023-07-19 17:43:31 +07:00
parent 053475fe4f
commit 9e48460bdb
9 changed files with 2776 additions and 2713 deletions

View File

@ -151,6 +151,7 @@ SET(SQL_EMBEDDED_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
../sql/xa.cc
../sql/json_table.cc
../sql/opt_histogram_json.cc
../sql/sp_instr.cc
${GEN_SOURCES}
${MYSYS_LIBWRAP_SOURCE}
)

View File

@ -165,6 +165,7 @@ SET (SQL_SOURCE
rpl_gtid.cc rpl_parallel.cc
semisync.cc semisync_master.cc semisync_slave.cc
semisync_master_ack_receiver.cc
sp_instr.cc
sql_schema.cc
lex_charset.cc charset_collations.cc
sql_type.cc sql_mode.cc sql_type_json.cc

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1663
sql/sp_instr.cc Normal file

File diff suppressed because it is too large Load Diff

1107
sql/sp_instr.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -23,6 +23,7 @@
#include "mysql.h"
#include "sp_head.h"
#include "sql_cursor.h"
#include "sp_instr.h" // class sp_instr, ...
#include "sp_rcontext.h"
#include "sp_pcontext.h"
#include "sql_select.h" // create_virtual_tmp_table

View File

@ -28,6 +28,7 @@
#include <hash.h>
#include "sp_head.h"
#include "sp.h"
#include "sp_instr.h" // class sp_instr, ...
#include "sql_select.h"
#include "sql_cte.h"
#include "sql_signal.h"

View File

@ -43,6 +43,7 @@
#include "lex_symbol.h"
#include "item_create.h"
#include "sp_head.h"
#include "sp_instr.h" // classes sp_instr,...
#include "sp_rcontext.h"
#include "sp.h"
#include "sql_show.h"