mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
34 lines
1.9 KiB
Text
34 lines
1.9 KiB
Text
DROP TABLE IF EXISTS t1,t2,t3;
|
|
CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN>, c <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
|
|
INSERT INTO t1 (a,b,c) VALUES (1,100,'a'),(2,200,'b'),(3,300,'c');
|
|
ALTER ONLINE TABLE t1 MODIFY b <INT_COLUMN> DEFAULT 5;
|
|
ALTER ONLINE TABLE t1 CHANGE b new_name <INT_COLUMN>;
|
|
ALTER ONLINE TABLE t1 COMMENT 'new comment';
|
|
ALTER ONLINE TABLE t1 RENAME TO t2;
|
|
ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
|
|
DROP TABLE IF EXISTS t2;
|
|
Warnings:
|
|
Note 1051 Unknown table 'test.t2'
|
|
CREATE TEMPORARY TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
|
|
INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c');
|
|
ALTER ONLINE TABLE t1 MODIFY b <INT_COLUMN> DEFAULT 5;
|
|
Warnings:
|
|
Warning 1366 Incorrect integer value: 'a' for column 'b' at row 1
|
|
Warning 1366 Incorrect integer value: 'b' for column 'b' at row 2
|
|
Warning 1366 Incorrect integer value: 'c' for column 'b' at row 3
|
|
ALTER ONLINE TABLE t1 CHANGE b new_name <INT_COLUMN>;
|
|
ALTER ONLINE TABLE t1 COMMENT 'new comment';
|
|
ALTER ONLINE TABLE t1 RENAME TO t2;
|
|
DROP TABLE IF EXISTS t1, t2;
|
|
CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN>, c <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
|
|
INSERT INTO t1 (a,b,c) VALUES (1,100,'a'),(2,200,'b'),(3,300,'c');
|
|
ALTER ONLINE TABLE t1 DROP COLUMN b, ADD b <INT_COLUMN>;
|
|
ALTER ONLINE TABLE t1 MODIFY b BIGINT <CUSTOM_COL_OPTIONS>;
|
|
ERROR 0A000: LOCK=NONE is not supported. Reason: Cannot change column type INPLACE. Try LOCK=SHARED.
|
|
ALTER ONLINE TABLE t1 ENGINE=MEMORY;
|
|
ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED.
|
|
DROP TABLE t1;
|
|
CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN>, c <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
|
|
ALTER ONLINE TABLE t1 ADD INDEX (b);
|
|
ALTER ONLINE TABLE t1 DROP INDEX b;
|
|
DROP TABLE t1;
|