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

Function path_starts_from_data_home_dir

sql/sql_parse.cc:10203–10233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10201extern "C" {
10202
10203int path_starts_from_data_home_dir(const char *path)
10204{
10205 size_t dir_len= strlen(path);
10206 DBUG_ENTER("path_starts_from_data_home_dir");
10207
10208 if (mysql_unpacked_real_data_home_len<= dir_len)
10209 {
10210 if (dir_len > mysql_unpacked_real_data_home_len &&
10211 path[mysql_unpacked_real_data_home_len] != FN_LIBCHAR)
10212 DBUG_RETURN(0);
10213
10214 if (lower_case_file_system)
10215 {
10216 if (!default_charset_info->strnncoll(path,
10217 mysql_unpacked_real_data_home_len,
10218 mysql_unpacked_real_data_home,
10219 mysql_unpacked_real_data_home_len))
10220 {
10221 DBUG_PRINT("error", ("Path is part of mysql_real_data_home"));
10222 DBUG_RETURN(1);
10223 }
10224 }
10225 else if (!memcmp(path, mysql_unpacked_real_data_home,
10226 mysql_unpacked_real_data_home_len))
10227 {
10228 DBUG_PRINT("error", ("Path is part of mysql_real_data_home"));
10229 DBUG_RETURN(1);
10230 }
10231 }
10232 DBUG_RETURN(0);
10233}
10234
10235}
10236

Callers 1

test_if_data_home_dirFunction · 0.85

Calls 1

strnncollMethod · 0.80

Tested by 1

test_if_data_home_dirFunction · 0.68