Changeset: a338f3b9fafd for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a338f3b9fafd Modified Files: monetdb5/modules/atoms/uuid.c sql/backends/monet5/sql_cast.c Branch: default Log Message:
Improving BAT properties propagation diffs (101 lines): diff --git a/monetdb5/modules/atoms/uuid.c b/monetdb5/modules/atoms/uuid.c --- a/monetdb5/modules/atoms/uuid.c +++ b/monetdb5/modules/atoms/uuid.c @@ -316,8 +316,8 @@ bailout: dst->tnil = nils; dst->tnonil = !nils; dst->tkey = b->tkey; - dst->tsorted = b->tsorted; - dst->trevsorted = b->trevsorted; + dst->tsorted = BATcount(dst) <= 1; + dst->trevsorted = BATcount(dst) <= 1; BBPkeepref(*res = dst->batCacheid); } else if (dst) BBPreclaim(dst); @@ -406,8 +406,8 @@ bailout: dst->tnil = nils; dst->tnonil = !nils; dst->tkey = b->tkey; - dst->tsorted = b->tsorted; - dst->trevsorted = b->trevsorted; + dst->tsorted = BATcount(dst) <= 1; + dst->trevsorted = BATcount(dst) <= 1; BBPkeepref(*res = dst->batCacheid); } else if (dst) BBPreclaim(dst); diff --git a/sql/backends/monet5/sql_cast.c b/sql/backends/monet5/sql_cast.c --- a/sql/backends/monet5/sql_cast.c +++ b/sql/backends/monet5/sql_cast.c @@ -78,7 +78,7 @@ batstr_2_blob(bat *res, const bat *bid, msg = createException(SQL, "batcalc.str_2_blob", SQLSTATE(HY013) MAL_MALLOC_FAIL); goto bailout; } - nils |= ATOMcmp(TYPE_blob, r, ATOMnilptr(TYPE_blob)) == 0; + nils |= strNil(v); } } else { for (BUN i = 0; i < q; i++) { @@ -91,26 +91,26 @@ batstr_2_blob(bat *res, const bat *bid, msg = createException(SQL, "batcalc.str_2_blob", SQLSTATE(HY013) MAL_MALLOC_FAIL); goto bailout; } - nils |= ATOMcmp(TYPE_blob, r, ATOMnilptr(TYPE_blob)) == 0; + nils |= strNil(v); } } bailout: GDKfree(r); - if (b) - BBPunfix(b->batCacheid); - if (s) - BBPunfix(s->batCacheid); if (dst && !msg) { BATsetcount(dst, q); dst->tnil = nils; dst->tnonil = !nils; - dst->tkey = BATcount(dst) <= 1; + dst->tkey = b->tkey; dst->tsorted = BATcount(dst) <= 1; dst->trevsorted = BATcount(dst) <= 1; BBPkeepref(*res = dst->batCacheid); } else if (dst) BBPreclaim(dst); + if (b) + BBPunfix(b->batCacheid); + if (s) + BBPunfix(s->batCacheid); return msg; } @@ -330,20 +330,20 @@ SQLbatstr_cast(Client cntxt, MalBlkPtr m bailout: GDKfree(r); + if (dst && !msg) { + BATsetcount(dst, q); + dst->tnil = nils; + dst->tnonil = !nils; + dst->tkey = from_str ? b->tkey : BATcount(dst) <= 1; + dst->tsorted = from_str ? b->tsorted : BATcount(dst) <= 1; + dst->trevsorted = from_str ? b->trevsorted : BATcount(dst) <= 1; + BBPkeepref(*res = dst->batCacheid); + } else if (dst) + BBPreclaim(dst); if (b) BBPunfix(b->batCacheid); if (s) BBPunfix(s->batCacheid); - if (dst && !msg) { - BATsetcount(dst, q); - dst->tnil = nils; - dst->tnonil = !nils; - dst->tkey = BATcount(dst) <= 1; - dst->tsorted = BATcount(dst) <= 1; - dst->trevsorted = BATcount(dst) <= 1; - BBPkeepref(*res = dst->batCacheid); - } else if (dst) - BBPreclaim(dst); return msg; } _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list