← Back to team overview

maria-developers team mailing list archive

Re: 9acabefd276: MDEV-22010: use executables MariaDB named in scripts

 

Hi, Rucha!

On Mar 17, Rucha Deodhar wrote:
> revision-id: 9acabefd276 (mariadb-10.5.2-386-g9acabefd276)
> parent(s): de407e7cb4d
> author: Rucha Deodhar <rucha.deodhar@xxxxxxxxxxx>
> committer: Rucha Deodhar <rucha.deodhar@xxxxxxxxxxx>
> timestamp: 2021-02-11 15:19:29 +0530
> message:
> 
> MDEV-22010: use executables MariaDB named in scripts
> 
> As a part of this MDEV following changes were made:
> 1) Mariadb named executables used instead of mysql named executables in scripts
> 2) renamed mysql-test-run and mysql-stress-test to mariadb-test-run and
> mariadb-stress-test and created a symlink.
> 
> diff --git a/debian/mariadb-test.links b/debian/mariadb-test.links
> index 718a5355474..b3577667d01 100644
> --- a/debian/mariadb-test.links
> +++ b/debian/mariadb-test.links
> @@ -2,5 +2,7 @@ usr/bin/mariadb-client-test usr/bin/mysql_client_test
>  usr/bin/mariadb-client-test-embedded usr/bin/mysql_client_test_embedded
>  usr/bin/mariadb-test usr/bin/mysqltest
>  usr/bin/mariadb-test-embedded usr/bin/mysqltest_embedded
> -usr/share/mysql/mysql-test/mysql-test-run.pl usr/share/mysql/mysql-test/mtr
> -usr/share/mysql/mysql-test/mysql-test-run.pl usr/share/mysql/mysql-test/mysql-test-run
> +usr/share/mysql/mysql-test/mariadb-test-run.pl usr/share/mysql/mysql-test/mysql-test-run.pl
> +usr/share/mysql/mysql-test/mariadb-stress-test.pl usr/share/mysql/mysql-test/mysql-stress-test.pl
> +usr/share/mysql/mysql-test/mariadb-test-run.pl usr/share/mysql/mysql-test/mysql-test-run
> +usr/share/mysql/mysql-test/mariadb-test-run.pl usr/share/mysql/mysql-test/mtr

Not sure that was part of the task, but ok.
Did you check that both debs and rpms package all new symlinks correctly?

> diff --git a/mysql-test/.mtr b/mysql-test/.mtr
> new file mode 120000
> index 00000000000..68986c8cd7e
> --- /dev/null
> +++ b/mysql-test/.mtr
> @@ -0,0 +1 @@
> +./mariadb-test-run

What is that? What is .mtr file?

> \ No newline at end of file
> diff --git a/mysql-test/mysql-stress-test.pl b/mysql-test/mysql-stress-test.pl
> new file mode 120000
> index 00000000000..e704a5d70bf
> --- /dev/null
> +++ b/mysql-test/mysql-stress-test.pl
> @@ -0,0 +1 @@
> +./mariadb-stress-test.pl

looks like you've checked in files you shouldn't have. Like symlinks.

> \ No newline at end of file
> diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
> new file mode 120000
> index 00000000000..56150a0ecad
> --- /dev/null
> +++ b/mysql-test/mysql-test-run.pl
> @@ -0,0 +1 @@
> +./mariadb-test-run.pl

another one

> \ No newline at end of file
> diff --git a/scripts/msql2mysql.sh b/scripts/msql2mysql.sh
> index 72a609fa6e7..11923fa15c7 100644
> --- a/scripts/msql2mysql.sh
> +++ b/scripts/msql2mysql.sh
> @@ -16,4 +16,4 @@
>  # Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston
>  # MA  02110-1335  USA.
>  
> -@bindir@/replace msqlConnect mysql_connect msqlListDBs  mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $*
> +@bindir@/replace msqlConnect mysql_connect msqlListDBs  mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mysql mariadb mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $*

Why?

> diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
> index 5f183afe8fc..084af42d01c 100644
> --- a/scripts/mysql_install_db.sh
> +++ b/scripts/mysql_install_db.sh
> @@ -338,11 +338,15 @@ then
>      cannot_find_file resolveip @resolveip_locations@
>      exit 1
>    fi
> -  mysqld=`find_in_dirs mysqld @mysqld_locations@`
> +  mysqld=`find_in_dirs mariadbd @mysqld_locations@`
>    if test -z "$mysqld"
>    then
> -    cannot_find_file mysqld @mysqld_locations@
> -    exit 1
> +    mysqld=`find_in_dirs mysqld @mysqld_locations@`
> +    if test -z "$mysqld"
> +    then
> +      cannot_find_file mysqld @mysqld_locations@

Hmm. At least, it should be mariadbd in the cannot_find_file line.

Why do you search for mysqld after mariadbd wasn't found?

> +      exit 1
> +    fi
>    fi
>    langdir=`find_in_dirs --dir errmsg.sys @errmsg_locations@`
>    if test -z "$langdir"
> @@ -579,7 +583,7 @@ else
>    echo
>    echo "    shell> $mysqld --skip-grant-tables --general-log &"
>    echo
> -  echo "and use the command line tool $bindir/mysql"
> +  echo "and use the command line tool $bindir/mariadb or $bindir/mysql"

again, why both?

>    echo "to connect to the mysql database and look at the grant tables:"
>    echo
>    echo "    shell> $bindir/mysql -u root mysql"
> @@ -613,7 +617,9 @@ then
>      echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !"
>      echo "To do so, start the server, then issue the following commands:"
>      echo
> +    echo "'$bindir/mariadb-admin' -u root password 'new-password' or"
>      echo "'$bindir/mysqladmin' -u root password 'new-password'"
> +    echo "'$bindir/mariadb-admin' -u root -h $hostname password 'new-password' or"
>      echo "'$bindir/mysqladmin' -u root -h $hostname password 'new-password'"

and here

>      echo
>      echo "Alternatively you can run:"
> diff --git a/scripts/mysql_secure_installation.sh b/scripts/mysql_secure_installation.sh
> index b2a9edf4953..12364f1be43 100644
> --- a/scripts/mysql_secure_installation.sh
> +++ b/scripts/mysql_secure_installation.sh
> @@ -159,15 +159,19 @@ then
>      cannot_find_file my_print_defaults $basedir/bin $basedir/extra
>      exit 1
>    fi
> -  mysql_command=`find_in_basedir mysql bin`
> +  mysql_command=`find_in_basedir mariadb bin`
>    if test -z "$mysql_command"
>    then
> -    cannot_find_file mysql $basedir/bin
> -    exit 1
> +    mysql_command=`find_in_basedir mysql bin`
> +    if test -z "$mysql_command"
> +    then
> +      cannot_find_file mysql $basedir/bin
> +      exit 1
> +    fi

same as above

>    fi
>  else
>    print_defaults="@bindir@/my_print_defaults"
> -  mysql_command="@bindir@/mysql"
> +  mysql_command="@bindir@/mariadb"
>  fi
>  
>  if test ! -x "$print_defaults"
> diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
> index 126eb924814..7763fb9db91 100644
> --- a/scripts/mysqld_safe.sh
> +++ b/scripts/mysqld_safe.sh
> @@ -531,7 +531,11 @@ else
>    ledir='@libexecdir@'
>  fi
>  
> -helper=`find_in_bin mysqld_safe_helper`
> +helper=`find_in_bin mariadbd-safe-helper`
> +if test -x helper
> +then
> +   helper=`find_in_bin mysqld_safe_helper`
> +fi

and here

>  print_defaults=`find_in_bin my_print_defaults`
>  # Check if helper exists
>  command -v $helper --help >/dev/null 2>&1
> diff --git a/scripts/wsrep_sst_common.sh b/scripts/wsrep_sst_common.sh
> index 5e134570881..cf38bda8f70 100644
> --- a/scripts/wsrep_sst_common.sh
> +++ b/scripts/wsrep_sst_common.sh
> @@ -273,13 +273,21 @@ SCRIPTS_DIR="$(cd $(dirname "$0"); pwd -P)"
>  EXTRA_DIR="$SCRIPTS_DIR/../extra"
>  CLIENT_DIR="$SCRIPTS_DIR/../client"
>  
> -if [ -x "$CLIENT_DIR/mysql" ]; then
> +if [-x "$CLIENT_DIR/mariadb"]; then
> +    MYSQL_CLIENT="$CLIENT_DIR/mariadb"
> +elif [-x mariadb] then;
> +    MYSQL_CLIENT=mariadb
> +elif [ -x "$CLIENT_DIR/mysql" ]; then
>      MYSQL_CLIENT="$CLIENT_DIR/mysql"
>  else
>      MYSQL_CLIENT=mysql
>  fi
>  
> -if [ -x "$CLIENT_DIR/mysqldump" ]; then
> +if [ -x "$CLIENT_DIR/mariadb-dump" ]; then
> +    MYSQLDUMP="$CLIENT_DIR/mariadb-dump"
> +elif [-x mariadb-dump]; then
> +    MYSQLDUMP=mariadb-dump
> +elif [ -x "$CLIENT_DIR/mysqldump" ]; then
>      MYSQLDUMP="$CLIENT_DIR/mysqldump"
>  else
>      MYSQLDUMP=mysqldump

and here

Regards,
Sergei
VP of MariaDB Server Engineering
and security@xxxxxxxxxxx