1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.1

into  labbari.dsl.inet.fi:/home/my/bk/mysql-maria.prod


BitKeeper/etc/ignore:
  auto-union
client/mysqldump.c:
  Auto merged
include/my_base.h:
  Auto merged
include/my_sys.h:
  Auto merged
mysql-test/lib/mtr_cases.pl:
  Auto merged
mysql-test/lib/mtr_report.pl:
  Auto merged
mysql-test/r/ps_2myisam.result:
  Auto merged
mysql-test/r/ps_3innodb.result:
  Auto merged
mysql-test/r/ps_4heap.result:
  Auto merged
mysql-test/r/ps_5merge.result:
  Auto merged
mysql-test/r/ps_7ndb.result:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
mysql-test/t/view.test:
  Auto merged
sql/Makefile.am:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/handler.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/share/errmsg.txt:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
storage/myisam/mi_key.c:
  Auto merged
storage/myisam/mi_open.c:
  Merged with main 5.1.
This commit is contained in:
unknown
2007-07-07 18:33:43 +03:00
282 changed files with 79463 additions and 1714 deletions

View File

@@ -30,6 +30,10 @@
#include <myisampack.h>
#include <errno.h>
#ifdef WITH_MARIA_STORAGE_ENGINE
#include <maria.h>
#endif
#ifdef WITH_PARTITION_STORAGE_ENGINE
#include "ha_partition.h"
#endif
@@ -64,7 +68,7 @@ static const LEX_STRING sys_table_aliases[]=
};
const char *ha_row_type[] = {
"", "FIXED", "DYNAMIC", "COMPRESSED", "REDUNDANT", "COMPACT", "?","?","?"
"", "FIXED", "DYNAMIC", "COMPRESSED", "REDUNDANT", "COMPACT", "PAGE","?","?","?"
};
const char *tx_isolation_names[] =
@@ -292,7 +296,8 @@ handler *get_ha_partition(partition_info *part_info)
0 OK
!= 0 Error
*/
static int ha_init_errors(void)
int ha_init_errors(void)
{
#define SETMSG(nr, msg) errmsgs[(nr) - HA_ERR_FIRST]= (msg)
const char **errmsgs;
@@ -507,9 +512,6 @@ int ha_init()
int error= 0;
DBUG_ENTER("ha_init");
if (ha_init_errors())
DBUG_RETURN(1);
DBUG_ASSERT(total_ha < MAX_HA);
/*
Check if there is a transaction-capable storage engine besides the
@@ -2789,6 +2791,98 @@ int ha_change_key_cache(KEY_CACHE *old_key_cache,
}
/*****************************************************************************
pagecache handling.
This code is only relevant for maria tables
pagecache->cache may be 0 only in the case where a key cache is not
initialized or when we where not able to init the key cache in a previous
call to ha_init_pagecache() (probably out of memory)
*****************************************************************************/
#ifdef WITH_MARIA_STORAGE_ENGINE
/* Init a pagecache if it has not been initied before */
int ha_init_pagecache(const char *name, PAGECACHE *pagecache)
{
DBUG_ENTER("ha_init_key_cache");
if (!pagecache->inited)
{
pthread_mutex_lock(&LOCK_global_system_variables);
long tmp_buff_size= (long) pagecache->param_buff_size;
uint division_limit= pagecache->param_division_limit;
uint age_threshold= pagecache->param_age_threshold;
pthread_mutex_unlock(&LOCK_global_system_variables);
DBUG_RETURN(!init_pagecache(pagecache,
tmp_buff_size, division_limit, age_threshold,
MARIA_KEY_BLOCK_LENGTH));
}
DBUG_RETURN(0);
}
/* Resize key cache */
/*
TODO: uncomment when resize will be implemented
int ha_resize_pagecache(PAGECACHE *pagecache)
{
DBUG_ENTER("ha_resize_pagecache");
if (pagecache->inited)
{
pthread_mutex_lock(&LOCK_global_system_variables);
long tmp_buff_size= (long) pagecache->param_buff_size;
long tmp_block_size= (long) pagecache->param_block_size;
uint division_limit= pagecache->param_division_limit;
uint age_threshold= pagecache->param_age_threshold;
pthread_mutex_unlock(&LOCK_global_system_variables);
DBUG_RETURN(!resize_pagecache(pagecache, tmp_block_size,
tmp_buff_size,
division_limit, age_threshold));
}
DBUG_RETURN(0);
}
*/
/* Change parameters for key cache (like size) */
int ha_change_pagecache_param(PAGECACHE *pagecache)
{
if (pagecache->inited)
{
pthread_mutex_lock(&LOCK_global_system_variables);
uint division_limit= pagecache->param_division_limit;
uint age_threshold= pagecache->param_age_threshold;
pthread_mutex_unlock(&LOCK_global_system_variables);
change_pagecache_param(pagecache, division_limit, age_threshold);
}
return 0;
}
/* Free memory allocated by a key cache */
int ha_end_pagecache(PAGECACHE *pagecache)
{
end_pagecache(pagecache, 1); // Can never fail
return 0;
}
/* Move all tables from one key cache to another one */
int ha_change_pagecache(PAGECACHE *old_pagecache,
PAGECACHE *new_pagecache)
{
maria_change_pagecache(old_pagecache, new_pagecache);
return 0;
}
#endif /* WITH_MARIA_STORAGE_ENGINE */
/** @brief
Try to discover one table from handler(s)