summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorAshish Agarwal <ashish.y.agarwal@oracle.com>2011-09-27 17:38:51 +0530
committerAshish Agarwal <ashish.y.agarwal@oracle.com>2011-09-27 17:38:51 +0530
commit5dbcff9b9c86dc9608252d270b6ebff7a6066040 (patch)
tree0609c557ee598226869fb5fc1f1406679fc64c48 /storage
parent147f897d376c26327a85a6c6121dfc6f704d1df0 (diff)
downloadmariadb-git-5dbcff9b9c86dc9608252d270b6ebff7a6066040.tar.gz
BUG#11759349 - 51655: CREATE TABLE IN MEMORY ENGINE DOESN'T STORE
CREATE_TIME IN INFORMATION_SC It was impossible to determine MEMORY table creation time, since it wasn't stored/exposed. With this patch creation time is saved and it is available via I_S.TABLES.CREATE_TIME. Note: it was decided that additional analysis is required before implementing UPDATE_TIME. Thus this patch doesn't store UPDATE_TIME.
Diffstat (limited to 'storage')
-rw-r--r--storage/heap/ha_heap.cc1
-rw-r--r--storage/heap/hp_create.c1
-rw-r--r--storage/heap/hp_info.c1
3 files changed, 3 insertions, 0 deletions
diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc
index d805fac2783..5d819722b6e 100644
--- a/storage/heap/ha_heap.cc
+++ b/storage/heap/ha_heap.cc
@@ -382,6 +382,7 @@ int ha_heap::info(uint flag)
stats.index_file_length= hp_info.index_length;
stats.max_data_file_length= hp_info.max_records * hp_info.reclength;
stats.delete_length= hp_info.deleted * hp_info.reclength;
+ stats.create_time= (ulong) hp_info.create_time;
if (flag & HA_STATUS_AUTO)
stats.auto_increment_value= hp_info.auto_increment;
/*
diff --git a/storage/heap/hp_create.c b/storage/heap/hp_create.c
index b6814fc1614..5208d4676c3 100644
--- a/storage/heap/hp_create.c
+++ b/storage/heap/hp_create.c
@@ -186,6 +186,7 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
share->auto_key= create_info->auto_key;
share->auto_key_type= create_info->auto_key_type;
share->auto_increment= create_info->auto_increment;
+ share->create_time= (long) time((time_t*) 0);
/* Must be allocated separately for rename to work */
if (!(share->name= my_strdup(name,MYF(0))))
{
diff --git a/storage/heap/hp_info.c b/storage/heap/hp_info.c
index ea78c53fd40..c72dbaf2065 100644
--- a/storage/heap/hp_info.c
+++ b/storage/heap/hp_info.c
@@ -53,6 +53,7 @@ int heap_info(reg1 HP_INFO *info,reg2 HEAPINFO *x, int flag )
x->index_length = info->s->index_length;
x->max_records = info->s->max_records;
x->errkey = info->errkey;
+ x->create_time = info->s->create_time;
if (flag & HA_STATUS_AUTO)
x->auto_increment= info->s->auto_increment + 1;
DBUG_RETURN(0);