Skip to content

Commit d5bfe4d

Browse files
author
Ashish Agarwal
committed
Merge of fix for bug#11759349 from mysql-5.5.
2 parents 4466206 + e5c43f5 commit d5bfe4d

File tree

8 files changed

+40
-35
lines changed

8 files changed

+40
-35
lines changed

include/heap.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ typedef struct st_heapinfo /* Struct from heap_info */
5151
uint reclength; /* Length of one record */
5252
int errkey;
5353
ulonglong auto_increment;
54+
time_t create_time;
5455
} HEAPINFO;
5556

5657

@@ -147,6 +148,7 @@ typedef struct st_heap_share
147148
uint open_count;
148149
uchar *del_link; /* Link to next block with del. rec */
149150
char * name; /* Name of "memory-file" */
151+
time_t create_time;
150152
THR_LOCK lock;
151153
mysql_mutex_t intern_lock; /* Locking for use with _locking */
152154
my_bool delete_on_close;

mysql-test/r/heap.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,8 +718,8 @@ create table t1 (c char(10)) engine=memory;
718718
create table t2 (c varchar(10)) engine=memory;
719719
show table status like 't_';
720720
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
721-
t1 MEMORY 10 Fixed 0 11 0 # 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL
722-
t2 MEMORY 10 Fixed 0 12 0 # 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL
721+
t1 MEMORY 10 Fixed 0 11 0 # 0 0 NULL # NULL NULL latin1_swedish_ci NULL
722+
t2 MEMORY 10 Fixed 0 12 0 # 0 0 NULL # NULL NULL latin1_swedish_ci NULL
723723
drop table t1, t2;
724724
CREATE TABLE t1(a VARCHAR(1), b VARCHAR(2), c VARCHAR(256),
725725
KEY(a), KEY(b), KEY(c)) ENGINE=MEMORY;

mysql-test/r/show_check.result

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -460,57 +460,57 @@ insert into t2 values (1),(2);
460460
insert into t3 values (1,1),(2,2);
461461
show table status;
462462
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
463-
t1 MEMORY 10 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
464-
t2 MEMORY 10 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
465-
t3 MEMORY 10 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
463+
t1 MEMORY 10 Fixed 2 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
464+
t2 MEMORY 10 Fixed 2 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
465+
t3 MEMORY 10 Fixed 2 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
466466
insert into t1 values (3),(4);
467467
insert into t2 values (3),(4);
468468
insert into t3 values (3,3),(4,4);
469469
show table status;
470470
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
471-
t1 MEMORY 10 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
472-
t2 MEMORY 10 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
473-
t3 MEMORY 10 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
471+
t1 MEMORY 10 Fixed 4 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
472+
t2 MEMORY 10 Fixed 4 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
473+
t3 MEMORY 10 Fixed 4 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
474474
insert into t1 values (5);
475475
insert into t2 values (5);
476476
insert into t3 values (5,5);
477477
show table status;
478478
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
479-
t1 MEMORY 10 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
480-
t2 MEMORY 10 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
481-
t3 MEMORY 10 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
479+
t1 MEMORY 10 Fixed 5 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
480+
t2 MEMORY 10 Fixed 5 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
481+
t3 MEMORY 10 Fixed 5 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
482482
delete from t1 where a=3;
483483
delete from t2 where b=3;
484484
delete from t3 where a=3;
485485
show table status;
486486
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
487-
t1 MEMORY 10 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
488-
t2 MEMORY 10 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
489-
t3 MEMORY 10 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
487+
t1 MEMORY 10 Fixed 4 # # # # # NULL # NULL NULL latin1_swedish_ci NULL
488+
t2 MEMORY 10 Fixed 4 # # # # # NULL # NULL NULL latin1_swedish_ci NULL
489+
t3 MEMORY 10 Fixed 4 # # # # # NULL # NULL NULL latin1_swedish_ci NULL
490490
truncate table t1;
491491
truncate table t2;
492492
truncate table t3;
493493
show table status;
494494
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
495-
t1 MEMORY 10 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
496-
t2 MEMORY 10 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
497-
t3 MEMORY 10 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
495+
t1 MEMORY 10 Fixed 0 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
496+
t2 MEMORY 10 Fixed 0 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
497+
t3 MEMORY 10 Fixed 0 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
498498
insert into t1 values (5);
499499
insert into t2 values (5);
500500
insert into t3 values (5,5);
501501
show table status;
502502
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
503-
t1 MEMORY 10 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
504-
t2 MEMORY 10 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
505-
t3 MEMORY 10 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
503+
t1 MEMORY 10 Fixed 1 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
504+
t2 MEMORY 10 Fixed 1 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
505+
t3 MEMORY 10 Fixed 1 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
506506
delete from t1 where a=5;
507507
delete from t2 where b=5;
508508
delete from t3 where a=5;
509509
show table status;
510510
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
511-
t1 MEMORY 10 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
512-
t2 MEMORY 10 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
513-
t3 MEMORY 10 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
511+
t1 MEMORY 10 Fixed 0 # # # # # NULL # NULL NULL latin1_swedish_ci NULL
512+
t2 MEMORY 10 Fixed 0 # # # # # NULL # NULL NULL latin1_swedish_ci NULL
513+
t3 MEMORY 10 Fixed 0 # # # # # NULL # NULL NULL latin1_swedish_ci NULL
514514
drop table t1, t2, t3;
515515
create database mysqltest;
516516
show create database mysqltest;
@@ -662,7 +662,7 @@ DROP TABLE t1;
662662
flush tables;
663663
SHOW TABLE STATUS like 't1';
664664
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
665-
t1 NULL NULL NULL NULL # # # # NULL NULL NULL NULL NULL NULL NULL NULL Incorrect information in file: './test/t1.frm'
665+
t1 NULL NULL NULL NULL # # # # NULL NULL # NULL NULL NULL NULL NULL Incorrect information in file: './test/t1.frm'
666666
Warnings:
667667
Warning 1033 Incorrect information in file: './test/t1.frm'
668668
show create table t1;
@@ -1334,7 +1334,7 @@ CREATE DATABASE `
13341334
CREATE TABLE `�`.`�` (a int) ENGINE=Memory;
13351335
SHOW TABLE STATUS FROM `�` LIKE '�';
13361336
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
1337-
� MEMORY 10 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
1337+
� MEMORY 10 Fixed 0 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
13381338
DROP DATABASE `�`;
13391339
show columns from `#mysql50#????????`;
13401340
Got one of the listed errors

mysql-test/t/heap.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ drop table t1;
454454
#
455455
create table t1 (c char(10)) engine=memory;
456456
create table t2 (c varchar(10)) engine=memory;
457-
--replace_column 8 #
457+
--replace_column 8 # 12 #
458458
show table status like 't_';
459459
drop table t1, t2;
460460

mysql-test/t/show_check.test

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -295,37 +295,37 @@ CREATE TABLE t3 (
295295
insert into t1 values (1),(2);
296296
insert into t2 values (1),(2);
297297
insert into t3 values (1,1),(2,2);
298-
--replace_column 6 # 7 # 8 # 9 #
298+
--replace_column 6 # 7 # 8 # 9 # 12 #
299299
show table status;
300300
insert into t1 values (3),(4);
301301
insert into t2 values (3),(4);
302302
insert into t3 values (3,3),(4,4);
303-
--replace_column 6 # 7 # 8 # 9 #
303+
--replace_column 6 # 7 # 8 # 9 # 12 #
304304
show table status;
305305
insert into t1 values (5);
306306
insert into t2 values (5);
307307
insert into t3 values (5,5);
308-
--replace_column 6 # 7 # 8 # 9 #
308+
--replace_column 6 # 7 # 8 # 9 # 12 #
309309
show table status;
310310
delete from t1 where a=3;
311311
delete from t2 where b=3;
312312
delete from t3 where a=3;
313-
--replace_column 6 # 7 # 8 # 9 # 10 #
313+
--replace_column 6 # 7 # 8 # 9 # 10 # 12 #
314314
show table status;
315315
truncate table t1;
316316
truncate table t2;
317317
truncate table t3;
318-
--replace_column 6 # 7 # 8 # 9 #
318+
--replace_column 6 # 7 # 8 # 9 # 12 #
319319
show table status;
320320
insert into t1 values (5);
321321
insert into t2 values (5);
322322
insert into t3 values (5,5);
323-
--replace_column 6 # 7 # 8 # 9 #
323+
--replace_column 6 # 7 # 8 # 9 # 12 #
324324
show table status;
325325
delete from t1 where a=5;
326326
delete from t2 where b=5;
327327
delete from t3 where a=5;
328-
--replace_column 6 # 7 # 8 # 9 # 10 #
328+
--replace_column 6 # 7 # 8 # 9 # 10 # 12 #
329329
show table status;
330330

331331
drop table t1, t2, t3;
@@ -443,7 +443,7 @@ flush tables;
443443
# Create a junk frm file on disk
444444
let $MYSQLD_DATADIR= `select @@datadir`;
445445
exec echo "this is a junk file for test" >> $MYSQLD_DATADIR/test/t1.frm ;
446-
--replace_column 6 # 7 # 8 # 9 #
446+
--replace_column 6 # 7 # 8 # 9 # 12 #
447447
SHOW TABLE STATUS like 't1';
448448
--error ER_NOT_FORM_FILE
449449
show create table t1;
@@ -1073,7 +1073,7 @@ set names latin1;
10731073
SET NAMES latin1;
10741074
CREATE DATABASE `�`;
10751075
CREATE TABLE `�`.`�` (a int) ENGINE=Memory;
1076-
--replace_column 6 # 7 # 8 # 9 #
1076+
--replace_column 6 # 7 # 8 # 9 # 12 #
10771077
SHOW TABLE STATUS FROM `�` LIKE '�';
10781078
DROP DATABASE `�`;
10791079

storage/heap/ha_heap.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ int ha_heap::info(uint flag)
412412
stats.index_file_length= hp_info.index_length;
413413
stats.max_data_file_length= hp_info.max_records * hp_info.reclength;
414414
stats.delete_length= hp_info.deleted * hp_info.reclength;
415+
stats.create_time= (ulong) hp_info.create_time;
415416
if (flag & HA_STATUS_AUTO)
416417
stats.auto_increment_value= hp_info.auto_increment;
417418
/*

storage/heap/hp_create.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ int heap_create(const char *name, HP_CREATE_INFO *create_info,
186186
share->auto_key= create_info->auto_key;
187187
share->auto_key_type= create_info->auto_key_type;
188188
share->auto_increment= create_info->auto_increment;
189+
share->create_time= (long) time((time_t*) 0);
189190
/* Must be allocated separately for rename to work */
190191
if (!(share->name= my_strdup(name,MYF(0))))
191192
{

storage/heap/hp_info.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ int heap_info(reg1 HP_INFO *info,reg2 HEAPINFO *x, int flag )
5353
x->index_length = info->s->index_length;
5454
x->max_records = info->s->max_records;
5555
x->errkey = info->errkey;
56+
x->create_time = info->s->create_time;
5657
if (flag & HA_STATUS_AUTO)
5758
x->auto_increment= info->s->auto_increment + 1;
5859
DBUG_RETURN(0);

0 commit comments

Comments
 (0)