Skip to content

Commit a90d37e

Browse files
author
Mats Kindahl
committed
Merging with mysql-5.5
2 parents c497fb7 + e6ff7b6 commit a90d37e

File tree

8 files changed

+72
-25
lines changed

8 files changed

+72
-25
lines changed

client/readline.cc

+2
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file)
3333
LINE_BUFFER *line_buff;
3434
MY_STAT input_file_stat;
3535

36+
#ifndef __WIN__
3637
if (my_fstat(fileno(file), &input_file_stat, MYF(MY_WME)) ||
3738
MY_S_ISDIR(input_file_stat.st_mode) ||
3839
MY_S_ISBLK(input_file_stat.st_mode))
3940
return 0;
41+
#endif
4042

4143
if (!(line_buff=(LINE_BUFFER*)
4244
my_malloc(sizeof(*line_buff),MYF(MY_WME | MY_ZEROFILL))))
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=debug --vardir=var-debug --skip-ndbcluster --skip-rpl --report-features --debug-server
2+
perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=normal --vardir=var-normal --skip-ndbcluster --report-features
3+
perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=ps --vardir=var-ps --skip-ndbcluster --ps-protocol
4+
perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=funcs1+ps --vardir=var-funcs_1_ps --suite=funcs_1 --ps-protocol
5+
perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=funcs2 --vardir=var-funcs2 --suite=funcs_2
6+
perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=partitions --vardir=var-parts --suite=parts
7+
perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=stress --vardir=var-stress --suite=stress
8+
perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=jp --vardir=var-jp --suite=jp
9+
perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-embedded --embedded-server --skip-rpl --skip-ndbcluster
10+
perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=nist --vardir=var-nist --suite=nist
11+
perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=nist+ps --vardir=var-nist_ps --suite=nist --ps-protocol

mysql-test/collections/test-bt

-10
This file was deleted.

mysql-test/collections/test-bt-debug

-1
This file was deleted.

mysql-test/collections/test-bt-debug-fast

Whitespace-only changes.

mysql-test/collections/test-bt-fast

-2
This file was deleted.

mysql-test/mysql-test-run.pl

+1-1
Original file line numberDiff line numberDiff line change
@@ -2022,7 +2022,7 @@ ($)
20222022

20232023
# Need to check if we will be running mysqld-debug
20242024
if ($opt_debug_server) {
2025-
$running_debug= 1 if find_mysqld($basedir) =~ /-debug$/;
2025+
$running_debug= 1 if find_mysqld($basedir) =~ /mysqld-debug/;
20262026
}
20272027

20282028
while (<PLUGDEF>) {

support-files/mysql.spec.sh

+58-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
22
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License as published by
@@ -523,10 +523,27 @@ rm -f $RBR%{_mandir}/man1/make_win_bin_dist.1*
523523
##############################################################################
524524

525525
%pre -n MySQL-server%{product_suffix}
526+
# This is the code running at the beginning of a RPM upgrade action,
527+
# before replacing the old files with the new ones.
526528

527529
# ATTENTION: Parts of this are duplicated in the "triggerpostun" !
528530

529-
mysql_datadir=%{mysqldatadir}
531+
# There are users who deviate from the default file system layout.
532+
# Check local settings to support them.
533+
if [ -x %{_bindir}/my_print_defaults ]
534+
then
535+
mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'`
536+
PID_FILE_PATT=`%{_bindir}/my_print_defaults server mysqld | grep '^--pid-file=' | sed -n 's/--pid-file=//p'`
537+
fi
538+
if [ -z "$mysql_datadir" ]
539+
then
540+
mysql_datadir=%{mysqldatadir}
541+
fi
542+
if [ -z "$PID_FILE_PATT" ]
543+
then
544+
PID_FILE_PATT="$mysql_datadir/*.pid"
545+
fi
546+
530547
# Check if we can safely upgrade. An upgrade is only safe if it's from one
531548
# of our RPMs in the same version family.
532549

@@ -601,7 +618,7 @@ fi
601618

602619
# We assume that if there is exactly one ".pid" file,
603620
# it contains the valid PID of a running MySQL server.
604-
NR_PID_FILES=`ls $mysql_datadir/*.pid 2>/dev/null | wc -l`
621+
NR_PID_FILES=`ls $PID_FILE_PATT 2>/dev/null | wc -l`
605622
case $NR_PID_FILES in
606623
0 ) SERVER_TO_START='' ;; # No "*.pid" file == no running server
607624
1 ) SERVER_TO_START='true' ;;
@@ -623,8 +640,8 @@ if [ -f $STATUS_FILE ]; then
623640
echo "before repeating the MySQL upgrade."
624641
exit 1
625642
elif [ -n "$SEVERAL_PID_FILES" ] ; then
626-
echo "Your MySQL directory '$mysql_datadir' has more than one PID file:"
627-
ls -ld $mysql_datadir/*.pid
643+
echo "You have more than one PID file:"
644+
ls -ld $PID_FILE_PATT
628645
echo "Please check which one (if any) corresponds to a running server"
629646
echo "and delete all others before repeating the MySQL upgrade."
630647
exit 1
@@ -649,17 +666,17 @@ if [ -d $mysql_datadir ] ; then
649666
if [ -n "$SERVER_TO_START" ] ; then
650667
# There is only one PID file, race possibility ignored
651668
echo "PID file:" >> $STATUS_FILE
652-
ls -l $mysql_datadir/*.pid >> $STATUS_FILE
653-
cat $mysql_datadir/*.pid >> $STATUS_FILE
669+
ls -l $PID_FILE_PATT >> $STATUS_FILE
670+
cat $PID_FILE_PATT >> $STATUS_FILE
654671
echo >> $STATUS_FILE
655672
echo "Server process:" >> $STATUS_FILE
656-
ps -fp `cat $mysql_datadir/*.pid` >> $STATUS_FILE
673+
ps -fp `cat $PID_FILE_PATT` >> $STATUS_FILE
657674
echo >> $STATUS_FILE
658675
echo "SERVER_TO_START=$SERVER_TO_START" >> $STATUS_FILE
659676
else
660677
# Take a note we checked it ...
661678
echo "PID file:" >> $STATUS_FILE
662-
ls -l $mysql_datadir/*.pid >> $STATUS_FILE 2>&1
679+
ls -l $PID_FILE_PATT >> $STATUS_FILE 2>&1
663680
fi
664681
fi
665682

@@ -674,10 +691,22 @@ if [ -x %{_sysconfdir}/init.d/mysql ] ; then
674691
fi
675692

676693
%post -n MySQL-server%{product_suffix}
694+
# This is the code running at the end of a RPM install or upgrade action,
695+
# after the (new) files have been written.
677696

678697
# ATTENTION: Parts of this are duplicated in the "triggerpostun" !
679698

680-
mysql_datadir=%{mysqldatadir}
699+
# There are users who deviate from the default file system layout.
700+
# Check local settings to support them.
701+
if [ -x %{_bindir}/my_print_defaults ]
702+
then
703+
mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'`
704+
fi
705+
if [ -z "$mysql_datadir" ]
706+
then
707+
mysql_datadir=%{mysqldatadir}
708+
fi
709+
681710
NEW_VERSION=%{mysql_version}-%{release}
682711
STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER
683712

@@ -855,7 +884,17 @@ fi
855884
# http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch10s02.html
856885
# For all details of this code, see the "pre" and "post" sections.
857886

858-
mysql_datadir=%{mysqldatadir}
887+
# There are users who deviate from the default file system layout.
888+
# Check local settings to support them.
889+
if [ -x %{_bindir}/my_print_defaults ]
890+
then
891+
mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'`
892+
fi
893+
if [ -z "$mysql_datadir" ]
894+
then
895+
mysql_datadir=%{mysqldatadir}
896+
fi
897+
859898
NEW_VERSION=%{mysql_version}-%{release}
860899
STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER-LAST # Note the difference!
861900
STATUS_HISTORY=$mysql_datadir/RPM_UPGRADE_HISTORY
@@ -1085,6 +1124,14 @@ echo "=====" >> $STATUS_HISTORY
10851124
# merging BK trees)
10861125
##############################################################################
10871126
%changelog
1127+
1128+
* Thu Feb 09 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
1129+
1130+
- Fix bug#56581: If an installation deviates from the default file locations
1131+
("datadir" and "pid-file"), the mechanism to detect a running server (on upgrade)
1132+
should still work, and use these locations.
1133+
The problem was that the fix for bug#27072 did not check for local settings.
1134+
10881135
* Tue Nov 23 2010 Jonathan Perkin <jonathan.perkin@oracle.com>
10891136

10901137
- EXCEPTIONS-CLIENT has been deleted, remove it from here too

0 commit comments

Comments
 (0)