1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge rurik.mysql.com:/home/igor/mysql-5.0

into  rurik.mysql.com:/home/igor/dev/mysql-5.0-2
This commit is contained in:
igor@rurik.mysql.com
2005-11-22 23:00:57 -08:00
133 changed files with 3261 additions and 1028 deletions

View File

@ -1088,6 +1088,11 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
/* find a unused table in the open table cache */
if (refresh)
*refresh=0;
/* an open table operation needs a lot of the stack space */
if (check_stack_overrun(thd, 8 * STACK_MIN_SIZE, (char *)&alias))
return 0;
if (thd->killed)
DBUG_RETURN(0);
key_length= (uint) (strmov(strmov(key, table_list->db)+1,
@ -1200,17 +1205,16 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
(void) unpack_filename(path, path);
if (mysql_frm_type(thd, path, &not_used) == FRMTYPE_VIEW)
{
TABLE tab;// will not be used (because it's VIEW) but have to be passed
/*
Will not be used (because it's VIEW) but has to be passed.
Also we will not free it (because it is a stack variable).
*/
TABLE tab;
table= &tab;
VOID(pthread_mutex_lock(&LOCK_open));
if (open_unireg_entry(thd, table, table_list->db,
table_list->table_name,
alias, table_list, mem_root))
{
table->next=table->prev=table;
free_cache_entry(table);
}
else
if (!open_unireg_entry(thd, table, table_list->db,
table_list->table_name,
alias, table_list, mem_root))
{
DBUG_ASSERT(table_list->view != 0);
VOID(pthread_mutex_unlock(&LOCK_open));