1
#-----------------------------------------------------------------------------
2
# csv_alter_table.test - .test file for MySQL regression suite
3
# Purpose: To test the behavior of the CSV engine
4
# Bug#31473 resulted in strict enforcement of non-nullable
5
# columns in CSV engine.
6
# Tests code for Bug#33696 - CSV engine allows NULLable
7
# Columns via ALTER TABLE statements
10
# Last modified: 2008-01-06
11
#-----------------------------------------------------------------------------
13
--source include/have_csv.inc
15
#############################################################################
16
# Testcase csv_alter_table.1: Positive test for ALTER table
18
#############################################################################
19
-- echo # ===== csv_alter_table.1 =====
21
DROP TABLE IF EXISTS t1;
24
CREATE TABLE t1 (a int NOT NULL) ENGINE = CSV;
25
ALTER TABLE t1 ADD COLUMN b CHAR(5) NOT NULL;
27
ALTER TABLE t1 DROP COLUMN b;
29
ALTER TABLE t1 MODIFY a BIGINT NOT NULL;
31
ALTER TABLE t1 CHANGE a a INT NOT NULL;
36
#############################################################################
37
# Testcase csv_alter_table.2: Negative test for ALTER table
38
# These queries should not succeed / should throw errors
39
#############################################################################
40
-- echo # ===== csv_alter_table.2 =====
42
DROP TABLE IF EXISTS t1;
45
CREATE TABLE t1 (a int NOT NULL) ENGINE = CSV;
46
--error ER_CHECK_NOT_IMPLEMENTED
47
ALTER TABLE t1 ADD COLUMN b CHAR(5);
49
--error ER_CHECK_NOT_IMPLEMENTED
50
ALTER TABLE t1 MODIFY a BIGINT;
52
--error ER_CHECK_NOT_IMPLEMENTED
53
ALTER TABLE t1 CHANGE a a INT;