MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / reset

Method reset

sql/item.cc:1755–1783  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1753*/
1754
1755void Item_param::reset()
1756{
1757 DBUG_ENTER("Item_param::reset");
1758 /* Shrink string buffer if it's bigger than max possible CHAR column */
1759 if (str_value.alloced_length() > MAX_CHAR_WIDTH)
1760 str_value.free();
1761 else
1762 str_value.length(0);
1763 str_value_ptr.length(0);
1764 /*
1765 We must prevent all charset conversions until data has been written
1766 to the binary log.
1767 */
1768 str_value.set_charset(&my_charset_bin);
1769 collation.set(&my_charset_bin, DERIVATION_COERCIBLE);
1770 state= NO_VALUE;
1771 maybe_null= 1;
1772 null_value= 0;
1773 /*
1774 Don't reset item_type to PARAM_ITEM: it's only needed to guard
1775 us from item optimizations at prepare stage, when item doesn't yet
1776 contain a literal of some kind.
1777 In all other cases when this object is accessed its value is
1778 set (this assumption is guarded by 'state' and
1779 DBUG_ASSERTS(state != NO_VALUE) in all Item_param::get_*
1780 methods).
1781 */
1782 DBUG_VOID_RETURN;
1783}
1784
1785
1786double Item_param::val_real()

Callers 1

dispatch_commandFunction · 0.45

Calls 5

alloced_lengthMethod · 0.80
freeMethod · 0.80
lengthMethod · 0.45
set_charsetMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected