mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-5816: Stored programs: validation of stored program statements
For those SP instructions that need to get access to ia LEX object on execution, added storing of their original sql expressions inside classes derived from the class sp_lex_instr. A stored sql expression is returned by the abstract method sp_lex_instr::get_expr_query redefined in derived classes. Since an expression constituting a SP instruction can be invalid SQL statement in general case (not parseable statement), the virtual method sp_lex_instr::get_query() is introduced to return a valid string for a statement that corresponds to the given instruction. Additionally, introduced the rule remember_start_opt in the grammar. The new rule intended to get correct position of a current token taking into attention the fact whether lookahead was done or not.
This commit is contained in:
@@ -8417,3 +8417,11 @@ void Charset_loader_server::raise_not_applicable_error(const char *cs,
|
||||
{
|
||||
my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0), cl, cs);
|
||||
}
|
||||
|
||||
|
||||
LEX_CSTRING make_string(THD *thd, const char *start_ptr,
|
||||
const char *end_ptr)
|
||||
{
|
||||
size_t length= end_ptr - start_ptr;
|
||||
return {strmake_root(thd->mem_root, start_ptr, length), length};
|
||||
}
|
||||
|
Reference in New Issue
Block a user