diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item.cc | 2 | ||||
-rw-r--r-- | sql/log.cc | 2 | ||||
-rw-r--r-- | sql/table.cc | 1 |
3 files changed, 3 insertions, 2 deletions
diff --git a/sql/item.cc b/sql/item.cc index 96806ea2ed1..53d9d532b3d 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -4525,7 +4525,7 @@ bool Item_type_holder::join_types(THD *thd, Item *item, TABLE *table) bool use_new_field= 0, use_expression_type= 0; Item_result new_result_type= type_convertor[item_type][item->result_type()]; Field *field= get_holder_example_field(thd, item, table); - bool item_is_a_field= field; + bool item_is_a_field= (field != NULL); /* Check if both items point to fields: in this case we can adjust column types of result table in the union smartly. diff --git a/sql/log.cc b/sql/log.cc index 7d6854b6fb4..d21979a707c 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1325,7 +1325,7 @@ bool MYSQL_LOG::write(Log_event* event_info) binlog_[wild_]{do|ignore}_table?" (WL#1049)" */ if ((thd && !(thd->options & OPTION_BIN_LOG)) || - (local_db && !db_ok(local_db, binlog_do_db, binlog_ignore_db))) + (!db_ok(local_db, binlog_do_db, binlog_ignore_db))) { VOID(pthread_mutex_unlock(&LOCK_log)); DBUG_PRINT("error",("!db_ok('%s')", local_db)); diff --git a/sql/table.cc b/sql/table.cc index 69a132329c0..620a0d62316 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -661,6 +661,7 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat, if (!(field->flags & BINARY_FLAG)) keyinfo->flags|= HA_END_SPACE_KEY; } + set_if_bigger(outparam->max_key_length, keyinfo->key_length); if (field->type() == MYSQL_TYPE_BIT) key_part->key_part_flag|= HA_BIT_PART; |