Below is the list of changes that have just been committed into a local
5.0 repository of uchum. When uchum does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-04-29 08:40:49+05:00, gshchepa@stripped +4 -0
Merge gshchepa.loc:/home/uchum/work/bk-trees/mysql-4.1-opt
into gshchepa.loc:/home/uchum/work/bk-trees/mysql-5.0-opt-13191
mysql-test/r/innodb_mysql.result@stripped, 2007-04-29 08:36:26+05:00, gshchepa@stripped +39 -39
Merge with 4.1, fix of bug #13191.
sql/field.cc@stripped, 2007-04-29 08:36:38+05:00, gshchepa@stripped +6 -4
Merge with 4.1, fix of bug #13191.
sql/field.h@stripped, 2007-04-29 08:36:36+05:00, gshchepa@stripped +1 -1
Merge with 4.1, fix of bug #13191.
sql/key.cc@stripped, 2007-04-29 08:36:39+05:00, gshchepa@stripped +4 -6
Merge with 4.1, fix of bug #13191.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: gshchepa
# Host: gshchepa.loc
# Root: /home/uchum/work/bk-trees/mysql-5.0-opt-13191
--- 1.347/sql/field.cc 2007-04-29 06:55:43 +05:00
+++ 1.348/sql/field.cc 2007-04-29 08:36:38 +05:00
@@ -6223,7 +6223,7 @@ uint Field_string::max_packed_col_length
uint Field_string::get_key_image(char *buff, uint length, imagetype type_arg)
{
- uint bytes = my_charpos(cs, ptr, ptr + field_length,
+ uint bytes = my_charpos(field_charset, ptr, ptr + field_length,
length / field_charset->mbmaxlen);
memcpy(buff, ptr, bytes);
if (bytes < length)
@@ -7072,7 +7072,7 @@ int Field_blob::cmp_binary(const char *a
/* The following is used only when comparing a key */
-uint Field_blob::get_key_image(char *buff,uint length, imagetype type)
+uint Field_blob::get_key_image(char *buff,uint length, imagetype type_arg)
{
uint32 blob_length= get_length(ptr);
char *blob;
@@ -8144,7 +8144,7 @@ int Field_bit::cmp_offset(uint row_offse
}
-void Field_bit::get_key_image(char *buff, uint length, imagetype type_arg)
+uint Field_bit::get_key_image(char *buff, uint length, imagetype type_arg)
{
if (bit_len)
{
@@ -8152,7 +8152,9 @@ void Field_bit::get_key_image(char *buff
*buff++= bits;
length--;
}
- memcpy(buff, ptr, min(length, bytes_in_rec));
+ uint data_length = min(length, bytes_in_rec);
+ memcpy(buff, ptr, data_length);
+ return data_length + 1;
}
--- 1.201/sql/field.h 2007-04-29 06:59:01 +05:00
+++ 1.202/sql/field.h 2007-04-29 08:36:36 +05:00
@@ -265,7 +265,7 @@ public:
virtual uint get_key_image(char *buff, uint length, imagetype type)
{
- get_image(buff,length,cs);
+ get_image(buff, length, &my_charset_bin);
return length;
}
virtual void set_key_image(char *buff,uint length)
--- 1.40/sql/key.cc 2007-04-29 07:00:52 +05:00
+++ 1.41/sql/key.cc 2007-04-29 08:36:39 +05:00
@@ -124,19 +124,17 @@ void key_copy(byte *to_key, byte *from_r
{
key_length-= HA_KEY_BLOB_LENGTH;
length= min(key_length, key_part->length);
- key_part->field->get_key_image((char *) key, length,
- key_part->field->charset(),
- Field::itRAW);
- key+= HA_KEY_BLOB_LENGTH;
+ key_part->field->get_key_image(to_key, length, Field::itRAW);
+ to_key+= HA_KEY_BLOB_LENGTH;
}
else
{
length= min(key_length, key_part->length);
Field *field= key_part->field;
CHARSET_INFO *cs= field->charset();
- uint bytes= field->get_key_image(key, length, Field::itRAW);
+ uint bytes= field->get_key_image(to_key, length, Field::itRAW);
if (bytes < length)
- cs->cset->fill(cs, key + bytes, length - bytes, ' ');
+ cs->cset->fill(cs, to_key + bytes, length - bytes, ' ');
}
to_key+= length;
key_length-= length;
--- 1.18/mysql-test/r/innodb_mysql.result 2007-04-29 06:52:54 +05:00
+++ 1.19/mysql-test/r/innodb_mysql.result 2007-04-29 08:36:26 +05:00
@@ -351,45 +351,6 @@ SELECT * FROM t1, t2;
i i
1 1
DROP TABLE t2, t1;
-create table t1(
-id int auto_increment,
-c char(1) not null,
-counter int not null default 1,
-primary key (id),
-unique key (c)
-) engine=innodb;
-insert into t1 (id, c) values
-(NULL, 'a'),
-(NULL, 'a')
-on duplicate key update id = values(id), counter = counter + 1;
-select * from t1;
-id c counter
-2 a 2
-insert into t1 (id, c) values
-(NULL, 'b')
-on duplicate key update id = values(id), counter = counter + 1;
-select * from t1;
-id c counter
-2 a 2
-3 b 1
-truncate table t1;
-insert into t1 (id, c) values (NULL, 'a');
-select * from t1;
-id c counter
-1 a 1
-insert into t1 (id, c) values (NULL, 'b'), (NULL, 'b')
-on duplicate key update id = values(id), c = values(c), counter = counter + 1;
-select * from t1;
-id c counter
-1 a 1
-3 b 2
-insert into t1 (id, c) values (NULL, 'a')
-on duplicate key update id = values(id), c = values(c), counter = counter + 1;
-select * from t1;
-id c counter
-3 b 2
-4 a 2
-drop table t1;
End of 4.1 tests.
create table t1 (
a varchar(30), b varchar(30), primary key(a), key(b)
@@ -517,5 +478,44 @@ a
1
2
5
+drop table t1;
+create table t1(
+id int auto_increment,
+c char(1) not null,
+counter int not null default 1,
+primary key (id),
+unique key (c)
+) engine=innodb;
+insert into t1 (id, c) values
+(NULL, 'a'),
+(NULL, 'a')
+on duplicate key update id = values(id), counter = counter + 1;
+select * from t1;
+id c counter
+2 a 2
+insert into t1 (id, c) values
+(NULL, 'b')
+on duplicate key update id = values(id), counter = counter + 1;
+select * from t1;
+id c counter
+2 a 2
+3 b 1
+truncate table t1;
+insert into t1 (id, c) values (NULL, 'a');
+select * from t1;
+id c counter
+1 a 1
+insert into t1 (id, c) values (NULL, 'b'), (NULL, 'b')
+on duplicate key update id = values(id), c = values(c), counter = counter + 1;
+select * from t1;
+id c counter
+1 a 1
+3 b 2
+insert into t1 (id, c) values (NULL, 'a')
+on duplicate key update id = values(id), c = values(c), counter = counter + 1;
+select * from t1;
+id c counter
+3 b 2
+4 a 2
drop table t1;
End of 5.0 tests
| Thread |
|---|
| • bk commit into 5.0 tree (gshchepa:1.2448) | gshchepa | 29 Apr |