summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/mysql-test-run.sh22
-rw-r--r--mysql-test/r/grant.result33
-rw-r--r--mysql-test/t/grant.test21
3 files changed, 69 insertions, 7 deletions
diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh
index a26b597f8db..9a825ea125e 100644
--- a/mysql-test/mysql-test-run.sh
+++ b/mysql-test/mysql-test-run.sh
@@ -37,10 +37,11 @@ which ()
continue 2
fi
done
- echo "which: no $file in ($PATH)"
+ echo "Fatal error: Cannot find program $file in $PATH" 1>&2
exit 1
done
IFS="$save_ifs"
+ exit 0
}
@@ -68,7 +69,7 @@ sleep_until_file_created ()
do
if [ -r $file ]
then
- return
+ return 0
fi
sleep 1
loop=`expr $loop - 1`
@@ -81,8 +82,10 @@ sleep_until_file_created ()
SED=sed
-BASENAME=`which basename | $SED q`
+BASENAME=`which basename`
+if test $? != 0; then exit 1; fi
DIFF=`which diff | $SED q`
+if test $? != 0; then exit 1; fi
CAT=cat
CUT=cut
HEAD=head
@@ -90,12 +93,15 @@ TAIL=tail
ECHO=echo # use internal echo if possible
EXPR=expr # use internal if possible
FIND=find
-GCOV=`which gcov | $SED q`
+GCOV=`which gcov`
+if test $? != 0; then exit 1; fi
PRINTF=printf
RM=rm
-TIME=`which time | $SED q`
+TIME=`which time`
+if test $? != 0; then exit 1; fi
TR=tr
-XARGS=`which xargs | $SED q`
+XARGS=`which xargs`
+if test $? != 0; then exit 1; fi
# Are we using a source or a binary distribution?
@@ -461,7 +467,9 @@ GPROF_DIR=$MYSQL_TMP_DIR/gprof
GPROF_MASTER=$GPROF_DIR/master.gprof
GPROF_SLAVE=$GPROF_DIR/slave.gprof
TIMEFILE="$MYSQL_TEST_DIR/var/log/mysqltest-time"
-XTERM=`which xterm`
+if [ -n "$DO_CLIENT_GDB" -o -n "$DO_GDB" ] ; then
+ XTERM=`which xterm`
+fi
#++
# Function Definitions
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result
new file mode 100644
index 00000000000..c08f6094080
--- /dev/null
+++ b/mysql-test/r/grant.result
@@ -0,0 +1,33 @@
+delete from mysql.user where user='mysqltest_1';
+delete from mysql.db where user='mysqltest_1';
+flush privileges;
+grant select on mysqltest.* to mysqltest_1@localhost require cipher "EDH-RSA-DES-CBC3-SHA";
+show grants for mysqltest_1@localhost;
+Grants for mysqltest_1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA'
+GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
+grant delete on mysqltest.* to mysqltest_1@localhost;
+show grants for mysqltest_1@localhost;
+Grants for mysqltest_1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA'
+GRANT SELECT, DELETE ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
+revoke delete on mysqltest.* from mysqltest_1@localhost;
+show grants for mysqltest_1@localhost;
+Grants for mysqltest_1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA'
+GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
+grant select on mysqltest.* to mysqltest_1@localhost require NONE;
+show grants for mysqltest_1@localhost;
+Grants for mysqltest_1@localhost
+GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
+grant USAGE on mysqltest.* to mysqltest_1@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "testsubject" ISSUER "MySQL AB";
+show grants for mysqltest_1@localhost;
+Grants for mysqltest_1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE ISSUER 'MySQL AB' SUBJECT 'testsubject' CIPHER 'EDH-RSA-DES-CBC3-SHA'
+GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
+revoke all privileges on mysqltest.* from mysqltest_1@localhost;
+show grants for mysqltest_1@localhost;
+Grants for mysqltest_1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE ISSUER 'MySQL AB' SUBJECT 'testsubject' CIPHER 'EDH-RSA-DES-CBC3-SHA'
+delete from mysql.user where user='mysqltest_1';
+flush privileges;
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
new file mode 100644
index 00000000000..be1b09a9b78
--- /dev/null
+++ b/mysql-test/t/grant.test
@@ -0,0 +1,21 @@
+#
+# Test that SSL options works properly
+#
+
+delete from mysql.user where user='mysqltest_1';
+delete from mysql.db where user='mysqltest_1';
+flush privileges;
+grant select on mysqltest.* to mysqltest_1@localhost require cipher "EDH-RSA-DES-CBC3-SHA";
+show grants for mysqltest_1@localhost;
+grant delete on mysqltest.* to mysqltest_1@localhost;
+show grants for mysqltest_1@localhost;
+revoke delete on mysqltest.* from mysqltest_1@localhost;
+show grants for mysqltest_1@localhost;
+grant select on mysqltest.* to mysqltest_1@localhost require NONE;
+show grants for mysqltest_1@localhost;
+grant USAGE on mysqltest.* to mysqltest_1@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "testsubject" ISSUER "MySQL AB";
+show grants for mysqltest_1@localhost;
+revoke all privileges on mysqltest.* from mysqltest_1@localhost;
+show grants for mysqltest_1@localhost;
+delete from mysql.user where user='mysqltest_1';
+flush privileges;