All pages
Powered by GitBook
1 of 1

Loading...

format_path

The format_path function replaces specific system paths in a given string with their corresponding system variable names for better readability.

Syntax

sys.format_path(path)

Description

format_path is a available with the that, given a path, returns a modified path after replacing subpaths matching the values of various system variables with the variable name.

The system variables that are matched are, in order:

Examples

This page is licensed: CC BY-SA / Gnu FDL

innodb_log_group_home_dir
  • innodb_undo_directory

  • basedir

  • stored function
    Sys Schema
    datadir
    tmpdir
    slave_load_tmpdir
    innodb_data_home_dir
    SELECT @@tmpdir;
    +------------------------------------+
    | @@tmpdir                           |
    +------------------------------------+
    | /home/ian/sandboxes/msb_10_8_2/tmp |
    +------------------------------------+
    
    SELECT sys.format_path('/home/ian/sandboxes/msb_10_8_2/tmp/testdb.ibd');
    +------------------------------------------------------------------+
    | sys.format_path('/home/ian/sandboxes/msb_10_8_2/tmp/testdb.ibd') |
    +------------------------------------------------------------------+
    | @@tmpdir/testdb.ibd                                              |
    +------------------------------------------------------------------+

    Sys Schema is available from MariaDB 10.6.