diff options
author | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2011-01-07 15:30:42 +0200 |
---|---|---|
committer | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2011-01-07 15:30:42 +0200 |
commit | 1ec2fccd6ddab49051cce92fdb1fc268cd41d3c6 (patch) | |
tree | 6ac405c960b55307209d659c4786e2e5f41de576 /sql/item_func.cc | |
parent | 95cc85dbf515991ea1b19307cacce5c4ba24f21d (diff) | |
parent | d2b0c83646292a85f4600ef6316167cd7571d471 (diff) | |
download | mariadb-git-1ec2fccd6ddab49051cce92fdb1fc268cd41d3c6.tar.gz |
automerge
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r-- | sql/item_func.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc index 1f354009f72..bffbd03e15a 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1,4 +1,4 @@ -/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc. +/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1329,9 +1329,14 @@ void Item_func_div::fix_length_and_dec() { decimals=max(args[0]->decimals,args[1]->decimals)+prec_increment; set_if_smaller(decimals, NOT_FIXED_DEC); - max_length=args[0]->max_length - args[0]->decimals + decimals; uint tmp=float_length(decimals); - set_if_smaller(max_length,tmp); + if (decimals == NOT_FIXED_DEC) + max_length= tmp; + else + { + max_length=args[0]->max_length - args[0]->decimals + decimals; + set_if_smaller(max_length,tmp); + } break; } case INT_RESULT: |