summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <istruewing@stella.local>2008-01-15 09:43:47 +0100
committerunknown <istruewing@stella.local>2008-01-15 09:43:47 +0100
commit18a7ec307977df75160e071b57355404a09e8e96 (patch)
tree7f28382d7f8ea5d9439327c802b22968149c953c
parent84762ce2cb01d352858dfff14afa9debffd14d8a (diff)
parent53f762abfd26e432477016f00cd984e2c6c9e2d1 (diff)
downloadmariadb-git-18a7ec307977df75160e071b57355404a09e8e96.tar.gz
Merge stella.local:/home2/mydev/mysql-5.0-bug32705
into stella.local:/home2/mydev/mysql-5.0-axmrg mysql-test/r/myisam.result: Manual merge from 4.1 mysql-test/t/myisam.test: Manual merge from 4.1
-rw-r--r--myisam/mi_open.c11
-rw-r--r--mysql-test/r/myisam.result10
-rw-r--r--mysql-test/t/myisam.test13
3 files changed, 33 insertions, 1 deletions
diff --git a/myisam/mi_open.c b/myisam/mi_open.c
index ec169ac8785..5314d6a9a6c 100644
--- a/myisam/mi_open.c
+++ b/myisam/mi_open.c
@@ -791,8 +791,17 @@ static void setup_key_functions(register MI_KEYDEF *keyinfo)
keyinfo->get_key= _mi_get_pack_key;
if (keyinfo->seg[0].flag & HA_PACK_KEY)
{ /* Prefix compression */
+ /*
+ _mi_prefix_search() compares end-space against ASCII blank (' ').
+ It cannot be used for character sets, that do not encode the
+ blank character like ASCII does. UCS2 is an example. All
+ character sets with a fixed width > 1 or a mimimum width > 1
+ cannot represent blank like ASCII does. In these cases we have
+ to use _mi_seq_search() for the search.
+ */
if (!keyinfo->seg->charset || use_strnxfrm(keyinfo->seg->charset) ||
- (keyinfo->seg->flag & HA_NULL_PART))
+ (keyinfo->seg->flag & HA_NULL_PART) ||
+ (keyinfo->seg->charset->mbminlen > 1))
keyinfo->bin_search=_mi_seq_search;
else
keyinfo->bin_search=_mi_prefix_search;
diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result
index 33f64d600bb..3207d0d1f45 100644
--- a/mysql-test/r/myisam.result
+++ b/mysql-test/r/myisam.result
@@ -1839,6 +1839,16 @@ CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
+CREATE TABLE t1 (
+c1 CHAR(255) CHARACTER SET UCS2 COLLATE UCS2_BIN NOT NULL,
+KEY(c1)
+) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('marshall\'s');
+INSERT INTO t1 VALUES ('marsh');
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
CREATE TABLE t1 (id int NOT NULL, ref int NOT NULL, INDEX (id)) ENGINE=MyISAM;
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 (id, ref) VALUES (1,3), (2,1), (3,2), (4,5), (4,4);
diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test
index 90d4fc01afb..58e991cb323 100644
--- a/mysql-test/t/myisam.test
+++ b/mysql-test/t/myisam.test
@@ -1194,6 +1194,19 @@ CHECK TABLE t1 EXTENDED;
DROP TABLE t1;
#
+# Bug#32705 - myisam corruption: Key in wrong position
+# at page 1024 with ucs2_bin
+#
+CREATE TABLE t1 (
+ c1 CHAR(255) CHARACTER SET UCS2 COLLATE UCS2_BIN NOT NULL,
+ KEY(c1)
+ ) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('marshall\'s');
+INSERT INTO t1 VALUES ('marsh');
+CHECK TABLE t1 EXTENDED;
+DROP TABLE t1;
+
+#
# Bug#28837: MyISAM storage engine error (134) doing delete with self-join
#