summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislav Vaintroub <vvaintroub@googlemail.com>2016-02-22 12:48:03 +0100
committerVladislav Vaintroub <vvaintroub@googlemail.com>2016-02-22 12:48:03 +0100
commit3a24f1cf8426409a69619982e84ca498d581f8a1 (patch)
tree8879ea081a106ecb5bebb15f5cf43bbe5b33eb1e
parentff25158d7f5a8e29c1b074631e4b98693bed343e (diff)
downloadmariadb-git-3a24f1cf8426409a69619982e84ca498d581f8a1.tar.gz
MDEV-9307 - provide info about DATA/INDEX directory in INFORMATION_SCHEMA.TA
BLES (in CREATE_OPTIONS column)
-rw-r--r--mysql-test/r/information_schema_inno.result5
-rw-r--r--mysql-test/r/mysqldump.result2
-rw-r--r--mysql-test/r/show_check.result4
-rw-r--r--mysql-test/r/symlink.result3
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is.result4
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables.result6
-rw-r--r--mysql-test/t/information_schema_inno.test6
-rw-r--r--mysql-test/t/symlink.test2
-rw-r--r--sql/sql_show.cc13
9 files changed, 35 insertions, 10 deletions
diff --git a/mysql-test/r/information_schema_inno.result b/mysql-test/r/information_schema_inno.result
index 838a7ad5162..7755d112f8e 100644
--- a/mysql-test/r/information_schema_inno.result
+++ b/mysql-test/r/information_schema_inno.result
@@ -101,3 +101,8 @@ SELECT * FROM information_schema.partitions
WHERE table_schema= 'test' AND table_name= 'v1';
DROP TABLE t1;
DROP VIEW v1;
+CREATE TABLE t1(i int) ENGINE=Innodb ROW_FORMAT=REDUNDANT DATA DIRECTORY='MYSQLTEST_VARDIR/tmp';
+SELECT CREATE_OPTIONS FROM INFORMATION_SCHEMA.TABLES where TABLE_NAME='t1';
+CREATE_OPTIONS
+row_format=REDUNDANT DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/'
+DROP TABLE t1;
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index 3646618cb1d..6652701090c 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -3715,7 +3715,7 @@ CREATE TEMPORARY TABLE `TABLES` (
`CHECK_TIME` datetime DEFAULT NULL,
`TABLE_COLLATION` varchar(32) DEFAULT NULL,
`CHECKSUM` bigint(21) unsigned DEFAULT NULL,
- `CREATE_OPTIONS` varchar(255) DEFAULT NULL,
+ `CREATE_OPTIONS` varchar(2048) DEFAULT NULL,
`TABLE_COMMENT` varchar(2048) NOT NULL DEFAULT ''
) ENGINE=MEMORY DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index 6d1cbb21ac7..654b00d68ae 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -133,7 +133,7 @@ def information_schema TABLES TABLES UPDATE_TIME Update_time 12 19 0 Y 128 0 63
def information_schema TABLES TABLES CHECK_TIME Check_time 12 19 0 Y 128 0 63
def information_schema TABLES TABLES TABLE_COLLATION Collation 253 32 0 Y 0 0 8
def information_schema TABLES TABLES CHECKSUM Checksum 8 21 0 Y 32800 0 63
-def information_schema TABLES TABLES CREATE_OPTIONS Create_options 253 255 0 Y 0 0 8
+def information_schema TABLES TABLES CREATE_OPTIONS Create_options 253 2048 0 Y 0 0 8
def information_schema TABLES TABLES TABLE_COMMENT Comment 253 2048 0 N 1 0 8
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
show databases;
@@ -935,7 +935,7 @@ def information_schema TABLES TABLES TABLE_TYPE TABLE_TYPE 253 192 10 N 1 0 33
def information_schema TABLES TABLES ENGINE ENGINE 253 192 6 Y 0 0 33
def information_schema TABLES TABLES ROW_FORMAT ROW_FORMAT 253 30 5 Y 0 0 33
def information_schema TABLES TABLES TABLE_COLLATION TABLE_COLLATION 253 96 17 Y 0 0 33
-def information_schema TABLES TABLES CREATE_OPTIONS CREATE_OPTIONS 253 765 0 Y 0 0 33
+def information_schema TABLES TABLES CREATE_OPTIONS CREATE_OPTIONS 253 6144 0 Y 0 0 33
def information_schema TABLES TABLES TABLE_COMMENT TABLE_COMMENT 253 6144 0 N 1 0 33
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_COLLATION CREATE_OPTIONS TABLE_COMMENT
def test t1 BASE TABLE MyISAM Fixed latin1_swedish_ci
diff --git a/mysql-test/r/symlink.result b/mysql-test/r/symlink.result
index 279af1e44d2..b02c9a0c6f5 100644
--- a/mysql-test/r/symlink.result
+++ b/mysql-test/r/symlink.result
@@ -202,6 +202,9 @@ t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/run/'
+select create_options from information_schema.tables where table_name='t1';
+create_options
+DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/run/'
# CREATE TABLE LIKE statement on table with INDEX/DATA DIRECTORY
# options should not fail. Per documentation newly created table
# should not inherit value of these options from the original table.
diff --git a/mysql-test/suite/funcs_1/r/is_columns_is.result b/mysql-test/suite/funcs_1/r/is_columns_is.result
index 66a90f1dc87..e992b79321e 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_is.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_is.result
@@ -363,7 +363,7 @@ def information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 20 0 N
def information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select
def information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select
def information_schema TABLES CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select
-def information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 255 765 NULL NULL NULL utf8 utf8_general_ci varchar(255) select
+def information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) select
def information_schema TABLES CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select
def information_schema TABLES DATA_FREE 13 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select
def information_schema TABLES DATA_LENGTH 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select
@@ -906,7 +906,7 @@ NULL information_schema TABLES UPDATE_TIME datetime NULL NULL NULL NULL datetime
NULL information_schema TABLES CHECK_TIME datetime NULL NULL NULL NULL datetime
3.0000 information_schema TABLES TABLE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
NULL information_schema TABLES CHECKSUM bigint NULL NULL NULL NULL bigint(21) unsigned
-3.0000 information_schema TABLES CREATE_OPTIONS varchar 255 765 utf8 utf8_general_ci varchar(255)
+3.0000 information_schema TABLES CREATE_OPTIONS varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
3.0000 information_schema TABLES TABLE_COMMENT varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
3.0000 information_schema TABLESPACES TABLESPACE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema TABLESPACES ENGINE varchar 64 192 utf8 utf8_general_ci varchar(64)
diff --git a/mysql-test/suite/funcs_1/r/is_tables.result b/mysql-test/suite/funcs_1/r/is_tables.result
index 1b4ad503b29..53fb95680e9 100644
--- a/mysql-test/suite/funcs_1/r/is_tables.result
+++ b/mysql-test/suite/funcs_1/r/is_tables.result
@@ -47,7 +47,7 @@ UPDATE_TIME datetime YES NULL
CHECK_TIME datetime YES NULL
TABLE_COLLATION varchar(32) YES NULL
CHECKSUM bigint(21) unsigned YES NULL
-CREATE_OPTIONS varchar(255) YES NULL
+CREATE_OPTIONS varchar(2048) YES NULL
TABLE_COMMENT varchar(2048) NO
SHOW CREATE TABLE information_schema.TABLES;
Table Create Table
@@ -71,7 +71,7 @@ TABLES CREATE TEMPORARY TABLE `TABLES` (
`CHECK_TIME` datetime DEFAULT NULL,
`TABLE_COLLATION` varchar(32) DEFAULT NULL,
`CHECKSUM` bigint(21) unsigned DEFAULT NULL,
- `CREATE_OPTIONS` varchar(255) DEFAULT NULL,
+ `CREATE_OPTIONS` varchar(2048) DEFAULT NULL,
`TABLE_COMMENT` varchar(2048) NOT NULL DEFAULT ''
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.TABLES;
@@ -95,7 +95,7 @@ UPDATE_TIME datetime YES NULL
CHECK_TIME datetime YES NULL
TABLE_COLLATION varchar(32) YES NULL
CHECKSUM bigint(21) unsigned YES NULL
-CREATE_OPTIONS varchar(255) YES NULL
+CREATE_OPTIONS varchar(2048) YES NULL
TABLE_COMMENT varchar(2048) NO
SELECT table_catalog, table_schema, table_name
FROM information_schema.tables WHERE table_catalog IS NULL OR table_catalog <> 'def';
diff --git a/mysql-test/t/information_schema_inno.test b/mysql-test/t/information_schema_inno.test
index 657d0effd7e..9a9658e9027 100644
--- a/mysql-test/t/information_schema_inno.test
+++ b/mysql-test/t/information_schema_inno.test
@@ -109,3 +109,9 @@ CREATE TABLE t1 engine = InnoDB AS
DROP TABLE t1;
DROP VIEW v1;
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval CREATE TABLE t1(i int) ENGINE=Innodb ROW_FORMAT=REDUNDANT DATA DIRECTORY='$MYSQLTEST_VARDIR/tmp';
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+SELECT CREATE_OPTIONS FROM INFORMATION_SCHEMA.TABLES where TABLE_NAME='t1';
+DROP TABLE t1;
diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test
index 20585dd9ab7..065be302237 100644
--- a/mysql-test/t/symlink.test
+++ b/mysql-test/t/symlink.test
@@ -292,6 +292,8 @@ eval create table t1 (a int primary key) engine=myisam
index directory="$MYSQLTEST_VARDIR/run";
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
show create table t1;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+select create_options from information_schema.tables where table_name='t1';
--echo # CREATE TABLE LIKE statement on table with INDEX/DATA DIRECTORY
--echo # options should not fail. Per documentation newly created table
--echo # should not inherit value of these options from the original table.
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index d931aed475a..6aeea4b0316 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -5036,6 +5036,15 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
}
append_create_options(thd, &str, share->option_list, false, 0);
+ if (file)
+ {
+ HA_CREATE_INFO create_info;
+ memset(&create_info, 0, sizeof(create_info));
+ file->update_create_info(&create_info);
+ append_directory(thd, &str, "DATA", create_info.data_file_name);
+ append_directory(thd, &str, "INDEX", create_info.index_file_name);
+ }
+
if (str.length())
table->field[19]->store(str.ptr()+1, str.length()-1, cs);
@@ -8300,8 +8309,8 @@ ST_FIELD_INFO tables_fields_info[]=
OPEN_FRM_ONLY},
{"CHECKSUM", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG, 0,
(MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Checksum", OPEN_FULL_TABLE},
- {"CREATE_OPTIONS", 255, MYSQL_TYPE_STRING, 0, 1, "Create_options",
- OPEN_FRM_ONLY},
+ {"CREATE_OPTIONS", 2048, MYSQL_TYPE_STRING, 0, 1, "Create_options",
+ OPEN_FULL_TABLE},
{"TABLE_COMMENT", TABLE_COMMENT_MAXLEN, MYSQL_TYPE_STRING, 0, 0,
"Comment", OPEN_FRM_ONLY},
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}