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 */
| 1407 | |
| 1408 | */ |
| 1409 | bool 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 | /** |
no test coverage detected