summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorhf@eagle.intranet.mysql.r18.ru <>2006-01-21 18:50:06 +0400
committerhf@eagle.intranet.mysql.r18.ru <>2006-01-21 18:50:06 +0400
commit4f368f9f93246a319a55b5ee34744b5425fb8f59 (patch)
treeba57b634fbff540434a56e3ce0639c85ec0f82ea /sql
parentf2c3ed8e7b2ab119b6d8896c5187ec375a5e70d4 (diff)
parent02ce3d0cad5ef5cc6e77a1fdf628bf825b5f9157 (diff)
downloadmariadb-git-4f368f9f93246a319a55b5ee34744b5425fb8f59.tar.gz
Merging
Diffstat (limited to 'sql')
-rw-r--r--sql/item_func.cc13
-rw-r--r--sql/spatial.h2
2 files changed, 11 insertions, 4 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 428a796682c..2d595e5fdc8 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -429,12 +429,19 @@ my_decimal *Item_real_func::val_decimal(my_decimal *decimal_value)
void Item_func::fix_num_length_and_dec()
{
- decimals= 0;
+ uint fl_length= 0;
+ decimals=0;
for (uint i=0 ; i < arg_count ; i++)
{
- set_if_bigger(decimals, args[i]->decimals);
+ set_if_bigger(decimals,args[i]->decimals);
+ set_if_bigger(fl_length, args[i]->max_length);
+ }
+ max_length=float_length(decimals);
+ if (fl_length > max_length)
+ {
+ decimals= NOT_FIXED_DEC;
+ max_length= float_length(NOT_FIXED_DEC);
}
- max_length= float_length(decimals);
}
diff --git a/sql/spatial.h b/sql/spatial.h
index 4253689c078..527dc750bdc 100644
--- a/sql/spatial.h
+++ b/sql/spatial.h
@@ -142,7 +142,7 @@ struct MBR
bool inner_point(double x, double y) const
{
/* The following should be safe, even if we compare doubles */
- return (xmin<x) && (xmax>x) && (ymin<y) && (ymax>x);
+ return (xmin<x) && (xmax>x) && (ymin<y) && (ymax>y);
}
int overlaps(const MBR *mbr)