diff options
author | unknown <monty@mysql.com> | 2004-12-02 14:43:51 +0200 |
---|---|---|
committer | unknown <monty@mysql.com> | 2004-12-02 14:43:51 +0200 |
commit | 93cf297fcb932aaaf1c006d7066ec453c9a907cb (patch) | |
tree | 8f90ede7dbeae77977acb6dee6d00daeb9081399 /mysql-test | |
parent | b18b1be91323358b1078e5eb409b3c2042a54786 (diff) | |
download | mariadb-git-93cf297fcb932aaaf1c006d7066ec453c9a907cb.tar.gz |
Cleanups during review stage
Added auto-correct of field length for enum/set tables for ALTER TABLE
This is becasue of a bug in previous MySQL 4.1 versions where the length for enum/set was set incorrectly after ALTER TABLE
mysql-test/r/rpl_start_stop_slave.result:
Fixed wrong test
mysql-test/r/type_enum.result:
Added test for wrong enum/set length after alter table
mysql-test/t/ps.test:
removed empty line
mysql-test/t/type_enum.test:
Added test for wrong enum/set length after alter table
sql/field.cc:
Added auto-correct of field length for enum/set tables.
This is becasue of a bug in previous MySQL 4.1 versions where the length for enum/set was set incorrectly after ALTER TABLE
sql/item_cmpfunc.cc:
Simple optimization
sql/mysql_priv.h:
Made local function global
sql/set_var.cc:
Simple cleanup
sql/sql_table.cc:
Simple cleanups & optimizations
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/rpl_start_stop_slave.result | 4 | ||||
-rw-r--r-- | mysql-test/r/type_enum.result | 12 | ||||
-rw-r--r-- | mysql-test/t/ps.test | 1 | ||||
-rw-r--r-- | mysql-test/t/type_enum.test | 13 |
4 files changed, 27 insertions, 3 deletions
diff --git a/mysql-test/r/rpl_start_stop_slave.result b/mysql-test/r/rpl_start_stop_slave.result index 1b4d87124d1..1fcb586d1fb 100644 --- a/mysql-test/r/rpl_start_stop_slave.result +++ b/mysql-test/r/rpl_start_stop_slave.result @@ -1,9 +1,9 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; stop slave; create table t1(n int); start slave; diff --git a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result index da85ffe6495..86b8e1d8653 100644 --- a/mysql-test/r/type_enum.result +++ b/mysql-test/r/type_enum.result @@ -1693,3 +1693,15 @@ oe ue ss DROP TABLE t1; +create table t1 (a enum ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin); +insert into t1 values ('Y'); +alter table t1 add b set ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin; +alter table t1 add c enum ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin; +select * from t1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 t1 a a 254 3 1 Y 384 0 8 +def test t1 t1 b b 254 9 0 Y 2176 0 8 +def test t1 t1 c c 254 3 0 Y 384 0 8 +a b c +Y NULL NULL +drop table t1; diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 7fe88ad0ddc..51d1fd065cf 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -471,4 +471,3 @@ execute stmt using @var, @var, @var; set @var=null; select @var is null, @var is not null, @var; execute stmt using @var, @var, @var; - diff --git a/mysql-test/t/type_enum.test b/mysql-test/t/type_enum.test index dc2e4d0f469..485fef8a0ca 100644 --- a/mysql-test/t/type_enum.test +++ b/mysql-test/t/type_enum.test @@ -72,3 +72,16 @@ CREATE TABLE t1 (c enum('ae','oe','ue','ss') collate latin1_german2_ci); INSERT INTO t1 VALUES ('ä'),('ö'),('ü'),('ß'); SELECT * FROM t1; DROP TABLE t1; + +# +# Test bug where enum fields where extended for each ALTER TABLE +# + +create table t1 (a enum ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin); +insert into t1 values ('Y'); +alter table t1 add b set ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin; +alter table t1 add c enum ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin; +--enable_metadata +select * from t1; +--disable metadata +drop table t1; |