| 805 | */ |
| 806 | |
| 807 | bool Lex_input_stream::init(THD *thd, |
| 808 | char* buff, |
| 809 | size_t length) |
| 810 | { |
| 811 | DBUG_EXECUTE_IF("bug42064_simulate_oom", |
| 812 | DBUG_SET("+d,simulate_out_of_memory");); |
| 813 | |
| 814 | m_cpp_buf= thd->alloc(length + 1); |
| 815 | |
| 816 | DBUG_EXECUTE_IF("bug42064_simulate_oom", |
| 817 | DBUG_SET("-d,bug42064_simulate_oom");); |
| 818 | |
| 819 | if (m_cpp_buf == NULL) |
| 820 | return true; |
| 821 | |
| 822 | m_thd= thd; |
| 823 | reset(buff, length); |
| 824 | |
| 825 | return false; |
| 826 | } |
| 827 | |
| 828 | |
| 829 | /** |
no test coverage detected