Skip to content

Commit 3446841

Browse files
AliSQLAliSQL
authored andcommitted
[Feature] Issue#26 ADD TokuDB COMPRESSION FORMAT ROW_TYPE SUPPORT
Description: ------------ port from: http://bazaar.launchpad.net/~laurynas-biveinis/percona-server/tokudb-compression/revision/517
1 parent 96ee8f5 commit 3446841

9 files changed

Lines changed: 55 additions & 11 deletions

File tree

mysql-test/r/information_schema.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,7 @@ GROUP BY column_type ORDER BY num;
12021202
column_type GROUP_CONCAT(table_schema, '.', table_name) num
12031203
varchar(7) information_schema.ROUTINES,information_schema.VIEWS 2
12041204
varchar(30) information_schema.COLUMNS,information_schema.PROFILING,information_schema.PROFILING 3
1205-
varchar(20) information_schema.FILES,information_schema.FILES,information_schema.PLUGINS,information_schema.PLUGINS,information_schema.PLUGINS,information_schema.PROFILING 6
1205+
varchar(20) information_schema.FILES,information_schema.FILES,information_schema.FILES,information_schema.PLUGINS,information_schema.PLUGINS,information_schema.PLUGINS,information_schema.PROFILING,information_schema.TABLES 8
12061206
create table t1(f1 char(1) not null, f2 char(9) not null)
12071207
default character set utf8;
12081208
select CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH from

mysql-test/r/mysqldump.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3596,7 +3596,7 @@ CREATE TEMPORARY TABLE `TABLES` (
35963596
`TABLE_TYPE` varchar(64) NOT NULL DEFAULT '',
35973597
`ENGINE` varchar(64) DEFAULT NULL,
35983598
`VERSION` bigint(21) unsigned DEFAULT NULL,
3599-
`ROW_FORMAT` varchar(10) DEFAULT NULL,
3599+
`ROW_FORMAT` varchar(20) DEFAULT NULL,
36003600
`TABLE_ROWS` bigint(21) unsigned DEFAULT NULL,
36013601
`AVG_ROW_LENGTH` bigint(21) unsigned DEFAULT NULL,
36023602
`DATA_LENGTH` bigint(21) unsigned DEFAULT NULL,

mysql-test/r/show_check.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Catalog Database Table Table_alias Column Column_alias Type Length Max length Is
120120
def information_schema TABLES TABLES TABLE_NAME Name 253 64 0 N 1 0 8
121121
def information_schema TABLES TABLES ENGINE Engine 253 64 0 Y 0 0 8
122122
def information_schema TABLES TABLES VERSION Version 8 21 0 Y 32800 0 63
123-
def information_schema TABLES TABLES ROW_FORMAT Row_format 253 10 0 Y 0 0 8
123+
def information_schema TABLES TABLES ROW_FORMAT Row_format 253 20 0 Y 0 0 8
124124
def information_schema TABLES TABLES TABLE_ROWS Rows 8 21 0 Y 32800 0 63
125125
def information_schema TABLES TABLES AVG_ROW_LENGTH Avg_row_length 8 21 0 Y 32800 0 63
126126
def information_schema TABLES TABLES DATA_LENGTH Data_length 8 21 0 Y 32800 0 63
@@ -928,7 +928,7 @@ def information_schema TABLES TABLES TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 3
928928
def information_schema TABLES TABLES TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33
929929
def information_schema TABLES TABLES TABLE_TYPE TABLE_TYPE 253 192 10 N 1 0 33
930930
def information_schema TABLES TABLES ENGINE ENGINE 253 192 6 Y 0 0 33
931-
def information_schema TABLES TABLES ROW_FORMAT ROW_FORMAT 253 30 5 Y 0 0 33
931+
def information_schema TABLES TABLES ROW_FORMAT ROW_FORMAT 253 60 5 Y 0 0 33
932932
def information_schema TABLES TABLES TABLE_COLLATION TABLE_COLLATION 253 96 17 Y 0 0 33
933933
def information_schema TABLES TABLES CREATE_OPTIONS CREATE_OPTIONS 253 765 0 Y 0 0 33
934934
def information_schema TABLES TABLES TABLE_COMMENT TABLE_COMMENT 253 6144 0 N 1 0 33

mysql-test/suite/funcs_1/r/is_columns_is.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ NULL information_schema FILES LAST_ACCESS_TIME datetime NULL NULL NULL NULL date
511511
NULL information_schema FILES RECOVER_TIME bigint NULL NULL NULL NULL bigint(4)
512512
NULL information_schema FILES TRANSACTION_COUNTER bigint NULL NULL NULL NULL bigint(4)
513513
NULL information_schema FILES VERSION bigint NULL NULL NULL NULL bigint(21) unsigned
514-
3.0000 information_schema FILES ROW_FORMAT varchar 10 30 utf8 utf8_general_ci varchar(10)
514+
3.0000 information_schema FILES ROW_FORMAT varchar 10 60 utf8 utf8_general_ci varchar(10)
515515
NULL information_schema FILES TABLE_ROWS bigint NULL NULL NULL NULL bigint(21) unsigned
516516
NULL information_schema FILES AVG_ROW_LENGTH bigint NULL NULL NULL NULL bigint(21) unsigned
517517
NULL information_schema FILES DATA_LENGTH bigint NULL NULL NULL NULL bigint(21) unsigned
@@ -692,7 +692,7 @@ NULL information_schema STATISTICS SUB_PART bigint NULL NULL NULL NULL bigint(3)
692692
3.0000 information_schema TABLES TABLE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
693693
3.0000 information_schema TABLES ENGINE varchar 64 192 utf8 utf8_general_ci varchar(64)
694694
NULL information_schema TABLES VERSION bigint NULL NULL NULL NULL bigint(21) unsigned
695-
3.0000 information_schema TABLES ROW_FORMAT varchar 10 30 utf8 utf8_general_ci varchar(10)
695+
3.0000 information_schema TABLES ROW_FORMAT varchar 10 60 utf8 utf8_general_ci varchar(10)
696696
NULL information_schema TABLES TABLE_ROWS bigint NULL NULL NULL NULL bigint(21) unsigned
697697
NULL information_schema TABLES AVG_ROW_LENGTH bigint NULL NULL NULL NULL bigint(21) unsigned
698698
NULL information_schema TABLES DATA_LENGTH bigint NULL NULL NULL NULL bigint(21) unsigned

mysql-test/suite/funcs_1/r/is_tables.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ TABLE_NAME varchar(64) NO
3434
TABLE_TYPE varchar(64) NO
3535
ENGINE varchar(64) YES NULL
3636
VERSION bigint(21) unsigned YES NULL
37-
ROW_FORMAT varchar(10) YES NULL
37+
ROW_FORMAT varchar(20) YES NULL
3838
TABLE_ROWS bigint(21) unsigned YES NULL
3939
AVG_ROW_LENGTH bigint(21) unsigned YES NULL
4040
DATA_LENGTH bigint(21) unsigned YES NULL
@@ -58,7 +58,7 @@ TABLES CREATE TEMPORARY TABLE `TABLES` (
5858
`TABLE_TYPE` varchar(64) NOT NULL DEFAULT '',
5959
`ENGINE` varchar(64) DEFAULT NULL,
6060
`VERSION` bigint(21) unsigned DEFAULT NULL,
61-
`ROW_FORMAT` varchar(10) DEFAULT NULL,
61+
`ROW_FORMAT` varchar(20) DEFAULT NULL,
6262
`TABLE_ROWS` bigint(21) unsigned DEFAULT NULL,
6363
`AVG_ROW_LENGTH` bigint(21) unsigned DEFAULT NULL,
6464
`DATA_LENGTH` bigint(21) unsigned DEFAULT NULL,
@@ -82,7 +82,7 @@ TABLE_NAME varchar(64) NO
8282
TABLE_TYPE varchar(64) NO
8383
ENGINE varchar(64) YES NULL
8484
VERSION bigint(21) unsigned YES NULL
85-
ROW_FORMAT varchar(10) YES NULL
85+
ROW_FORMAT varchar(20) YES NULL
8686
TABLE_ROWS bigint(21) unsigned YES NULL
8787
AVG_ROW_LENGTH bigint(21) unsigned YES NULL
8888
DATA_LENGTH bigint(21) unsigned YES NULL

sql/handler.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ static const LEX_STRING sys_table_aliases[]=
9494
const char *ha_row_type[] = {
9595
"", "FIXED", "DYNAMIC", "COMPRESSED", "REDUNDANT", "COMPACT",
9696
/* Reserved to be "PAGE" in future versions */ "?",
97+
"TOKUDB_UNCOMPRESSED", "TOKUDB_ZLIB", "TOKUDB_QUICKLZ", "TOKUDB_LZMA",
98+
"TOKUDB_FAST", "TOKUDB_SMALL",
9799
"?","?","?"
98100
};
99101

sql/lex.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,12 @@ static SYMBOL symbols[] = {
590590
{ "TINYINT", SYM(TINYINT)},
591591
{ "TINYTEXT", SYM(TINYTEXT)},
592592
{ "TO", SYM(TO_SYM)},
593+
{ "TOKUDB_UNCOMPRESSED", SYM(TOKU_UNCOMPRESSED_SYM)},
594+
{ "TOKUDB_ZLIB", SYM(TOKU_ZLIB_SYM)},
595+
{ "TOKUDB_QUICKLZ", SYM(TOKU_QUICKLZ_SYM)},
596+
{ "TOKUDB_LZMA", SYM(TOKU_LZMA_SYM)},
597+
{ "TOKUDB_FAST", SYM(TOKU_FAST_SYM)},
598+
{ "TOKUDB_SMALL", SYM(TOKU_SMALL_SYM)},
593599
{ "TRAILING", SYM(TRAILING)},
594600
{ "TRANSACTION", SYM(TRANSACTION_SYM)},
595601
{ "TRIGGER", SYM(TRIGGER_SYM)},

sql/sql_show.cc

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4845,6 +4845,24 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
48454845
case ROW_TYPE_PAGE:
48464846
tmp_buff= "Paged";
48474847
break;
4848+
case ROW_TYPE_TOKU_UNCOMPRESSED:
4849+
tmp_buff= "tokudb_uncompressed";
4850+
break;
4851+
case ROW_TYPE_TOKU_ZLIB:
4852+
tmp_buff= "tokudb_zlib";
4853+
break;
4854+
case ROW_TYPE_TOKU_QUICKLZ:
4855+
tmp_buff= "tokudb_quicklz";
4856+
break;
4857+
case ROW_TYPE_TOKU_LZMA:
4858+
tmp_buff= "tokudb_lzma";
4859+
break;
4860+
case ROW_TYPE_TOKU_FAST:
4861+
tmp_buff= "tokudb_fast";
4862+
break;
4863+
case ROW_TYPE_TOKU_SMALL:
4864+
tmp_buff= "tokudb_small";
4865+
break;
48484866
}
48494867

48504868
table->field[6]->store(tmp_buff, strlen(tmp_buff), cs);
@@ -7857,7 +7875,7 @@ ST_FIELD_INFO tables_fields_info[]=
78577875
{"ENGINE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, "Engine", OPEN_FRM_ONLY},
78587876
{"VERSION", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG, 0,
78597877
(MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Version", OPEN_FRM_ONLY},
7860-
{"ROW_FORMAT", 10, MYSQL_TYPE_STRING, 0, 1, "Row_format", OPEN_FULL_TABLE},
7878+
{"ROW_FORMAT", 20, MYSQL_TYPE_STRING, 0, 1, "Row_format", OPEN_FULL_TABLE},
78617879
{"TABLE_ROWS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG, 0,
78627880
(MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Rows", OPEN_FULL_TABLE},
78637881
{"AVG_ROW_LENGTH", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG, 0,
@@ -8392,7 +8410,7 @@ ST_FIELD_INFO files_fields_info[]=
83928410
{"TRANSACTION_COUNTER", 4, MYSQL_TYPE_LONGLONG, 0, 1, 0, SKIP_OPEN_TABLE},
83938411
{"VERSION", 21 , MYSQL_TYPE_LONGLONG, 0,
83948412
(MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Version", SKIP_OPEN_TABLE},
8395-
{"ROW_FORMAT", 10, MYSQL_TYPE_STRING, 0, 1, "Row_format", SKIP_OPEN_TABLE},
8413+
{"ROW_FORMAT", 20, MYSQL_TYPE_STRING, 0, 1, "Row_format", SKIP_OPEN_TABLE},
83968414
{"TABLE_ROWS", 21 , MYSQL_TYPE_LONGLONG, 0,
83978415
(MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Rows", SKIP_OPEN_TABLE},
83988416
{"AVG_ROW_LENGTH", 21 , MYSQL_TYPE_LONGLONG, 0,

sql/sql_yacc.yy

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,6 +1609,12 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
16091609
%token TINYINT
16101610
%token TINYTEXT
16111611
%token TO_SYM /* SQL-2003-R */
1612+
%token TOKU_UNCOMPRESSED_SYM
1613+
%token TOKU_ZLIB_SYM
1614+
%token TOKU_QUICKLZ_SYM
1615+
%token TOKU_LZMA_SYM
1616+
%token TOKU_FAST_SYM
1617+
%token TOKU_SMALL_SYM
16121618
%token TRAILING /* SQL-2003-R */
16131619
%token TRANSACTION_SYM
16141620
%token TRIGGERS_SYM
@@ -6272,6 +6278,12 @@ row_types:
62726278
| COMPRESSED_SYM { $$= ROW_TYPE_COMPRESSED; }
62736279
| REDUNDANT_SYM { $$= ROW_TYPE_REDUNDANT; }
62746280
| COMPACT_SYM { $$= ROW_TYPE_COMPACT; }
6281+
| TOKU_UNCOMPRESSED_SYM { $$= ROW_TYPE_TOKU_UNCOMPRESSED; }
6282+
| TOKU_ZLIB_SYM { $$= ROW_TYPE_TOKU_ZLIB; }
6283+
| TOKU_QUICKLZ_SYM { $$= ROW_TYPE_TOKU_QUICKLZ; }
6284+
| TOKU_LZMA_SYM { $$= ROW_TYPE_TOKU_LZMA; }
6285+
| TOKU_FAST_SYM { $$= ROW_TYPE_TOKU_FAST; }
6286+
| TOKU_SMALL_SYM { $$= ROW_TYPE_TOKU_SMALL; }
62756287
;
62766288

62776289
merge_insert_types:
@@ -14518,6 +14530,12 @@ keyword_sp:
1451814530
| TIMESTAMP_ADD {}
1451914531
| TIMESTAMP_DIFF {}
1452014532
| TIME_SYM {}
14533+
| TOKU_UNCOMPRESSED_SYM {}
14534+
| TOKU_ZLIB_SYM {}
14535+
| TOKU_QUICKLZ_SYM {}
14536+
| TOKU_LZMA_SYM {}
14537+
| TOKU_SMALL_SYM {}
14538+
| TOKU_FAST_SYM {}
1452114539
| TYPES_SYM {}
1452214540
| TYPE_SYM {}
1452314541
| UDF_RETURNS_SYM {}

0 commit comments

Comments
 (0)