| 1917 | /** If pointer is not a null pointer, append filename to it. */ |
| 1918 | |
| 1919 | bool append_file_to_dir(THD *thd, const char **filename_ptr, |
| 1920 | const char *table_name) |
| 1921 | { |
| 1922 | char buff[FN_REFLEN],*ptr, *end; |
| 1923 | if (!*filename_ptr) |
| 1924 | return 0; // nothing to do |
| 1925 | |
| 1926 | /* Check that the filename is not too long and it's a hard path */ |
| 1927 | if (strlen(*filename_ptr)+strlen(table_name) >= FN_REFLEN-1 || |
| 1928 | !test_if_hard_path(*filename_ptr)) |
| 1929 | { |
| 1930 | my_error(ER_WRONG_TABLE_NAME, MYF(0), *filename_ptr); |
| 1931 | return 1; |
| 1932 | } |
| 1933 | /* Fix is using unix filename format on dos */ |
| 1934 | strmov(buff,*filename_ptr); |
| 1935 | end=convert_dirname(buff, *filename_ptr, NullS); |
| 1936 | if (!(ptr= (char*) thd->alloc((size_t) (end-buff) + strlen(table_name)+1))) |
| 1937 | return 1; // End of memory |
| 1938 | *filename_ptr=ptr; |
| 1939 | strxmov(ptr,buff,table_name,NullS); |
| 1940 | return 0; |
| 1941 | } |
| 1942 | |
| 1943 | |
| 1944 | /** |
nothing calls this directly
no test coverage detected