1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

BUG#823930: Wrong result with semijoin materialization and blob fields

- Make subquery_types_allow_materialization() detect a case where 
  create_tmp_table() would create a blob column which would make it 
  impossible to use materialization
  Non-semi-join materialization worked because it detected that this case
  and felt back to use IN->EXISTS. Semi-join Materialization cannot easily
  fallback, so we have to detect this case early.
This commit is contained in:
Sergey Petrunya
2011-09-06 17:06:04 +04:00
parent e1435a5178
commit fc6b6435b4
3 changed files with 22 additions and 6 deletions

View File

@@ -559,6 +559,16 @@ bool subquery_types_allow_materialization(Item_in_subselect *in_subs)
if (inner->field_type() == MYSQL_TYPE_BLOB ||
inner->field_type() == MYSQL_TYPE_GEOMETRY)
DBUG_RETURN(FALSE);
/*
Materialization also is unable to work when create_tmp_table() will
create a blob column because item->max_length is too big.
The following check is copied from Item::make_string_field():
*/
if (inner->max_length / inner->collation.collation->mbmaxlen >
CONVERT_IF_BIGGER_TO_BLOB)
{
DBUG_RETURN(FALSE);
}
break;
case TIME_RESULT:
if (mysql_type_to_time_type(outer->field_type()) !=