summaryrefslogtreecommitdiff
path: root/mysys/my_init.c
diff options
context:
space:
mode:
authorDaniel Black <daniel@mariadb.org>2022-09-21 11:10:05 +1000
committerSergei Golubchik <serg@mariadb.org>2023-02-10 10:45:25 +0100
commitb30b040b733ff2045ffcd7bdd44f608c7f4912b5 (patch)
treed23e6e1aaa027fe26068e9a87994316d806c2b23 /mysys/my_init.c
parentce4a289f1c367987977f1a02bbb8d8b8e8e6bb53 (diff)
downloadmariadb-git-b30b040b733ff2045ffcd7bdd44f608c7f4912b5.tar.gz
MDEV-29582 deprecate mysql* names
Eventually mysql symlinks will go away, as MariaDB and MySQL keep diverging and we do not want to make it impossible to install MariaDB and MySQL side-by-side when users want it. It also useful if people start using MariaDB tools with MariaDB. If the exe doesn't begine with "mariadb" or is a symlink, print a warning to use the resolved name. In my_readlink, add check on my_thread_var as its used by comp_err and other build utils that also use my_init.
Diffstat (limited to 'mysys/my_init.c')
-rw-r--r--mysys/my_init.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/mysys/my_init.c b/mysys/my_init.c
index 44488e5848a..9ca68e80c1d 100644
--- a/mysys/my_init.c
+++ b/mysys/my_init.c
@@ -170,7 +170,17 @@ my_bool my_init(void)
my_progname_short= "unknown";
if (my_progname)
+ {
+ char link_name[FN_REFLEN];
my_progname_short= my_progname + dirname_length(my_progname);
+ /*
+ If its a link a different program that doesn't begin with mariadb
+ like mariadb-repair might link to mariadb-check.
+ */
+ if (strncmp(my_progname_short, "mariadb", 7)
+ && my_readlink(link_name, my_progname, MYF(0)) == 0)
+ my_error(EE_NAME_DEPRECATED, MYF(MY_WME), my_progname, link_name);
+ }
/* Initialize our mutex handling */
my_mutex_init();