diff options
author | Monty <monty@mariadb.org> | 2016-10-02 15:35:08 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2016-10-05 01:11:07 +0300 |
commit | 8be53a389c8eebed337057fa366b7c4506ba16b1 (patch) | |
tree | abd36c95a598f1d6e5537e94fd7de034715ce299 /sql/sp_head.cc | |
parent | 0bae1957dd124f8382ae6af1de0e2168fc200bfb (diff) | |
download | mariadb-git-8be53a389c8eebed337057fa366b7c4506ba16b1.tar.gz |
MDEV-6112 multiple triggers per table
This is similar to MysQL Worklog 3253, but with
a different implementation. The disk format and
SQL syntax is identical with MySQL 5.7.
Fetures supported:
- "Any" ammount of any trigger
- Supports FOLLOWS and PRECEDES to be
able to put triggers in a certain execution order.
Implementation details:
- Class Trigger added to hold information about a trigger.
Before this trigger information was stored in a set of lists in
Table_triggers_list and in Table_triggers_list::bodies
- Each Trigger has a next field that poinst to the next Trigger with the
same action and time.
- When accessing a trigger, we now always access all linked triggers
- The list are now only used to load and save trigger files.
- MySQL trigger test case (trigger_wl3253) added and we execute these
identically.
- Even more gracefully handling of wrong trigger files than before. This
is useful if a trigger file uses functions or syntax not provided by
the server.
- Each trigger now has a "Created" field that shows when the trigger was
created, with 2 decimals.
Other comments:
- Many of the changes in test files was done because of the new "Created"
field in the trigger file. This shows up in SHOW ... TRIGGER and when
using information_schema.trigger.
- Don't check if all memory is released if on uses --gdb; This is needed
to be able to get a list from safemalloc of not freed memory while
debugging.
- Added option to trim_whitespace() to know how many prefix characters
was skipped.
- Changed a few ulonglong sql_mode to sql_mode_t, to find some wrong usage
of sql_mode.
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r-- | sql/sp_head.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 41006f07a0a..37479c14047 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -707,6 +707,7 @@ sp_head::set_stmt_end(THD *thd) { Lex_input_stream *lip= & thd->m_parser_state->m_lip; /* shortcut */ const char *end_ptr= lip->get_cpp_ptr(); /* shortcut */ + uint not_used; /* Make the string of parameters. */ @@ -724,7 +725,7 @@ sp_head::set_stmt_end(THD *thd) m_body.length= end_ptr - m_body_begin; m_body.str= thd->strmake(m_body_begin, m_body.length); - trim_whitespace(thd->charset(), & m_body); + trim_whitespace(thd->charset(), &m_body, ¬_used); /* Make the string of UTF-body. */ @@ -732,7 +733,7 @@ sp_head::set_stmt_end(THD *thd) m_body_utf8.length= lip->get_body_utf8_length(); m_body_utf8.str= thd->strmake(lip->get_body_utf8_str(), m_body_utf8.length); - trim_whitespace(thd->charset(), & m_body_utf8); + trim_whitespace(thd->charset(), &m_body_utf8, ¬_used); /* Make the string of whole stored-program-definition query (in the @@ -741,7 +742,7 @@ sp_head::set_stmt_end(THD *thd) m_defstr.length= end_ptr - lip->get_cpp_buf(); m_defstr.str= thd->strmake(lip->get_cpp_buf(), m_defstr.length); - trim_whitespace(thd->charset(), & m_defstr); + trim_whitespace(thd->charset(), &m_defstr, ¬_used); } |