summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authormonty@donna.mysql.com <>2001-02-03 18:00:29 +0200
committermonty@donna.mysql.com <>2001-02-03 18:00:29 +0200
commit728b63e0de8b992e29b00cc100e183e6f9011643 (patch)
treeb01406ccbcbde61bdde5e643977c7f0fa76dc098 /sql/sql_select.cc
parentcffc2849f945a8c2e5e775a270d6f35c572ed443 (diff)
downloadmariadb-git-728b63e0de8b992e29b00cc100e183e6f9011643.tar.gz
Workaround for bug in thread library in Unixware 7
Fixed bug in GROUP BY on ELT() Added SEQUENCE() to UDF examples
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc17
1 files changed, 7 insertions, 10 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index a3288540562..539433f5208 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -3288,7 +3288,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
KEY_PART_INFO *key_part_info;
Item_result_field **copy_func;
MI_COLUMNDEF *recinfo;
- uint temp_pool_slot;
+ uint temp_pool_slot=MY_BIT_NONE;
DBUG_ENTER("create_tmp_table");
DBUG_PRINT("enter",("distinct: %d save_sum_fields: %d allow_distinct_limit: %d group: %d",
@@ -3297,18 +3297,15 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
statistic_increment(created_tmp_tables, &LOCK_status);
- if(use_temp_pool) {
+ if (use_temp_pool)
temp_pool_slot = bitmap_set_next(temp_pool, TEMP_POOL_SIZE);
- if(temp_pool_slot != MY_BIT_NONE) // we got a slot
- sprintf(path, "%s%s_%lx_%i", mysql_tmpdir, tmp_file_prefix,
- current_pid, temp_pool_slot);
- else // if we run out of slots in the pool, fall back to old behavior
- sprintf(path,"%s%s%lx_%lx_%x",mysql_tmpdir,tmp_file_prefix,current_pid,
- thd->thread_id, thd->tmp_table++);
- } else {
+
+ if (temp_pool_slot != MY_BIT_NONE) // we got a slot
+ sprintf(path, "%s%s_%lx_%i", mysql_tmpdir, tmp_file_prefix,
+ current_pid, temp_pool_slot);
+ else // if we run out of slots or we are not using tempool
sprintf(path,"%s%s%lx_%lx_%x",mysql_tmpdir,tmp_file_prefix,current_pid,
thd->thread_id, thd->tmp_table++);
- };
if (group)
{