mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge mysql.com:/home/mysql_src/mysql-5.0
into mysql.com:/home/mysql_src/mysql-5.1-merge-of-5.0 (not all files are good, I'll fix; I'll ask some devs to check their part)
This commit is contained in:
@ -896,6 +896,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
|
||||
else
|
||||
{
|
||||
/* Field redefined */
|
||||
sql_field->def= dup_field->def;
|
||||
sql_field->sql_type= dup_field->sql_type;
|
||||
sql_field->charset= (dup_field->charset ?
|
||||
dup_field->charset :
|
||||
@ -905,8 +906,15 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
|
||||
sql_field->key_length= dup_field->key_length;
|
||||
sql_field->create_length_to_internal_length();
|
||||
sql_field->decimals= dup_field->decimals;
|
||||
sql_field->flags= dup_field->flags;
|
||||
sql_field->unireg_check= dup_field->unireg_check;
|
||||
/*
|
||||
We're making one field from two, the result field will have
|
||||
dup_field->flags as flags. If we've incremented null_fields
|
||||
because of sql_field->flags, decrement it back.
|
||||
*/
|
||||
if (!(sql_field->flags & NOT_NULL_FLAG))
|
||||
null_fields--;
|
||||
sql_field->flags= dup_field->flags;
|
||||
it2.remove(); // Remove first (create) definition
|
||||
select_field_pos--;
|
||||
break;
|
||||
@ -2338,7 +2346,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
|
||||
/* if view are unsupported */
|
||||
if (table->view && view_operator_func == NULL)
|
||||
{
|
||||
result_code= HA_ADMIN_NOT_IMPLEMENTED;
|
||||
result_code= HA_ADMIN_NOT_BASE_TABLE;
|
||||
goto send_result;
|
||||
}
|
||||
thd->open_options&= ~extra_open_options;
|
||||
@ -2473,6 +2481,16 @@ send_result_message:
|
||||
}
|
||||
break;
|
||||
|
||||
case HA_ADMIN_NOT_BASE_TABLE:
|
||||
{
|
||||
char buf[ERRMSGSIZE+20];
|
||||
uint length= my_snprintf(buf, ERRMSGSIZE,
|
||||
ER(ER_BAD_TABLE_ERROR), table_name);
|
||||
protocol->store("note", 4, system_charset_info);
|
||||
protocol->store(buf, length, system_charset_info);
|
||||
}
|
||||
break;
|
||||
|
||||
case HA_ADMIN_OK:
|
||||
protocol->store("status", 6, system_charset_info);
|
||||
protocol->store("OK",2, system_charset_info);
|
||||
@ -2573,16 +2591,19 @@ send_result_message:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (fatal_error)
|
||||
table->table->s->version=0; // Force close of table
|
||||
else if (open_for_modify)
|
||||
if (table->table)
|
||||
{
|
||||
pthread_mutex_lock(&LOCK_open);
|
||||
remove_table_from_cache(thd, table->table->s->db,
|
||||
table->table->s->table_name, RTFC_NO_FLAG);
|
||||
pthread_mutex_unlock(&LOCK_open);
|
||||
/* May be something modified consequently we have to invalidate cache */
|
||||
query_cache_invalidate3(thd, table->table, 0);
|
||||
if (fatal_error)
|
||||
table->table->s->version=0; // Force close of table
|
||||
else if (open_for_modify)
|
||||
{
|
||||
pthread_mutex_lock(&LOCK_open);
|
||||
remove_table_from_cache(thd, table->table->s->db,
|
||||
table->table->s->table_name, RTFC_NO_FLAG);
|
||||
pthread_mutex_unlock(&LOCK_open);
|
||||
/* Something may be modified, that's why we have to invalidate cache */
|
||||
query_cache_invalidate3(thd, table->table, 0);
|
||||
}
|
||||
}
|
||||
close_thread_tables(thd);
|
||||
table->table=0; // For query cache
|
||||
|
Reference in New Issue
Block a user