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
DROP TABLE IF EXISTS t1;
21
CREATE TABLE t1 (a int NOT NULL) ENGINE = CSV;
22
ALTER TABLE t1 ADD COLUMN b CHAR(5) NOT NULL;
24
ALTER TABLE t1 DROP COLUMN b;
26
ALTER TABLE t1 MODIFY a BIGINT NOT NULL;
28
ALTER TABLE t1 CHANGE a a INT NOT NULL;
33
#############################################################################
34
# Testcase csv_alter_table.2: Negative test for ALTER table
35
# These queries should not succeed / should throw errors
36
#############################################################################
37
DROP TABLE IF EXISTS t1;
39
CREATE TABLE t1 (a int NOT NULL) ENGINE = CSV;
40
--error ER_CHECK_NOT_IMPLEMENTED
41
ALTER TABLE t1 ADD COLUMN b CHAR(5);
43
--error ER_CHECK_NOT_IMPLEMENTED
44
ALTER TABLE t1 MODIFY a BIGINT;
46
--error ER_CHECK_NOT_IMPLEMENTED
47
ALTER TABLE t1 CHANGE a a INT;