| 194 | */ |
| 195 | |
| 196 | bool Lex_input_stream::init(THD *thd, |
| 197 | char* buff, |
| 198 | unsigned int length) |
| 199 | { |
| 200 | DBUG_EXECUTE_IF("bug42064_simulate_oom", |
| 201 | DBUG_SET("+d,simulate_out_of_memory");); |
| 202 | |
| 203 | m_cpp_buf= (char*) thd->alloc(length + 1); |
| 204 | |
| 205 | DBUG_EXECUTE_IF("bug42064_simulate_oom", |
| 206 | DBUG_SET("-d,bug42064_simulate_oom");); |
| 207 | |
| 208 | if (m_cpp_buf == NULL) |
| 209 | return TRUE; |
| 210 | |
| 211 | m_thd= thd; |
| 212 | reset(buff, length); |
| 213 | |
| 214 | return FALSE; |
| 215 | } |
| 216 | |
| 217 | |
| 218 | /** |