Changeset: 19035ee46ecc for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=19035ee46ecc
Modified Files:
        gdk/gdk_calc.c
Branch: default
Log Message:

When converting to string, don't call atomtostr function for nil.
The function may well return the string "nil" which is not what we
want to get.


diffs (41 lines):

diff --git a/gdk/gdk_calc.c b/gdk/gdk_calc.c
--- a/gdk/gdk_calc.c
+++ b/gdk/gdk_calc.c
@@ -13686,11 +13686,14 @@ convert_any_str(BAT *b, BAT *bn, BUN cnt
                                        end = i + 1;
                        }
                        src = BUNtvar(bi, i);
-                       if ((*atomtostr)(&dst, &len, src) < 0)
-                               goto bunins_failed;
-                       if ((*atomcmp)(src, nil) == 0)
+                       if ((*atomcmp)(src, nil) == 0) {
                                nils++;
-                       tfastins_nocheckVAR(bn, i, dst, bn->twidth);
+                               tfastins_nocheckVAR(bn, i, str_nil, bn->twidth);
+                       } else {
+                               if ((*atomtostr)(&dst, &len, src) < 0)
+                                       goto bunins_failed;
+                               tfastins_nocheckVAR(bn, i, dst, bn->twidth);
+                       }
                }
        } else {
                size_t size = ATOMsize(tp);
@@ -13707,11 +13710,14 @@ convert_any_str(BAT *b, BAT *bn, BUN cnt
                                if (++cand == candend)
                                        end = i + 1;
                        }
-                       if ((*atomtostr)(&dst, &len, src) < 0)
-                               goto bunins_failed;
-                       if ((*atomcmp)(src, nil) == 0)
+                       if ((*atomcmp)(src, nil) == 0) {
                                nils++;
-                       tfastins_nocheckVAR(bn, i, dst, bn->twidth);
+                               tfastins_nocheckVAR(bn, i, str_nil, bn->twidth);
+                       } else {
+                               if ((*atomtostr)(&dst, &len, src) < 0)
+                                       goto bunins_failed;
+                               tfastins_nocheckVAR(bn, i, dst, bn->twidth);
+                       }
                        src = (const void *) ((const char *) src + size);
                }
        }
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to