1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Added some checking that LEX_CSTRING is \0 terminated

- When adding LEX_CSTRING to String, we are now checking that
  string is \0 terminated (as normally LEX_CSTRING should be
  usable for printf(). In the cases when one wants to avoid the
  checking one can use String->append(ptr, length) instead of just
  String->append(LEX_CSTRING*)
This commit is contained in:
Monty
2018-01-19 19:56:34 +02:00
parent f55dc7f733
commit 486c86dd39
6 changed files with 30 additions and 19 deletions

View File

@ -693,7 +693,13 @@ static void build_trig_stmt_query(THD *thd, TABLE_LIST *tables,
/* Create statement for storing trigger (without trigger order) */
if (lex->trg_chistics.ordering_clause == TRG_ORDER_NONE)
trigger_def->append(&stmt_definition);
{
/*
Not that here stmt_definition doesn't end with a \0, which is
normally expected from a LEX_CSTRING
*/
trigger_def->append(stmt_definition.str, stmt_definition.length);
}
else
{
/* Copy data before FOLLOWS/PRECEDES trigger_name */