DROP TABLE IF EXISTS test_online;
CREATE TABLE test_online(id INT AUTO_INCREMENT PRIMARY KEY, handle INT, DATA BIGINT NOT NULL DEFAULT 0) engine = innodb;
INSERT INTO test_online(handle) VALUES(12),(54),(546);
SELECT *, md5(handle) FROM test_online;
ALTER TABLE test_online ADD INDEX handle(handle), algorithm=inplace; 
ALTER TABLE test_online ADD COLUMN hash VARCHAR(32) AS (md5(handle)) persistent, ADD UNIQUE INDEX hash(hash), algorithm=inplace;
ALTER TABLE test_online ADD COLUMN hash VARCHAR(32) AS (md5(handle)) persistent, algorithm=inplace;                             
ALTER TABLE test_online ADD COLUMN hash VARCHAR(32) AS (md5(handle)) persistent, ADD UNIQUE INDEX hash(hash), algorithm=copy;
SELECT * FROM test_online;
ALTER TABLE test_online DROP INDEX handle, algorithm=inplace;
ALTER TABLE test_online ADD INDEX DATA(DATA), algorithm=inplace;
CREATE INDEX DATA on test_online(DATA) algorithm=inplace;
ALTER TABLE test_online DROP COLUMN hash, algorithm=inplace;
ALTER TABLE test_online DROP INDEX handle, algorithm=inplace;
ALTER TABLE test_online ADD INDEX DATA(DATA), algorithm=inplace;
ALTER TABLE test_online ADD COLUMN sha VARCHAR(32) AS (sha1(handle)) persistent, algorithm=inplace;
ALTER TABLE test_online ADD COLUMN sha VARCHAR(32), algorithm=inplace;

