mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Added more rows to test to get predictable results
This commit is contained in:
@ -250,18 +250,18 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||||||
1 SIMPLE t1 index x x 5 NULL 9 Using where; Using index
|
1 SIMPLE t1 index x x 5 NULL 9 Using where; Using index
|
||||||
drop table t1;
|
drop table t1;
|
||||||
CREATE TABLE t1 (key1 int(11) NOT NULL default '0', KEY i1 (key1));
|
CREATE TABLE t1 (key1 int(11) NOT NULL default '0', KEY i1 (key1));
|
||||||
INSERT INTO t1 VALUES (0),(1),(1);
|
INSERT INTO t1 VALUES (0),(0),(0),(0),(0),(1),(1);
|
||||||
CREATE TABLE t2 (keya int(11) NOT NULL default '0', KEY j1 (keya));
|
CREATE TABLE t2 (keya int(11) NOT NULL default '0', KEY j1 (keya));
|
||||||
INSERT INTO t2 VALUES (0),(0),(1),(1),(2),(2);
|
INSERT INTO t2 VALUES (0),(0),(1),(1),(2),(2);
|
||||||
explain select * from t1, t2 where (t1.key1 <t2.keya + 1) and t2.keya=3;
|
explain select * from t1, t2 where (t1.key1 <t2.keya + 1) and t2.keya=3;
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t2 ref j1 j1 4 const 1 Using index
|
1 SIMPLE t2 ref j1 j1 4 const 1 Using index
|
||||||
1 SIMPLE t1 index i1 i1 4 NULL 3 Using where; Using index
|
1 SIMPLE t1 range i1 i1 4 NULL 7 Using where; Using index
|
||||||
explain select * from t1 force index(i1), t2 force index(j1) where
|
explain select * from t1 force index(i1), t2 force index(j1) where
|
||||||
(t1.key1 <t2.keya + 1) and t2.keya=3;
|
(t1.key1 <t2.keya + 1) and t2.keya=3;
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t2 ref j1 j1 4 const 1 Using index
|
1 SIMPLE t2 ref j1 j1 4 const 1 Using index
|
||||||
1 SIMPLE t1 index i1 i1 4 NULL 3 Using where; Using index
|
1 SIMPLE t1 range i1 i1 4 NULL 7 Using where; Using index
|
||||||
DROP TABLE t1,t2;
|
DROP TABLE t1,t2;
|
||||||
CREATE TABLE t1 (
|
CREATE TABLE t1 (
|
||||||
a int(11) default NULL,
|
a int(11) default NULL,
|
||||||
|
@ -198,7 +198,7 @@ drop table t1;
|
|||||||
# bug #1172: "Force index" option caused server crash
|
# bug #1172: "Force index" option caused server crash
|
||||||
#
|
#
|
||||||
CREATE TABLE t1 (key1 int(11) NOT NULL default '0', KEY i1 (key1));
|
CREATE TABLE t1 (key1 int(11) NOT NULL default '0', KEY i1 (key1));
|
||||||
INSERT INTO t1 VALUES (0),(1),(1);
|
INSERT INTO t1 VALUES (0),(0),(0),(0),(0),(1),(1);
|
||||||
CREATE TABLE t2 (keya int(11) NOT NULL default '0', KEY j1 (keya));
|
CREATE TABLE t2 (keya int(11) NOT NULL default '0', KEY j1 (keya));
|
||||||
INSERT INTO t2 VALUES (0),(0),(1),(1),(2),(2);
|
INSERT INTO t2 VALUES (0),(0),(1),(1),(2),(2);
|
||||||
explain select * from t1, t2 where (t1.key1 <t2.keya + 1) and t2.keya=3;
|
explain select * from t1, t2 where (t1.key1 <t2.keya + 1) and t2.keya=3;
|
||||||
|
@ -233,7 +233,7 @@ if [ $BASE_SYSTEM != "netware" ] ; then
|
|||||||
chmod a+x $BASE/bin/*
|
chmod a+x $BASE/bin/*
|
||||||
$CP scripts/* $BASE/bin
|
$CP scripts/* $BASE/bin
|
||||||
$BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@ \@pkgdatadir\@ ./support-files < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db
|
$BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@ \@pkgdatadir\@ ./support-files < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db
|
||||||
$BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@sbindir\@ ./bin \@MYSQLD_USER\@ mysql \@localstatedir\@ /usr/local/mysql/data \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server
|
$BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@sbindir\@ ./bin \@libexecdir\@ ./bin \@MYSQLD_USER\@ @MYSQLD_USER@ \@localstatedir\@ /usr/local/mysql/data \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server
|
||||||
$BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe
|
$BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe
|
||||||
mv $BASE/support-files/binary-configure $BASE/configure
|
mv $BASE/support-files/binary-configure $BASE/configure
|
||||||
chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* $BASE/support-files/mysql.server $BASE/configure
|
chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* $BASE/support-files/mysql.server $BASE/configure
|
||||||
|
@ -48,15 +48,19 @@ datadir=
|
|||||||
|
|
||||||
# Set some defaults
|
# Set some defaults
|
||||||
pid_file=
|
pid_file=
|
||||||
|
server_pid_file=
|
||||||
|
user=@MYSQLD_USER@
|
||||||
if test -z "$basedir"
|
if test -z "$basedir"
|
||||||
then
|
then
|
||||||
basedir=@prefix@
|
basedir=@prefix@
|
||||||
bindir=@bindir@
|
bindir=@bindir@
|
||||||
datadir=@localstatedir@
|
datadir=@localstatedir@
|
||||||
sbindir=@sbindir@
|
sbindir=@sbindir@
|
||||||
|
libexecdir=@libexecdir@
|
||||||
else
|
else
|
||||||
bindir="$basedir/bin"
|
bindir="$basedir/bin"
|
||||||
sbindir="$basedir/sbin"
|
sbindir="$basedir/bin"
|
||||||
|
libexecdir="$basedir/bin"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -92,6 +96,8 @@ parse_server_arguments() {
|
|||||||
case "$arg" in
|
case "$arg" in
|
||||||
--basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
|
--basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
|
||||||
--datadir=*) datadir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
|
--datadir=*) datadir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
|
||||||
|
--user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
|
||||||
|
--pid-file=*) server_pid_file=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@ -100,6 +106,7 @@ parse_manager_arguments() {
|
|||||||
for arg do
|
for arg do
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
--pid-file=*) pid_file=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
|
--pid-file=*) pid_file=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
|
||||||
|
--user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@ -181,7 +188,7 @@ then
|
|||||||
extra_args="-e $datadir/my.cnf"
|
extra_args="-e $datadir/my.cnf"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
parse_server_arguments `$print_defaults $extra_args mysqld`
|
parse_server_arguments `$print_defaults $extra_args mysqld server mysql_server mysql.server`
|
||||||
|
|
||||||
# Look for the pidfile
|
# Look for the pidfile
|
||||||
parse_manager_arguments `$print_defaults $extra_args manager`
|
parse_manager_arguments `$print_defaults $extra_args manager`
|
||||||
@ -198,9 +205,15 @@ else
|
|||||||
* ) pid_file="$datadir/$pid_file" ;;
|
* ) pid_file="$datadir/$pid_file" ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
if test -z "$server_pid_file"
|
||||||
user=@MYSQLD_USER@
|
then
|
||||||
USER_OPTION="--user=$user"
|
server_pid_file=$datadir/`@HOSTNAME@`.pid
|
||||||
|
else
|
||||||
|
case "$server_pid_file" in
|
||||||
|
/* ) ;;
|
||||||
|
* ) server_pid_file="$datadir/$server_pid_file" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
# Safeguard (relative paths, core dumps..)
|
# Safeguard (relative paths, core dumps..)
|
||||||
cd $basedir
|
cd $basedir
|
||||||
@ -209,12 +222,21 @@ case "$mode" in
|
|||||||
'start')
|
'start')
|
||||||
# Start daemon
|
# Start daemon
|
||||||
|
|
||||||
if test -x $sbindir/mysqlmanager
|
manager=$bindir/mysqlmanager
|
||||||
|
if test -x $libexecdir/mysqlmanager
|
||||||
|
then
|
||||||
|
manager=$libexecdir/mysqlmanager
|
||||||
|
elif test -x $bindir/mysqlmanager
|
||||||
|
then
|
||||||
|
manager=$sbindir/mysqlmanager
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -x $manager
|
||||||
then
|
then
|
||||||
# Give extra arguments to mysqld with the my.cnf file. This script may
|
# Give extra arguments to mysqld with the my.cnf file. This script may
|
||||||
# be overwritten at next upgrade.
|
# be overwritten at next upgrade.
|
||||||
echo $echo_n "Starting MySQL"
|
echo $echo_n "Starting MySQL"
|
||||||
$sbindir/mysqlmanager $USER_OPTION --pid-file=$pid_file >/dev/null 2>&1 &
|
$manager --user=$user --pid-file=$pid_file >/dev/null 2>&1 &
|
||||||
wait_for_pid created
|
wait_for_pid created
|
||||||
|
|
||||||
# Make lock for RedHat / SuSE
|
# Make lock for RedHat / SuSE
|
||||||
@ -222,14 +244,38 @@ case "$mode" in
|
|||||||
then
|
then
|
||||||
touch /var/lock/subsys/mysqlmanager
|
touch /var/lock/subsys/mysqlmanager
|
||||||
fi
|
fi
|
||||||
|
elif test -x $bindir/mysqld_safe
|
||||||
|
then
|
||||||
|
# Give extra arguments to mysqld with the my.cnf file. This script may be overwritten at next upgrade.
|
||||||
|
echo $echo_n "Starting MySQL"
|
||||||
|
pid_file=$server_pid_file
|
||||||
|
$bindir/mysqld_safe --datadir=$datadir --pid-file=$server_pid_file >/dev/null 2>&1 &
|
||||||
|
wait_for_pid created
|
||||||
|
|
||||||
|
# Make lock for RedHat / SuSE
|
||||||
|
if test -w /var/lock/subsys
|
||||||
|
then
|
||||||
|
touch /var/lock/subsys/mysql
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
log_failure_msg "Can't execute $sbindir/mysqlmanager"
|
log_failure_msg "Couldn't find MySQL manager or server"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
'stop')
|
'stop')
|
||||||
# Stop daemon. We use a signal here to avoid having to know the
|
# Stop daemon. We use a signal here to avoid having to know the
|
||||||
# root password.
|
# root password.
|
||||||
|
|
||||||
|
# The RedHat / SuSE lock directory to remove
|
||||||
|
lock_dir=/var/lock/subsys/mysqlmanager
|
||||||
|
|
||||||
|
# If the manager pid_file doesn't exist, try the server's
|
||||||
|
if test ! -s "$pid_file"
|
||||||
|
then
|
||||||
|
pid_file=$server_pid_file
|
||||||
|
lock_dir=/var/lock/subsys/mysql
|
||||||
|
fi
|
||||||
|
|
||||||
if test -s "$pid_file"
|
if test -s "$pid_file"
|
||||||
then
|
then
|
||||||
mysqlmanager_pid=`cat $pid_file`
|
mysqlmanager_pid=`cat $pid_file`
|
||||||
@ -239,12 +285,12 @@ case "$mode" in
|
|||||||
wait_for_pid removed
|
wait_for_pid removed
|
||||||
|
|
||||||
# delete lock for RedHat / SuSE
|
# delete lock for RedHat / SuSE
|
||||||
if test -f /var/lock/subsys/mysqlmanager
|
if test -f $lock_dir
|
||||||
then
|
then
|
||||||
rm -f /var/lock/subsys/mysqlmanager
|
rm -f $lock_dir
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
log_failure_msg "mysqlmanager PID file could not be found!"
|
log_failure_msg "MySQL manager or server PID file could not be found!"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@ -255,9 +301,19 @@ case "$mode" in
|
|||||||
$0 start
|
$0 start
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
'reload')
|
||||||
|
if test -s "$server_pid_file" ; then
|
||||||
|
mysqld_pid=`cat $server_pid_file`
|
||||||
|
kill -HUP $mysqld_pid && log_success_msg "Reloading service MySQL"
|
||||||
|
touch $server_pid_file
|
||||||
|
else
|
||||||
|
log_failure_msg "MySQL PID file could not be found!"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
# usage
|
# usage
|
||||||
echo "Usage: $0 start|stop|restart"
|
echo "Usage: $0 start|stop|restart|reload"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
Reference in New Issue
Block a user