-
-
Notifications
You must be signed in to change notification settings - Fork 2k
MDEV-12302: Execute triggers for foreign key updates/deletes #3496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
fd0fe05 to
5ed8787
Compare
954b0e6 to
bfda058
Compare
|
Hello @Simoffsky! As the project is close to its final stage, it's time to reorganize your code, also covering @vuvova's request from #3354. Please move the triggers processing (and other sql-layer "hooks") code to the sql layer. Let's consider two approaches to this. 1. Make two sql-side functions related to hooks: before and afterI will refer to hooks as to ephemere trigger like actions, that are to be done before or after a row change. We can already observe that before hooks differ from after hooks: before hooks also include updating virtual fields, whereas after hooks don't. In the close future, the list will expand (like with row logging, CHEK constraints, etc). So it makes sense for making two functions. This approach would look as placing two functions in This also could make sense to be done in four functions instead of two. Then, in This approach also requires a manual conversion back from sql format (in case if triggers change the data) 2. Call an sql-layer function instead of innodb's
|
|
Please also join all tests in a single file. Test execution time is a problem for us, as every test run has a significant latency. Note that we maintain 80 characters width for the c/c++ sode, with putting an opening |
b700b79 to
33545f7
Compare
f2b8b9f to
1ca8660
Compare
42c3ab6 to
5709403
Compare
5709403 to
e41df1e
Compare
e41df1e to
88beee6
Compare
9c53dcf to
11a22ef
Compare
37ddc47 to
f1fe0e8
Compare
f1fe0e8 to
79551cf
Compare
FooBarrior
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Simoffsky I'm going to have a time to focus on my leftovers, and this patch is of my high interest.
Let's go through it, perhaps, and see what could we miss?
| row_sel_store_mysql_rec(maria_table->record[1], prebuilt, rec, NULL, | ||
| true, clust_index, offsets); | ||
|
|
||
| //if (node->upd_row == NULL) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you remember what was the problem with this line? Perhaps, just a comment not removed
| thr->prebuilt->m_mysql_table = NULL; | ||
| row_upd_step(thr); | ||
| thr->prebuilt->m_mysql_table = mysql_table; | ||
| //row_upd_step(thr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another quirk. what should we do with it?
Description
Roadmap:
✅ Simple Delete
✅ Simple Update
✅ Fetch data from secondary indexes
✅ Handle changes coming from BEFORE triggers
✅ Virtual fields
✅ Test ON DELETE/UPDATE SET NULL
✅ Bit fields (probably just test it)
✅ Long blobs
Release Notes
TODO: What should the release notes say about this change?
Include any changed system variables, status variables or behaviour. Optionally list any https://mariadb.com/kb/ pages that need changing.
How can this PR be tested?
TODO: modify the automated test suite to verify that the PR causes MariaDB to behave as intended.
Consult the documentation on "Writing good test cases".
If the changes are not amenable to automated testing, please explain why not and carefully describe how to test manually.
Basing the PR against the correct MariaDB version
mainbranch.PR quality check