Changeset: 8f619c2ff336 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8f619c2ff336
Modified Files:
sql/common/sql_types.c
sql/test/BugTracker-2009/Tests/overflow.SF-2853458.stable.err
sql/test/BugTracker-2009/Tests/pow_operator.SF-2812721.stable.out
sql/test/BugTracker-2013/Tests/mitosis-floor.Bug-3330.stable.out
sql/test/bugs/Tests/floor-bug-sf-967066.stable.out
Branch: Jan2014
Log Message:
fixed bug 3521, ie use exp(double) (and other related math functions) when
the input type isn't a real (ie single precision floating point).
diffs (93 lines):
diff --git a/sql/common/sql_types.c b/sql/common/sql_types.c
--- a/sql/common/sql_types.c
+++ b/sql/common/sql_types.c
@@ -1441,11 +1441,7 @@ sqltypeinit( sql_allocator *sa)
sql_create_func(sa, "scale_up", "calc", "*", *u, *t,
*t, SCALE_NONE);
}
- /* initial assignment to t is on purpose like this, such that the
- * compiler (as of gcc-4.6) "sees" that we never go below the
- * initial pointer, and hence don't get a
- * error: array subscript is below array bounds */
- for (t = floats + (dates - floats - 1); t >= floats; t--) {
+ for (t = floats; t < dates; t++) {
sql_create_func(sa, "power", "mmath", "pow", *t, *t, *t,
SCALE_FIX);
sql_create_func(sa, "floor", "mmath", "floor", *t, NULL, *t,
SCALE_FIX);
sql_create_func(sa, "ceil", "mmath", "ceil", *t, NULL, *t,
SCALE_FIX);
diff --git a/sql/test/BugTracker-2009/Tests/overflow.SF-2853458.stable.err
b/sql/test/BugTracker-2009/Tests/overflow.SF-2853458.stable.err
--- a/sql/test/BugTracker-2009/Tests/overflow.SF-2853458.stable.err
+++ b/sql/test/BugTracker-2009/Tests/overflow.SF-2853458.stable.err
@@ -67,12 +67,12 @@ stderr of test 'overflow.SF-2853458` in
# 22:26:13 > mclient -lsql -umonetdb -Pmonetdb --host=alf --port=35561
# 22:26:13 >
-MAPI = (monetdb) /var/tmp/mtest-23209/.s.monetdb.33225
+MAPI = (monetdb) /var/tmp/mtest-9389/.s.monetdb.34946
QUERY = select cast(power(2,63) as bigint);
-ERROR = !overflow in conversion of 9.22337204e+18 to lng.
-MAPI = (monetdb) /var/tmp/mtest-23209/.s.monetdb.33225
+ERROR = !overflow in conversion of 9.2233720368547758e+18 to lng.
+MAPI = (monetdb) /var/tmp/mtest-9389/.s.monetdb.34946
QUERY = select cast(power(2,64) as bigint);
-ERROR = !overflow in conversion of 1.84467441e+19 to lng.
+ERROR = !overflow in conversion of 1.8446744073709552e+19 to lng.
# 22:26:13 >
# 22:26:13 > Done.
diff --git a/sql/test/BugTracker-2009/Tests/pow_operator.SF-2812721.stable.out
b/sql/test/BugTracker-2009/Tests/pow_operator.SF-2812721.stable.out
--- a/sql/test/BugTracker-2009/Tests/pow_operator.SF-2812721.stable.out
+++ b/sql/test/BugTracker-2009/Tests/pow_operator.SF-2812721.stable.out
@@ -27,17 +27,17 @@ Ready.
#select power(2,2);
% .L # table_name
% power_single_value # name
-% real # type
-% 15 # length
+% double # type
+% 24 # length
[ 4 ]
#select power(2.8,2);
% .L # table_name
% power_single_value # name
-% real # type
-% 15 # length
-[ 7.83999968 ]
+% double # type
+% 24 # length
+[ 7.84 ]
-# 09:09:06 >
-# 09:09:06 > "Done."
-# 09:09:06 >
+# 19:02:22 >
+# 19:02:22 > "Done."
+# 19:02:22 >
diff --git a/sql/test/BugTracker-2013/Tests/mitosis-floor.Bug-3330.stable.out
b/sql/test/BugTracker-2013/Tests/mitosis-floor.Bug-3330.stable.out
--- a/sql/test/BugTracker-2013/Tests/mitosis-floor.Bug-3330.stable.out
+++ b/sql/test/BugTracker-2013/Tests/mitosis-floor.Bug-3330.stable.out
@@ -51,8 +51,8 @@ Ready.
#;
% sys.image, sys.image, sys.image, sys.L1 # table_name
% tilex, tiley, intensity, count # name
-% real, real, int, wrd # type
-% 15, 15, 1, 1 # length
+% double, double, int, wrd # type
+% 24, 24, 1, 1 # length
[ 0, 0, 3, 1 ]
[ 0, 0, 6, 1 ]
#drop table error;
diff --git a/sql/test/bugs/Tests/floor-bug-sf-967066.stable.out
b/sql/test/bugs/Tests/floor-bug-sf-967066.stable.out
--- a/sql/test/bugs/Tests/floor-bug-sf-967066.stable.out
+++ b/sql/test/bugs/Tests/floor-bug-sf-967066.stable.out
@@ -27,8 +27,8 @@ Ready.
#select floor(3.5);
% .L # table_name
% floor_single_value # name
-% real # type
-% 15 # length
+% double # type
+% 24 # length
[ 3 ]
# 12:51:03 >
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list