diff options
author | Sergei Petrunia <psergey@askmonty.org> | 2019-10-31 19:44:29 +0300 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2019-11-01 08:57:56 +0100 |
commit | 9c72963d2aef783cae652b5b8ac01f7aa2bcb43a (patch) | |
tree | 6081efdd5c8d95a0212add857be59775f915cefa /storage/rocksdb/rdb_datadic.cc | |
parent | 162f475c4be81dfbceed093ad03d114b4c69a3c0 (diff) | |
download | mariadb-git-bb-10.3-MDEV-17171.tar.gz |
MDEV-17171: RocksDB Tables do not have "Creation Date"bb-10.3-MDEV-17171
Variant#5 of the patch:
- take creation date from the .frm file, like InnoDB does
- Update_time is in-memory only (like in InnoDB).
Diffstat (limited to 'storage/rocksdb/rdb_datadic.cc')
-rw-r--r-- | storage/rocksdb/rdb_datadic.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/storage/rocksdb/rdb_datadic.cc b/storage/rocksdb/rdb_datadic.cc index e369c08dd51..0cefed77ac8 100644 --- a/storage/rocksdb/rdb_datadic.cc +++ b/storage/rocksdb/rdb_datadic.cc @@ -3592,6 +3592,26 @@ bool Rdb_tbl_def::put_dict(Rdb_dict_manager *const dict, return false; } +time_t Rdb_tbl_def::get_creation_time() { + time_t create_time = m_create_time; + + if (create_time == CREATE_TIME_UNKNOWN) { + // Read it from the .frm file. It's not a problem if several threads do this + // concurrently + char path[FN_REFLEN]; + snprintf(path, sizeof(path), "%s/%s/%s%s", mysql_data_home, + m_dbname.c_str(), m_tablename.c_str(), reg_ext); + unpack_filename(path,path); + MY_STAT f_stat; + if (my_stat(path, &f_stat, MYF(0))) + create_time = f_stat.st_ctime; + else + create_time = 0; // will be shown as SQL NULL + m_create_time = create_time; + } + return create_time; +} + // Length that each index flag takes inside the record. // Each index in the array maps to the enum INDEX_FLAG static const std::array<uint, 1> index_flag_lengths = { |