Rename native functions#27
Conversation
|
I just tested it with MySQL version 8.0.20. It doesn't seem to be a issue there. They are only native functions in MariaDB. If renaming the functions is too big of a change then i would suggest creating a extra branch |
|
did the mariadb branch ever get created to solve this issue? |
|
The pull request is working fine with MariaDB 11.5. I am wondering whether this fix is to be merged into upstream, since this pull request is now open for almost 6 years. udf_infusion is not working with MariaDB from at least version 10.11 (I did not test earlier versions), due to the function naming conflict. Alternatively, if renaming is unwanted for MySQL usage (I did not test with MySQL), a build-time option for ./configure could be used to optionally allow for renaming the three functions using #ifdef's. If naming of the functions is a concern, may be using a prefix like "agg_" for udf_infusion's functions would make the defined aggregate functions easy to distinguish from the build-in MariaDB window functions median(), percentile_cont(), percentile_disc(). |
|
For reference, this is the work-around to apply the pull request to up-to-date udf_infusion, which works with MariaDB 11.5: git clone https://github.com/infusion/udf_infusion.git
cd udf_infusion
git remote add ngaro https://github.com/ngaro/udf_infusion.git
git fetch --all
git merge ngaro/nonative
./configure
make
sudo make install
mariadb [OPTIONS_HERE ...] < load.sql |
|
what about adding a tag "udf_" or "udf_infusion" or "udf_i" to ALL the functions such as This would prevent future clashes and effectively creates a namespace for these extra routines. This would break current code - but could be turned off with an option in configure --no_tag. |
|
Yes, this sounds very reasonable. |
On newer versions of MySQL and MariaDB there are native functions that clash with udf_infusion defined functions.
The following renames where necessary to solve this:
median()is nowmed()percentile_cont()is nowpercentile_contin()percentile_disc()is nowpercentile_discr()