Changeset: a7c5608cc0d5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/a7c5608cc0d5
Added Files:
        sql/test/BugTracker-2026/Tests/8062-groupby-inet6.test
Modified Files:
        monetdb5/modules/mal/pp_algebra.c
        sql/test/BugTracker-2026/Tests/All
Branch: default
Log Message:

add missing implementations for inet6, fixing issue # 8062


diffs (102 lines):

diff --git a/monetdb5/modules/mal/pp_algebra.c 
b/monetdb5/modules/mal/pp_algebra.c
--- a/monetdb5/modules/mal/pp_algebra.c
+++ b/monetdb5/modules/mal/pp_algebra.c
@@ -30,8 +30,12 @@
 #define inet4_min(a,b) ((cmp((void*)&a, (void*)&b) < 0) ? a : b)
 #define inet4_max(a,b) ((cmp((void*)&a, (void*)&b) > 0) ? a : b)
 
+#define inet6_min(a,b) ((cmp((void*)&a, (void*)&b) < 0) ? a : b)
+#define inet6_max(a,b) ((cmp((void*)&a, (void*)&b) > 0) ? a : b)
+
 #define getArgReference_date(stk, pci, nr) (date*)getArgReference(stk, pci, nr)
 #define getArgReference_inet4(stk, pci, nr) (inet4*)getArgReference(stk, pci, 
nr)
+#define getArgReference_inet6(stk, pci, nr) (inet6*)getArgReference(stk, pci, 
nr)
 #define getArgReference_daytime(stk, pci, nr) (daytime*)getArgReference(stk, 
pci, nr)
 #define getArgReference_timestamp(stk, pci, nr) 
(timestamp*)getArgReference(stk, pci, nr)
 
@@ -774,7 +778,7 @@ LOCKEDAGGRmin(Client cntxt, MalBlkPtr mb
                type != TYPE_lng && type != TYPE_int && type != TYPE_sht && 
type != TYPE_bte && type != TYPE_bit &&
                type != TYPE_flt && type != TYPE_dbl && type != TYPE_oid &&
                type != TYPE_date && type != TYPE_daytime && type != 
TYPE_timestamp && type != TYPE_uuid && type != TYPE_str &&
-               type != TYPE_inet4)
+               type != TYPE_inet4 && type != TYPE_inet6)
                return createException(SQL, "lockedaggr.min", "Wrong input type 
(%d)", type);
 
        pipeline_lock(p);
@@ -785,6 +789,7 @@ LOCKEDAGGRmin(Client cntxt, MalBlkPtr mb
                if (!err) {
                        aggr(date,min);
                        faggr(inet4,inet4_min);
+                       faggr(inet6,inet6_min);
                        aggr(daytime,min);
                        aggr(timestamp,min);
                        faggr(uuid,uuid_min);
@@ -836,7 +841,7 @@ LOCKEDAGGRmax(Client cntxt, MalBlkPtr mb
                type != TYPE_lng && type != TYPE_int && type != TYPE_sht && 
type != TYPE_bte && type != TYPE_bit &&
                type != TYPE_flt && type != TYPE_dbl && type != TYPE_oid &&
                type != TYPE_date && type != TYPE_daytime && type != 
TYPE_timestamp && type != TYPE_uuid && type != TYPE_str &&
-               type != TYPE_inet4)
+               type != TYPE_inet4 && type != TYPE_inet6)
                return createException(SQL, "lockedaggr.max", "Wrong input type 
(%d)", type);
 
        pipeline_lock(p);
@@ -847,6 +852,7 @@ LOCKEDAGGRmax(Client cntxt, MalBlkPtr mb
                if (!err) {
                        aggr(date,max);
                        faggr(inet4,inet4_max);
+                       faggr(inet6,inet6_max);
                        aggr(daytime,max);
                        aggr(timestamp,max);
                        faggr(uuid,uuid_max);
@@ -2705,6 +2711,7 @@ LALGcount(Client ctx, bat *rid, bat *gid
                gcount(int);
                gcount(date);
                gfcount(inet4);
+               gfcount(inet6);
                gcount(lng);
                gcount(oid);
                gcount(daytime);
@@ -3947,6 +3954,7 @@ LALGmin(Client ctx, bat *rid, bat *gid, 
        gfunc(int,min);
        gfunc(date,min);
        gfunc2(inet4,inet4_min);
+       gfunc2(inet6,inet6_min);
        gfunc(lng,min);
        gfunc(daytime,min);
        gfunc(timestamp,min);
@@ -4104,6 +4112,7 @@ LALGmax(Client ctx, bat *rid, bat *gid, 
        gfunc(int,max);
        gfunc(date,max);
        gfunc2(inet4,inet4_max);
+       gfunc2(inet6,inet6_max);
        gfunc(lng,max);
        gfunc(daytime,max);
        gfunc(timestamp,max);
diff --git a/sql/test/BugTracker-2026/Tests/8062-groupby-inet6.test 
b/sql/test/BugTracker-2026/Tests/8062-groupby-inet6.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2026/Tests/8062-groupby-inet6.test
@@ -0,0 +1,15 @@
+statement ok
+CREATE TABLE t(g INT, ip INET6)
+
+statement ok rowcount 4
+INSERT INTO t VALUES
+  (1, CAST('2001:db8::2' AS INET6)),
+  (1, CAST('2001:db8::1' AS INET6)),
+  (2, CAST('2001:db8::4' AS INET6)),
+  (2, CAST('2001:db8::3' AS INET6))
+
+query IT
+SELECT g, MIN(ip) AS m FROM t GROUP BY g ORDER BY g
+----
+1      2001:db8::1
+2      2001:db8::3
diff --git a/sql/test/BugTracker-2026/Tests/All 
b/sql/test/BugTracker-2026/Tests/All
--- a/sql/test/BugTracker-2026/Tests/All
+++ b/sql/test/BugTracker-2026/Tests/All
@@ -214,3 +214,4 @@ KNOWNFAIL?8030-inner-join-group-by-bug
 8036-alter+insert-in-trans
 8037-alter-table-decimal
 8031-simplify-count-too-simple
+8062-groupby-inet6
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to