| 1788 | /* Append directory name (if exists) to CREATE INFO */ |
| 1789 | |
| 1790 | static void append_directory(THD *thd, String *packet, LEX_CSTRING *dir_type, |
| 1791 | const char *filename) |
| 1792 | { |
| 1793 | if (filename && !(thd->variables.sql_mode & MODE_NO_DIR_IN_CREATE)) |
| 1794 | { |
| 1795 | size_t length= dirname_length(filename); |
| 1796 | packet->append(' '); |
| 1797 | packet->append(dir_type); |
| 1798 | packet->append(STRING_WITH_LEN(" DIRECTORY='")); |
| 1799 | #ifdef _WIN32 |
| 1800 | /* Convert \ to / to be able to create table on unix */ |
| 1801 | char *winfilename= (char*) thd->memdup(filename, length); |
| 1802 | char *pos, *end; |
| 1803 | for (pos= winfilename, end= pos+length ; pos < end ; pos++) |
| 1804 | { |
| 1805 | if (*pos == '\\') |
| 1806 | *pos = '/'; |
| 1807 | } |
| 1808 | filename= winfilename; |
| 1809 | #endif |
| 1810 | packet->append(filename, length); |
| 1811 | packet->append('\''); |
| 1812 | } |
| 1813 | } |
| 1814 | |
| 1815 | |
| 1816 | #define LIST_PROCESS_HOST_LEN 64 |
no test coverage detected