merge with 5.5-tokudb tree. In particular:

* add TokuDB, together with the ft-index library
* cmake support, auto-detecting whether tokudb can be built
* fix packaging - tokudb-engine.rpm, deb
* remove PBXT
* add jemalloc
* the server is built with jemalloc by default even if TokuDB is not built
* documentation files in RPM are installed in the correct location
* support for optional deb packages (tokudb has specific build requirements)
* move plugins from mariadb-server deb to appropriate debs (server/test/libmariadbclient)
* correct mariadb-test.deb to be not architecture-independent
* fix out-of-tree builds to never modify in-tree files
* new handler::prepare_index_scan() method
This commit is contained in:
Sergei Golubchik 2013-09-10 23:02:25 +02:00
commit 62643f81e6
2920 changed files with 1896665 additions and 81705 deletions

View file

@ -102,8 +102,8 @@ ADD_LIBRARY(sql STATIC ${SQL_SOURCE})
ADD_DEPENDENCIES(sql GenServerSource)
DTRACE_INSTRUMENT(sql)
TARGET_LINK_LIBRARIES(sql ${MYSQLD_STATIC_PLUGIN_LIBS}
mysys dbug strings vio regex
${LIBWRAP} ${LIBCRYPT} ${LIBDL}
mysys dbug strings vio regex ${LIBJEMALLOC}
${LIBWRAP} ${LIBCRYPT} ${LIBDL} ${CMAKE_THREAD_LIBS_INIT}
${SSL_LIBRARIES})
IF(WIN32)

View file

@ -357,7 +357,8 @@ enum legacy_db_type
/** Performance schema engine. */
DB_TYPE_PERFORMANCE_SCHEMA,
DB_TYPE_ARIA=42,
DB_TYPE_FIRST_DYNAMIC=43,
DB_TYPE_TOKUDB=43,
DB_TYPE_FIRST_DYNAMIC=44,
DB_TYPE_DEFAULT=127 // Must be last
};
/*
@ -1867,6 +1868,16 @@ public:
}
/* This is called after index_init() if we need to do a index scan */
virtual int prepare_index_scan() { return 0; }
virtual int prepare_index_key_scan_map(const uchar * key, key_part_map keypart_map)
{
uint key_len= calculate_key_len(table, active_index, key, keypart_map);
return prepare_index_key_scan(key, key_len);
}
virtual int prepare_index_key_scan( const uchar * key, uint key_len )
{ return 0; }
virtual int prepare_range_scan(const key_range *start_key, const key_range *end_key)
{ return 0; }
int ha_rnd_init(bool scan) __attribute__ ((warn_unused_result))
{
DBUG_EXECUTE_IF("ha_rnd_init_fail", return HA_ERR_TABLE_DEF_CHANGED;);

View file

@ -11390,6 +11390,26 @@ int QUICK_SELECT_DESC::get_next()
if (!(last_range= rev_it++))
DBUG_RETURN(HA_ERR_END_OF_FILE); // All ranges used
key_range start_key;
start_key.key= (const uchar*) last_range->min_key;
start_key.length= last_range->min_length;
start_key.flag= ((last_range->flag & NEAR_MIN) ? HA_READ_AFTER_KEY :
(last_range->flag & EQ_RANGE) ?
HA_READ_KEY_EXACT : HA_READ_KEY_OR_NEXT);
start_key.keypart_map= last_range->min_keypart_map;
key_range end_key;
end_key.key= (const uchar*) last_range->max_key;
end_key.length= last_range->max_length;
end_key.flag= (last_range->flag & NEAR_MAX ? HA_READ_BEFORE_KEY :
HA_READ_AFTER_KEY);
end_key.keypart_map= last_range->max_keypart_map;
result= file->prepare_range_scan((last_range->flag & NO_MIN_RANGE) ? NULL : &start_key,
(last_range->flag & NO_MAX_RANGE) ? NULL : &end_key);
if (result)
{
DBUG_RETURN(result);
}
if (last_range->flag & NO_MAX_RANGE) // Read last record
{
int local_error;

View file

@ -371,7 +371,15 @@ static int rr_quick(READ_RECORD *info)
static int rr_index_first(READ_RECORD *info)
{
int tmp= info->table->file->ha_index_first(info->record);
int tmp;
// tell handler that we are doing an index scan
if ((tmp = info->table->file->prepare_index_scan()))
{
tmp= rr_handle_error(info, tmp);
return tmp;
}
tmp= info->table->file->ha_index_first(info->record);
info->read_record= rr_index;
if (tmp)
tmp= rr_handle_error(info, tmp);

View file

@ -176,8 +176,7 @@ static struct
/* we disable few other plugins by default */
{ "ndbcluster", PLUGIN_OFF },
{ "feedback", PLUGIN_OFF },
{ "pbxt", PLUGIN_OFF }
{ "feedback", PLUGIN_OFF }
};
/* support for Services */

View file

@ -17367,6 +17367,11 @@ join_read_always_key(JOIN_TAB *tab)
if (cp_buffer_from_ref(tab->join->thd, table, &tab->ref))
return -1;
if ((error= table->file->prepare_index_key_scan_map(tab->ref.key_buff, make_prev_keypart_map(tab->ref.key_parts))))
{
report_error(table,error);
return -1;
}
if ((error= table->file->ha_index_read_map(table->record[0],
tab->ref.key_buff,
make_prev_keypart_map(tab->ref.key_parts),
@ -17400,6 +17405,11 @@ join_read_last_key(JOIN_TAB *tab)
if (cp_buffer_from_ref(tab->join->thd, table, &tab->ref))
return -1;
if ((error= table->file->prepare_index_key_scan_map(tab->ref.key_buff, make_prev_keypart_map(tab->ref.key_parts))))
{
report_error(table,error);
return -1;
}
if ((error= table->file->ha_index_read_map(table->record[0],
tab->ref.key_buff,
make_prev_keypart_map(tab->ref.key_parts),