simpler fix for mysql bug #56085, no need to write an error interceptor,
when the function has a dedicated flag for this very use case.
This commit is contained in:
parent
028ce66c9e
commit
73f79ac83f
@ -90,13 +90,15 @@
|
|||||||
#define IF_WIN(A,B) B
|
#define IF_WIN(A,B) B
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef EMBEDDED_LIBRARY
|
#ifdef EMBEDDED_LIBRARY
|
||||||
|
#define IF_EMBEDDED(A,B) A
|
||||||
|
#else
|
||||||
|
#define IF_EMBEDDED(A,B) B
|
||||||
|
|
||||||
#ifdef WITH_NDB_BINLOG
|
#ifdef WITH_NDB_BINLOG
|
||||||
#define HAVE_NDB_BINLOG 1
|
#define HAVE_NDB_BINLOG 1
|
||||||
#endif
|
#endif
|
||||||
#endif /* !EMBEDDED_LIBRARY */
|
|
||||||
|
|
||||||
#ifndef EMBEDDED_LIBRARY
|
|
||||||
#define HAVE_REPLICATION
|
#define HAVE_REPLICATION
|
||||||
#define HAVE_EXTERNAL_CLIENT
|
#define HAVE_EXTERNAL_CLIENT
|
||||||
#endif
|
#endif
|
||||||
|
@ -1707,9 +1707,6 @@ static void plugin_load(MEM_ROOT *tmp_root, int *argc, char **argv)
|
|||||||
int error;
|
int error;
|
||||||
THD *new_thd= new THD;
|
THD *new_thd= new THD;
|
||||||
bool result;
|
bool result;
|
||||||
#ifdef EMBEDDED_LIBRARY
|
|
||||||
No_such_table_error_handler error_handler;
|
|
||||||
#endif /* EMBEDDED_LIBRARY */
|
|
||||||
DBUG_ENTER("plugin_load");
|
DBUG_ENTER("plugin_load");
|
||||||
|
|
||||||
new_thd->thread_stack= (char*) &tables;
|
new_thd->thread_stack= (char*) &tables;
|
||||||
@ -1718,22 +1715,13 @@ static void plugin_load(MEM_ROOT *tmp_root, int *argc, char **argv)
|
|||||||
new_thd->db_length= 5;
|
new_thd->db_length= 5;
|
||||||
bzero((char*) &new_thd->net, sizeof(new_thd->net));
|
bzero((char*) &new_thd->net, sizeof(new_thd->net));
|
||||||
tables.init_one_table("mysql", 5, "plugin", 6, "plugin", TL_READ);
|
tables.init_one_table("mysql", 5, "plugin", 6, "plugin", TL_READ);
|
||||||
|
tables.open_strategy= TABLE_LIST:: IF_EMBEDDED(OPEN_IF_EXISTS, OPEN_NORMAL);
|
||||||
#ifdef EMBEDDED_LIBRARY
|
|
||||||
/*
|
|
||||||
When building an embedded library, if the mysql.plugin table
|
|
||||||
does not exist, we silently ignore the missing table
|
|
||||||
*/
|
|
||||||
new_thd->push_internal_handler(&error_handler);
|
|
||||||
#endif /* EMBEDDED_LIBRARY */
|
|
||||||
|
|
||||||
result= open_and_lock_tables(new_thd, &tables, FALSE, MYSQL_LOCK_IGNORE_TIMEOUT);
|
result= open_and_lock_tables(new_thd, &tables, FALSE, MYSQL_LOCK_IGNORE_TIMEOUT);
|
||||||
|
|
||||||
#ifdef EMBEDDED_LIBRARY
|
table= tables.table;
|
||||||
new_thd->pop_internal_handler();
|
if (IF_EMBEDDED(!table, false))
|
||||||
if (error_handler.safely_trapped_errors())
|
|
||||||
goto end;
|
goto end;
|
||||||
#endif /* EMBEDDED_LIBRARY */
|
|
||||||
|
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
@ -1745,7 +1733,7 @@ static void plugin_load(MEM_ROOT *tmp_root, int *argc, char **argv)
|
|||||||
sql_print_warning("Could not open mysql.plugin table. Some options may be missing from the help text");
|
sql_print_warning("Could not open mysql.plugin table. Some options may be missing from the help text");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
table= tables.table;
|
|
||||||
if (init_read_record(&read_record_info, new_thd, table, NULL, 1, 0, FALSE))
|
if (init_read_record(&read_record_info, new_thd, table, NULL, 1, 0, FALSE))
|
||||||
{
|
{
|
||||||
sql_print_error("Could not initialize init_read_record; Plugins not "
|
sql_print_error("Could not initialize init_read_record; Plugins not "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user