| 1 |
--echo # |
| 2 |
--echo # MDEV-15935 Connection Redirection Mechanism in MariaDB Client/Server Protocol |
| 3 |
--echo # |
| 4 |
# redirect_url is undefined in embedded. |
| 5 |
--source include/not_embedded.inc |
| 6 |
|
| 7 |
# We need to connect as a non super user for the init-connect to take |
| 8 |
# effect |
| 9 |
--source include/add_anonymous_users.inc |
| 10 |
connect (con,localhost,anyone_but_root); |
| 11 |
select @@redirect_url; |
| 12 |
|
| 13 |
connection default; |
| 14 |
--source include/delete_anonymous_users.inc |
| 15 |
set @old_global_redirect_url=@@global.redirect_url; |
| 16 |
set @old_session_redirect_url=@@session.redirect_url; |
| 17 |
set @old_session_track_system_variables=@@session_track_system_variables; |
| 18 |
set session_track_system_variables=""; |
| 19 |
|
| 20 |
select @@global.redirect_url; |
| 21 |
set global redirect_url=default; |
| 22 |
select @@global.redirect_url; |
| 23 |
--error ER_WRONG_VALUE_FOR_VAR |
| 24 |
set global redirect_url="mariadb.org"; |
| 25 |
--error ER_WRONG_VALUE_FOR_VAR |
| 26 |
set global redirect_url="https://mariadb.org"; |
| 27 |
|
| 28 |
--error ER_WRONG_VALUE_FOR_VAR |
| 29 |
set global redirect_url="mysql://mariadb.org:"; |
| 30 |
--error ER_WRONG_VALUE_FOR_VAR |
| 31 |
set global redirect_url="mysql://mariadb.org:hello"; |
| 32 |
--error ER_WRONG_VALUE_FOR_VAR |
| 33 |
set global redirect_url="mysql://"; |
| 34 |
set global redirect_url="mysql://mariadb.org"; |
| 35 |
select @@global.redirect_url; |
| 36 |
--error ER_WRONG_VALUE_FOR_VAR |
| 37 |
set global redirect_url="mysql://mariadb.org:12a"; |
| 38 |
--error ER_WRONG_VALUE_FOR_VAR |
| 39 |
set global redirect_url="mysql://mariadb.org:66666"; |
| 40 |
set global redirect_url="mysql://mariadb.org:12345"; |
| 41 |
select @@global.redirect_url; |
| 42 |
|
| 43 |
--error ER_WRONG_VALUE_FOR_VAR |
| 44 |
set global redirect_url="maria"; |
| 45 |
--error ER_WRONG_VALUE_FOR_VAR |
| 46 |
set global redirect_url="mariadb://mariadb.org:"; |
| 47 |
--error ER_WRONG_VALUE_FOR_VAR |
| 48 |
set global redirect_url="mariadb://mariadb.org:hello"; |
| 49 |
--error ER_WRONG_VALUE_FOR_VAR |
| 50 |
set global redirect_url="mariadb://"; |
| 51 |
set global redirect_url="mariadb://mariadb.org"; |
| 52 |
select @@global.redirect_url; |
| 53 |
--error ER_WRONG_VALUE_FOR_VAR |
| 54 |
set global redirect_url="mariadb://mariadb.org:12a"; |
| 55 |
--error ER_WRONG_VALUE_FOR_VAR |
| 56 |
set global redirect_url="mariadb://mariadb.org:66666"; |
| 57 |
set global redirect_url="mariadb://mariadb.org:12345"; |
| 58 |
select @@global.redirect_url; |
| 59 |
|
| 60 |
select @@session.redirect_url; |
| 61 |
# Test that session default is global value |
| 62 |
set session redirect_url=default; |
| 63 |
select @@session.redirect_url; |
| 64 |
set session redirect_url="mysql://localhost"; |
| 65 |
select @@session.redirect_url; |
| 66 |
select @@global.redirect_url; |
| 67 |
|
| 68 |
set global redirect_url=@old_global_redirect_url; |
| 69 |
set session redirect_url=@old_session_redirect_url; |
| 70 |
set session session_track_system_variables=@old_session_track_system_variables; |
| 71 |
|
| 72 |
--echo # |
| 73 |
--echo # end of test MDEV-15935 |
| 74 |
--echo # |