mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
merge of 5.1-main into 5.1-maria. Myisam->Maria change propagation will follow.
There were so many changes into mtr (this is the new mtr coming) that I rather copied mtr from 6.0-main here (at least this one knows how to run Maria tests). I also fixed suite/maria tests to be accepted by the new mtr. mysys/thr_mutex.c: adding DBUG_PRINT here, so that we can locate where the warning is issued.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2000-2004 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -124,6 +124,9 @@ static my_bool show_plugins(THD *thd, plugin_ref plugin,
|
||||
case PLUGIN_IS_READY:
|
||||
table->field[2]->store(STRING_WITH_LEN("ACTIVE"), cs);
|
||||
break;
|
||||
case PLUGIN_IS_DISABLED:
|
||||
table->field[2]->store(STRING_WITH_LEN("DISABLED"), cs);
|
||||
break;
|
||||
default:
|
||||
DBUG_ASSERT(0);
|
||||
}
|
||||
@ -471,6 +474,7 @@ find_files(THD *thd, List<LEX_STRING> *files, const char *db,
|
||||
if (wild && !wild[0])
|
||||
wild=0;
|
||||
|
||||
|
||||
bzero((char*) &table_list,sizeof(table_list));
|
||||
|
||||
if (!(dirp = my_dir(path,MYF(dir ? MY_WANT_STAT : 0))))
|
||||
@ -993,15 +997,15 @@ static bool get_field_default_value(THD *thd, TABLE *table,
|
||||
{
|
||||
bool has_default;
|
||||
bool has_now_default;
|
||||
|
||||
/*
|
||||
enum enum_field_types field_type= field->type();
|
||||
/*
|
||||
We are using CURRENT_TIMESTAMP instead of NOW because it is
|
||||
more standard
|
||||
*/
|
||||
has_now_default= table->timestamp_field == field &&
|
||||
field->unireg_check != Field::TIMESTAMP_UN_FIELD;
|
||||
|
||||
has_default= (field->type() != FIELD_TYPE_BLOB &&
|
||||
|
||||
has_default= (field_type != FIELD_TYPE_BLOB &&
|
||||
!(field->flags & NO_DEFAULT_VALUE_FLAG) &&
|
||||
field->unireg_check != Field::NEXT_NUMBER &&
|
||||
!((thd->variables.sql_mode & (MODE_MYSQL323 | MODE_MYSQL40))
|
||||
@ -1016,7 +1020,19 @@ static bool get_field_default_value(THD *thd, TABLE *table,
|
||||
{ // Not null by default
|
||||
char tmp[MAX_FIELD_WIDTH];
|
||||
String type(tmp, sizeof(tmp), field->charset());
|
||||
field->val_str(&type);
|
||||
if (field_type == MYSQL_TYPE_BIT)
|
||||
{
|
||||
longlong dec= field->val_int();
|
||||
char *ptr= longlong2str(dec, tmp + 2, 2);
|
||||
uint32 length= (uint32) (ptr - tmp);
|
||||
tmp[0]= 'b';
|
||||
tmp[1]= '\'';
|
||||
tmp[length]= '\'';
|
||||
type.length(length + 1);
|
||||
quoted= 0;
|
||||
}
|
||||
else
|
||||
field->val_str(&type);
|
||||
if (type.length())
|
||||
{
|
||||
String def_val;
|
||||
@ -3571,6 +3587,11 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
|
||||
ptr=strxmov(ptr, " row_format=",
|
||||
ha_row_type[(uint) share->row_type],
|
||||
NullS);
|
||||
if (share->key_block_size)
|
||||
{
|
||||
ptr= strmov(ptr, " KEY_BLOCK_SIZE=");
|
||||
ptr= longlong10_to_str(share->key_block_size, ptr, 10);
|
||||
}
|
||||
#ifdef WITH_PARTITION_STORAGE_ENGINE
|
||||
if (is_partitioned)
|
||||
ptr= strmov(ptr, " partitioned");
|
||||
@ -3907,6 +3928,25 @@ static my_bool iter_schema_engines(THD *thd, plugin_ref plugin,
|
||||
handlerton *default_type= ha_default_handlerton(thd);
|
||||
DBUG_ENTER("iter_schema_engines");
|
||||
|
||||
|
||||
/* Disabled plugins */
|
||||
if (plugin_state(plugin) != PLUGIN_IS_READY)
|
||||
{
|
||||
|
||||
struct st_mysql_plugin *plug= plugin_decl(plugin);
|
||||
if (!(wild && wild[0] &&
|
||||
wild_case_compare(scs, plug->name,wild)))
|
||||
{
|
||||
restore_record(table, s->default_values);
|
||||
table->field[0]->store(plug->name, strlen(plug->name), scs);
|
||||
table->field[1]->store(C_STRING_WITH_LEN("NO"), scs);
|
||||
table->field[2]->store(plug->descr, strlen(plug->descr), scs);
|
||||
if (schema_table_store_record(thd, table))
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
if (!(hton->flags & HTON_HIDDEN))
|
||||
{
|
||||
LEX_STRING *name= plugin_name(plugin);
|
||||
@ -3927,10 +3967,13 @@ static my_bool iter_schema_engines(THD *thd, plugin_ref plugin,
|
||||
strlen(plugin_decl(plugin)->descr), scs);
|
||||
tmp= &yesno[test(hton->commit)];
|
||||
table->field[3]->store(tmp->str, tmp->length, scs);
|
||||
table->field[3]->set_notnull();
|
||||
tmp= &yesno[test(hton->prepare)];
|
||||
table->field[4]->store(tmp->str, tmp->length, scs);
|
||||
table->field[4]->set_notnull();
|
||||
tmp= &yesno[test(hton->savepoint_set)];
|
||||
table->field[5]->store(tmp->str, tmp->length, scs);
|
||||
table->field[5]->set_notnull();
|
||||
|
||||
if (schema_table_store_record(thd, table))
|
||||
DBUG_RETURN(1);
|
||||
@ -3941,8 +3984,12 @@ static my_bool iter_schema_engines(THD *thd, plugin_ref plugin,
|
||||
|
||||
int fill_schema_engines(THD *thd, TABLE_LIST *tables, COND *cond)
|
||||
{
|
||||
return plugin_foreach(thd, iter_schema_engines,
|
||||
MYSQL_STORAGE_ENGINE_PLUGIN, tables->table);
|
||||
DBUG_ENTER("fill_schema_engines");
|
||||
if (plugin_foreach_with_mask(thd, iter_schema_engines,
|
||||
MYSQL_STORAGE_ENGINE_PLUGIN,
|
||||
~PLUGIN_IS_FREED, tables->table))
|
||||
DBUG_RETURN(1);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
||||
@ -6139,9 +6186,9 @@ ST_FIELD_INFO engines_fields_info[]=
|
||||
{"ENGINE", 64, MYSQL_TYPE_STRING, 0, 0, "Engine", SKIP_OPEN_TABLE},
|
||||
{"SUPPORT", 8, MYSQL_TYPE_STRING, 0, 0, "Support", SKIP_OPEN_TABLE},
|
||||
{"COMMENT", 80, MYSQL_TYPE_STRING, 0, 0, "Comment", SKIP_OPEN_TABLE},
|
||||
{"TRANSACTIONS", 3, MYSQL_TYPE_STRING, 0, 0, "Transactions", SKIP_OPEN_TABLE},
|
||||
{"XA", 3, MYSQL_TYPE_STRING, 0, 0, "XA", SKIP_OPEN_TABLE},
|
||||
{"SAVEPOINTS", 3 ,MYSQL_TYPE_STRING, 0, 0, "Savepoints", SKIP_OPEN_TABLE},
|
||||
{"TRANSACTIONS", 3, MYSQL_TYPE_STRING, 0, 1, "Transactions", SKIP_OPEN_TABLE},
|
||||
{"XA", 3, MYSQL_TYPE_STRING, 0, 1, "XA", SKIP_OPEN_TABLE},
|
||||
{"SAVEPOINTS", 3 ,MYSQL_TYPE_STRING, 0, 1, "Savepoints", SKIP_OPEN_TABLE},
|
||||
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user