1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Merge gleb.loc:/home/uchum/work/bk/5.0-opt-30287

into  gleb.loc:/home/uchum/work/bk/5.1-opt
This commit is contained in:
gshchepa/uchum@gleb.loc
2007-08-21 19:46:29 +05:00
3 changed files with 16 additions and 10 deletions

View File

@ -9404,7 +9404,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
bool using_unique_constraint= 0;
bool use_packed_rows= 0;
bool not_all_columns= !(select_options & TMP_TABLE_ALL_COLUMNS);
char *tmpname, *tmppath, path[FN_REFLEN], table_name[NAME_LEN+1];
char *tmpname,path[FN_REFLEN];
uchar *pos, *group_buff, *bitmaps;
uchar *null_flags;
Field **reg_field, **from_field, **default_field;
@ -9428,12 +9428,12 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
temp_pool_slot = bitmap_lock_set_next(&temp_pool);
if (temp_pool_slot != MY_BIT_NONE) // we got a slot
sprintf(table_name, "%s_%lx_%i", tmp_file_prefix,
sprintf(path, "%s_%lx_%i", tmp_file_prefix,
current_pid, temp_pool_slot);
else
{
/* if we run out of slots or we are not using tempool */
sprintf(table_name, "%s%lx_%lx_%x", tmp_file_prefix,current_pid,
sprintf(path,"%s%lx_%lx_%x", tmp_file_prefix,current_pid,
thd->thread_id, thd->tmp_table++);
}
@ -9441,8 +9441,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
No need to change table name to lower case as we are only creating
MyISAM or HEAP tables here
*/
fn_format(path, table_name, mysql_tmpdir, "",
MY_REPLACE_EXT|MY_UNPACK_FILENAME);
fn_format(path, path, mysql_tmpdir, "", MY_REPLACE_EXT|MY_UNPACK_FILENAME);
if (group)
{
@ -9488,8 +9488,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
sizeof(*key_part_info)*(param->group_parts+1),
&param->start_recinfo,
sizeof(*param->recinfo)*(field_count*2+4),
&tmppath, (uint) strlen(path)+1,
&tmpname, (uint) strlen(table_name)+1,
&tmpname, (uint) strlen(path)+1,
&group_buff, (group && ! using_unique_constraint ?
param->group_length : 0),
&bitmaps, bitmap_buffer_size(field_count)*2,
@ -9508,8 +9507,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
DBUG_RETURN(NULL); /* purecov: inspected */
}
param->items_to_copy= copy_func;
strmov(tmppath, path);
strmov(tmpname, table_name);
strmov(tmpname,path);
/* make table according to fields */
bzero((char*) table,sizeof(*table));
@ -9534,7 +9532,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
table->keys_in_use_for_query.init();
table->s= share;
init_tmp_table_share(share, "", 0, tmpname, tmppath);
init_tmp_table_share(share, "", 0, tmpname, tmpname);
share->blob_field= blob_field;
share->blob_ptr_size= mi_portable_sizeof_char_ptr;
share->db_low_byte_first=1; // True for HEAP and MyISAM