summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorDavi Arnaut <Davi.Arnaut@Sun.COM>2009-01-08 16:28:30 -0200
committerDavi Arnaut <Davi.Arnaut@Sun.COM>2009-01-08 16:28:30 -0200
commit1a6452a208566af6bf30ce91e7154ff11ca485d3 (patch)
tree01c30ebdf16a0e588e215173022e17f464049ab7 /sql
parent7ba37134d247f6057302f6af9893df603d14afae (diff)
parent13bb89ed06fcee674a8bf18bc3839d997064f933 (diff)
downloadmariadb-git-1a6452a208566af6bf30ce91e7154ff11ca485d3.tar.gz
Auto-merge from upstream 5.1-bugteam
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_partition.cc6
-rw-r--r--sql/mysqld.cc2
-rw-r--r--sql/set_var.cc5
-rw-r--r--sql/sql_partition.cc4
4 files changed, 9 insertions, 8 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 9617b9941bc..0e36a868b3e 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -4815,7 +4815,7 @@ int ha_partition::info(uint flag)
/*
Calculates statistical variables
records: Estimate of number records in table
- We report sum (always at least 2)
+ We report sum (always at least 2 if not empty)
deleted: Estimate of number holes in the table due to
deletes
We report sum
@@ -4854,13 +4854,13 @@ int ha_partition::info(uint flag)
stats.check_time= file->stats.check_time;
}
} while (*(++file_array));
- if (stats.records < 2 &&
+ if (stats.records && stats.records < 2 &&
!(m_file[0]->ha_table_flags() & HA_STATS_RECORDS_IS_EXACT))
stats.records= 2;
if (stats.records > 0)
stats.mean_rec_length= (ulong) (stats.data_file_length / stats.records);
else
- stats.mean_rec_length= 1; //? What should we set here
+ stats.mean_rec_length= 0;
}
if (flag & HA_STATUS_CONST)
{
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 022dbdbe7e3..1e9d942b1dd 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -230,7 +230,7 @@ extern "C" sig_handler handle_segfault(int sig);
#if defined(__linux__)
#define ENABLE_TEMP_POOL 1
#else
-#define ENABLE_TEMP_TOOL 0
+#define ENABLE_TEMP_POOL 0
#endif
/* Constants */
diff --git a/sql/set_var.cc b/sql/set_var.cc
index c8b3f068b30..07e1528d483 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -1527,14 +1527,14 @@ bool sys_var_thd_ulong::update(THD *thd, set_var *var)
ulonglong tmp= var->save_result.ulonglong_value;
/* Don't use bigger value than given with --maximum-variable-name=.. */
- if ((ulong) tmp > max_system_variables.*offset)
+ if (tmp > max_system_variables.*offset)
{
throw_bounds_warning(thd, TRUE, TRUE, name, (longlong) tmp);
tmp= max_system_variables.*offset;
}
if (option_limits)
- tmp= (ulong) fix_unsigned(thd, tmp, option_limits);
+ tmp= fix_unsigned(thd, tmp, option_limits);
#if SIZEOF_LONG < SIZEOF_LONG_LONG
else if (tmp > ULONG_MAX)
{
@@ -1543,6 +1543,7 @@ bool sys_var_thd_ulong::update(THD *thd, set_var *var)
}
#endif
+ DBUG_ASSERT(tmp <= ULONG_MAX);
if (var->type == OPT_GLOBAL)
global_system_variables.*offset= (ulong) tmp;
else
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index e96d9c11a84..ad24aa3c283 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -6760,7 +6760,7 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info,
store_key_image_to_rec(field, max_value, field_len);
bool include_endp= !test(flags & NEAR_MAX);
part_iter->part_nums.end= get_endpoint(part_info, 0, include_endp);
- if (part_iter->part_nums.start == part_iter->part_nums.end &&
+ if (part_iter->part_nums.start >= part_iter->part_nums.end &&
!part_iter->ret_null_part)
return 0; /* No partitions */
}
@@ -6938,7 +6938,7 @@ int get_part_iter_for_interval_via_walking(partition_info *part_info,
uint32 get_next_partition_id_range(PARTITION_ITERATOR* part_iter)
{
- if (part_iter->part_nums.cur == part_iter->part_nums.end)
+ if (part_iter->part_nums.cur >= part_iter->part_nums.end)
{
part_iter->part_nums.cur= part_iter->part_nums.start;
return NOT_A_PARTITION_ID;