Commit 567561ed authored by unknown's avatar unknown

Merge bk-internal.mysql.com:/data0/bk/mysql-5.1

into  bk-internal.mysql.com:/data0/bk/mysql-5.1-kt

parents 4bc57533 a822d651
......@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* Error messages for MySQL clients */
/* (Error messages for the daemon are in share/language/errmsg.sys) */
/* (Error messages for the daemon are in sql/share/errmsg.txt) */
#ifdef __cplusplus
extern "C" {
......
......@@ -21,7 +21,7 @@
Plugin API. Common for all plugin types.
*/
#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0001
#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0002
/*
The allowable types of plugins
......@@ -31,10 +31,6 @@
#define MYSQL_FTPARSER_PLUGIN 2 /* Full-text parser plugin */
#define MYSQL_MAX_PLUGIN_TYPE_NUM 3 /* The number of plugin types */
#if !defined(__attribute__) && (defined(__cplusplus) || !defined(__GNUC__) || __GNUC__ == 2 && __GNUC_MINOR__ < 8)
#define __attribute__(A)
#endif
/*
Macros for beginning and ending plugin declarations. Between
mysql_declare_plugin and mysql_declare_plugin_end there should
......
......@@ -44,7 +44,7 @@ libmysqlsources = errmsg.c get_password.c libmysql.c client.c pack.c \
noinst_HEADERS = embedded_priv.h emb_qcache.h
sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
ha_innodb.cc ha_ndbcluster.cc \
ha_ndbcluster.cc \
ha_ndbcluster_binlog.cc ha_partition.cc \
handler.cc sql_handler.cc \
hostname.cc init.cc password.c \
......
......@@ -17,6 +17,10 @@
#include <ctype.h>
#include <mysql/plugin.h>
#if !defined(__attribute__) && (defined(__cplusplus) || !defined(__GNUC__) || __GNUC__ == 2 && __GNUC_MINOR__ < 8)
#define __attribute__(A)
#endif
static long number_of_calls= 0; /* for SHOW STATUS, see below */
/*
......
......@@ -28,7 +28,7 @@ ADD_DEFINITIONS(-DHAVE_ROW_BASED_REPLICATION -DMYSQL_SERVER
ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc
discover.cc ../libmysql/errmsg.c field.cc field_conv.cc
filesort.cc gstream.cc
ha_innodb.cc ha_partition.cc
ha_partition.cc
handler.cc hash_filo.cc hash_filo.h
hostname.cc init.cc item.cc item_buff.cc item_cmpfunc.cc
item_create.cc item_func.cc item_geofunc.cc item_row.cc
......
......@@ -50,7 +50,6 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
sql_map.h sql_string.h unireg.h \
sql_error.h field.h handler.h mysqld_suffix.h \
ha_partition.h \
ha_innodb.h \
ha_ndbcluster.h ha_ndbcluster_binlog.h \
ha_ndbcluster_tables.h \
opt_range.h protocol.h rpl_tblmap.h \
......@@ -87,7 +86,7 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc sql_partition.cc \
unireg.cc des_key_file.cc \
discover.cc time.cc opt_range.cc opt_sum.cc \
records.cc filesort.cc handler.cc \
ha_partition.cc ha_innodb.cc \
ha_partition.cc \
ha_ndbcluster.cc ha_ndbcluster_binlog.cc \
sql_db.cc sql_table.cc sql_rename.cc sql_crypt.cc \
sql_load.cc mf_iocache.cc field_conv.cc sql_show.cc \
......
......@@ -85,6 +85,8 @@ struct show_table_authors_st show_table_authors[]= {
{ "Matthias Leich", "Berlin, Germany", "Testing - Server" },
{ "Dmitri Lenev", "Moscow, Russia",
"Time zones support (4.1), Triggers (5.0)" },
{ "Arjen Lentz", "Brisbane, Australia",
"Documentation (2001-2004), Dutch error messages, LOG2()" },
{ "Marc Liyanage", "", "Created Mac OS X packages" },
{ "Zarko Mocnik", "", "Sorting for Slovenian language" },
{ "Per-Erik Martin", "Uppsala, Sweden", "Stored Procedures (5.0)" },
......
......@@ -255,7 +255,12 @@ enum legacy_db_type
DB_TYPE_BLACKHOLE_DB,
DB_TYPE_PARTITION_DB,
DB_TYPE_BINLOG,
DB_TYPE_FIRST_DYNAMIC=32,
DB_TYPE_SOLID,
DB_TYPE_PBXT,
DB_TYPE_TABLE_FUNCTION,
DB_TYPE_MEMCACHE,
DB_TYPE_FALCON,
DB_TYPE_FIRST_DYNAMIC=42,
DB_TYPE_DEFAULT=127 // Must be last
};
......
......@@ -4710,6 +4710,7 @@ ER_MASTER_FATAL_ERROR_READING_BINLOG
ER_SLAVE_IGNORED_TABLE
eng "Slave SQL thread ignored the query because of replicate-*-table rules"
ger "Slave-SQL-Thread hat die Abfrage aufgrund von replicate-*-table-Regeln ignoriert"
nla "Slave SQL thread negeerde de query vanwege replicate-*-table opties"
por "Slave SQL thread ignorado a consulta devido s normas de replicao-*-tabela"
spa "Slave SQL thread ignorado el query debido a las reglas de replicacin-*-tabla"
swe "Slav SQL trden ignorerade frgan pga en replicate-*-table regel"
......@@ -4717,29 +4718,34 @@ ER_INCORRECT_GLOBAL_LOCAL_VAR
eng "Variable '%-.64s' is a %s variable"
serbian "Incorrect foreign key definition for '%-.64s': %s"
ger "Variable '%-.64s' ist eine %s-Variable"
nla "Variabele '%-.64s' is geen %s variabele"
spa "Variable '%-.64s' es una %s variable"
swe "Variabel '%-.64s' r av typ %s"
ER_WRONG_FK_DEF 42000
eng "Incorrect foreign key definition for '%-.64s': %s"
ger "Falsche Fremdschlssel-Definition fr '%-.64s': %s"
nla "Incorrecte foreign key definitie voor '%-.64s': %s"
por "Definio errada da chave estrangeira para '%-.64s': %s"
spa "Equivocada definicin de llave extranjera para '%-.64s': %s"
swe "Felaktig FOREIGN KEY-definition fr '%-.64s': %s"
ER_KEY_REF_DO_NOT_MATCH_TABLE_REF
eng "Key reference and table reference don't match"
ger "Schlssel- und Tabellenverweis passen nicht zusammen"
nla "Sleutel- en tabelreferentie komen niet overeen"
por "Referncia da chave e referncia da tabela no coincidem"
spa "Referencia de llave y referencia de tabla no coinciden"
swe "Nyckelreferensen och tabellreferensen stmmer inte verens"
ER_OPERAND_COLUMNS 21000
eng "Operand should contain %d column(s)"
ger "Operand sollte %d Spalte(n) enthalten"
nla "Operand behoort %d kolommen te bevatten"
rus " %d "
spa "Operando debe tener %d columna(s)"
ukr " %d æ"
ER_SUBQUERY_NO_1_ROW 21000
eng "Subquery returns more than 1 row"
ger "Unterabfrage lieferte mehr als einen Datensatz zurck"
nla "Subquery retourneert meer dan 1 rij"
por "Subconsulta retorna mais que 1 registro"
rus " "
spa "Subconsulta retorna mas que 1 lnea"
......@@ -4749,6 +4755,7 @@ ER_UNKNOWN_STMT_HANDLER
dan "Unknown prepared statement handler (%.*s) given to %s"
eng "Unknown prepared statement handler (%.*s) given to %s"
ger "Unbekannter Prepared-Statement-Handler (%.*s) fr %s angegeben"
nla "Onebekende prepared statement handler (%.*s) voor %s aangegeven"
por "Desconhecido manipulador de declarao preparado (%.*s) determinado para %s"
spa "Desconocido preparado comando handler (%.*s) dado para %s"
swe "Oknd PREPARED STATEMENT id (%.*s) var given till %s"
......@@ -4756,12 +4763,14 @@ ER_UNKNOWN_STMT_HANDLER
ER_CORRUPT_HELP_DB
eng "Help database is corrupt or does not exist"
ger "Die Hilfe-Datenbank ist beschdigt oder existiert nicht"
nla "Help database is beschadigd of bestaat niet"
por "Banco de dado de ajuda corrupto ou no existente"
spa "Base de datos Help est corrupto o no existe"
swe "Hjlpdatabasen finns inte eller r skadad"
ER_CYCLIC_REFERENCE
eng "Cyclic reference on subqueries"
ger "Zyklischer Verweis in Unterabfragen"
nla "Cyclische verwijzing in subqueries"
por "Referncia cclica em subconsultas"
rus " "
spa "Cclica referencia en subconsultas"
......@@ -4770,6 +4779,7 @@ ER_CYCLIC_REFERENCE
ER_AUTO_CONVERT
eng "Converting column '%s' from %s to %s"
ger "Feld '%s' wird von %s nach %s umgewandelt"
nla "Veld '%s' wordt van %s naar %s geconverteerd"
por "Convertendo coluna '%s' de %s para %s"
rus " '%s' %s %s"
spa "Convirtiendo columna '%s' de %s para %s"
......@@ -4778,6 +4788,7 @@ ER_AUTO_CONVERT
ER_ILLEGAL_REFERENCE 42S22
eng "Reference '%-.64s' not supported (%s)"
ger "Verweis '%-.64s' wird nicht untersttzt (%s)"
nla "Verwijzing '%-.64s' niet ondersteund (%s)"
por "Referncia '%-.64s' no suportada (%s)"
rus " '%-.64s' (%s)"
spa "Referencia '%-.64s' no soportada (%s)"
......@@ -4786,12 +4797,14 @@ ER_ILLEGAL_REFERENCE 42S22
ER_DERIVED_MUST_HAVE_ALIAS 42000
eng "Every derived table must have its own alias"
ger "Fr jede abgeleitete Tabelle muss ein eigener Alias angegeben werden"
nla "Voor elke afgeleide tabel moet een unieke alias worden gebruikt"
por "Cada tabela derivada deve ter seu prprio alias"
spa "Cada tabla derivada debe tener su propio alias"
swe "Varje 'derived table' mste ha sitt eget alias"
ER_SELECT_REDUCED 01000
eng "Select %u was reduced during optimization"
ger "Select %u wurde whrend der Optimierung reduziert"
nla "Select %u werd geredureerd tijdens optimtalisatie"
por "Select %u foi reduzido durante otimizao"
rus "Select %u "
spa "Select %u fu reducido durante optimizacin"
......@@ -4800,62 +4813,73 @@ ER_SELECT_REDUCED 01000
ER_TABLENAME_NOT_ALLOWED_HERE 42000
eng "Table '%-.64s' from one of the SELECTs cannot be used in %-.32s"
ger "Tabelle '%-.64s', die in einem der SELECT-Befehle verwendet wurde, kann nicht in %-.32s verwendet werden"
nla "Tabel '%-.64s' uit een van de SELECTS kan niet in %-.32s gebruikt worden"
por "Tabela '%-.64s' de um dos SELECTs no pode ser usada em %-.32s"
spa "Tabla '%-.64s' de uno de los SELECT no puede ser usada en %-.32s"
swe "Tabell '%-.64s' frn en SELECT kan inte anvndas i %-.32s"
ER_NOT_SUPPORTED_AUTH_MODE 08004
eng "Client does not support authentication protocol requested by server; consider upgrading MySQL client"
ger "Client untersttzt das vom Server erwartete Authentifizierungsprotokoll nicht. Bitte aktualisieren Sie Ihren MySQL-Client"
nla "Client ondersteunt het door de server verwachtte authenticatieprotocol niet. Overweeg een nieuwere MySQL client te gebruiken"
por "Cliente no suporta o protocolo de autenticao exigido pelo servidor; considere a atualizao do cliente MySQL"
spa "Cliente no soporta protocolo de autenticacin solicitado por el servidor; considere actualizar el cliente MySQL"
swe "Klienten stder inte autentiseringsprotokollet som begrts av servern; vervg uppgradering av klientprogrammet."
ER_SPATIAL_CANT_HAVE_NULL 42000
eng "All parts of a SPATIAL index must be NOT NULL"
ger "Alle Teile eines SPATIAL-Index mssen als NOT NULL deklariert sein"
nla "Alle delete van een SPATIAL index dienen als NOT NULL gedeclareerd te worden"
por "Todas as partes de uma SPATIAL index devem ser NOT NULL"
spa "Todas las partes de una SPATIAL index deben ser NOT NULL"
swe "Alla delar av en SPATIAL index mste vara NOT NULL"
ER_COLLATION_CHARSET_MISMATCH 42000
eng "COLLATION '%s' is not valid for CHARACTER SET '%s'"
ger "COLLATION '%s' ist fr CHARACTER SET '%s' ungltig"
nla "COLLATION '%s' is niet geldig voor CHARACTER SET '%s'"
por "COLLATION '%s' no vlida para CHARACTER SET '%s'"
spa "COLLATION '%s' no es vlido para CHARACTER SET '%s'"
swe "COLLATION '%s' r inte tilltet fr CHARACTER SET '%s'"
ER_SLAVE_WAS_RUNNING
eng "Slave is already running"
ger "Slave luft bereits"
nla "Slave is reeds actief"
por "O slave j est rodando"
spa "Slave ya est funcionando"
swe "Slaven har redan startat"
ER_SLAVE_WAS_NOT_RUNNING
eng "Slave already has been stopped"
ger "Slave wurde bereits angehalten"
nla "Slave is reeds gestopt"
por "O slave j est parado"
spa "Slave ya fu parado"
swe "Slaven har redan stoppat"
ER_TOO_BIG_FOR_UNCOMPRESS
eng "Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)"
ger "Unkomprimierte Daten sind zu gro. Die maximale Gre betrgt %d (wahrscheinlich wurde die Lnge der unkomprimierten Daten beschdigt)"
nla "Ongecomprimeerder data is te groot; de maximum lengte is %d (waarschijnlijk, de lengte van de gecomprimeerde data was beschadigd)"
por "Tamanho muito grande dos dados des comprimidos. O mximo tamanho %d. (provavelmente, o comprimento dos dados descomprimidos est corrupto)"
spa "Tamao demasiado grande para datos descomprimidos. El mximo tamao es %d. (probablemente, extensin de datos descomprimidos fu corrompida)"
ER_ZLIB_Z_MEM_ERROR
eng "ZLIB: Not enough memory"
ger "ZLIB: Nicht genug Speicher"
nla "ZLIB: Onvoldoende geheugen"
por "ZLIB: No suficiente memria disponvel"
spa "Z_MEM_ERROR: No suficiente memoria para zlib"
ER_ZLIB_Z_BUF_ERROR
eng "ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)"
ger "ZLIB: Im Ausgabepuffer ist nicht genug Platz vorhanden (wahrscheinlich wurde die Lnge der unkomprimierten Daten beschdigt)"
nla "ZLIB: Onvoldoende ruimte in uitgaande buffer (waarschijnlijk, de lengte van de ongecomprimeerde data was beschadigd)"
por "ZLIB: No suficiente espao no buffer emissor (provavelmente, o comprimento dos dados descomprimidos est corrupto)"
spa "Z_BUF_ERROR: No suficiente espacio en el bfer de salida para zlib (probablemente, extensin de datos descomprimidos fu corrompida)"
ER_ZLIB_Z_DATA_ERROR
eng "ZLIB: Input data corrupted"
ger "ZLIB: Eingabedaten beschdigt"
nla "ZLIB: Invoer data beschadigd"
por "ZLIB: Dados de entrada est corrupto"
spa "ZLIB: Dato de entrada fu corrompido para zlib"
ER_CUT_VALUE_GROUP_CONCAT
eng "%d line(s) were cut by GROUP_CONCAT()"
ger "%d Zeile(n) durch GROUP_CONCAT() abgeschnitten"
nla "%d regel(s) door GROUP_CONCAT() ingekort"
por "%d linha(s) foram cortada(s) por GROUP_CONCAT()"
spa "%d lnea(s) fue(fueron) cortadas por group_concat()"
swe "%d rad(er) kapades av group_concat()"
......@@ -4863,11 +4887,13 @@ ER_CUT_VALUE_GROUP_CONCAT
ER_WARN_TOO_FEW_RECORDS 01000
eng "Row %ld doesn't contain data for all columns"
ger "Zeile %ld enthlt nicht fr alle Felder Daten"
nla "Rij %ld bevat niet de data voor alle kolommen"
por "Conta de registro menor que a conta de coluna na linha %ld"
spa "Lnea %ld no contiene datos para todas las columnas"
ER_WARN_TOO_MANY_RECORDS 01000
eng "Row %ld was truncated; it contained more data than there were input columns"
ger "Zeile %ld gekrzt, die Zeile enthielt mehr Daten, als es Eingabefelder gibt"
nla "Regel %ld ingekort, bevatte meer data dan invoer kolommen"
por "Conta de registro maior que a conta de coluna na linha %ld"
spa "Lnea %ld fu truncada; La misma contine mas datos que las que existen en las columnas de entrada"
ER_WARN_NULL_TO_NOTNULL 22004
......
......@@ -35,12 +35,17 @@ plugin_type_init plugin_type_initialize[MYSQL_MAX_PLUGIN_TYPE_NUM]=
0,ha_initialize_handlerton,0
};
plugin_type_init plugin_type_deinitialize[MYSQL_MAX_PLUGIN_TYPE_NUM]=
{
0,ha_finalize_handlerton,0
};
static const char *plugin_interface_version_sym=
"_mysql_plugin_interface_version_";
static const char *sizeof_st_plugin_sym=
"_mysql_sizeof_struct_st_plugin_";
static const char *plugin_declarations_sym= "_mysql_plugin_declarations_";
static int min_plugin_interface_version= 0x0000;
static int min_plugin_interface_version= MYSQL_PLUGIN_INTERFACE_VERSION & ~0xFF;
/* Note that 'int version' must be the first field of every plugin
sub-structure (plugin->info).
*/
......@@ -469,50 +474,68 @@ err:
}
void plugin_deinitializer(struct st_plugin_int *plugin)
void plugin_deinitialize(struct st_plugin_int *plugin)
{
if (plugin->plugin->status_vars)
{
SHOW_VAR array[2]= {
{plugin->plugin->name, (char*)plugin->plugin->status_vars, SHOW_ARRAY},
{0, 0, SHOW_UNDEF}
};
remove_status_vars(array);
}
if (plugin->state == PLUGIN_IS_READY)
if (plugin_type_deinitialize[plugin->plugin->type] &&
(*plugin_type_deinitialize[plugin->plugin->type])(plugin))
{
sql_print_error("Plugin '%s' of type %s failed deinitialization",
plugin->name.str, plugin_type_names[plugin->plugin->type]);
}
if (plugin->plugin->status_vars)
{
#ifdef FIX_LATER
/*
We have a problem right now where we can not prepend without
breaking backwards compatibility. We will fix this shortly so
that engines have "use names" and we wil use those for
CREATE TABLE, and use the plugin name then for adding automatic
variable names.
*/
SHOW_VAR array[2]= {
{plugin->plugin->name, (char*)plugin->plugin->status_vars, SHOW_ARRAY},
{0, 0, SHOW_UNDEF}
};
remove_status_vars(array);
#else
remove_status_vars(plugin->plugin->status_vars);
#endif /* FIX_LATER */
}
if (plugin->plugin->deinit)
{
DBUG_PRINT("info", ("Deinitializing plugin: '%s'", plugin->name.str));
if (plugin->plugin->deinit())
{
if (plugin->plugin->deinit)
{
DBUG_PRINT("info", ("Deinitializing plugin: '%s'", plugin->name.str));
if (plugin->plugin->deinit())
{
DBUG_PRINT("warning", ("Plugin '%s' deinit function returned error.",
plugin->name.str));
}
}
plugin->state= PLUGIN_IS_UNINITIALIZED;
DBUG_PRINT("warning", ("Plugin '%s' deinit function returned error.",
plugin->name.str));
}
}
plugin->state= PLUGIN_IS_UNINITIALIZED;
}
static void plugin_del(struct st_plugin_int *plugin)
{
DBUG_ENTER("plugin_del(plugin)");
hash_delete(&plugin_hash[plugin->plugin->type], (byte*)plugin);
plugin_dl_del(&plugin->plugin_dl->dl);
plugin->state= PLUGIN_IS_FREED;
plugin_array_version++;
DBUG_VOID_RETURN;
}
static void plugin_del(const LEX_STRING *name)
{
uint i;
struct st_plugin_int *plugin;
DBUG_ENTER("plugin_del");
DBUG_ENTER("plugin_del(name)");
if ((plugin= plugin_find_internal(name, MYSQL_ANY_PLUGIN)))
{
plugin_deinitializer(plugin);
hash_delete(&plugin_hash[plugin->plugin->type], (byte*)plugin);
plugin_dl_del(&plugin->plugin_dl->dl);
plugin->state= PLUGIN_IS_FREED;
plugin_array_version++;
}
plugin_del(plugin);
DBUG_VOID_RETURN;
}
void plugin_unlock(struct st_plugin_int *plugin)
{
DBUG_ENTER("plugin_unlock");
......@@ -521,9 +544,8 @@ void plugin_unlock(struct st_plugin_int *plugin)
plugin->ref_count--;
if (plugin->state == PLUGIN_IS_DELETED && ! plugin->ref_count)
{
if (plugin->plugin->deinit)
plugin->plugin->deinit();
plugin_del(&plugin->name);
plugin_deinitialize(plugin);
plugin_del(plugin);
}
rw_unlock(&THR_LOCK_plugin);
DBUG_VOID_RETURN;
......@@ -537,15 +559,15 @@ static int plugin_initialize(struct st_plugin_int *plugin)
if (plugin->plugin->status_vars)
{
#ifdef FIX_LATER
/*
/*
We have a problem right now where we can not prepend without
breaking backwards compatibility. We will fix this shortly so
breaking backwards compatibility. We will fix this shortly so
that engines have "use names" and we wil use those for
CREATE TABLE, and use the plugin name then for adding automatic
variable names.
*/
SHOW_VAR array[2]= {
{plugin->name, (char*)plugin->status_vars, SHOW_ARRAY},
{plugin->plugin->name, (char*)plugin->plugin->status_vars, SHOW_ARRAY},
{0, 0, SHOW_UNDEF}
};
if (add_status_vars(array)) // add_status_vars makes a copy
......@@ -578,53 +600,6 @@ err:
DBUG_RETURN(1);
}
static int plugin_finalize(THD *thd, struct st_plugin_int *plugin)
{
int rc;
DBUG_ENTER("plugin_finalize");
if (plugin->ref_count)
{
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
"Plugin is busy and will be uninstalled on shutdown");
goto err;
}
switch (plugin->plugin->type)
{
case MYSQL_STORAGE_ENGINE_PLUGIN:
if (ha_finalize_handlerton(plugin))
{
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
"Storage engine shutdown failed. "
"It will be uninstalled on shutdown");
sql_print_warning("Storage engine '%s' shutdown failed. "
"It will be uninstalled on shutdown", plugin->name.str);
goto err;
}
break;
default:
break;
}
if (plugin->plugin->deinit)
{
if ((rc= plugin->plugin->deinit()))
{
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
"Plugin deinit failed. "
"It will be uninstalled on shutdown");
sql_print_warning("Plugin '%s' deinit failed. "
"It will be uninstalled on shutdown", plugin->name.str);
goto err;
}
}
DBUG_RETURN(0);
err:
DBUG_RETURN(1);
}
static byte *get_hash_key(const byte *buff, uint *length,
my_bool not_used __attribute__((unused)))
{
......@@ -637,7 +612,7 @@ static byte *get_hash_key(const byte *buff, uint *length,
/*
The logic is that we first load and initialize all compiled in plugins.
From there we load up the dynamic types (assuming we have not been told to
skip this part).
skip this part).
Finally we inializie everything, aka the dynamic that have yet to initialize.
*/
......@@ -666,7 +641,7 @@ int plugin_init(int skip_dynamic_loading)
goto err;
}
/*
/*
First we register builtin plugins
*/
for (builtins= mysqld_builtins; *builtins; builtins++)
......@@ -702,7 +677,10 @@ int plugin_init(int skip_dynamic_loading)
if (tmp->state == PLUGIN_IS_UNINITIALIZED)
{
if (plugin_initialize(tmp))
plugin_del(&tmp->name);
{
plugin_deinitialize(tmp);
plugin_del(tmp);
}
}
}
......@@ -812,7 +790,7 @@ void plugin_shutdown(void)
{
struct st_plugin_int *tmp= dynamic_element(&plugin_array, i,
struct st_plugin_int *);
plugin_deinitializer(tmp);
plugin_deinitialize(tmp);
}
......@@ -862,7 +840,7 @@ my_bool mysql_install_plugin(THD *thd, const LEX_STRING *name, const LEX_STRING
{
my_error(ER_CANT_INITIALIZE_UDF, MYF(0), name->str,
"Plugin initialization function failed.");
goto err;
goto deinit;
}
table->use_all_columns();
......@@ -879,10 +857,9 @@ my_bool mysql_install_plugin(THD *thd, const LEX_STRING *name, const LEX_STRING
rw_unlock(&THR_LOCK_plugin);
DBUG_RETURN(FALSE);
deinit:
if (tmp->plugin->deinit)
tmp->plugin->deinit();
plugin_deinitialize(tmp);
err:
plugin_del(name);
plugin_del(tmp);
rw_unlock(&THR_LOCK_plugin);
DBUG_RETURN(TRUE);
}
......@@ -917,10 +894,17 @@ my_bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name)
goto err;
}
if (!plugin_finalize(thd, plugin))
plugin_del(name);
else
if (plugin->ref_count)
{
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
"Plugin is busy and will be uninstalled on shutdown");
plugin->state= PLUGIN_IS_DELETED;
}
else
{
plugin_deinitialize(plugin);
plugin_del(plugin);
}
table->use_all_columns();
table->field[0]->store(name->str, name->length, system_charset_info);
......@@ -983,7 +967,6 @@ my_bool plugin_foreach_with_mask(THD *thd, plugin_foreach_func *func,
for (idx= 0; idx < total; idx++)
{
plugin= plugins[idx];
if (unlikely(version != plugin_array_version))
{
rw_rdlock(&THR_LOCK_plugin);
......@@ -992,6 +975,7 @@ my_bool plugin_foreach_with_mask(THD *thd, plugin_foreach_func *func,
plugins[i]=0;
rw_unlock(&THR_LOCK_plugin);
}
plugin= plugins[idx];
if (plugin && func(thd, plugin, arg))
goto err;
}
......
......@@ -125,7 +125,7 @@ int az_open (azio_stream *s, const char *path, int Flags, File fd)
buffer[8] = 0 /*xflags*/;
buffer[9] = 0x03;
s->start = 10L;
my_write(s->file, buffer, s->start, MYF(0));
my_write(s->file, buffer, (uint)s->start, MYF(0));
/* We use 10L instead of ftell(s->file) to because ftell causes an
* fflush on some systems. This version of the library doesn't use
* start anyway in write mode, so this initialization is not
......@@ -503,7 +503,7 @@ int azrewind (s)
if (!s->transparent) (void)inflateReset(&s->stream);
s->in = 0;
s->out = 0;
return my_seek(s->file, s->start, MY_SEEK_SET, MYF(0));
return my_seek(s->file, (int)s->start, MY_SEEK_SET, MYF(0));
}
/* ===========================================================================
......
......@@ -1263,7 +1263,6 @@ bool ha_federated::create_where_from_key(String *to,
if (tmp.append(STRING_WITH_LEN(") ")))
goto err;
next_loop:
if (store_length >= length)
break;
DBUG_PRINT("info", ("remainder %d", remainder));
......@@ -2016,8 +2015,8 @@ int ha_federated::delete_row(const byte *buf)
{
DBUG_RETURN(stash_remote_error());
}
stats.deleted+= mysql->affected_rows;
stats.records-= mysql->affected_rows;
stats.deleted+= (ha_rows)mysql->affected_rows;
stats.records-= (ha_rows)mysql->affected_rows;
DBUG_PRINT("info",
("rows deleted %d rows deleted for all time %d",
int(mysql->affected_rows), stats.deleted));
......@@ -2373,7 +2372,6 @@ int ha_federated::rnd_next(byte *buf)
int ha_federated::read_next(byte *buf, MYSQL_RES *result)
{
int retval;
my_ulonglong num_rows;
MYSQL_ROW row;
DBUG_ENTER("ha_federated::read_next");
......@@ -2867,7 +2865,7 @@ int ha_federated::connection_autocommit(bool state)
{
const char *text;
DBUG_ENTER("ha_federated::connection_autocommit");
text= (state == true) ? "SET AUTOCOMMIT=1" : "SET AUTOCOMMIT=0";
text= (state == TRUE) ? "SET AUTOCOMMIT=1" : "SET AUTOCOMMIT=0";
DBUG_RETURN(execute_simple_query(text, 16));
}
......
......@@ -2,7 +2,12 @@
#SET(CMAKE_C_FLAGS_DEBUG "-DSAFEMALLOC -DSAFE_MUTEX")
ADD_DEFINITIONS(-DMYSQL_SERVER -D_WIN32 -DWIN32 -D_LIB)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include include)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib
include
handler
${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/extra/yassl/include)
ADD_LIBRARY(innobase btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c
buf/buf0buf.c buf/buf0flu.c buf/buf0lru.c buf/buf0rea.c
data/data0data.c data/data0type.c
......@@ -23,6 +28,7 @@ ADD_LIBRARY(innobase btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c
os/os0file.c os/os0proc.c os/os0sync.c os/os0thread.c
page/page0cur.c page/page0page.c
que/que0que.c
handler/ha_innodb.cc
read/read0read.c
rem/rem0cmp.c rem/rem0rec.c
row/row0ins.c row/row0mysql.c row/row0purge.c row/row0row.c row/row0sel.c row/row0uins.c
......
......@@ -34,6 +34,7 @@ noinst_HEADERS =
SUBDIRS = os ut btr buf data dict dyn eval fil fsp fut \
ha ibuf lock log mach mem mtr page \
handler \
pars que read rem row srv sync thr trx usr
EXTRA_DIST = include/btr0btr.h include/btr0btr.ic include/btr0cur.h include/btr0cur.ic \
......@@ -86,6 +87,7 @@ EXTRA_DIST = include/btr0btr.h include/btr0btr.ic include/btr0cur.h include/btr
include/univ.i include/usr0sess.h include/usr0sess.ic include/usr0types.h \
include/ut0byte.h include/ut0byte.ic include/ut0dbg.h include/ut0lst.h \
include/ut0mem.h include/ut0mem.ic include/ut0rnd.h include/ut0rnd.ic \
handler/ha_innodb.h \
include/ut0sort.h include/ut0ut.h include/ut0ut.ic include/ut0vec.h include/ut0vec.ic include/ha_prototypes.h \
include/ut0list.h include/ut0list.ic \
include/ut0wqueue.h \
......@@ -102,6 +104,7 @@ libinnobase_a_LIBADD = usr/libusr.a srv/libsrv.a dict/libdict.a \
page/libpage.a rem/librem.a thr/libthr.a \
sync/libsync.a data/libdata.a mach/libmach.a \
ha/libha.a dyn/libdyn.a mem/libmem.a \
handler/libhandler.a \
ut/libut.a os/libos.a ut/libut.a
libinnobase_a_SOURCES =
......
# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
# & Innobase Oy
#
# 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
include ../include/Makefile.i
DEFS = -DMYSQL_SERVER @DEFS@
noinst_LIBRARIES = libhandler.a
libhandler_a_SOURCES = ha_innodb.cc
EXTRA_PROGRAMS =
# Don't update the files from bitkeeper
%::SCCS/s.%
......@@ -31,8 +31,7 @@ have disables the InnoDB inlining in this file. */
#pragma implementation // gcc: Class implementation
#endif
#include "mysql_priv.h"
#include "slave.h"
#include <mysql_priv.h>
#include <m_ctype.h>
#include <hash.h>
......@@ -1600,21 +1599,6 @@ innobase_init(void)
pthread_cond_init(&commit_cond, NULL);
innodb_inited= 1;
/* If this is a replication slave and we needed to do a crash recovery,
set the master binlog position to what InnoDB internally knew about
how far we got transactions durable inside InnoDB. There is a
problem here: if the user used also MyISAM tables, InnoDB might not
know the right position for them.
THIS DOES NOT WORK CURRENTLY because replication seems to initialize
glob_mi also after innobase_init. */
/* if (trx_sys_mysql_master_log_pos != -1) {
ut_memcpy(glob_mi.log_file_name, trx_sys_mysql_master_log_name,
1 + ut_strlen(trx_sys_mysql_master_log_name));
glob_mi.pos = trx_sys_mysql_master_log_pos;
}
*/
DBUG_RETURN(FALSE);
error:
have_innodb= SHOW_OPTION_DISABLED; // If we couldn't use handler
......@@ -1689,19 +1673,6 @@ innobase_commit_low(
return;
}
#ifdef HAVE_REPLICATION
THD *thd=current_thd;
if (thd && thd->slave_thread) {
/* Update the replication position info inside InnoDB */
trx->mysql_master_log_file_name
= active_mi->rli.group_master_log_name;
trx->mysql_master_log_pos = ((ib_longlong)
active_mi->rli.future_group_master_log_pos);
}
#endif /* HAVE_REPLICATION */
trx_commit_for_mysql(trx);
}
......
......@@ -65,6 +65,7 @@ MYSQL_PLUGIN_ACTIONS(innobase, [
storage/innobase/sync/Makefile
storage/innobase/thr/Makefile
storage/innobase/trx/Makefile
storage/innobase/handler/Makefile
storage/innobase/usr/Makefile)
])
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