1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

MCOL-520 - changes for mysql_upgrade requiring password

This commit is contained in:
David Hill
2018-11-06 15:35:47 -06:00
parent 5dd8bbd634
commit 5d04584704
4 changed files with 27 additions and 4 deletions

View File

@ -15,6 +15,7 @@ rpmmode=install
user=`whoami 2>/dev/null` user=`whoami 2>/dev/null`
quiet=0 quiet=0
shiftcnt=0 shiftcnt=0
password=" "
for arg in "$@"; do for arg in "$@"; do
if [ $(expr -- "$arg" : '--prefix=') -eq 9 ]; then if [ $(expr -- "$arg" : '--prefix=') -eq 9 ]; then
@ -40,6 +41,9 @@ for arg in "$@"; do
elif [ $(expr -- "$arg" : '--module') -eq 8 ]; then elif [ $(expr -- "$arg" : '--module') -eq 8 ]; then
module="$(echo $arg | awk -F= '{print $2}')" module="$(echo $arg | awk -F= '{print $2}')"
((shiftcnt++)) ((shiftcnt++))
elif [ $(expr -- "$arg" : '--password') -eq 10 ]; then
password="$(echo $arg | awk -F= '{print $2}')"
((shiftcnt++))
fi fi
done done
shift $shiftcnt shift $shiftcnt
@ -155,9 +159,15 @@ if [ $module = "um" ] || ( [ $module = "pm" ] && [ $PMwithUM = "y" ] ) || [ $Ser
echo "ERROR: post-mysqld-install failed: check ${tmpDir}/post-mysqld-install.log" echo "ERROR: post-mysqld-install failed: check ${tmpDir}/post-mysqld-install.log"
exit 1 exit 1
fi fi
echo "Run post-mysql-install" echo "Run post-mysql-install"
$COLUMNSTORE_INSTALL_DIR/bin/post-mysql-install --installdir=$COLUMNSTORE_INSTALL_DIR --tmpdir=${tmpDir} > ${tmpDir}/post-mysql-install.log 2>&1 mysqlPassword=" "
if [[ $password != " " ]]; then
mysqlPassword="--password="$password
fi
$COLUMNSTORE_INSTALL_DIR/bin/post-mysql-install --installdir=$COLUMNSTORE_INSTALL_DIR $mysqlPassword --tmpdir=${tmpDir} > ${tmpDir}/post-mysql-install.log 2>&1
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "ERROR: post-mysql-install failed: check ${tmpDir}/post-mysql-install.log" echo "ERROR: post-mysql-install failed: check ${tmpDir}/post-mysql-install.log"
exit 1 exit 1

View File

@ -282,8 +282,14 @@ void mysqlSetup()
if (p && *p) if (p && *p)
HOME = p; HOME = p;
} }
string mysqlpw = oam.getMySQLPassword();
cmd = installDir + "/bin/post-mysql-install --installdir=" + installDir + " --tmpdir=" + tmpDir + " > " + tmpDir + "/post-mysql-install.log"; string passwordOption = "";
if ( mysqlpw != oam::UnassignedName )
passwordOption = " --password=" + mysqlpw;
cmd = installDir + "/bin/post-mysql-install --installdir=" + installDir + " --tmpdir=" + tmpDir + " " + passwordOption + " > " + tmpDir + "/post-mysql-install.log";
rtnCode = system(cmd.c_str()); rtnCode = system(cmd.c_str());
if (WEXITSTATUS(rtnCode) == 2) if (WEXITSTATUS(rtnCode) == 2)

View File

@ -242,9 +242,16 @@ int main(int argc, char** argv)
} }
string modType = config.moduleType(); string modType = config.moduleType();
string mysqlpw = oam.getMySQLPassword();
string passwordOption = "";
if ( mysqlpw != oam::UnassignedName )
passwordOption = " --password=" + mysqlpw;
//run the module install script //run the module install script
string cmd = startup::StartUp::installDir() + "/bin/module_installer.sh " + " --installdir=" + startup::StartUp::installDir() + " --module=" + modType + " > " + tmpLogDir + "/module_installer.log 2>&1"; string cmd = startup::StartUp::installDir() + "/bin/module_installer.sh " + " --installdir=" + startup::StartUp::installDir() + " --module=" + modType + " " + passwordOption + " > " + tmpLogDir + "/module_installer.log 2>&1";
log.writeLog(__LINE__, "run module_installer.sh", LOG_TYPE_DEBUG); log.writeLog(__LINE__, "run module_installer.sh", LOG_TYPE_DEBUG);
log.writeLog(__LINE__, cmd, LOG_TYPE_DEBUG); log.writeLog(__LINE__, cmd, LOG_TYPE_DEBUG);

View File

@ -6588,7 +6588,7 @@ int ProcessMonitor::runUpgrade()
string mysqlpw = oam.getMySQLPassword(); string mysqlpw = oam.getMySQLPassword();
string passwordOption = passwordOption = ""; string passwordOption = "";
if ( mysqlpw != oam::UnassignedName ) if ( mysqlpw != oam::UnassignedName )
passwordOption = " --password=" + mysqlpw; passwordOption = " --password=" + mysqlpw;