MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / test_if_case_insensitive

Function test_if_case_insensitive

sql/mysqld.cc:2349–2374  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2347*/
2348
2349static int test_if_case_insensitive(const char *dir_name)
2350{
2351 int result= 0;
2352 File file;
2353 char buff[FN_REFLEN], buff2[FN_REFLEN];
2354 MY_STAT stat_info;
2355 DBUG_ENTER("test_if_case_insensitive");
2356
2357 fn_format(buff, glob_hostname, dir_name, ".lower-test",
2358 MY_UNPACK_FILENAME | MY_REPLACE_EXT | MY_REPLACE_DIR);
2359 fn_format(buff2, glob_hostname, dir_name, ".LOWER-TEST",
2360 MY_UNPACK_FILENAME | MY_REPLACE_EXT | MY_REPLACE_DIR);
2361 mysql_file_delete(key_file_casetest, buff2, MYF(0));
2362 if ((file= mysql_file_create(key_file_casetest,
2363 buff, 0666, O_RDWR, MYF(0))) < 0)
2364 {
2365 sql_print_warning("Can't create test file %s", buff);
2366 DBUG_RETURN(-1);
2367 }
2368 mysql_file_close(file, MYF(0));
2369 if (mysql_file_stat(key_file_casetest, buff2, &stat_info, MYF(0)))
2370 result= 1; // Can access file
2371 mysql_file_delete(key_file_casetest, buff, MYF(MY_WME));
2372 DBUG_PRINT("exit", ("result: %d", result));
2373 DBUG_RETURN(result);
2374}
2375
2376
2377/*****************************************************************************

Callers

nothing calls this directly

Calls 2

fn_formatFunction · 0.85
sql_print_warningFunction · 0.85

Tested by

no test coverage detected