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

Merge polly.local:/home/kaa/src/maint/bug28895/my50-bug28895

into  polly.local:/home/kaa/src/maint/mysql-5.0-maint
This commit is contained in:
kaa@polly.local
2007-06-12 11:42:39 +04:00
5 changed files with 28 additions and 8 deletions

View File

@ -9164,7 +9164,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,path[FN_REFLEN];
char *tmpname, *tmppath, path[FN_REFLEN], table_name[NAME_LEN+1];
byte *pos,*group_buff;
uchar *null_flags;
Field **reg_field, **from_field, **default_field;
@ -9187,12 +9187,12 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
temp_pool_slot = bitmap_set_next(&temp_pool);
if (temp_pool_slot != MY_BIT_NONE) // we got a slot
sprintf(path, "%s_%lx_%i", tmp_file_prefix,
current_pid, temp_pool_slot);
sprintf(table_name, "%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(path,"%s%lx_%lx_%x", tmp_file_prefix,current_pid,
sprintf(table_name, "%s%lx_%lx_%x", tmp_file_prefix,current_pid,
thd->thread_id, thd->tmp_table++);
}
@ -9200,7 +9200,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, path, mysql_tmpdir, "", MY_REPLACE_EXT|MY_UNPACK_FILENAME);
fn_format(path, table_name, mysql_tmpdir, "",
MY_REPLACE_EXT|MY_UNPACK_FILENAME);
if (group)
{
@ -9245,7 +9246,8 @@ 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),
&tmpname, (uint) strlen(path)+1,
&tmppath, (uint) strlen(path)+1,
&tmpname, (uint) strlen(table_name)+1,
&group_buff, group && ! using_unique_constraint ?
param->group_length : 0,
NullS))
@ -9263,7 +9265,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
DBUG_RETURN(NULL); /* purecov: inspected */
}
param->items_to_copy= copy_func;
strmov(tmpname,path);
strmov(tmppath, path);
strmov(tmpname, table_name);
/* make table according to fields */
bzero((char*) table,sizeof(*table));
@ -9289,7 +9292,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
table->s= &table->share_not_to_be_used;
table->s->blob_field= blob_field;
table->s->table_name= table->s->path= tmpname;
table->s->table_name= tmpname;
table->s->path= tmppath;
table->s->db= "";
table->s->blob_ptr_size= mi_portable_sizeof_char_ptr;
table->s->tmp_table= NON_TRANSACTIONAL_TMP_TABLE;