mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
405613ebb5
The `Item` class methods `get_copy()`, `build_clone()`, and `clone_item()` face an issue where they may be defined in a descendant class (e.g., `Item_func`) but not in a further descendant (e.g., `Item_func_child`). This can lead to scenarios where `build_clone()`, when operating on an instance of `Item_func_child` with a pointer to the base class (`Item`), returns an instance of `Item_func` instead of `Item_func_child`. Since this limitation cannot be resolved at compile time, this commit introduces runtime type checks for the copy/clone operations. A debug assertion will now trigger in case of a type mismatch. `get_copy()`, `build_clone()`, and `clone_item()` are no more virtual, but virtual `do_get_copy()`, `do_build_clone()`, and `do_clone_item()` are added to the protected section of the class `Item`. Additionally, const qualifiers have been added to certain methods to enhance code reliability. Reviewer: Oleksandr Byelkin <sanja@mariadb.com> |
||
---|---|---|
.. | ||
mysql-test/func_test | ||
CMakeLists.txt | ||
plugin.cc |