Changeset: 37a9c0572c2d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/37a9c0572c2d
Modified Files:
        sql/backends/monet5/dict.c
        sql/test/dict/Tests/dict01.test
Branch: Jan2022
Log Message:

My bad, look for base type instead of storage type when decompressing BATs


diffs (88 lines):

diff --git a/sql/backends/monet5/dict.c b/sql/backends/monet5/dict.c
--- a/sql/backends/monet5/dict.c
+++ b/sql/backends/monet5/dict.c
@@ -294,7 +294,7 @@ DICTdecompress_(BAT *o, BAT *u, role_t r
        if (o->ttype == TYPE_bte) {
                unsigned char *op = Tloc(o, 0);
 
-               if (ATOMstorage(u->ttype) == TYPE_int) {
+               if (ATOMbasetype(u->ttype) == TYPE_int) {
                        int *up = Tloc(u, 0);
                        int *bp = Tloc(b, 0);
 
@@ -307,7 +307,7 @@ DICTdecompress_(BAT *o, BAT *u, role_t r
                        BATnegateprops(b);
                        b->tnil = nils;
                        b->tnonil = !nils;
-               } else if (ATOMstorage(u->ttype) == TYPE_lng) {
+               } else if (ATOMbasetype(u->ttype) == TYPE_lng) {
                        lng *up = Tloc(u, 0);
                        lng *bp = Tloc(b, 0);
 
@@ -334,7 +334,7 @@ DICTdecompress_(BAT *o, BAT *u, role_t r
                assert(o->ttype == TYPE_sht);
                unsigned short *op = Tloc(o, 0);
 
-               if (ATOMstorage(u->ttype) == TYPE_int) {
+               if (ATOMbasetype(u->ttype) == TYPE_int) {
                        int *up = Tloc(u, 0);
                        int *bp = Tloc(b, 0);
 
@@ -347,7 +347,7 @@ DICTdecompress_(BAT *o, BAT *u, role_t r
                        BATnegateprops(b);
                        b->tnil = nils;
                        b->tnonil = !nils;
-               } else if (ATOMstorage(u->ttype) == TYPE_lng) {
+               } else if (ATOMbasetype(u->ttype) == TYPE_lng) {
                        lng *up = Tloc(u, 0);
                        lng *bp = Tloc(b, 0);
 
diff --git a/sql/test/dict/Tests/dict01.test b/sql/test/dict/Tests/dict01.test
--- a/sql/test/dict/Tests/dict01.test
+++ b/sql/test/dict/Tests/dict01.test
@@ -405,6 +405,45 @@ statement ok
 START TRANSACTION
 
 statement ok
+CREATE TABLE "t0" ("c0" INET)
+
+statement ok rowcount 18
+INSERT INTO "t0" VALUES 
('164.82.81.89'),('113.147.23.38'),('86.149.73.111'),('181.250.179.49/28'),('194.195.10.124/2'),('73.161.236.158'),('10.30.207.106'),
+('70.12.16.242/26'),('202.52.196.246/20'),('208.167.107.137'),('31.108.174.206'),('103.74.10.64/29'),('230.91.255.3/25'),('128.184.144.74'),('72.63.75.16/22'),
+('23.39.29.46/31'),('35.154.241.4/10'),('97.134.228.106/31')
+
+statement ok
+CREATE TABLE "t1" ("c0" INET)
+
+statement ok rowcount 13
+INSERT INTO "t1" VALUES 
('58.166.167.234/4'),('17.41.170.78'),(NULL),('125.66.199.214'),('31.72.22.103/13'),('177.199.200.115'),('140.247.168.238/24'),
+('175.250.175.86/17'),('16.63.246.44'),('54.110.196.2/0'),('208.9.31.24/0'),('119.47.128.18'),('5.250.95.199/28')
+
+statement ok
+COMMIT
+
+statement ok
+CALL "dict_compress"('sys','t1','c0',false)
+
+statement error MERGE DELETE: Multiple rows in the input relation match the 
same row in the target table 'sys.t1'
+MERGE INTO t1 USING (SELECT DISTINCT 0.3, sys."network"(t1.c0) FROM t1) AS 
mergejoined(c0,c1) ON TRUE WHEN MATCHED THEN UPDATE SET c0 = INET 
'56.157.166.36';
+
+statement ok
+START TRANSACTION
+
+statement ok
+DROP TABLE t0
+
+statement ok
+DROP TABLE t1
+
+statement ok
+COMMIT
+
+statement ok
+START TRANSACTION
+
+statement ok
 DROP ALL PROCEDURE "sys"."dict_compress"
 
 statement ok
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to