Server IP : 104.21.38.3 / Your IP : 104.23.175.142 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/extra/binlog_tests/ |
Upload File : |
# ==== Purpose ==== # # Add [position|datetime] data to mysqlbinlog. To generate a binary log with # a few deterministic,increasing timestamps. # # ==== Implementation ==== # We need to set fixed timestamps in this test. # Use a date in the future to keep a growing timestamp along the # binlog (including the Start_log_event). This test will work # unchanged everywhere, because mysql-test-run has fixed TZ, which it # exports (so mysqlbinlog has same fixed TZ). # # ===== Assumption ======== # As this is a generic file and be used by other test, So we have made an # assumption that a table is already created with defination like # CREATE TABLE t1 (a INT); # # Binlog 1: # One transaction with timestamp 2031-01-01 12:00:00 --let $datetime_1= 2031-01-01 12:00:00 eval SET TIMESTAMP= UNIX_TIMESTAMP("$datetime_1"); INSERT INTO t1 VALUES(1); --let $pos_1= query_get_value(SHOW MASTER STATUS, Position, 1) # One transaction with timestamp 2032-01-01 12:00:00 --let $datetime_2= 2032-01-01 12:00:00 eval SET TIMESTAMP= UNIX_TIMESTAMP("$datetime_2"); INSERT INTO t1 VALUES(2); --let $pos_2= query_get_value(SHOW MASTER STATUS, Position, 1) # One transaction with timestamp 2033-01-01 12:00:00 eval SET TIMESTAMP= UNIX_TIMESTAMP("2033-01-01 12:00:00"); INSERT INTO t1 VALUES(3); --let $file_1= query_get_value(SHOW MASTER STATUS, File, 1) FLUSH LOGS; #Binlog 2: # One transaction with timestamp 2034-01-01 12:00:00 SET TIMESTAMP= UNIX_TIMESTAMP("2034-01-01 12:00:00"); INSERT INTO t1 VALUES(4); --let $pos_3= query_get_value(SHOW MASTER STATUS, Position, 1) # One transaction with timestamp 2035-01-01 12:00:00 --let $datetime_3= 2035-01-01 12:00:00 eval SET TIMESTAMP= UNIX_TIMESTAMP("$datetime_3"); INSERT INTO t1 VALUES(5); --let $file_2= query_get_value(SHOW MASTER STATUS, File, 1) FLUSH LOGS;