All pages
Powered by GitBook
1 of 1

Loading...

extract_schema_from_file_name

This function takes a file path and returns the schema name it belongs to, assuming the file is located within the schema's directory.

Syntax

sys.extract_schema_from_file_name(path)

Description

extract_schema_from_file_name is a available with the .

Given a file path, it returns the schema (database) name. The file name is assumed to be within the schema directory, and therefore the function will not return the expected result with partitions, or when tables are defined using the DATA_DIRECTORY table option.

The function does not examine anything on disk. The return value, a VARCHAR(64), is determined solely from the provided path.

Examples

See also

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

stored function
Sys Schema
extract_table_from_file_name()
SELECT sys.extract_schema_from_file_name('/usr/local/mysql/data/db/t1.ibd');
+----------------------------------------------------------------------+
| sys.extract_schema_from_file_name('/usr/local/mysql/data/db/t1.ibd') |
+----------------------------------------------------------------------+
| db                                                                   |
+----------------------------------------------------------------------+

Sys Schema is available from MariaDB 10.6.