Commit 2b706159 authored by igor@rurik.mysql.com's avatar igor@rurik.mysql.com

Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0

into rurik.mysql.com:/home/igor/mysql-5.0
parents 316eff7a 7322441d
......@@ -587,13 +587,15 @@ int thr_write_keys(MI_SORT_PARAM *sort_param)
while (!got_error &&
!my_b_read(&sinfo->tempfile_for_exceptions,(byte*)&key_length,
sizeof(key_length)) &&
!my_b_read(&sinfo->tempfile_for_exceptions,(byte*)mergebuf,
(uint) key_length))
sizeof(key_length)))
{
if (_mi_ck_write(info,sinfo->key,(uchar*) mergebuf,
key_length - info->s->rec_reflength))
got_error=1;
byte ft_buf[HA_FT_MAXBYTELEN + HA_FT_WLEN + 10];
if (key_length > sizeof(ft_buf) ||
my_b_read(&sinfo->tempfile_for_exceptions, (byte*)ft_buf,
(uint)key_length) ||
_mi_ck_write(info, sinfo->key, (uchar*)ft_buf,
key_length - info->s->rec_reflength))
got_error=1;
}
}
}
......
......@@ -128,3 +128,9 @@ SELECT * FROM t1;
a
DROP TABLE t1;
CREATE TABLE t1 (a CHAR(50) CHARACTER SET big5 NOT NULL, FULLTEXT(a));
INSERT INTO t1 VALUES(0xA741ADCCA66EB6DC20A7DAADCCABDCA66E);
SELECT HEX(a) FROM t1 WHERE MATCH(a) AGAINST (0xA741ADCCA66EB6DC IN BOOLEAN MODE);
HEX(a)
A741ADCCA66EB6DC20A7DAADCCABDCA66E
DROP TABLE t1;
......@@ -422,3 +422,11 @@ SELECT COUNT(*) FROM t1 WHERE MATCH(t) AGAINST ('"osnabr
COUNT(*)
1
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(30), FULLTEXT(a));
INSERT INTO t1 VALUES('bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb');
SET myisam_repair_threads=2;
REPAIR TABLE t1;
Table Op Msg_type Msg_text
test.t1 repair status OK
SET myisam_repair_threads=@@global.myisam_repair_threads;
DROP TABLE t1;
......@@ -28,4 +28,12 @@ INSERT INTO t1 VALUES ('
SELECT * FROM t1;
DROP TABLE t1;
#
# BUG#12075 - FULLTEXT non-functional for big5 strings
#
CREATE TABLE t1 (a CHAR(50) CHARACTER SET big5 NOT NULL, FULLTEXT(a));
INSERT INTO t1 VALUES(0xA741ADCCA66EB6DC20A7DAADCCABDCA66E);
SELECT HEX(a) FROM t1 WHERE MATCH(a) AGAINST (0xA741ADCCA66EB6DC IN BOOLEAN MODE);
DROP TABLE t1;
# End of 4.1 tests
......@@ -339,4 +339,15 @@ INSERT INTO t1 VALUES('Mit freundlichem Gr
SELECT COUNT(*) FROM t1 WHERE MATCH(t) AGAINST ('"osnabrck"' IN BOOLEAN MODE);
DROP TABLE t1;
#
# BUG#11684 - repair crashes mysql when table has fulltext index
#
CREATE TABLE t1 (a VARCHAR(30), FULLTEXT(a));
INSERT INTO t1 VALUES('bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb');
SET myisam_repair_threads=2;
REPAIR TABLE t1;
SET myisam_repair_threads=@@global.myisam_repair_threads;
DROP TABLE t1;
# End of 4.1 tests
......@@ -2632,7 +2632,11 @@ int group_concat_key_cmp_with_distinct(void* arg, byte* key1,
the temporary table, not the original field
*/
Field *field= (*field_item)->get_tmp_table_field();
if (field)
/*
If field_item is a const item then either get_tp_table_field returns 0
or it is an item over a const table.
*/
if (field && !(*field_item)->const_item())
{
int res;
uint offset= field->offset() - table->s->null_bytes;
......@@ -2666,8 +2670,11 @@ int group_concat_key_cmp_with_order(void* arg, byte* key1, byte* key2)
the temporary table, not the original field
*/
Field *field= item->get_tmp_table_field();
/* If the item is a constant, there is no tmp table field */
if (field)
/*
If item is a const item then either get_tp_table_field returns 0
or it is an item over a const table.
*/
if (field && !item->const_item())
{
int res;
uint offset= field->offset() - table->s->null_bytes;
......@@ -3037,7 +3044,6 @@ bool Item_func_group_concat::setup(THD *thd)
DBUG_RETURN(TRUE);
count_field_types(tmp_table_param,all_fields,0);
tmp_table_param->need_const= 1;
DBUG_ASSERT(table == 0);
/*
We have to create a temporary table to get descriptions of fields
......
......@@ -1705,14 +1705,13 @@ public:
bool using_indirect_summary_function;
/* If >0 convert all blob fields to varchar(convert_blob_length) */
uint convert_blob_length;
bool need_const; /* <=> const items are saved in tmp table */
CHARSET_INFO *table_charset;
bool schema_table;
TMP_TABLE_PARAM()
:copy_field(0), group_parts(0),
group_length(0), group_null_parts(0), convert_blob_length(0),
need_const(0), schema_table(0)
group_length(0), group_null_parts(0), convert_blob_length(0),
schema_table(0)
{}
~TMP_TABLE_PARAM()
{
......
......@@ -8254,8 +8254,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
param->using_indirect_summary_function=1;
continue;
}
if (item->const_item() && (int) hidden_field_count <= 0 &&
!param->need_const)
if (item->const_item() && (int) hidden_field_count <= 0)
continue; // We don't have to store this
}
if (type == Item::SUM_FUNC_ITEM && !group && !save_sum_fields)
......
......@@ -61,12 +61,12 @@ static uchar NEAR ctype_big5[257] =
2,2,2,2,2,2,2,2,2,2,2,16,16,16,16,32,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
3,3,3,3,3,3,3,3,3,3,0,0,0,0,0,0,
};
static uchar NEAR to_lower_big5[]=
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment