Commit 707dd6b9 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-5943 'show table status' does not immediately show tokudb tables

MDEV-5839 TokuDB tables not properly cleaned on DROP DATABASE

TokuDB does not support discover_table_names() and writes no files
in the database directory, so automatic filename-based
discover_table_names() doesn't work either. So, it must force .frm
file to disk in ::create()
parent 97687f28
...@@ -979,6 +979,9 @@ struct TABLE_SHARE ...@@ -979,6 +979,9 @@ struct TABLE_SHARE
*/ */
bool write_frm_image(const uchar *frm_image, size_t frm_length); bool write_frm_image(const uchar *frm_image, size_t frm_length);
bool write_frm_image(void)
{ return frm_image ? write_frm_image(frm_image->str, frm_image->length) : 0; }
/* /*
returns an frm image for this table. returns an frm image for this table.
the memory is allocated and must be freed later the memory is allocated and must be freed later
......
...@@ -6861,6 +6861,12 @@ int ha_tokudb::create(const char *name, TABLE * form, HA_CREATE_INFO * create_in ...@@ -6861,6 +6861,12 @@ int ha_tokudb::create(const char *name, TABLE * form, HA_CREATE_INFO * create_in
THD* thd = ha_thd(); THD* thd = ha_thd();
memset(&kc_info, 0, sizeof(kc_info)); memset(&kc_info, 0, sizeof(kc_info));
// TokuDB does not support discover_table_names() and writes no files
// in the database directory, so automatic filename-based
// discover_table_names() doesn't work either. So, it must force .frm
// file to disk.
form->s->write_frm_image();
trx = (tokudb_trx_data *) thd_data_get(ha_thd(), tokudb_hton->slot); trx = (tokudb_trx_data *) thd_data_get(ha_thd(), tokudb_hton->slot);
const srv_row_format_t row_type= (srv_row_format_t)form->s->option_struct->row_format; const srv_row_format_t row_type= (srv_row_format_t)form->s->option_struct->row_format;
......
...@@ -5,6 +5,7 @@ CREATE TABLE foo (c1 int not null primary key) engine=TokuDB; ...@@ -5,6 +5,7 @@ CREATE TABLE foo (c1 int not null primary key) engine=TokuDB;
SELECT CREATE_OPTIONS SELECT CREATE_OPTIONS
FROM INFORMATION_SCHEMA.TABLES WHERE (table_name LIKE 'foo'); FROM INFORMATION_SCHEMA.TABLES WHERE (table_name LIKE 'foo');
CREATE_OPTIONS CREATE_OPTIONS
`compression`='tokudb_zlib'
SHOW CREATE TABLE foo; SHOW CREATE TABLE foo;
Table Create Table Table Create Table
foo CREATE TABLE `foo` ( foo CREATE TABLE `foo` (
......
create table t1 (id int primary key) engine=tokudb;
show tables;
Tables_in_test
t1
drop table t1;
create database mysqltest1;
use mysqltest1;
create table t1 (a int) engine=tokudb;
drop database mysqltest1;
create database mysqltest1;
use mysqltest1;
create table t1 (a int) engine=tokudb;
drop database mysqltest1;
#
# MDEV-5943 'show table status' does not immediately show tokudb tables
#
create table t1 (id int primary key) engine=tokudb;
show tables;
drop table t1;
#
# MDEV-5839 TokuDB tables not properly cleaned on DROP DATABASE
#
create database mysqltest1;
use mysqltest1;
create table t1 (a int) engine=tokudb;
drop database mysqltest1;
create database mysqltest1;
use mysqltest1;
create table t1 (a int) engine=tokudb;
drop database mysqltest1;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment