diff --git a/plugins/mysql/patch/mysql-5.5-fix-arm-client_plugin.patch b/plugins/mysql/patch/mysql-5.5-fix-arm-client_plugin.patch new file mode 100644 index 000000000..6c6f30ec2 --- /dev/null +++ b/plugins/mysql/patch/mysql-5.5-fix-arm-client_plugin.patch @@ -0,0 +1,37 @@ +diff -ruN mysql-5.5.42.orig/sql-common/client_plugin.c mysql-5.5.42/sql-common/client_plugin.c +--- mysql-5.5.42.orig/sql-common/client_plugin.c 2015-01-07 04:39:40.000000000 +0800 ++++ mysql-5.5.42/sql-common/client_plugin.c 2015-03-24 10:36:45.682700014 +0800 +@@ -233,6 +233,7 @@ + { + MYSQL mysql; + struct st_mysql_client_plugin **builtin; ++ va_list dummy; + + if (initialized) + return 0; +@@ -249,7 +250,7 @@ + pthread_mutex_lock(&LOCK_load_client_plugin); + + for (builtin= mysql_client_builtins; *builtin; builtin++) +- add_plugin(&mysql, *builtin, 0, 0, 0); ++ add_plugin(&mysql, *builtin, 0, 0, dummy); + + pthread_mutex_unlock(&LOCK_load_client_plugin); + +@@ -293,6 +294,7 @@ + mysql_client_register_plugin(MYSQL *mysql, + struct st_mysql_client_plugin *plugin) + { ++ va_list dummy; + if (is_not_initialized(mysql, plugin->name)) + return NULL; + +@@ -307,7 +309,7 @@ + plugin= NULL; + } + else +- plugin= add_plugin(mysql, plugin, 0, 0, 0); ++ plugin= add_plugin(mysql, plugin, 0, 0, dummy); + + pthread_mutex_unlock(&LOCK_load_client_plugin); + return plugin; diff --git a/plugins/mysql/versions/5.5/install.sh b/plugins/mysql/versions/5.5/install.sh index d561f64d9..b7be4c2b9 100755 --- a/plugins/mysql/versions/5.5/install.sh +++ b/plugins/mysql/versions/5.5/install.sh @@ -10,12 +10,53 @@ rootPath=$(dirname "$curPath") rootPath=$(dirname "$rootPath") serverPath=$(dirname "$rootPath") sysName=`uname` +sysArch=`arch` install_tmp=${rootPath}/tmp/mw_install.pl mysqlDir=${serverPath}/source/mysql VERSION=5.5.62 +_os=`uname` +echo "use system: ${_os}" +if [ ${_os} == "Darwin" ]; then + OSNAME='macos' +elif grep -Eq "openSUSE" /etc/*-release; then + OSNAME='opensuse' + zypper refresh +elif grep -Eq "FreeBSD" /etc/*-release; then + OSNAME='freebsd' + pkg install -y wget unzip +elif grep -Eqi "Arch" /etc/issue || grep -Eq "Arch" /etc/*-release; then + OSNAME='arch' + echo y | pacman -Sy unzip +elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then + OSNAME='centos' + yum install -y wget zip unzip +elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then + OSNAME='fedora' + yum install -y wget zip unzip +elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then + OSNAME='rocky' + yum install -y wget zip unzip +elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then + OSNAME='alma' + yum install -y wget zip unzip +elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then + OSNAME='debian' + apt update -y + apt install -y devscripts + apt install -y wget zip unzip +elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then + OSNAME='ubuntu' + apt install -y wget zip unzip +else + OSNAME='unknow' +fi + +VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` + + Install_mysql() { mkdir -p ${mysqlDir} @@ -69,6 +110,13 @@ Install_mysql() WHERE_DIR_GPP=`which g++` fi + # https://blog.whsir.com/post-7748.html + # arm架构编译MySQL5.5报错 + if [[ "$sysArch" =~ "aarch" ]];then + # wget --no-check-certificate -O ${mysqlDir}/mysql-5.5-fix-arm-client_plugin.patch https://down.whsir.com/downloads/mysql-5.5-fix-arm-client_plugin.patch + cd ${mysqlDir}/mysql-5.5.62 && patch -p1 < ${rootPath}/plugins/mysql/patch/mysql-5.5-fix-arm-client_plugin.patch + fi + if [ "$OSNAME" == "ubuntu" ];then apt install -y libudev-dev apt install -y libtirpc-dev