Changeset: 31b20e1648ed for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/31b20e1648ed
Modified Files:
        sql/storage/bat/bat_storage.c
Branch: Mar2025
Log Message:

Some fixes to altering the type of a column.
(grafted from ec6ff0a04b5c78898caf0cae58deeec257ef9e79)


diffs (20 lines):

diff --git a/sql/storage/bat/bat_storage.c b/sql/storage/bat/bat_storage.c
--- a/sql/storage/bat/bat_storage.c
+++ b/sql/storage/bat/bat_storage.c
@@ -3054,10 +3054,15 @@ col_subtype(sql_trans *tr, sql_column *c
                if (!b)
                        return res;
 
-               BAT *bn = BATconvert(b, NULL /* could use tids, but need NILS 
*/, t->type->localtype, col->type.scale, t->scale, t->digits);
+               BAT *bn = BATconvert(b, NULL /* could use tids, but need NILS 
*/, t->type->localtype, col->type.scale, t->scale, t->type->eclass == EC_NUM ? 
0 : t->digits);
                if (!bn)
                        return res;
                BBPreclaim(b);
+               b = COLcopy(bn, bn->ttype, true, PERSISTENT);
+               BBPreclaim(bn);
+               if ((bn = b) == NULL)
+                       return res;
+
                res = swap_bats(tr, col, bn);
                BBPreclaim(bn);
        }
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to