| 9392 | /** If pointer is not a null pointer, append filename to it. */ |
| 9393 | |
| 9394 | bool append_file_to_dir(THD *thd, const char **filename_ptr, |
| 9395 | const LEX_CSTRING *table_name) |
| 9396 | { |
| 9397 | char buff[FN_REFLEN],*ptr, *end; |
| 9398 | if (!*filename_ptr) |
| 9399 | return 0; // nothing to do |
| 9400 | |
| 9401 | /* Check that the filename is not too long and it's a hard path */ |
| 9402 | if (strlen(*filename_ptr)+table_name->length >= FN_REFLEN-1 || |
| 9403 | !test_if_hard_path(*filename_ptr)) |
| 9404 | { |
| 9405 | my_error(ER_WRONG_TABLE_NAME, MYF(0), *filename_ptr); |
| 9406 | return 1; |
| 9407 | } |
| 9408 | /* Fix is using unix filename format on dos */ |
| 9409 | strmov(buff,*filename_ptr); |
| 9410 | end=convert_dirname(buff, *filename_ptr, NullS); |
| 9411 | if (unlikely(!(ptr= thd->alloc((size_t)(end-buff) + table_name->length + 1)))) |
| 9412 | return 1; // End of memory |
| 9413 | *filename_ptr=ptr; |
| 9414 | strxmov(ptr,buff,table_name->str,NullS); |
| 9415 | return 0; |
| 9416 | } |
| 9417 | |
| 9418 | |
| 9419 | Comp_creator *comp_eq_creator(bool invert) |
no test coverage detected