Merge chilla.local:/home/mydev/mysql-4.1-bug24985

into  chilla.local:/home/mydev/mysql-5.0-bug24985
This commit is contained in:
istruewing@chilla.local 2007-03-27 10:54:37 +02:00
commit ef1dec00c4
3 changed files with 34 additions and 1 deletions

View File

@ -280,6 +280,18 @@ a
1 1
1 1
drop table t1; drop table t1;
CREATE TABLE t1 (
c1 ENUM('1', '2'),
UNIQUE USING BTREE(c1)
) ENGINE= MEMORY DEFAULT CHARSET= utf8;
INSERT INTO t1 VALUES('1'), ('2');
DROP TABLE t1;
CREATE TABLE t1 (
c1 SET('1', '2'),
UNIQUE USING BTREE(c1)
) ENGINE= MEMORY DEFAULT CHARSET= utf8;
INSERT INTO t1 VALUES('1'), ('2');
DROP TABLE t1;
End of 4.1 tests End of 4.1 tests
CREATE TABLE t1(val INT, KEY USING BTREE(val)) ENGINE=memory; CREATE TABLE t1(val INT, KEY USING BTREE(val)) ENGINE=memory;
INSERT INTO t1 VALUES(0); INSERT INTO t1 VALUES(0);

View File

@ -204,4 +204,22 @@ CREATE TABLE t1 (a INT, UNIQUE USING BTREE(a)) ENGINE=MEMORY;
INSERT INTO t1 VALUES(NULL),(NULL); INSERT INTO t1 VALUES(NULL),(NULL);
DROP TABLE t1; DROP TABLE t1;
#
# Bug#24985 - UTF8 ENUM primary key on MEMORY using BTREE
# causes incorrect duplicate entries
#
CREATE TABLE t1 (
c1 ENUM('1', '2'),
UNIQUE USING BTREE(c1)
) ENGINE= MEMORY DEFAULT CHARSET= utf8;
INSERT INTO t1 VALUES('1'), ('2');
DROP TABLE t1;
CREATE TABLE t1 (
c1 SET('1', '2'),
UNIQUE USING BTREE(c1)
) ENGINE= MEMORY DEFAULT CHARSET= utf8;
INSERT INTO t1 VALUES('1'), ('2');
DROP TABLE t1;
--echo End of 4.1 tests
--echo End of 5.0 tests --echo End of 5.0 tests

View File

@ -604,7 +604,10 @@ int ha_heap::create(const char *name, TABLE *table_arg,
seg->length= (uint) key_part->length; seg->length= (uint) key_part->length;
seg->flag= key_part->key_part_flag; seg->flag= key_part->key_part_flag;
seg->charset= field->charset(); if (field->flags & (ENUM_FLAG | SET_FLAG))
seg->charset= &my_charset_bin;
else
seg->charset= field->charset();
if (field->null_ptr) if (field->null_ptr)
{ {
seg->null_bit= field->null_bit; seg->null_bit= field->null_bit;