1-- source include/not_embedded.inc
2# Windows paths are \ not /, so ignore here
3-- source include/not_windows.inc
4# Tests for sys schema
5# Verify the sys.format_path() function perfoms as expected
6#
7
8# Passing NULL should return NULL
9SELECT sys.format_path(NULL);
10
11# Ensure basedir is recognized and stripped
12SET @mypath := CONCAT(@@global.basedir, 'logs/binlog.000001');
13
14SELECT sys.format_path(@mypath);
15
16# Ensure datadir is recognized and stripped
17SET @mypath := CONCAT(@@global.datadir, 'foo/bar.foo');
18
19SELECT sys.format_path(@mypath);
20
21# Ensure tmpdir is recognized and stripped
22SET @mypath := CONCAT(@@global.tmpdir, '/foo/bar.foo');
23
24SELECT sys.format_path(@mypath);
25
26# Ensure innodb_data_home_dir is recognized and stripped
27SET @mypath := CONCAT(@@global.innodb_data_home_dir, '/foo/bar.ibd');
28
29SELECT sys.format_path(@mypath);
30
31# Ensure innodb_log_group_home_dir is recognized and stripped
32SET @mypath := CONCAT(@@global.innodb_log_group_home_dir, '/ib_logfile0');
33
34SELECT sys.format_path(@mypath);
35
36# Ensure innodb_undo_directory is recognized and stripped
37SET @mypath := CONCAT(@@global.innodb_undo_directory, '/undo0');
38
39SELECT sys.format_path(@mypath);
40
41# Unrecognized paths should return the full path
42SELECT sys.format_path('/foo/bar/baz.foo');
43