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

Method store

sql/item_func.cc:1409–1422  ·  view source on GitHub ↗

Set value to user variable. @param ptr pointer to buffer with new value @param length length of new value @param type type of new value @retval false on success @retval true on allocation error */

Source from the content-addressed store, hash-verified

1407
1408*/
1409bool user_var_entry::store(void *from, uint length, Item_result type)
1410{
1411 // Store strings with end \0
1412 if (realloc(length + MY_TEST(type == STRING_RESULT)))
1413 return true;
1414 if (type == STRING_RESULT)
1415 m_ptr[length]= 0; // Store end \0
1416 memmove(m_ptr, from, length);
1417 if (type == DECIMAL_RESULT)
1418 ((my_decimal*) m_ptr)->fix_buffer_pointer();
1419 m_length= length;
1420 m_type= type;
1421 return false;
1422}
1423
1424
1425/**

Callers 1

set_valueMethod · 0.45

Calls 2

fix_buffer_pointerMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected