Commit 27c9ed11 authored by Sergei Golubchik's avatar Sergei Golubchik

TokuDB now compiles and passes all tests as in 5.5

parent 9af17704
......@@ -369,7 +369,7 @@ static inline bool do_ignore_flag_optimization(THD* thd, TABLE* table, bool opt_
}
static inline uint get_key_parts(const KEY *key) {
#if 50609 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699
#if 50609 <= MYSQL_VERSION_ID
return key->user_defined_key_parts;
#else
return key->key_parts;
......@@ -1733,7 +1733,7 @@ int ha_tokudb::initialize_share(
goto exit;
}
#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID < 100004
#if defined(MARIADB_BASE_VERSION)
// a hack to support frm-only ALTER TABLE in MariaDB 5.5
// in 10.0 there's a proper fix with the new discovery and online alter
if (thd_sql_command(thd) == SQLCOM_ALTER_TABLE) {
......
......@@ -615,8 +615,9 @@ class ha_tokudb : public handler {
int cmp_ref(const uchar * ref1, const uchar * ref2);
bool check_if_incompatible_data(HA_CREATE_INFO * info, uint table_changes);
// MariaDB MRR introduced in 5.5
#ifdef MARIADB_BASE_VERSION
// MariaDB MRR introduced in 5.5
#if MYSQL_VERSION_ID < 50600
int multi_range_read_init(RANGE_SEQ_IF* seq,
void* seq_init_param,
uint n_ranges, uint mode,
......@@ -631,10 +632,21 @@ class ha_tokudb : public handler {
uint *flags, COST_VECT *cost);
int multi_range_read_explain_info(uint mrr_mode,
char *str, size_t size);
#else
// MariaDB MRR introduced in 10.0
int multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param,
uint n_ranges, uint mode, HANDLER_BUFFER *buf);
int multi_range_read_next(range_id_t *range_info);
ha_rows multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq,
void *seq_init_param,
uint n_ranges, uint *bufsz,
uint *flags, Cost_estimate *cost);
ha_rows multi_range_read_info(uint keyno, uint n_ranges, uint keys, uint key_parts,
uint *bufsz, uint *flags, Cost_estimate *cost);
int multi_range_read_explain_info(uint mrr_mode, char *str, size_t size);
#endif
// MariaDB MRR introduced in 5.6
#if !defined(MARIADB_BASE_VERSION)
#else
// MySQL MRR introduced in 5.6
#if 50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699
int multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param,
uint n_ranges, uint mode, HANDLER_BUFFER *buf);
......
......@@ -94,6 +94,10 @@ PATENT RIGHTS GRANT:
/**
* Multi Range Read interface, DS-MRR calls
*/
#if MYSQL_VERSION_ID >= 100000
#define COST_VECT Cost_estimate
#endif
int ha_tokudb::multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param,
uint n_ranges, uint mode,
......
......@@ -116,7 +116,7 @@ bool field_valid_for_tokudb_table(Field* field) {
case MYSQL_TYPE_TIMESTAMP:
case MYSQL_TYPE_DOUBLE:
case MYSQL_TYPE_FLOAT:
#if 50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699
#if 50600 <= MYSQL_VERSION_ID
case MYSQL_TYPE_DATETIME2:
case MYSQL_TYPE_TIMESTAMP2:
case MYSQL_TYPE_TIME2:
......@@ -263,7 +263,7 @@ TOKU_TYPE mysql_to_toku_type (Field* field) {
case MYSQL_TYPE_FLOAT:
ret_val = toku_type_float;
goto exit;
#if 50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699
#if 50600 <= MYSQL_VERSION_ID
case MYSQL_TYPE_DATETIME2:
case MYSQL_TYPE_TIMESTAMP2:
case MYSQL_TYPE_TIME2:
......@@ -3199,7 +3199,7 @@ bool fields_are_same_type(
case MYSQL_TYPE_NEWDATE:
case MYSQL_TYPE_TIME:
case MYSQL_TYPE_TIMESTAMP:
#if 50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699
#if 50600 <= MYSQL_VERSION_ID
case MYSQL_TYPE_DATETIME2:
case MYSQL_TYPE_TIMESTAMP2:
case MYSQL_TYPE_TIME2:
......
......@@ -262,7 +262,7 @@ static inline const uchar* unpack_toku_field_blob(
}
static inline uint get_null_offset(TABLE* table, Field* field) {
#if 50606 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699
#if 50606 <= MYSQL_VERSION_ID
return field->null_offset(table->record[0]);
#else
return (uint) ((uchar*) field->null_ptr - (uchar*) table->record[0]);
......
......@@ -316,7 +316,7 @@ static void tokudb_cleanup_log_files(void);
static int tokudb_end(handlerton * hton, ha_panic_function type);
static bool tokudb_flush_logs(handlerton * hton);
static bool tokudb_show_status(handlerton * hton, THD * thd, stat_print_fn * print, enum ha_stat_type);
static void tokudb_handle_fatal_signal(handlerton *hton, THD *thd, int sig);
static void tokudb_handle_fatal_signal(handlerton *hton, THD *thd, int sig) __attribute__ ((__unused__));
static int tokudb_close_connection(handlerton * hton, THD * thd);
static int tokudb_commit(handlerton * hton, THD * thd, bool all);
static int tokudb_rollback(handlerton * hton, THD * thd, bool all);
......@@ -331,7 +331,7 @@ static int tokudb_rollback_to_savepoint(handlerton * hton, THD * thd, void *save
static int tokudb_savepoint(handlerton * hton, THD * thd, void *savepoint);
static int tokudb_release_savepoint(handlerton * hton, THD * thd, void *savepoint);
static int tokudb_discover_table(handlerton *hton, THD* thd, TABLE_SHARE *ts);
static int tokudb_discover(handlerton *hton, THD* thd, const char *db, const char *name, uchar **frmblob, size_t *frmlen);
static int tokudb_discover(handlerton *hton, THD* thd, const char *db, const char *name, uchar **frmblob, size_t *frmlen) __attribute__ ((__unused__));
static int tokudb_discover2(handlerton *hton, THD* thd, const char *db, const char *name, bool translate_name,uchar **frmblob, size_t *frmlen);
static int tokudb_discover3(handlerton *hton, THD* thd, const char *db, const char *name, char *path, uchar **frmblob, size_t *frmlen);
handlerton *tokudb_hton;
......
......@@ -233,7 +233,7 @@ HELLO
HELLO MY
a
hello
set option sql_big_tables=1;
set big_tables=1;
select distinct t from t1;
t
NULL
......@@ -314,7 +314,7 @@ HELLO
HELLO MY
a
hello
set option sql_big_tables=0;
set big_tables=0;
select distinct * from t1;
t c b d
NULL NULL NULL NULL
......
......@@ -681,7 +681,7 @@ select 0.8 = 0.7 + 0.1;
1
drop table if exists t1;
Warnings:
Note 1051 Unknown table 't1'
Note 1051 Unknown table 'test.t1'
create table t1 (col1 decimal(38));
insert into t1 values (12345678901234567890123456789012345678);
select * from t1;
......
......@@ -112,7 +112,7 @@ select distinct t from t1 order by t;
select distinct b from t1 order by b;
select t from t1 group by t;
select b from t1 group by b;
set option sql_big_tables=1;
set big_tables=1;
select distinct t from t1;
select distinct b from t1;
select distinct t from t1 order by t;
......@@ -123,7 +123,7 @@ select distinct c from t1 order by c;
select distinct d from t1 order by d;
select c from t1 group by c;
select d from t1 group by d;
set option sql_big_tables=0;
set big_tables=0;
select distinct * from t1;
select t,count(*) from t1 group by t;
select b,count(*) from t1 group by b;
......
drop table if exists t2970;
Warnings:
Note 1051 Unknown table 't2970'
Note 1051 Unknown table 'test.t2970'
create table t2970 (a int, b int, c int, d int, key(a), key(a,b));
insert into t2970 values (1,1,1,1),(1,2,3,4);
explain select a,count(b),max(b) from t2970 where a > 0 group by a order by a;
......
......@@ -7,14 +7,14 @@ ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
SELECT * FROM t1;
ERROR 42S02: Table 'test.t1' doesn't exist
DROP TABLE t1;
ERROR 42S02: Unknown table 't1'
ERROR 42S02: Unknown table 'test.t1'
SET AUTOCOMMIT = 0;
CREATE TABLE t1 (PRIMARY KEY (a)) SELECT 1 AS a UNION ALL SELECT 1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
SELECT * FROM t1;
ERROR 42S02: Table 'test.t1' doesn't exist
DROP TABLE t1;
ERROR 42S02: Unknown table 't1'
ERROR 42S02: Unknown table 'test.t1'
create table t1 (a int, b int) engine=MyISAM;
insert into t1 values (1,1),(1,2);
alter table t1 engine=TokuDB, add unique key (a);
......
use test;
drop table if exists site;
Warnings:
Note 1051 Unknown table 'site'
Note 1051 Unknown table 'test.site'
drop table if exists screenshot;
Warnings:
Note 1051 Unknown table 'screenshot'
Note 1051 Unknown table 'test.screenshot'
CREATE TABLE `site` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(200) NOT NULL DEFAULT '',
......
......@@ -15,6 +15,6 @@ flush logs;;
select DB, command, state, info from information_schema.processlist;
DB command state info
test Query executing select DB, command, state, info from information_schema.processlist
test Query NULL flush logs
test Query init flush logs
set tokudb_checkpoint_lock=0;
set global tokudb_checkpoint_on_flush_logs=OFF;
......@@ -21,21 +21,21 @@ select DB, command, state, info from information_schema.processlist;
DB command state info
test Query executing select DB, command, state, info from information_schema.processlist
test Sleep NULL
test Query NULL flush logs
test Query init flush logs
set session tokudb_checkpoint_lock=1;
# should still see a flush logs
select DB, command, state, info from information_schema.processlist;
DB command state info
test Query executing select DB, command, state, info from information_schema.processlist
test Sleep NULL
test Query NULL flush logs
test Query init flush logs
set session tokudb_checkpoint_lock=0;
# should still see a flush logs
select DB, command, state, info from information_schema.processlist;
DB command state info
test Sleep NULL
test Query executing select DB, command, state, info from information_schema.processlist
test Query NULL flush logs
test Query init flush logs
set session tokudb_checkpoint_lock=0;
# should see nothing
select DB, command, state, info from information_schema.processlist;
......
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