diff --git a/sql/item.cc b/sql/item.cc index d51b931a3d1..9f69ec8eece 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -11545,6 +11545,10 @@ table_map Item_ref_null_helper::used_tables() const #ifndef DBUG_OFF +void print_query_stderr() +{ + fprintf(stderr, "Q:%s\n", current_thd->query()); +} /* Debugger help function */ static char dbug_item_print_buf[2048]; diff --git a/sql/item.h b/sql/item.h index a207b2c2f2a..597b2371650 100644 --- a/sql/item.h +++ b/sql/item.h @@ -7830,6 +7830,9 @@ class Item_cache: public Item_fixed_hybrid, }; +const char *dbug_print_item(Item *item); +void print_query_stderr(); + class Item_cache_int: public Item_cache { protected: @@ -7851,7 +7854,11 @@ class Item_cache_int: public Item_cache Item *shallow_copy(THD *thd) const override { return get_item_copy(thd, this); } Item *deep_copy(THD *thd) const override - { return shallow_copy_with_checks(thd); } + { + fprintf(stderr,"AABBQQ-7: cloning %s\n", dbug_print_item(example)); + print_query_stderr(); + return shallow_copy_with_checks(thd); + } }; @@ -7874,6 +7881,12 @@ class Item_cache_bool: public Item_cache_int protected: Item *shallow_copy(THD *thd) const override { return get_item_copy(thd, this); } + Item *deep_copy(THD *thd) const override + { + fprintf(stderr,"AABBQQ-8: cloning %s\n", dbug_print_item(example)); + print_query_stderr(); + return shallow_copy_with_checks(thd); + } }; @@ -7887,7 +7900,11 @@ class Item_cache_year: public Item_cache_int return type_handler_year.Item_get_date_with_warn(thd, this, to, mode); } Item *deep_copy(THD *thd) const override - { return shallow_copy_with_checks(thd); } + { + fprintf(stderr,"AABBQQ-9: cloning %s\n", dbug_print_item(example)); + print_query_stderr(); + return shallow_copy_with_checks(thd); + } protected: Item *shallow_copy(THD *thd) const override { return get_item_copy(thd, this); } @@ -7918,6 +7935,13 @@ class Item_cache_temporal: public Item_cache_int Item *clone_constant(THD *thd) const override; Item *convert_to_basic_const_item(THD *thd) override; virtual Item *make_literal(THD *) =0; +protected: + Item *deep_copy(THD *thd) const override + { + fprintf(stderr,"AABBQQ-10: cloning %s\n", dbug_print_item(example)); + print_query_stderr(); + return shallow_copy_with_checks(thd); + } }; @@ -8029,6 +8053,13 @@ class Item_cache_date: public Item_cache_temporal { return has_value() ? Date(this).to_decimal(to) : NULL; } +protected: + Item *deep_copy(THD *thd) const override + { + fprintf(stderr,"AABBQQ-11: cloning %s\n", dbug_print_item(example)); + print_query_stderr(); + return shallow_copy_with_checks(thd); + } }; @@ -8043,7 +8074,11 @@ class Item_cache_timestamp: public Item_cache Item *shallow_copy(THD *thd) const override { return get_item_copy(thd, this); } Item *deep_copy(THD *thd) const override - { return shallow_copy_with_checks(thd); } + { + fprintf(stderr,"AABBQQ-1: cloning %s\n", dbug_print_item(example)); + print_query_stderr(); + return shallow_copy_with_checks(thd); + } public: bool cache_value() override; String* val_str(String *to) override @@ -8107,7 +8142,11 @@ class Item_cache_double: public Item_cache_real Item *shallow_copy(THD *thd) const override { return get_item_copy(thd, this); } Item *deep_copy(THD *thd) const override - { return shallow_copy_with_checks(thd); } + { + fprintf(stderr,"AABBQQ-2: cloning %s\n", dbug_print_item(example)); + print_query_stderr(); + return shallow_copy_with_checks(thd); + } }; @@ -8122,7 +8161,11 @@ class Item_cache_float: public Item_cache_real Item *shallow_copy(THD *thd) const override { return get_item_copy(thd, this); } Item *deep_copy(THD *thd) const override - { return shallow_copy_with_checks(thd); } + { + fprintf(stderr,"AABBQQ-3: cloning %s\n", dbug_print_item(example)); + print_query_stderr(); + return shallow_copy_with_checks(thd); + } }; @@ -8148,7 +8191,11 @@ class Item_cache_decimal: public Item_cache Item *shallow_copy(THD *thd) const override { return get_item_copy(thd, this); } Item *deep_copy(THD *thd) const override - { return shallow_copy_with_checks(thd); } + { + fprintf(stderr,"AABBQQ-4: cloning %s\n", dbug_print_item(example)); + print_query_stderr(); + return shallow_copy_with_checks(thd); + } }; @@ -8181,7 +8228,11 @@ class Item_cache_str: public Item_cache Item *shallow_copy(THD *thd) const override { return get_item_copy(thd, this); } Item *deep_copy(THD *thd) const override - { return shallow_copy_with_checks(thd); } + { + fprintf(stderr,"AABBQQ-5: cloning %s\n", dbug_print_item(example)); + print_query_stderr(); + return shallow_copy_with_checks(thd); + } }; @@ -8210,6 +8261,8 @@ class Item_cache_str_for_nullif: public Item_cache_str { return get_item_copy(thd, this); } Item *deep_copy(THD *thd) const override { + fprintf(stderr,"AABBQQ-12: cloning %s\n", dbug_print_item(example)); + print_query_stderr(); return shallow_copy_with_checks(thd); } }; @@ -8292,7 +8345,9 @@ class Item_cache_row: public Item_cache { return get_item_copy(thd, this); } Item *deep_copy(THD *thd) const override { - return shallow_copy_with_checks(thd); + fprintf(stderr,"AABBQQ-6: cloning %s\n", dbug_print_item(example)); + print_query_stderr(); + return shallow_copy_with_checks(thd); } };