Changeset: 26d15f1b713d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=26d15f1b713d
Modified Files:
        sql/backends/monet5/sql_subquery.c
Branch: Oct2020
Log Message:

Only ATOMextern atoms need allocation.


diffs (25 lines):

diff --git a/sql/backends/monet5/sql_subquery.c 
b/sql/backends/monet5/sql_subquery.c
--- a/sql/backends/monet5/sql_subquery.c
+++ b/sql/backends/monet5/sql_subquery.c
@@ -205,12 +205,15 @@ SQLall(ptr ret, const bat *bid)
                                }
                        }
                        s = ATOMlen(ATOMtype(b->ttype), p);
-                       *(ptr *) ret = GDKmalloc(s);
-                       if (*(ptr *) ret == NULL) {
-                               BBPunfix(b->batCacheid);
-                               throw(SQL, "sql.all", SQLSTATE(HY013) 
MAL_MALLOC_FAIL);
-                       }
-                       memcpy(*(ptr *)ret, p, s);
+                       if (ATOMextern(b->ttype)) {
+                               *(ptr *) ret = GDKmalloc(s);
+                               if (*(ptr *) ret == NULL) {
+                                       BBPunfix(b->batCacheid);
+                                       throw(SQL, "sql.all", SQLSTATE(HY013) 
MAL_MALLOC_FAIL);
+                               }
+                               memcpy(*(ptr *)ret, p, s);
+                       } else
+                               memcpy(ret, p, s);
                }
                }
        }
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to