diff --git a/mysql-test/r/count_distinct2.result b/mysql-test/r/count_distinct2.result index 131e3b325ec..f6b888dec3b 100644 --- a/mysql-test/r/count_distinct2.result +++ b/mysql-test/r/count_distinct2.result @@ -116,7 +116,7 @@ count(distinct n) 5000 show status like 'Created_tmp_disk_tables'; Variable_name Value -Created_tmp_disk_tables 1 +Created_tmp_disk_tables 2 drop table t1; create table t1 (s text); flush status; @@ -125,5 +125,5 @@ count(distinct s) 5000 show status like 'Created_tmp_disk_tables'; Variable_name Value -Created_tmp_disk_tables 1 +Created_tmp_disk_tables 2 drop table t1; diff --git a/mysql-test/r/temp_table.result b/mysql-test/r/temp_table.result index 2dd58f54327..6e36f24d8b0 100644 --- a/mysql-test/r/temp_table.result +++ b/mysql-test/r/temp_table.result @@ -94,6 +94,6 @@ d 2002-10-24 14:50:40 show status like "created_tmp%tables"; Variable_name Value -Created_tmp_disk_tables 0 +Created_tmp_disk_tables 1 Created_tmp_tables 2 drop table t1; diff --git a/sql/item.cc b/sql/item.cc index a0a623d98c5..9117105f26e 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -2269,7 +2269,7 @@ enum_field_types Item::field_type() const Field *Item::make_string_field(TABLE *table) { - if (max_length > MAX_FIELD_WIDTH) + if (max_length > CONVERT_IF_BIGGER_TO_BLOB) return new Field_blob(max_length, maybe_null, name, table, collation.collation); if (max_length > 0)