-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
MDEV-38574 Rename cloning functions of class Item and descendants #4557
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: 10.6
Are you sure you want to change the base?
Conversation
2b19dc1 to
3235437
Compare
This commit renames the cloning methods of class Item and its descendants in the following way: (from) (to) do_build_clone -> deep_copy build_clone -> deep_copy_with_checks do_get_copy -> shallow_copy get_copy -> shallow_copy_with_checks to better reflect their functionality. This change also makes sure `deep_copy_with_checks()` and `shallow_copy_with_checks()` comprise a public interface to the functionality while `deep_copy()` and `shallow_copy()` are protected and not accessible from outside of Item subclasses.
This commit renames method `clone_item()` of class Items and its descendants to `clone_constant()` to better clarity.
3235437 to
a692ee2
Compare
spetrunia
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.
diff --git a/extra/wolfssl/wolfssl b/extra/wolfssl/wolfssl
index 59f4fa56861..b077c81eb63 160000
--- a/extra/wolfssl/wolfssl
+++ b/extra/wolfssl/wolfssl
@@ -1 +1 @@
-Subproject commit 59f4fa568615396fbf381b073b220d1e8d61e4c2
+Subproject commit b077c81eb635392e694ccedbab8b644297ec0285Why this change? I think it's not intentional?
Oops, I missed that. Looks like an issue with |
|
|
||
| #define PCRE2_STATIC 1 /* Important on Windows */ | ||
| #include "pcre2.h" /* pcre2 header file */ | ||
|
|
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.
What's the above? why in this patch?
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.
It's moved from .cc file. But why?
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.
Otherwise I get a bunch of build errors looking like:
[build] In file included from /home/oleg/10.6-MDEV-38574-rename/sql/item.h:6681,
[build] from /home/oleg/10.6-MDEV-38574-rename/sql/sql_lex.h:35,
[build] from /home/oleg/10.6-MDEV-38574-rename/sql/sql_class.h:668,
[build] from /home/oleg/10.6-MDEV-38574-rename/storage/connect/user_connect.cc:40:
[build] /home/oleg/10.6-MDEV-38574-rename/sql/item_cmpfunc.h:3099:3: error: ‘pcre2_code’ does not name a type
[build] 3099 | pcre2_code *m_pcre;
[build] | ^~~~~~~~~~
It's not surprising, asitem_cmpfunc.h operates some pcre structures. Not clear how it managed to compile before, probably the order of includes was different.
| { return get_item_copy<Item_func_replace_oracle>(thd, this); } | ||
|
|
||
| protected: | ||
| Item *shallow_copy(THD *thd) const override { return nullptr; } |
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.
Why change the implementation?
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.
It's a mistake, will fix.
|
I see that this commit didn't change any semantics in Item_avg_field_decimal. But now when I see this: it looks concerning. Why do we not clone the arguments? This question is outside of scope of this PR. It won't prevent this PR from being pushed. |
Rephrase to something like: |
|
Same with the other commit:
...
Also make Item::deep_copy() and shallow_copy() protected. |
|
Please also apply this and squash into the first commit: more-protected.patch |
Apparently, instances of this classes are prone to failures like #4529. |
to better reflect their functionality.
This change also makes sure
deep_copy_with_checks()andshallow_copy_with_checks()comprise a public interface tothe functionality while
deep_copy()andshallow_copy()are protected and not accessible from outside of Item subclasses.clone_item()of class Items and its descendants toclone_constant()to better clarity.