Changeset: ae5373c36d02 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ae5373c36d02 Modified Files: MonetDB.spec configure.ag sql/server/sql_atom.c sql/server/sql_parser.y Branch: transaction-replication Log Message:
Merge with default branch diffs (157 lines): diff --git a/MonetDB.spec b/MonetDB.spec --- a/MonetDB.spec +++ b/MonetDB.spec @@ -562,9 +562,9 @@ used from the MAL level. Summary: MonetDB5 SQL server modules Group: Applications/Databases Requires: MonetDB5-server = %{version}-%{release} -%if %{?rhel:0}%{!?rhel:1} -# for systemd-tmpfiles -Requires: systemd-units +%if %{?rhel:0}%{!?rhel:1} || 0%{?rhel} >= 7 +# RHEL >= 7, and all current Fedora +Requires: %{_bindir}/systemd-tmpfiles %endif Obsoletes: MonetDB-SQL-devel Obsoletes: %{name}-SQL @@ -578,7 +578,7 @@ accelerators. It also has an SQL fronte This package contains the SQL frontend for MonetDB. If you want to use SQL with MonetDB, you will need to install this package. -%if %{?rhel:0}%{!?rhel:1} +%if %{?rhel:0}%{!?rhel:1} || 0%{?rhel} >= 7 %post SQL-server5 systemd-tmpfiles --create %{_sysconfdir}/tmpfiles.d/monetdbd.conf %endif @@ -588,11 +588,11 @@ systemd-tmpfiles --create %{_sysconfdir} %{_bindir}/monetdb %{_bindir}/monetdbd %dir %attr(775,monetdb,monetdb) %{_localstatedir}/log/monetdb -%if %{?rhel:0}%{!?rhel:1} -# Fedora 15 and newer +%if %{?rhel:0}%{!?rhel:1} || 0%{?rhel} >= 7 +# RHEL >= 7, and all current Fedora %{_sysconfdir}/tmpfiles.d/monetdbd.conf %else -# RedHat Enterprise Linux +# RedHat Enterprise Linux < 7 %dir %attr(775,monetdb,monetdb) %{_localstatedir}/run/monetdb %exclude %{_sysconfdir}/tmpfiles.d/monetdbd.conf %endif diff --git a/configure.ag b/configure.ag --- a/configure.ag +++ b/configure.ag @@ -477,7 +477,7 @@ case "$host_os" in if test -s /etc/os-release; then # this is the new way of getting release information # works for Fedora >= 17, Ubuntu >= 12.04 (Precise Pangolin) - LINUX_DIST=`source /etc/os-release; echo ${NAME}:${VERSION_ID}` + LINUX_DIST=`source /etc/os-release; echo ${ID}:${VERSION_ID}` elif test -s /etc/fedora-release ; then LINUX_DIST="`cat /etc/fedora-release | head -n1 \ | sed 's|^.*\(Fedora\).* release \([[0-9]][[^ \n]]*\)\( .*\)*$|\1:\2|'`" diff --git a/sql/server/sql_atom.c b/sql/server/sql_atom.c --- a/sql/server/sql_atom.c +++ b/sql/server/sql_atom.c @@ -657,21 +657,24 @@ atom_cast(atom *a, sql_subtype *tp) else a->data.val.lval *= mul; } else if (a->data.vtype == TYPE_int) { - assert(div || ((lng) GDK_int_min <= (lng) a->data.val.ival * mul && (lng) a->data.val.ival * mul <= (lng) GDK_int_max)); + if (!div && ((lng) GDK_int_min > (lng) a->data.val.ival * mul || (lng) a->data.val.ival * mul > (lng) GDK_int_max)) + return 0; a->data.val.ival += (int)rnd; if (div) a->data.val.ival /= (int) mul; else a->data.val.ival *= (int) mul; } else if (a->data.vtype == TYPE_sht) { - assert(div || ((lng) GDK_sht_min <= (lng) a->data.val.shval * mul && (lng) a->data.val.shval * mul <= (lng) GDK_sht_max)); + if (!div && ((lng) GDK_sht_min > (lng) a->data.val.shval * mul || (lng) a->data.val.shval * mul > (lng) GDK_sht_max)) + return 0; a->data.val.shval += (sht)rnd; if (div) a->data.val.shval /= (sht) mul; else a->data.val.shval *= (sht) mul; } else if (a->data.vtype == TYPE_bte) { - assert(div || ((lng) GDK_bte_min <= (lng) a->data.val.btval * mul && (lng) a->data.val.btval * mul <= (lng) GDK_bte_max)); + if (!div && ((lng) GDK_bte_min > (lng) a->data.val.btval * mul || (lng) a->data.val.btval * mul > (lng) GDK_bte_max)) + return 0; a->data.val.btval += (bte)rnd; if (div) a->data.val.btval /= (bte) mul; @@ -711,13 +714,16 @@ atom_cast(atom *a, sql_subtype *tp) if (a->data.vtype == TYPE_lng) { a->data.val.lval = (int) val; } else if (a->data.vtype == TYPE_int) { - assert( ((lng) GDK_int_min <= val && val <= (lng) GDK_int_max)); + if ( ((lng) GDK_int_min > val || val > (lng) GDK_int_max)) + return 0; a->data.val.ival = (int) val; } else if (a->data.vtype == TYPE_sht) { - assert( ((lng) GDK_sht_min <= val && val <= (lng) GDK_sht_max)); + if ( ((lng) GDK_sht_min > val || val > (lng) GDK_sht_max)) + return 0; a->data.val.shval = (int) val; } else if (a->data.vtype == TYPE_bte) { - assert( ((lng) GDK_bte_min <= val && val <= (lng) GDK_bte_max)); + if ( ((lng) GDK_bte_min > val || val > (lng) GDK_bte_max)) + return 0; a->data.val.btval = (int) val; } return 1; @@ -779,15 +785,18 @@ atom_cast(atom *a, sql_subtype *tp) if (a->data.vtype == TYPE_lng) a->data.val.lval *= mul; else if (a->data.vtype == TYPE_int) { - assert((lng) GDK_int_min <= (lng) a->data.val.ival * mul && (lng) a->data.val.ival * mul <= (lng) GDK_int_max); + if ((lng) GDK_int_min > (lng) a->data.val.ival * mul || (lng) a->data.val.ival * mul > (lng) GDK_int_max) + return 0; a->data.val.ival *= (int) mul; } else if (a->data.vtype == TYPE_sht) { - assert((lng) GDK_sht_min <= (lng) a->data.val.shval * mul && (lng) a->data.val.shval * mul <= (lng) GDK_sht_max); + if ((lng) GDK_sht_min > (lng) a->data.val.shval * mul || (lng) a->data.val.shval * mul > (lng) GDK_sht_max) + return 0; a->data.val.shval *= (sht) mul; } else if (a->data.vtype == TYPE_bte) { - assert((lng) GDK_bte_min <= (lng) a->data.val.btval * mul && (lng) a->data.val.btval * mul <= (lng) GDK_bte_max); + if ((lng) GDK_bte_min > (lng) a->data.val.btval * mul || (lng) a->data.val.btval * mul > (lng) GDK_bte_max) + return 0; a->data.val.btval *= (bte) mul; } return 1; @@ -827,7 +836,8 @@ atom_cast(atom *a, sql_subtype *tp) if (tp->type->localtype == TYPE_dbl) a->data.val.dval = a->d; else { - assert((dbl) GDK_flt_min <= a->d && a->d <= (dbl) GDK_flt_max); + if ((dbl) GDK_flt_min > a->d || a->d > (dbl) GDK_flt_max) + return 0; a->data.val.fval = (flt) a->d; } a->tpe = *tp; diff --git a/sql/server/sql_parser.y b/sql/server/sql_parser.y --- a/sql/server/sql_parser.y +++ b/sql/server/sql_parser.y @@ -4249,10 +4249,18 @@ literal: { sql_subtype t; sql_find_subtype(&t, "boolean", 0, 0 ); $$ = _newAtomNode( atom_bool(SA, &t, FALSE)); } + | NOT BOOL_FALSE + { sql_subtype t; + sql_find_subtype(&t, "boolean", 0, 0 ); + $$ = _newAtomNode( atom_bool(SA, &t, TRUE)); } | BOOL_TRUE { sql_subtype t; sql_find_subtype(&t, "boolean", 0, 0 ); $$ = _newAtomNode( atom_bool(SA, &t, TRUE)); } + | NOT BOOL_TRUE + { sql_subtype t; + sql_find_subtype(&t, "boolean", 0, 0 ); + $$ = _newAtomNode( atom_bool(SA, &t, FALSE)); } ; interval_expression: _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list