@brief Output a filepath. Similar to add_keyword_string except it also converts \ to / on Windows and skips the partition file name at the end if found. @note When Mysql sends a DATA DIRECTORY from SQL for partitions it does not use a file name, but it does for DATA DIRECTORY on a non-partitioned table. So when the storage engine is asked for the DATA DIRECTORY string after a restart throug
| 2185 | engine may include the filename. |
| 2186 | */ |
| 2187 | static int add_keyword_path(String *str, const char *keyword, |
| 2188 | const char *path) |
| 2189 | { |
| 2190 | char temp_path[FN_REFLEN]; |
| 2191 | safe_strcpy(temp_path, sizeof(temp_path), path); |
| 2192 | #ifdef _WIN32 |
| 2193 | /* Convert \ to / to be able to create table on unix */ |
| 2194 | char *pos, *end; |
| 2195 | size_t length= strlen(temp_path); |
| 2196 | for (pos= temp_path, end= pos+length ; pos < end ; pos++) |
| 2197 | { |
| 2198 | if (*pos == '\\') |
| 2199 | *pos = '/'; |
| 2200 | } |
| 2201 | #endif |
| 2202 | |
| 2203 | /* |
| 2204 | If the partition file name with its "#P#" identifier |
| 2205 | is found after the last slash, truncate that filename. |
| 2206 | */ |
| 2207 | truncate_partition_filename(temp_path); |
| 2208 | |
| 2209 | return add_keyword_string(str, keyword, true, temp_path); |
| 2210 | } |
| 2211 | |
| 2212 | static int add_keyword_int(String *str, const char *keyword, longlong num) |
| 2213 | { |
no test coverage detected