MCPcopy Create free account
hub / github.com/MariaDB/server / append_directory

Function append_directory

sql/sql_show.cc:1790–1813  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1788/* Append directory name (if exists) to CREATE INFO */
1789
1790static 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

Callers 2

add_table_optionsFunction · 0.85
get_schema_tables_recordFunction · 0.85

Calls 3

dirname_lengthFunction · 0.85
memdupMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected