summaryrefslogtreecommitdiff
path: root/sql/item_create.cc
diff options
context:
space:
mode:
authorAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-03-18 13:38:29 +0300
committerAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-03-18 13:38:29 +0300
commitaef97cadfaf1ea9947fd9f5dbedae6842412ddef (patch)
treeb9789210c6251e842ccc7cee877d0f3ffa2b0887 /sql/item_create.cc
parent7c10a8981ce3f5eff59e0f3a73e4f0ad176f8c90 (diff)
downloadmariadb-git-aef97cadfaf1ea9947fd9f5dbedae6842412ddef.tar.gz
Bug #8433: Overflow must be an error
All numeric operators and functions on integer, floating point and DECIMAL values now throw an 'out of range' error rather than returning an incorrect value or NULL, when the result is out of supported range for the corresponding data type. Some test cases in the test suite had to be updated accordingly either because the test case itself relied on a value returned in case of a numeric overflow, or because a numeric overflow was the root cause of the corresponding bugs. The latter tests are no longer relevant, since the expressions used to trigger the corresponding bugs are not valid anymore. However, such test cases have been adjusted and kept "for the record".
Diffstat (limited to 'sql/item_create.cc')
-rw-r--r--sql/item_create.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/sql/item_create.cc b/sql/item_create.cc
index a393c886483..5277e2c7b1d 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -2946,9 +2946,7 @@ Create_func_cot Create_func_cot::s_singleton;
Item*
Create_func_cot::create(THD *thd, Item *arg1)
{
- Item *i1= new (thd->mem_root) Item_int((char*) "1", 1, 1);
- Item *i2= new (thd->mem_root) Item_func_tan(arg1);
- return new (thd->mem_root) Item_func_div(i1, i2);
+ return new (thd->mem_root) Item_func_cot(arg1);
}