1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

5.3 merge

This commit is contained in:
Sergei Golubchik
2012-01-13 15:50:02 +01:00
750 changed files with 17402 additions and 7153 deletions

View File

@ -0,0 +1,26 @@
install plugin three_attempts soname 'dialog_examples.so';
create user test_dialog identified via three_attempts using 'SECRET';
#
# -pSECRET is picked up, no questions asked.
#
select user(), current_user();
user() current_user()
test_dialog@localhost test_dialog@%
#
# without -p. up to three questions are asked on the stdin.
# athentication is successful, the correct pasword is on the third line
#
Password, please: ***
Password, please: ****
Password, please: ******
select user(), current_user();
user() current_user()
test_dialog@localhost test_dialog@%
#
# athentication is unsuccessful, first three lines are all wrong
#
Password, please: ***
Password, please: ****
Password, please: *****
drop user test_dialog;
uninstall plugin three_attempts;

View File

@ -0,0 +1,13 @@
install plugin feedback soname 'feedback.so';
select plugin_status from information_schema.plugins where plugin_name='feedback';
plugin_status
ACTIVE
select * from information_schema.feedback where variable_name like 'feed%'
and variable_name not like '%_uid';
VARIABLE_NAME VARIABLE_VALUE
FEEDBACK 1.1
FEEDBACK_SEND_RETRY_WAIT 60
FEEDBACK_SEND_TIMEOUT 60
FEEDBACK_URL http://mariadb.org/feedback_plugin/post
FEEDBACK_USER_INFO mysql-test
uninstall plugin feedback;

View File

@ -0,0 +1,11 @@
select plugin_status from information_schema.plugins where plugin_name='feedback';
plugin_status
ACTIVE
select * from information_schema.feedback where variable_name like 'feed%'
and variable_name not like '%_uid';
VARIABLE_NAME VARIABLE_VALUE
FEEDBACK 1.1
FEEDBACK_SEND_RETRY_WAIT 60
FEEDBACK_SEND_TIMEOUT 60
FEEDBACK_URL http://mariadb.org/feedback_plugin/post
FEEDBACK_USER_INFO mysql-test

View File

@ -0,0 +1,15 @@
select plugin_status from information_schema.plugins where plugin_name='feedback';
plugin_status
ACTIVE
select * from information_schema.feedback where variable_name like 'feed%'
and variable_name not like '%_uid';
VARIABLE_NAME VARIABLE_VALUE
FEEDBACK 1.1
FEEDBACK_SEND_RETRY_WAIT 60
FEEDBACK_SEND_TIMEOUT 60
FEEDBACK_URL http://mariadb.org/feedback_plugin/post
FEEDBACK_USER_INFO mysql-test
feedback plugin: report to 'http://mariadb.org/feedback_plugin/post' was sent
feedback plugin: server replied 'ok'
feedback plugin: report to 'http://mariadb.org/feedback_plugin/post' was sent
feedback plugin: server replied 'ok'

View File

@ -0,0 +1,5 @@
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;

View File

@ -0,0 +1,22 @@
install plugin pam soname 'auth_pam.so';
create user test_pam identified via pam using 'mariadb_mtr';
#
# athentication is successful, challenge/pin are ok
# note that current_user() differts from user()
#
Challenge input first.
Enter: not very secret challenge
Now, the magic number!
PIN: ****
select user(), current_user(), database();
user() current_user() database()
test_pam@localhost pam_test@% test
#
# athentication is unsuccessful
#
Challenge input first.
Enter: not very secret challenge
Now, the magic number!
PIN: ****
drop user test_pam;
uninstall plugin pam;

View File

@ -0,0 +1,8 @@
package My::Suite::Plugins;
@ISA = qw(My::Suite);
$ENV{PAM_SETUP_FOR_MTR}=1 if -e '/etc/pam.d/mariadb_mtr';
bless { };

View 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;

View File

@ -0,0 +1 @@
--loose-feedback

View 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;

View File

@ -0,0 +1,2 @@
--loose-feedback
--plugin-load=$FEEDBACK_SO

View 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';

View 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

View 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;

View 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;