mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge neptunus.(none):/home/msvensson/mysql/bug10713_new/my50-bug10713_new
into neptunus.(none):/home/msvensson/mysql/bug10713_new/my51-bug10713_new mysql-test/mysql-test-run.sh: Auto merged sql/field.h: Auto merged sql/ha_federated.cc: Auto merged sql/ha_federated.h: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/handler.cc: Auto merged sql/handler.h: Auto merged sql/item.cc: Auto merged sql/sp.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_help.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_udf.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/table.cc: Auto merged sql/table.h: Auto merged sql/tztime.cc: Auto merged sql/unireg.cc: Auto merged storage/ndb/src/ndbapi/SignalSender.cpp: Auto merged VC++Files/mysql.sln: Manual merge 5.0 -> 5.1 scripts/make_win_src_distribution.sh: Manual merge 5.0 -> 5.1 sql/field.cc: Manual merge 5.0 -> 5.1
This commit is contained in:
@ -1030,23 +1030,23 @@ TABLE *reopen_name_locked_table(THD* thd, TABLE_LIST* table_list)
|
||||
|
||||
SYNOPSIS
|
||||
open_table()
|
||||
thd Thread context
|
||||
table_list Open first table in list
|
||||
refresh Pointer to memory that will be set to 1 if
|
||||
we need to close all tables and reopen them
|
||||
If this is a NULL pointer, then the is no version
|
||||
number checking and the table is not put in the
|
||||
thread-open-list
|
||||
flags Bitmap of flags to modify how open works:
|
||||
MYSQL_LOCK_IGNORE_FLUSH - Open table even if someone
|
||||
has done a flush or namelock on it.
|
||||
thd Thread context.
|
||||
table_list Open first table in list.
|
||||
refresh INOUT Pointer to memory that will be set to 1 if
|
||||
we need to close all tables and reopen them.
|
||||
If this is a NULL pointer, then the table is not
|
||||
put in the thread-open-list.
|
||||
flags Bitmap of flags to modify how open works:
|
||||
MYSQL_LOCK_IGNORE_FLUSH - Open table even if
|
||||
someone has done a flush or namelock on it.
|
||||
No version number checking is done.
|
||||
|
||||
IMPLEMENTATION
|
||||
Uses a cache of open tables to find a table not in use.
|
||||
|
||||
RETURN
|
||||
NULL Open failed. If refresh is set then one should close
|
||||
all other tables and retry the open
|
||||
all other tables and retry the open.
|
||||
# Success. Pointer to TABLE object for open table.
|
||||
*/
|
||||
|
||||
@ -1201,10 +1201,12 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
|
||||
|
||||
if (!thd->open_tables)
|
||||
thd->version=refresh_version;
|
||||
else if (thd->version != refresh_version && refresh)
|
||||
else if ((thd->version != refresh_version) &&
|
||||
! (flags & MYSQL_LOCK_IGNORE_FLUSH))
|
||||
{
|
||||
/* Someone did a refresh while thread was opening tables */
|
||||
*refresh=1;
|
||||
if (refresh)
|
||||
*refresh=1;
|
||||
VOID(pthread_mutex_unlock(&LOCK_open));
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
@ -2653,10 +2655,15 @@ find_field_in_view(THD *thd, TABLE_LIST *table_list,
|
||||
*ref != NULL means that *ref contains the item that we need to
|
||||
replace. If the item was aliased by the user, set the alias to
|
||||
the replacing item.
|
||||
We need to set alias on both ref itself and on ref real item.
|
||||
*/
|
||||
if (*ref && !(*ref)->is_autogenerated_name)
|
||||
{
|
||||
item->set_name((*ref)->name, (*ref)->name_length,
|
||||
system_charset_info);
|
||||
item->real_item()->set_name((*ref)->name, (*ref)->name_length,
|
||||
system_charset_info);
|
||||
}
|
||||
if (register_tree_change)
|
||||
thd->change_item_tree(ref, item);
|
||||
else
|
||||
|
Reference in New Issue
Block a user