summaryrefslogtreecommitdiff
path: root/sql/sql_trigger.cc
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-20051: Add new mode to wsrep_OSU_method in which Galera checks storage ↵Jan Lindström2020-02-111-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | engine of the effected table Introduced a new wsrep_strict_ddl configuration variable in which Galera checks storage engine of the effected table. If table is not InnoDB (only storage engine currently fully supporting Galera replication) DDL-statement will return error code: ER_GALERA_REPLICATION_NOT_SUPPORTED eng "DDL-statement is forbidden as table storage engine does not support Galera replication" However, when wsrep_replicate_myisam=ON we allow DDL-statements to MyISAM tables. If effected table is allowed storage engine Galera will run normal TOI. This new setting should be for now set globally on all nodes in a cluster. When this setting is set following DDL-clauses accessing tables not supporting Galera replication are refused: * CREATE TABLE (e.g. CREATE TABLE t1(a int) engine=Aria * ALTER TABLE * TRUNCATE TABLE * CREATE VIEW * CREATE TRIGGER * CREATE INDEX * DROP INDEX * RENAME TABLE * DROP TABLE Statements on PROCEDURE, EVENT, FUNCTION are allowed as effected tables are known only at execution. Furthermore, USER, ROLE, SERVER, DATABASE statements are also allowed as they do not really have effected table.
* Merge 10.3 into 10.4Marko Mäkelä2020-01-201-1/+1
|\ | | | | | | | | The MDEV-17062 fix in commit c4195305b2a8431f39a4c75cc1c66ba43685f7a0 was omitted.
| * MDEV-21341: Fix UBSAN failures: Issue Sixbb-10.3-mdev21341-issueSixSergei Petrunia2020-01-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | (Variant #2 of the patch, which keeps the sp_head object inside the MEM_ROOT that sp_head object owns) (10.3 version of the fix, with handling for class sp_package) sp_head::operator new() and operator delete() were dereferencing sp_head* pointers to memory that didn't hold a valid sp_head object (it was not created/already destroyed). This caused UBSan to crash when looking up type information. Fixed by providing static sp_head::create() and sp_head::destroy() methods.
* | MDEV-20225 BF aborting SP execution (#1394)seppo2019-10-011-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * MDEV-20225 BF aborting SP execution When stored procedure execution was chosen as victim for a BF abort, the old implemnetationn called for rollback immediately when execution was inside SP isntruction. Technically this happened in wsrep_after_statement() call, which identified the need for a rollback. The problem was that MariaDB does not accept rollback (nor commit) inside sub statement, there are several asserts about it, checking for THD::in_sub_stmt. This patch contains a fix, which skips calling wsrep_after_statement() for SP execution, which is marked as BF must abort. Instead, we return error code to upper level, where rollback will eventually happen, ouside of SP execution. Also, appending the affected trigger table (dropped or created) in the populated key set for the write set, which prevents parallel applying of other transactions working on the same table. * MDEV-20225 BF aborting SP execution, second patch First PR missed 4 commits, which are now squashed in this patch: - Added galera_sp_bf_abort test. A MTR test case which will reproduce BF-BF conflict if all keys corresponding to affected tables are not assigned for DROP TRIGGER. - Fixed incorrect use of sync pointsin MDEV-20225 - Added condition for SQLCOM_DROP_TRIGGER in wsrep_can_run_in_toi() to make it replicate. * MDEV-20225 BF aborting SP execution, third patch The galera_trigger.test caused a situation, where SP invocation caused a trigger to fire, and the trigger executed as sub statement SP, and was BF aborted by applier. because of wsrep_after_statement() was called for the sub-statement level, it ended up in exeuting rollback and asserted there. Thus fix will catch sub-statement level SP execution, and avoids calling wsrep_after_statement()
* | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-05-191-1/+1
|\ \ | |/
| * Merge 10.2 into 10.3Marko Mäkelä2019-05-141-1/+1
| |\
| | * Merge 10.1 into 10.2Marko Mäkelä2019-05-131-1/+1
| | |\
| | | * Merge branch '5.5' into 10.1Vicențiu Ciorbaru2019-05-111-1/+1
| | | |\
| | | | * Update FSF AddressVicențiu Ciorbaru2019-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | * Update wrong zip-code
* | | | | Merge 10.3 into 10.4Marko Mäkelä2019-03-201-2/+2
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The MDEV-17262 commit 26432e49d37a37d09b862bb49a021e44bdf4789c was skipped. In Galera 4, the implementation would seem to require changes to the streaming replication. In the tests archive.rnd_pos main.profiling, disable_ps_protocol for SHOW STATUS and SHOW PROFILE commands until MDEV-18974 has been fixed.
| * | | | Merge branch '10.2' into 10.3Sergei Golubchik2019-03-171-2/+2
| |\ \ \ \ | | |/ / /
| | * | | Merge branch '10.1' into 10.2Sergei Golubchik2019-03-151-2/+2
| | |\ \ \ | | | |/ /
| | | * | fix gcc 8 compiler warningsSergei Golubchik2019-03-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were two newly enabled warnings: 1. cast for a function pointers. Affected sql_analyse.h, mi_write.c and ma_write.cc, mf_iocache-t.cc, mysqlbinlog.cc, encryption.cc, etc 2. memcpy/memset of nontrivial structures. Fixed as: * the warning disabled for InnoDB * TABLE, TABLE_SHARE, and TABLE_LIST got a new method reset() which does the bzero(), which is safe for these classes, but any other bzero() will still cause a warning * Table_scope_and_contents_source_st uses `TABLE_LIST *` (trivial) instead of `SQL_I_List<TABLE_LIST>` (not trivial) so it's safe to bzero now. * added casts in debug_sync.cc and sql_select.cc (for JOIN) * move assignment method for MDL_request instead of memcpy() * PARTIAL_INDEX_INTERSECT_INFO::init() instead of bzero() * remove constructor from READ_RECORD() to make it trivial * replace some memcpy() with c++ copy assignments
* | | | | Merge branch '10.3' into 10.4Sergei Golubchik2019-01-261-4/+2
|\ \ \ \ \ | |/ / / /
| * | | | cleanup: trg2bit() helperSergei Golubchik2019-01-251-4/+2
| | | | |
* | | | | Galera4Brave Galera Crew2019-01-231-2/+1
| | | | |
* | | | | Merge 10.3 into 10.4Marko Mäkelä2018-11-061-2/+2
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.2 into 10.3Marko Mäkelä2018-11-061-3/+2
| |\ \ \ \ | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | main.derived_cond_pushdown: Move all 10.3 tests to the end, trim trailing white space, and add an "End of 10.3 tests" marker. Add --sorted_result to tests where the ordering is not deterministic. main.win_percentile: Add --sorted_result to tests where the ordering is no longer deterministic.
| | * | | Merge 10.1 into 10.2Marko Mäkelä2018-11-061-3/+2
| | |\ \ \ | | | |/ /
| | | * | wsrep: create a macro for the error: labelSergei Golubchik2018-10-241-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | that is used by WSREP_TO_ISOLATION_BEGIN and other galera macros, to avoid the need for wrapping this label in #ifdef WITH_WSREP/#endif
* | | | | cleanup: safe_lexcstrdup_root()Sergei Golubchik2018-10-311-12/+2
| | | | |
* | | | | Merge 10.3 into 10.4Marko Mäkelä2018-10-051-2/+6
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch '10.2' into 10.3Sergei Golubchik2018-09-281-2/+6
| |\ \ \ \ | | |/ / /
| | * | | Merge branch '10.1' into 10.2Oleksandr Byelkin2018-09-141-2/+6
| | |\ \ \ | | | |/ /
| | | * | Merge branch '10.0-galera' into 10.1Sergei Golubchik2018-09-071-1/+5
| | | |\ \
| | | | * | Fix compile error.Jan Lindström2018-07-191-1/+3
| | | | | |
| | | * | | MDEV-15890 Strange error message if you try to FLUSH TABLES <view> after ↵Alexey Botchkov2018-09-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LOCK TABLES <view>. Check if the argument of the FLUSH TABLE is a VIEW and handle it accordingly.
* | | | | | Merge remote-tracking branch 'origin/10.3' into 10.4Alexander Barkov2018-07-031-1/+1
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge branch '10.2' into 10.3Sergei Golubchik2018-06-301-1/+1
| |\ \ \ \ \ | | |/ / / /
| | * | | | Merge branch '10.1' into 10.2Sergei Golubchik2018-06-211-1/+1
| | |\ \ \ \ | | | |/ / /
| | | * | | Merge branch '10.0-galera' into 10.1Vicențiu Ciorbaru2018-06-121-1/+1
| | | |\ \ \ | | | | |/ /
| | | | * | Merge tag 'mariadb-10.0.35' into 10.0-galeraJan Lindström2018-05-071-1/+1
| | | | |\ \
| | | | * \ \ Merge remote-tracking branch 'origin/5.5-galera' into 10.0-galeraJan Lindström2018-05-071-0/+6
| | | | |\ \ \
| | | | | * \ \ Merge tag 'mariadb-5.5.60' into 5.5-galeraJan Lindström2018-04-241-0/+1
| | | | | |\ \ \ | | | | | | | |/ | | | | | | |/|
| | | | | * | | MW-416 Replicating DDL after ACL check, 5.6 versionsjaakola2017-10-191-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Re-implemented the fix for MW-416 according to 5.7 version
| | | | | * | | Merge tag 'mariadb-5.5.55' into bb-5.5-sachin-mergeSachin Setiya2017-04-181-0/+3
| | | | | |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Sachin Setiya <sachin.setiya@mariadb.com>
| | | | | * \ \ \ Merge from lp:maria/5.5 to maria-5.5.37 release revision 4154.Jan Lindström2014-04-161-0/+7
| | | | | |\ \ \ \
| | | | | * \ \ \ \ Merge from maria/5.5 (-rtag:mariadb-5.5.36).Nirbhay Choubey2014-02-251-1/+1
| | | | | |\ \ \ \ \
| | | | | * | | | | | Merging revision 3839..3932 from codership-mysql/5.5.Nirbhay Choubey2014-01-091-2/+2
| | | | | | | | | | |
| | | | | * | | | | | Merge with mariadb 5.5: bzr merge lp:maria/5.5 --rtag:mariadb-5.5.32Seppo Jaakola2013-08-211-1/+1
| | | | | |\ \ \ \ \ \
| | | | | * \ \ \ \ \ \ References: MDEV-4572 - merge with mariaDB 5.5.31Seppo Jaakola2013-05-261-3/+0
| | | | | |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bzr merge lp:maria/5.5 -rtag:mariadb-5.5.31 Text conflict in cmake/cpack_rpm.cmake Text conflict in debian/dist/Debian/control Text conflict in debian/dist/Ubuntu/control Text conflict in sql/CMakeLists.txt Conflict adding file sql/db.opt. Moved existing file to sql/db.opt.moved. Conflict adding file sql/db.opt.moved. Moved existing file to sql/db.opt.moved.moved. Text conflict in sql/mysqld.cc Text conflict in support-files/mysql.spec.sh 8 conflicts encountered.
| | | | | * \ \ \ \ \ \ \ References lp:1051808 - merged with lp:maria/5.5Seppo Jaakola2012-09-171-0/+3
| | | | | |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bzr merge lp:maria/5.5 ... Text conflict in CMakeLists.txt Text conflict in sql/mysqld.cc Text conflict in sql/sql_class.h Text conflict in sql/sql_truncate.cc 4 conflicts encountered.
| | | | | * \ \ \ \ \ \ \ \ references lp:1011983Seppo Jaakola2012-06-121-1/+1
| | | | | |\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merged latest MariaDB development in: bzr merge lp:maria/5.5 => Text conflict in CMakeLists.txt Text conflict in sql/handler.h Text conflict in support-files/CMakeLists.txt 3 conflicts
| | | | | * | | | | | | | | | Initial push of codership-wsrep API implementation for MariaDB. Seppo Jaakola2012-04-131-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge of: lp:maria/5.5, #3334: http://bazaar.launchpad.net/~maria-captains/maria/5.5/revision/3334 lp:codership-mysql/5.5, #3725: http://bazaar.launchpad.net/~codership/codership-mysql/wsrep-5.5/revision/3725
| | | | * | | | | | | | | | | Merge tag 'mariadb-10.0.30' into bb-sachin-10.0-galera-mergeSachin Setiya2017-03-171-0/+3
| | | | |\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Sachin Setiya <sachin.setiya@mariadb.com>
| | | | * \ \ \ \ \ \ \ \ \ \ \ Merge branch '10.0' into 10.0-galeraNirbhay Choubey2016-04-291-1/+1
| | | | |\ \ \ \ \ \ \ \ \ \ \ \
| | | | * | | | | | | | | | | | | MDEV-7996 : CURRENT_USER definer does not replicate for triggersNirbhay Choubey2015-04-161-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | THD's lex->definer initially holds "*current_user" for CURRENT_USER(). As a result when wsrep tries to create the trigger query, it incorrectly uses "*current_user". Fixed by calling get_current_user() to get the real current user. Merged galera_create_trigger.test from github.com/codership/mysql-wsrep.
| | | | * | | | | | | | | | | | | bzr merge -rtag:mariadb-10.0.15 maria/10.0Nirbhay Choubey2014-12-051-1/+1
| | | | |\ \ \ \ \ \ \ \ \ \ \ \ \
| | | | * \ \ \ \ \ \ \ \ \ \ \ \ \ bzr merge -r4209 maria/10.0.Nirbhay Choubey2014-05-211-0/+7
| | | | |\ \ \ \ \ \ \ \ \ \ \ \ \ \
| | | | * \ \ \ \ \ \ \ \ \ \ \ \ \ \ * bzr merge -rtag:mariadb-10.0.9 maria/10.0Nirbhay Choubey2014-03-261-1/+1
| | | | |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix for post-merge build failures.