Changeset: 36ed903cd21c for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/36ed903cd21c Modified Files: clients/Tests/exports.stable.out Branch: persistent_sketches Log Message:
merged with default diffs (truncated from 1927 to 300 lines): diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,28 @@ # ChangeLog file for devel # This file is updated with Maddlog +* Wed Nov 18 2026 Martin van Dinther <[email protected]> +- Queries to a proto_loader('odbc:...') function with a limit-clause + will now push the limit value down to the ODBC driver via ODBC call + SQLSetStmtAttr(stmt, SQL_ATTR_MAX_ROWS, limit, 0). This reduces + the amount of rows retrieved from the connected ODBC Data Source. Example: + SELECT * FROM proto_loader('odbc:DRIVER=/usr/lib64/libsqlite3odbc.so; + Database=/home/user1/sqlite_dbs/chinook.db; + QUERY=SELECT * FROM tracks') LIMIT 10; + Note: this limit push down is only possible when there are no other + clauses between the FROM-clause and the LIMIT-OFFSET-clause or + OFFSET-FETCHFIRST-clause. If you need extra clauses specify + them in the QUERY= part of the string literal, example: + SELECT * FROM proto_loader('odbc:DRIVER=/usr/lib64/libsqlite3odbc.so; + Database=/home/user1/sqlite_dbs/chinook.db; + QUERY=SELECT * FROM tracks WHERE Name LIKE ''%Love%'' ORDER BY Name') + LIMIT 10; + +* Wed Nov 18 2026 Ying Zhang <[email protected]> +- Added support for tuple matching at projections, so now one can run + queries like 'SELECT (1, 2) IN (SELECT 1, 2)' and 'SELECT (1, 2) NOT IN + (SELECT 1, 2)' + * Thu Oct 22 2026 Martin van Dinther <[email protected]> - Added support for reading DNA sequence alignment data from *.sam and *.bam files. Usage examples: diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out --- a/clients/Tests/exports.stable.out +++ b/clients/Tests/exports.stable.out @@ -1619,7 +1619,7 @@ int pl_register(const char *name, pl_add void pl_unregister(const char *name); void pp_cleanup(backend *ba, int var); void pqc_close(pqc_file *pq); -pqc_file *pqc_copy(pqc_file *pq); +pqc_file *pqc_copy(pqc_file *pq, int wid); pqc_file *pqc_dup(pqc_file *pq); const char *pqc_get_error(pqc_reader_t *r); int pqc_get_field(char *in, int *fieldid, int *type); diff --git a/common/stream/rw.c b/common/stream/rw.c --- a/common/stream/rw.c +++ b/common/stream/rw.c @@ -11,6 +11,7 @@ #include "monetdb_config.h" #include "stream.h" #include "stream_internal.h" +#include "mswap.h" @@ -55,7 +56,7 @@ mnstr_readSht(stream *restrict s, int16_ switch (s->read(s, val, sizeof(*val), 1)) { case 1: if (s->swapbytes) - *val = short_int_SWAP(*val); + *val = (int16_t) swap_int16((uint16_t) *val); return 1; case 0: return 0; @@ -71,7 +72,7 @@ mnstr_writeSht(stream *s, int16_t val) return 0; assert(s->binary); if (s->swapbytes) - val = short_int_SWAP(val); + val = (int16_t) swap_int16((uint16_t) val); return s->write(s, &val, sizeof(val), 1) == 1; } @@ -84,7 +85,7 @@ mnstr_readInt(stream *restrict s, int *r switch (s->read(s, val, sizeof(*val), 1)) { case 1: if (s->swapbytes) - *val = normal_int_SWAP(*val); + *val = (int32_t) swap_int32((uint32_t) *val); return 1; case 0: return 0; @@ -100,7 +101,7 @@ mnstr_writeInt(stream *s, int val) return 0; assert(s->binary); if (s->swapbytes) - val = normal_int_SWAP(val); + val = (int32_t) swap_int32((uint32_t) val); return s->write(s, &val, sizeof(val), 1) == 1; } @@ -136,7 +137,7 @@ mnstr_readLng(stream *restrict s, int64_ switch (s->read(s, val, sizeof(*val), 1)) { case 1: if (s->swapbytes) - *val = long_int_SWAP(*val); + *val = (int64_t) swap_int64((uint64_t) *val); return 1; case 0: return 0; @@ -152,7 +153,7 @@ mnstr_writeLng(stream *s, int64_t val) return 0; assert(s->binary); if (s->swapbytes) - val = long_int_SWAP(val); + val = (int64_t) swap_int64((uint64_t) val); return s->write(s, &val, sizeof(val), 1) == 1; } @@ -185,7 +186,7 @@ mnstr_readHge(stream *restrict s, int128 switch (s->read(s, val, sizeof(*val), 1)) { case 1: if (s->swapbytes) - *val = huge_int_SWAP(*val); + *val = (int128_t) swap_int128((uint128_t) *val); return 1; case 0: return 0; @@ -201,7 +202,7 @@ mnstr_writeHge(stream *s, int128_t val) return 0; assert(s->binary); if (s->swapbytes) - val = huge_int_SWAP(val); + val = (int128_t) swap_int128((uint128_t) val); return s->write(s, &val, sizeof(val), 1) == 1; } #endif @@ -242,7 +243,7 @@ mnstr_readShtArray(stream *restrict s, i } if (s->swapbytes) { for (size_t i = 0; i < cnt; i++, val++) - *val = short_int_SWAP(*val); + *val = (int16_t) swap_int16((uint16_t) *val); } return 1; } @@ -275,7 +276,7 @@ mnstr_readIntArray(stream *restrict s, i } if (s->swapbytes) { for (size_t i = 0; i < cnt; i++, val++) - *val = normal_int_SWAP(*val); + *val = (int32_t) swap_int32((uint32_t) *val); } return 1; } @@ -308,7 +309,7 @@ mnstr_readLngArray(stream *restrict s, i } if (s->swapbytes) { for (size_t i = 0; i < cnt; i++, val++) - *val = long_int_SWAP(*val); + *val = (int64_t) swap_int64((uint64_t) *val); } return 1; } @@ -342,7 +343,7 @@ mnstr_readHgeArray(stream *restrict s, i } if (s->swapbytes) { for (size_t i = 0; i < cnt; i++, val++) - *val = huge_int_SWAP(*val); + *val = (int128_t) swap_int128((uint128_t) *val); } return 1; } diff --git a/common/stream/stream_internal.h b/common/stream/stream_internal.h --- a/common/stream/stream_internal.h +++ b/common/stream/stream_internal.h @@ -90,55 +90,6 @@ #define UTF8BOM "\xEF\xBB\xBF" /* UTF-8 encoding of Unicode BOM */ #define UTF8BOMLENGTH 3 /* length of above */ -#ifdef _MSC_VER -/* use intrinsic functions on Windows */ -#define short_int_SWAP(s) ((int16_t) _byteswap_ushort((uint16_t) (s))) -/* on Windows, long is the same size as int */ -#define normal_int_SWAP(i) ((int) _byteswap_ulong((unsigned long) (i))) -#define long_int_SWAP(l) ((int64_t) _byteswap_uint64((unsigned __int64) (l))) -#else -#define short_int_SWAP(s) \ - ((int16_t) (((0x00ff & (uint16_t) (s)) << 8) | \ - ((0xff00 & (uint16_t) (s)) >> 8))) - -#define normal_int_SWAP(i) \ - ((int) (((((unsigned) 0xff << 0) & (unsigned) (i)) << 24) | \ - ((((unsigned) 0xff << 8) & (unsigned) (i)) << 8) | \ - ((((unsigned) 0xff << 16) & (unsigned) (i)) >> 8) | \ - ((((unsigned) 0xff << 24) & (unsigned) (i)) >> 24))) - -#define long_int_SWAP(l) \ - ((int64_t) (((((uint64_t) 0xff << 0) & (uint64_t) (l)) << 56) | \ - ((((uint64_t) 0xff << 8) & (uint64_t) (l)) << 40) | \ - ((((uint64_t) 0xff << 16) & (uint64_t) (l)) << 24) | \ - ((((uint64_t) 0xff << 24) & (uint64_t) (l)) << 8) | \ - ((((uint64_t) 0xff << 32) & (uint64_t) (l)) >> 8) | \ - ((((uint64_t) 0xff << 40) & (uint64_t) (l)) >> 24) | \ - ((((uint64_t) 0xff << 48) & (uint64_t) (l)) >> 40) | \ - ((((uint64_t) 0xff << 56) & (uint64_t) (l)) >> 56))) -#endif - -#ifdef HAVE_HGE -#define huge_int_SWAP(h) \ - ((int128_t) (((((uint128_t) 0xff << 0) & (uint128_t) (h)) << 120) | \ - ((((uint128_t) 0xff << 8) & (uint128_t) (h)) << 104) | \ - ((((uint128_t) 0xff << 16) & (uint128_t) (h)) << 88) | \ - ((((uint128_t) 0xff << 24) & (uint128_t) (h)) << 72) | \ - ((((uint128_t) 0xff << 32) & (uint128_t) (h)) << 56) | \ - ((((uint128_t) 0xff << 40) & (uint128_t) (h)) << 40) | \ - ((((uint128_t) 0xff << 48) & (uint128_t) (h)) << 24) | \ - ((((uint128_t) 0xff << 56) & (uint128_t) (h)) << 8) | \ - ((((uint128_t) 0xff << 64) & (uint128_t) (h)) >> 8) | \ - ((((uint128_t) 0xff << 72) & (uint128_t) (h)) >> 24) | \ - ((((uint128_t) 0xff << 80) & (uint128_t) (h)) >> 40) | \ - ((((uint128_t) 0xff << 88) & (uint128_t) (h)) >> 56) | \ - ((((uint128_t) 0xff << 96) & (uint128_t) (h)) >> 72) | \ - ((((uint128_t) 0xff << 104) & (uint128_t) (h)) >> 88) | \ - ((((uint128_t) 0xff << 112) & (uint128_t) (h)) >> 104) | \ - ((((uint128_t) 0xff << 120) & (uint128_t) (h)) >> 120))) -#endif - - struct stream { char *name; /* name of the stream */ struct stream *inner; /* if this stream is a wrapper around another one */ diff --git a/common/utils/CMakeLists.txt b/common/utils/CMakeLists.txt --- a/common/utils/CMakeLists.txt +++ b/common/utils/CMakeLists.txt @@ -22,6 +22,7 @@ target_sources(mutils mprompt.h msabaoth.c msabaoth.h mstring.c + mswap.h mutf8.c mutf8.h mutils.c mutils.h muuid.c muuid.h diff --git a/common/utils/copybinary_support.h b/common/utils/copybinary_support.h --- a/common/utils/copybinary_support.h +++ b/common/utils/copybinary_support.h @@ -13,6 +13,7 @@ #include <stdint.h> #include "copybinary.h" +#include "mswap.h" // According to Godbolt, these code sequences are recognized by // GCC at least back to 6.2 and Clang at least back to 6.0.0. @@ -25,87 +26,11 @@ // uint16_t swapped = copy_binary_byteswap16(value); -#ifdef _MSC_VER - -static inline uint16_t -copy_binary_byteswap16(uint16_t value) -{ - return _byteswap_ushort(value); -} - -static inline uint32_t -copy_binary_byteswap32(uint32_t value) -{ - return _byteswap_ulong(value); -} - -static inline uint64_t -copy_binary_byteswap64(uint64_t value) -{ - return _byteswap_uint64(value); -} - -#else - -static inline uint16_t -copy_binary_byteswap16(uint16_t value) -{ - return - ((value & (UINT16_C(0xFF) << 8)) >> 8) | - ((value & (UINT16_C(0xFF) << 0)) << 8) - ; -} - -static inline uint32_t -copy_binary_byteswap32(uint32_t value) -{ - return - ((value & (UINT32_C(0xFF) << 24)) >> 24) | - ((value & (UINT32_C(0xFF) << 16)) >> 8) | - ((value & (UINT32_C(0xFF) << 8)) << 8) | - ((value & (UINT32_C(0xFF) << 0)) << 24) - ; -} - -static inline uint64_t -copy_binary_byteswap64(uint64_t value) -{ - return - ((value & (UINT64_C(0xFF) << 56)) >> 56) | - ((value & (UINT64_C(0xFF) << 48)) >> 40) | - ((value & (UINT64_C(0xFF) << 40)) >> 24) | - ((value & (UINT64_C(0xFF) << 32)) >> 8) | - ((value & (UINT64_C(0xFF) << 24)) << 8) | - ((value & (UINT64_C(0xFF) << 16)) << 24) | _______________________________________________ checkin-list mailing list -- [email protected] To unsubscribe send an email to [email protected]
