diff options
author | unknown <ramil@mysql.com> | 2005-03-17 10:59:25 +0400 |
---|---|---|
committer | unknown <ramil@mysql.com> | 2005-03-17 10:59:25 +0400 |
commit | 3e4ae65a144d8f7a63ee5f8c4d1ec65f94f35b58 (patch) | |
tree | b43774a62a0b70321de5c0b260002b95fde4d49a | |
parent | a131e4d12dabef51820a3c4c69501c647a11b25c (diff) | |
parent | 7ceb5c6cef7c1b9bebe3869e9836035fbb177601 (diff) | |
download | mariadb-git-3e4ae65a144d8f7a63ee5f8c4d1ec65f94f35b58.tar.gz |
Merge
sql/key.cc:
Auto merged
mysql-test/r/update.result:
SCCS merged
mysql-test/t/update.test:
SCCS merged
-rw-r--r-- | mysql-test/r/update.result | 7 | ||||
-rw-r--r-- | mysql-test/t/update.test | 10 | ||||
-rw-r--r-- | sql/key.cc | 2 |
3 files changed, 18 insertions, 1 deletions
diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result index ac370db9ecc..4a9e95fb89e 100644 --- a/mysql-test/r/update.result +++ b/mysql-test/r/update.result @@ -219,3 +219,10 @@ select * from t1; id id_str 1 test1 drop table t1; +create table t1 (a int, b char(255), key(a, b(20))); +insert into t1 values (0, '1'); +update t1 set b = b + 1 where a = 0; +select * from t1; +a b +0 2 +drop table t1; diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test index 04192f25ac8..8eb3a924ee3 100644 --- a/mysql-test/t/update.test +++ b/mysql-test/t/update.test @@ -179,3 +179,13 @@ insert into t1 (id_str) values ("test"); update t1 set id_str = concat(id_str, id) where id = last_insert_id(); select * from t1; drop table t1; + +# +# Bug #8942: a problem with update and partial key part +# + +create table t1 (a int, b char(255), key(a, b(20))); +insert into t1 values (0, '1'); +update t1 set b = b + 1 where a = 0; +select * from t1; +drop table t1; diff --git a/sql/key.cc b/sql/key.cc index b1f4c9533a9..7ddd40de2c9 100644 --- a/sql/key.cc +++ b/sql/key.cc @@ -293,7 +293,7 @@ bool check_if_key_used(TABLE *table, uint idx, List<Item> &fields) f.rewind(); while ((field=(Item_field*) f++)) { - if (key_part->field == field->field) + if (key_part->field->eq(field->field)) return 1; } } |