| 1 |
include/install_replication_observers_example.inc |
| 2 |
# |
| 3 |
# Phase 1: The before commit hook fails. |
| 4 |
# Set a GTID in an empty transaction and watch it fail |
| 5 |
# |
| 6 |
SET SESSION sql_log_bin= 0; |
| 7 |
call mtr.add_suppression("Run function 'before_commit' in plugin"); |
| 8 |
SET SESSION sql_log_bin= 1; |
| 9 |
SET @debug_saved= @@GLOBAL.DEBUG; |
| 10 |
SET @@GLOBAL.DEBUG= '+d,force_error_on_before_commit_listener'; |
| 11 |
SET gtid_next='aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1'; |
| 12 |
COMMIT; |
| 13 |
ERROR HY000: Error on observer while running replication hook 'before_commit'. |
| 14 |
SET @@GLOBAL.DEBUG= @debug_saved; |
| 15 |
ROLLBACK; |
| 16 |
SET gtid_next='automatic'; |
| 17 |
# |
| 18 |
# Phase 2: The before commit hook makes the transaction rollback |
| 19 |
# Set a GTID in an empty transaction and watch it fail |
| 20 |
# |
| 21 |
SET @@GLOBAL.DEBUG= '+d,force_negative_certification_outcome'; |
| 22 |
SET gtid_next='aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:2'; |
| 23 |
COMMIT; |
| 24 |
ERROR 40000: Plugin instructed the server to rollback the current transaction. |
| 25 |
SET @@GLOBAL.DEBUG= @debug_saved; |
| 26 |
ROLLBACK; |
| 27 |
SET gtid_next='automatic'; |
| 28 |
# |
| 29 |
# Clean up |
| 30 |
# |
| 31 |
include/uninstall_replication_observers_example.inc |