403Webshell
Server IP : 104.21.38.3  /  Your IP : 172.68.164.92
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/ndb_rpl/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/src/mysql-test/suite/ndb_rpl/t/ndb_rpl_add_column.test
# The include statement below is a temp one for tests that are yet to
#be ported to run with InnoDB,
#but needs to be kept for tests that would need MyISAM in future.
--source include/force_myisam_default.inc

--source include/have_ndb.inc
--source suite/ndb_rpl/ndb_master-slave.inc

#
# Test add column
#
--connection master
CREATE TABLE t1 (c1 INT KEY) ROW_FORMAT=DYNAMIC ENGINE=NDB;

INSERT INTO t1 VALUES (1),(2),(3);

ALTER TABLE t1 ADD c2 INT;

--sync_slave_with_master
connection slave;
SELECT * FROM t1 ORDER BY c1;

connection master;

INSERT INTO t1 VALUES (6,6),(7,7),(8,8);
SELECT * FROM t1 ORDER BY c1;

--sync_slave_with_master
connection slave;
SELECT * FROM t1 ORDER BY c1;

#
# Test online alter table for various types
#
connection master;
ALTER TABLE t1 algorithm=inplace, ADD c CHAR(19);
INSERT INTO t1 values (11,1,"a");
ALTER TABLE t1 algorithm=inplace, ADD d FLOAT;
INSERT INTO t1 VALUES(12, 2,'b', -3.402823466E+38);
#FOR BUG#32095 SO COMMNET THE DOUBLE TYPE DATA.
# ALTER TABLE t1 algorithm=inplace, ADD e DOUBLE UNSIGNED;
# INSERT INTO t1 VALUES(13, 3,'c', -3.402823466E+38, 1.7976931348623157E+308);
ALTER TABLE t1 algorithm=inplace, ADD f DECIMAL(5,2);
INSERT INTO t1 VALUES(14, 4,'d', -3.402823466E+38, 456.78);
ALTER TABLE t1 algorithm=inplace, ADD g DATETIME;
INSERT INTO t1 VALUES(15, 5,'e', -3.402823466E+38, 456.78, '2007-10-26 12:00:00');
ALTER TABLE t1 algorithm=inplace, ADD h BINARY(4);
INSERT INTO t1 VALUES(16, 6,'f', -3.402823466E+38, 456.78, '2007-10-26 12:00:00',"abcd");
--echo **********************
--echo "Master data"
--echo **********************
SELECT * FROM t1 ORDER BY c1;
--sync_slave_with_master
connection slave;
--echo **********************
--echo "Slave data"
--echo **********************
SELECT * FROM t1 ORDER BY c1;
 
#
# Update the new added column
#
connection master;
UPDATE t1 SET c = "abcdef", d = 3.402823466E+38, f = 987.65, g = '2007-10-22 22:22:22', h = "aaaa";
--echo ***************************
--echo "Master Data After Update"
--echo ***************************
SELECT * FROM t1 ORDER BY c1;
--sync_slave_with_master
connection slave;
--echo *************************
--echo "Slave Data After Update"
--echo *************************
SELECT * FROM t1 ORDER BY c1;

connection master;
DROP TABLE t1;

--echo *************************************************
--echo * Insert And Update New Added Columns With Commit
--echo *************************************************
connection master;
CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ROW_FORMAT=DYNAMIC ENGINE NDB;
INSERT INTO t1 VALUES(1,1),(2,2);
BEGIN;
ALTER TABLE t1 algorithm=inplace, ADD c CHAR(19), ADD d VARCHAR(255), ADD e char(255);
INSERT INTO t1 VALUES (3,0,'3','3','3'),(4,0,'4','4','4'),(5,0,null,null,null);
UPDATE t1 SET c = 'aaa', d = 'bbb', e = 'ccc' WHERE a = 4;
COMMIT;
SELECT * FROM t1 ORDER BY a;
--sync_slave_with_master
connection slave;
--echo *************************
--echo "Slave Data With Commit
--echo *************************
SELECT * FROM t1 ORDER BY a;

--echo ***************************************************
--echo * Insert And Update New Added Columns With Rollback
--echo ***************************************************
connection master;
DROP TABLE t1;
CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ROW_FORMAT=DYNAMIC ENGINE NDB;
INSERT INTO t1 VALUES(1,1),(2,2);
ALTER TABLE t1 ADD c CHAR(19), ADD d VARCHAR(255), ADD e char(255);
BEGIN;
INSERT INTO t1 VALUES (3,0,'3','3','3'),(4,0,'4','4','4'),(5,0,null,null,null);
UPDATE t1 SET c = 'aaa', d = 'bbb', e = 'ccc' WHERE a = 4;
ROLLBACK;
SHOW CREATE TABLE t1;
SELECT * FROM t1 ORDER BY a;
--sync_slave_with_master
connection slave;
--echo *************************
--echo "Slave Data With Rollback
--echo *************************
SHOW CREATE TABLE t1;
SELECT * FROM t1 ORDER BY a;

# cleanup
--connection master
DROP TABLE t1;
-- source include/rpl_end.inc

Youez - 2016 - github.com/yon3zu
LinuXploit