mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
5.3 merge
This commit is contained in:
54
mysql-test/suite/plugins/t/dialog.test
Normal file
54
mysql-test/suite/plugins/t/dialog.test
Normal file
@ -0,0 +1,54 @@
|
||||
#
|
||||
# test for the client "dialog" plugin
|
||||
#
|
||||
|
||||
--source include/not_embedded.inc
|
||||
|
||||
if (!$DIALOG_SO) {
|
||||
skip No dialog auth plugin;
|
||||
}
|
||||
if (!$DIALOG_EXAMPLES_SO) {
|
||||
skip No dialog auth plugin;
|
||||
}
|
||||
|
||||
--replace_result .dll .so
|
||||
eval install plugin three_attempts soname '$DIALOG_EXAMPLES_SO';
|
||||
create user test_dialog identified via three_attempts using 'SECRET';
|
||||
|
||||
let $plugindir=`SELECT @@global.plugin_dir`;
|
||||
|
||||
--write_file $MYSQLTEST_VARDIR/tmp/dialog_good.txt
|
||||
foo
|
||||
1234
|
||||
SECRET
|
||||
select user(), current_user();
|
||||
EOF
|
||||
|
||||
--write_file $MYSQLTEST_VARDIR/tmp/dialog_bad.txt
|
||||
foo
|
||||
1234
|
||||
wrong
|
||||
SECRET
|
||||
EOF
|
||||
|
||||
--echo #
|
||||
--echo # -pSECRET is picked up, no questions asked.
|
||||
--echo #
|
||||
--exec echo "select user(), current_user();"|$MYSQL_TEST -u test_dialog -pSECRET --plugin-dir=$plugindir
|
||||
|
||||
--echo #
|
||||
--echo # without -p. up to three questions are asked on the stdin.
|
||||
--echo # athentication is successful, the correct pasword is on the third line
|
||||
--echo #
|
||||
--exec $MYSQL_TEST -u test_dialog --plugin-dir=$plugindir < $MYSQLTEST_VARDIR/tmp/dialog_good.txt
|
||||
|
||||
--echo #
|
||||
--echo # athentication is unsuccessful, first three lines are all wrong
|
||||
--echo #
|
||||
--error 1
|
||||
--exec $MYSQL_TEST -u test_dialog --plugin-dir=$plugindir < $MYSQLTEST_VARDIR/tmp/dialog_bad.txt
|
||||
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/dialog_good.txt
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/dialog_bad.txt
|
||||
drop user test_dialog;
|
||||
uninstall plugin three_attempts;
|
1
mysql-test/suite/plugins/t/feedback_plugin_install.opt
Normal file
1
mysql-test/suite/plugins/t/feedback_plugin_install.opt
Normal file
@ -0,0 +1 @@
|
||||
--loose-feedback
|
15
mysql-test/suite/plugins/t/feedback_plugin_install.test
Normal file
15
mysql-test/suite/plugins/t/feedback_plugin_install.test
Normal file
@ -0,0 +1,15 @@
|
||||
--source include/not_embedded.inc
|
||||
|
||||
if (`select length('$FEEDBACK_SO') = 0`) {
|
||||
skip No feedback plugin;
|
||||
}
|
||||
|
||||
--replace_regex /\.dll/.so/
|
||||
eval install plugin feedback soname '$FEEDBACK_SO';
|
||||
select plugin_status from information_schema.plugins where plugin_name='feedback';
|
||||
--replace_result https http
|
||||
--sorted_result
|
||||
select * from information_schema.feedback where variable_name like 'feed%'
|
||||
and variable_name not like '%_uid';
|
||||
uninstall plugin feedback;
|
||||
|
2
mysql-test/suite/plugins/t/feedback_plugin_load.opt
Normal file
2
mysql-test/suite/plugins/t/feedback_plugin_load.opt
Normal file
@ -0,0 +1,2 @@
|
||||
--loose-feedback
|
||||
--plugin-load=$FEEDBACK_SO
|
10
mysql-test/suite/plugins/t/feedback_plugin_load.test
Normal file
10
mysql-test/suite/plugins/t/feedback_plugin_load.test
Normal file
@ -0,0 +1,10 @@
|
||||
if (`select count(*) = 0 from information_schema.plugins where plugin_name = 'feedback' and plugin_status='active'`)
|
||||
{
|
||||
--skip Feedback plugin is not active
|
||||
}
|
||||
|
||||
select plugin_status from information_schema.plugins where plugin_name='feedback';
|
||||
--replace_result https http
|
||||
--sorted_result
|
||||
select * from information_schema.feedback where variable_name like 'feed%'
|
||||
and variable_name not like '%_uid';
|
32
mysql-test/suite/plugins/t/feedback_plugin_send.test
Normal file
32
mysql-test/suite/plugins/t/feedback_plugin_send.test
Normal file
@ -0,0 +1,32 @@
|
||||
source feedback_plugin_load.test;
|
||||
|
||||
if (!$MTR_FEEDBACK_PLUGIN) {
|
||||
skip MTR_FEEDBACK_PLUGIN is not set;
|
||||
}
|
||||
|
||||
#
|
||||
# Yep. The plugin waits 5 minutes before sending anything,
|
||||
# and there's no way to force it to send anything sooner.
|
||||
# Let's wait, and hope that mtr is started with --parallel and
|
||||
# is doing some work in other workers.
|
||||
#
|
||||
sleep 310;
|
||||
source include/restart_mysqld.inc;
|
||||
|
||||
replace_result https http;
|
||||
perl;
|
||||
$log_error= $ENV{'MYSQLTEST_VARDIR'} . '/log/mysqld.1.err';
|
||||
open(LOG, '<', $log_error) or die "open(< $log_error): $!";
|
||||
|
||||
# Get the first few rows (as there may be different number rows in the log)
|
||||
$i= 0;
|
||||
while ($_=<LOG>)
|
||||
{
|
||||
if (/feedback plugin:.*/)
|
||||
{
|
||||
print "$&\n";
|
||||
break if ($i++ >= 3);
|
||||
}
|
||||
}
|
||||
close LOG;
|
||||
EOF
|
11
mysql-test/suite/plugins/t/fulltext_plugin.test
Normal file
11
mysql-test/suite/plugins/t/fulltext_plugin.test
Normal file
@ -0,0 +1,11 @@
|
||||
--source include/have_simple_parser.inc
|
||||
|
||||
#
|
||||
# BUG#39746 - Debug flag breaks struct definition (server crash)
|
||||
#
|
||||
--replace_result .dll .so
|
||||
eval INSTALL PLUGIN simple_parser SONAME '$MYPLUGLIB_SO';
|
||||
CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a) WITH PARSER simple_parser);
|
||||
ALTER TABLE t1 ADD FULLTEXT(b) WITH PARSER simple_parser;
|
||||
DROP TABLE t1;
|
||||
UNINSTALL PLUGIN simple_parser;
|
46
mysql-test/suite/plugins/t/pam.test
Normal file
46
mysql-test/suite/plugins/t/pam.test
Normal file
@ -0,0 +1,46 @@
|
||||
|
||||
--source include/not_embedded.inc
|
||||
|
||||
if (!$AUTH_PAM_SO) {
|
||||
skip No pam auth plugin;
|
||||
}
|
||||
|
||||
if (!$PAM_SETUP_FOR_MTR) {
|
||||
skip No pam setup for mtr;
|
||||
}
|
||||
|
||||
--replace_result .dll .so
|
||||
eval install plugin pam soname '$AUTH_PAM_SO';
|
||||
create user test_pam identified via pam using 'mariadb_mtr';
|
||||
|
||||
let $plugindir=`SELECT @@global.plugin_dir`;
|
||||
|
||||
--write_file $MYSQLTEST_VARDIR/tmp/pam_good.txt
|
||||
not very secret challenge
|
||||
9225
|
||||
select user(), current_user(), database();
|
||||
EOF
|
||||
|
||||
--write_file $MYSQLTEST_VARDIR/tmp/pam_bad.txt
|
||||
not very secret challenge
|
||||
9224
|
||||
select user(), current_user(), database();
|
||||
EOF
|
||||
|
||||
--echo #
|
||||
--echo # athentication is successful, challenge/pin are ok
|
||||
--echo # note that current_user() differts from user()
|
||||
--echo #
|
||||
--exec $MYSQL_TEST -u test_pam --plugin-dir=$plugindir < $MYSQLTEST_VARDIR/tmp/pam_good.txt
|
||||
|
||||
--echo #
|
||||
--echo # athentication is unsuccessful
|
||||
--echo #
|
||||
--error 1
|
||||
--exec $MYSQL_TEST -u test_pam --plugin-dir=$plugindir < $MYSQLTEST_VARDIR/tmp/pam_bad.txt
|
||||
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/pam_good.txt
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/pam_bad.txt
|
||||
drop user test_pam;
|
||||
uninstall plugin pam;
|
||||
|
Reference in New Issue
Block a user