diff --git a/extra/mysql_waitpid.c b/extra/mysql_waitpid.c index 8f2a5c99395..7409e8f1c69 100644 --- a/extra/mysql_waitpid.c +++ b/extra/mysql_waitpid.c @@ -24,7 +24,6 @@ #include static const char *VER= "1.1"; -static char *progname; static my_bool verbose; void usage(void); @@ -50,7 +49,7 @@ get_one_option(const struct my_option *opt, { switch(opt->id) { case 'V': - printf("%s version %s by Jani Tolonen\n", progname, VER); + printf("%s version %s by Jani Tolonen\n", my_progname, VER); exit(0); case 'I': case '?': @@ -65,7 +64,7 @@ int main(int argc, char *argv[]) { int pid= 0, t= 0, sig= 0; - progname= argv[0]; + MY_INIT(argv[0]); if (handle_options(&argc, &argv, my_long_options, get_one_option)) exit(-1); @@ -96,8 +95,8 @@ int main(int argc, char *argv[]) void usage(void) { - printf("%s version %s by Jani Tolonen\n\n", progname, VER); - printf("usage: %s [options] #pid #time\n\n", progname); + printf("%s version %s by Jani Tolonen\n\n", my_progname, VER); + printf("usage: %s [options] #pid #time\n\n", my_progname); printf("Description: Waits for a program, which program id is #pid, to\n"); printf("terminate within #time seconds. If the program terminates within\n"); printf("this time, or if the #pid no longer exists, value 0 is returned.\n"); diff --git a/mysys/errors.c b/mysys/errors.c index a7b2f1ae603..b522590ae7b 100644 --- a/mysys/errors.c +++ b/mysys/errors.c @@ -60,7 +60,7 @@ const char *globerrs[GLOBERRS]= "Lock Pages in memory access rights required", "Memcntl %s cmd %s error", "Warning: Charset id '%d' csname '%s' trying to replace existing csname '%s'", - "Notice: %s is deprecated and will be removed in a future release, use command '%s'" + "Deprecated program name. It will be removed in a future release, use '%s' instead" }; void init_glob_errs(void) diff --git a/mysys/my_init.c b/mysys/my_init.c index 9ca68e80c1d..138b4697f97 100644 --- a/mysys/my_init.c +++ b/mysys/my_init.c @@ -43,6 +43,13 @@ static void setup_codepages(); #define _SC_PAGESIZE _SC_PAGE_SIZE #endif +#if defined(__linux__) +#define EXE_LINKPATH "/proc/self/exe" +#elif defined(__FreeBSD__) +/* unfortunately, not mounted by default */ +#define EXE_LINKPATH "/proc/curproc/file" +#endif + extern pthread_key(struct st_my_thread_var*, THR_KEY_mysys); #define SCALE_SEC 100 @@ -174,12 +181,21 @@ my_bool my_init(void) 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 my_progname_short doesn't start from "mariadb", but it's + a symlink to an actual executable, that does - warn the user. + First try to find the actual name via /proc, but if it's unmounted + (which it usually is on FreeBSD) resort to my_progname */ - 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); + if (strncmp(my_progname_short, "mariadb", 7)) + { + int res= 1; +#ifdef EXE_LINKPATH + res= my_readlink(link_name, EXE_LINKPATH, MYF(0)); +#endif + if ((res == 0 || my_readlink(link_name, my_progname, MYF(0)) == 0) && + strncmp(link_name + dirname_length(link_name), "mariadb", 7) == 0) + my_error(EE_NAME_DEPRECATED, MYF(MY_WME), link_name); + } } /* Initialize our mutex handling */ diff --git a/scripts/mysql_convert_table_format.sh b/scripts/mysql_convert_table_format.sh index 6b4d758a513..c3a719e4543 100644 --- a/scripts/mysql_convert_table_format.sh +++ b/scripts/mysql_convert_table_format.sh @@ -19,6 +19,9 @@ use DBI; use Getopt::Long; +warn "$0: Deprecated program name. It will be removed in a future release, use 'mariadb-convert-table-format' instead\n" + if $0 =~ m/mysql_convert_table_format$/; + $opt_help=$opt_version=$opt_verbose=$opt_force=0; $opt_user=$opt_database=$opt_password=undef; $opt_host="localhost"; diff --git a/scripts/mysql_find_rows.sh b/scripts/mysql_find_rows.sh index 09bcc22790a..a54ceee4071 100644 --- a/scripts/mysql_find_rows.sh +++ b/scripts/mysql_find_rows.sh @@ -18,6 +18,9 @@ $version="1.02"; use Getopt::Long; +warn "$0: Deprecated program name. It will be removed in a future release, use 'mariadb-find-rows' instead\n" + if $0 =~ m/mysql_find_rows$/; + $opt_help=$opt_Information=$opt_skip_use_db=0; $opt_regexp=$opt_dbregexp=".*"; $opt_start_row=1; $opt_rows=9999999999; diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index aeda217b39a..11e2f482273 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -47,8 +47,8 @@ dirname0=`dirname $0 2>/dev/null` dirname0=`dirname $dirname0 2>/dev/null` case "$0" in - *mysql*) - echo "Notice: $0 is deprecated and will be removed in a future release, use command mariadb-install-db" 1>&2 + *mysqld_install_db) + echo "$0: Deprecated program name. It will be removed in a future release, use 'mariadb-install-db' instead" 1>&2 ;; esac diff --git a/scripts/mysql_secure_installation.sh b/scripts/mysql_secure_installation.sh index 8dee27c2f7c..06229cf3d25 100644 --- a/scripts/mysql_secure_installation.sh +++ b/scripts/mysql_secure_installation.sh @@ -30,8 +30,8 @@ defaults_extra_file= no_defaults= case "$0" in - *mysql*) - echo "Notice: $0 is deprecated and will be removed in a future release, use command mariadb-secure-installation" 1>&2 + *mysql_secure_installation) + echo "$0: Deprecated program name. It will be removed in a future release, use 'mariadb-secure-installation' instead" 1>&2 ;; esac diff --git a/scripts/mysql_setpermission.sh b/scripts/mysql_setpermission.sh index b3c9c27ca88..76c07b6816b 100644 --- a/scripts/mysql_setpermission.sh +++ b/scripts/mysql_setpermission.sh @@ -55,6 +55,9 @@ use vars qw($dbh $sth $hostname $opt_user $opt_password $opt_help $opt_host my $sqlhost = ""; my $user = ""; +warn "$0: Deprecated program name. It will be removed in a future release, use 'mariadb-setpermission' instead\n" + if $0 =~ m/mysql_setpermission$/; + $dbh=$host=$opt_user= $opt_password= $opt_help= $opt_host= $opt_socket= ""; $opt_port=3306; diff --git a/scripts/mysqlaccess.sh b/scripts/mysqlaccess.sh index c9b1b72dc21..71f77cf8a11 100644 --- a/scripts/mysqlaccess.sh +++ b/scripts/mysqlaccess.sh @@ -32,6 +32,8 @@ BEGIN { $script = 'MySQLAccess' unless $script; $script_conf = "$script.conf"; $script_log = $ENV{'HOME'}."/$script.log"; + warn "$0: Deprecated program name. It will be removed in a future release, use 'mariadb-access' instead\n" + if $0 =~ m/mysqlaccess$/; # **************************** # information on MariaDB diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 9a1f3920f67..4e774e3c5ee 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -50,6 +50,8 @@ $homedir = $ENV{HOME}; $my_progname = $0; $my_progname =~ s/.*[\/]//; +warn "$0: Deprecated program name. It will be removed in a future release, use 'mariadb-multi' instead\n" + if $0 =~ m/mysqld_multi$/; if (defined($ENV{UMASK})) { my $UMASK = $ENV{UMASK}; diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 34a2de1c119..0802cf0614a 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -40,6 +40,12 @@ syslog_tag_mysqld_safe=mysqld_safe trap '' 1 2 3 15 # we shouldn't let anyone kill us +case "$0" in + *mysqld_safe) + echo "$0: Deprecated program name. It will be removed in a future release, use 'mariadb-safe' instead" 1>&2 + ;; +esac + # MySQL-specific environment variable. First off, it's not really a umask, # it's the desired mode. Second, it follows umask(2), not umask(3) in that # octal needs to be explicit. Our shell might be a proper sh without printf, diff --git a/scripts/mysqldumpslow.sh b/scripts/mysqldumpslow.sh index 5c46587e9e4..582f5c404fb 100644 --- a/scripts/mysqldumpslow.sh +++ b/scripts/mysqldumpslow.sh @@ -26,6 +26,9 @@ use strict; use Getopt::Long; +warn "$0: Deprecated program name. It will be removed in a future release, use 'mariadb-dumpslow' instead\n" + if $0 =~ m/mysqldumpslow$/; + # t=time, l=lock time, r=rows, a=rows affected # at, al, ar and aa are the corresponding averages diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 44abcfec055..a4445612beb 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -27,6 +27,9 @@ use Sys::Hostname; use File::Copy; use File::Temp qw(tempfile); +warn "$0: Deprecated program name. It will be removed in a future release, use 'mariadb-hotcopy' instead\n" + if $0 =~ m/mysqlhotcopy$/; + =head1 NAME mysqlhotcopy - fast on-line hot-backup utility for local MySQL databases and tables diff --git a/storage/rocksdb/tools/mysql_ldb.cc b/storage/rocksdb/tools/mysql_ldb.cc index b1eec03f214..454b7a63c73 100644 --- a/storage/rocksdb/tools/mysql_ldb.cc +++ b/storage/rocksdb/tools/mysql_ldb.cc @@ -8,6 +8,7 @@ #include "rocksdb/ldb_tool.h" int main(int argc, char **argv) { + MY_INIT(argv[0]); rocksdb::Options db_options; myrocks::Rdb_pk_comparator pk_comparator; db_options.comparator = &pk_comparator;