Changeset: e2c8c7512fb5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e2c8c7512fb5
Modified Files:
gdk/gdk_calc.c
gdk/gdk_calc_convert.c
gdk/gdk_calc_muldiv.c
gdk/gdk_calc_private.h
testing/sqllogictest.py
Branch: default
Log Message:
Merge with Jan2022 branch.
diffs (120 lines):
diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -754,3 +754,4 @@ 97e76b882f9fb28327393d21708fb22f2f6c22f1
f458e1c71c73d6bd9636369c1406eadb74f016bf Jan2022_9
f458e1c71c73d6bd9636369c1406eadb74f016bf Jan2022_SP1_release
00463fdd0d51d7ce058549a82bc74efaea6035a2 Jul2021_15
+00463fdd0d51d7ce058549a82bc74efaea6035a2 Jul2021_SP3_release
diff --git a/gdk/gdk_calc_convert.c b/gdk/gdk_calc_convert.c
--- a/gdk/gdk_calc_convert.c
+++ b/gdk/gdk_calc_convert.c
@@ -443,7 +443,7 @@ convert_##TYPE1##_##TYPE2(const TYPE1 *s
dst[i] = TYPE2##_nil; \
nils++; \
} else { \
- long double m = (long double) v * mul; \
+ ldouble m = (ldouble) v * mul; \
dst[i] = (TYPE2) rounddbl(m); \
if ((is_##TYPE2##_nil(dst[i]) || \
(precision && \
@@ -467,7 +467,7 @@ convert_##TYPE1##_##TYPE2(const TYPE1 *s
dst[i] = TYPE2##_nil; \
nils++; \
} else { \
- long double m = (long double) v * mul; \
+ ldouble m = (ldouble) v * mul; \
dst[i] = (TYPE2) rounddbl(m); \
if ((is_##TYPE2##_nil(dst[i]) || \
(precision && \
diff --git a/gdk/gdk_calc_muldiv.c b/gdk/gdk_calc_muldiv.c
--- a/gdk/gdk_calc_muldiv.c
+++ b/gdk/gdk_calc_muldiv.c
@@ -360,7 +360,7 @@ mul_##TYPE1##_##TYPE2##_##TYPE3(
\
dst[k] = TYPE3##_nil; \
nils++; \
} else { \
- long double m = lft[i] * (long double) rgt[j]; \
+ ldouble m = lft[i] * (ldouble) rgt[j]; \
dst[k] = (TYPE3) rounddbl(m); \
} \
} \
@@ -382,7 +382,7 @@ mul_##TYPE1##_##TYPE2##_##TYPE3(
\
dst[k] = TYPE3##_nil; \
nils++; \
} else { \
- long double m = lft[i] * (long double) rgt[j]; \
+ ldouble m = lft[i] * (ldouble) rgt[j]; \
dst[k] = (TYPE3) rounddbl(m); \
} \
} \
@@ -2674,7 +2674,7 @@ div_##TYPE1##_##TYPE2##_##TYPE3(
\
dst[k] = TYPE3##_nil; \
nils++; \
} else { \
- dst[k] = (TYPE3) rounddbl(lft[i] /
(long double) rgt[j]); \
+ dst[k] = (TYPE3) rounddbl(lft[i] /
(ldouble) rgt[j]); \
} \
} \
} \
@@ -2704,7 +2704,7 @@ div_##TYPE1##_##TYPE2##_##TYPE3(
\
dst[k] = TYPE3##_nil; \
nils++; \
} else { \
- dst[k] = (TYPE3) rounddbl(lft[i] /
(long double) rgt[j]); \
+ dst[k] = (TYPE3) rounddbl(lft[i] /
(ldouble) rgt[j]); \
} \
} \
} \
diff --git a/gdk/gdk_calc_private.h b/gdk/gdk_calc_private.h
--- a/gdk/gdk_calc_private.h
+++ b/gdk/gdk_calc_private.h
@@ -651,8 +651,23 @@ BUN dofsum(const void *restrict values,
} \
} while (0)
+#if defined(_MSC_VER) && defined(__INTEL_COMPILER)
+/* with Intel compiler on Windows, avoid using roundl and llroundl: they
+ * cause a mysterious crash; long double is the same size as double
+ * anyway */
+typedef double ldouble;
#ifdef TRUNCATE_NUMBERS
-#define rounddbl(x) (x)
+#define rounddbl(x) (x)
#else
-#define rounddbl(x) roundl(x)
+#define rounddbl(x) roundl(x)
+#define rounddbl(x) round(x)
#endif
+#else
+typedef long double ldouble;
+#ifdef TRUNCATE_NUMBERS
+#define rounddbl(x) (x)
+#else
+/* round long double to long long int in one go */
+#define rounddbl(x) llroundl(x)
+#endif
+#endif
diff --git a/testing/sqllogictest.py b/testing/sqllogictest.py
--- a/testing/sqllogictest.py
+++ b/testing/sqllogictest.py
@@ -742,6 +742,10 @@ if __name__ == '__main__':
help='port the server listens on')
parser.add_argument('--database', action='store', default='demo',
help='name of the database')
+ parser.add_argument('--user', action='store', default='monetdb',
+ help='user name to login to the database with')
+ parser.add_argument('--password', action='store', default='monetdb',
+ help='password to use to login to the database with')
parser.add_argument('--language', action='store', default='sql',
help='language to use for testing')
parser.add_argument('--nodrop', action='store_true',
@@ -761,7 +765,7 @@ if __name__ == '__main__':
args = opts.tests
sql = SQLLogic(report=opts.report)
sql.res = opts.results
- sql.connect(hostname=opts.host, port=opts.port, database=opts.database,
language=opts.language)
+ sql.connect(hostname=opts.host, port=opts.port, database=opts.database,
language=opts.language, username=opts.user, password=opts.password)
for test in args:
try:
if not opts.nodrop:
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]