Changeset: edb420672548 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=edb420672548
Modified Files:
        sql/backends/monet5/UDF/pyapi/conversion.c
        sql/backends/monet5/UDF/pyapi/convert_loops.h
        sql/backends/monet5/UDF/pyapi/formatinput.c
        sql/backends/monet5/UDF/pyapi/pyapi.c
        sql/backends/monet5/UDF/pyapi/pyloader.c
        sql/backends/monet5/UDF/pyapi/type_conversion.c
        sql/backends/monet5/vaults/bam/bam_export.c
        sql/backends/monet5/vaults/bam/bam_lib.c
        sql/backends/monet5/vaults/bam/bam_loader.c
        sql/backends/monet5/vaults/bam/bam_wrapper.c
        sql/backends/monet5/vaults/fits/fits.c
        sql/backends/monet5/vaults/lidar/lidar.c
        sql/backends/monet5/vaults/netcdf/netcdf.c
        sql/backends/monet5/vaults/shp/shp.c
Branch: malerrors
Log Message:

SQLSTATE MAL_MALLOC_FAILs


diffs (truncated from 951 to 300 lines):

diff --git a/sql/backends/monet5/UDF/pyapi/conversion.c 
b/sql/backends/monet5/UDF/pyapi/conversion.c
--- a/sql/backends/monet5/UDF/pyapi/conversion.c
+++ b/sql/backends/monet5/UDF/pyapi/conversion.c
@@ -156,7 +156,7 @@ PyObject *PyArrayObject_FromBAT(PyInput 
 
        if (!b) {
                // No BAT was found, we can't do anything in this case
-               msg = createException(MAL, "pyapi.eval", "SQLSTATE ----- 
!"MAL_MALLOC_FAIL " bat.");
+               msg = createException(MAL, "pyapi.eval", "SQLSTATE HY001 
!"MAL_MALLOC_FAIL " bat missing");
                goto wrapup;
        }
 
@@ -253,7 +253,7 @@ PyObject *PyArrayObject_FromBAT(PyInput 
                                                                
GDKzalloc(b->tvheap->free * sizeof(PyObject *));
                                                        if (!pyptrs) {
                                                                msg = 
createException(MAL, "pyapi.eval",
-                                                                               
                          "SQLSTATE ----- !"MAL_MALLOC_FAIL
+                                                                               
                          "SQLSTATE HY001 !"MAL_MALLOC_FAIL
                                                                                
                          " PyObject strings.");
                                                                goto wrapup;
                                                        }
@@ -318,8 +318,8 @@ PyObject *PyArrayObject_FromBAT(PyInput 
                                                                
GDKzalloc(b->tvheap->free * sizeof(PyObject *));
                                                        if (!pyptrs) {
                                                                msg = 
createException(MAL, "pyapi.eval",
-                                                                               
                          MAL_MALLOC_FAIL
-                                                                               
                          "SQLSTATE ----- !"" PyObject strings.");
+                                                                               
                          "SQLSTATE HY001 !"MAL_MALLOC_FAIL
+                                                                               
                          " PyObject strings.");
                                                                goto wrapup;
                                                        }
                                                        BATloop(b, p, q)
@@ -951,7 +951,7 @@ BAT *PyObject_ConvertToBAT(PyReturn *ret
        return b;
 bunins_failed:
        BBPunfix(b->batCacheid);
-       msg = createException(MAL, "pyapi.eval", "SQLSTATE ----- 
!"MAL_MALLOC_FAIL);
+       msg = createException(MAL, "pyapi.eval", "SQLSTATE HY001 
!"MAL_MALLOC_FAIL);
 wrapup:
        *return_message = msg;
        return NULL;
@@ -1011,7 +1011,7 @@ str ConvertFromSQLType(BAT *b, sql_subty
                *ret_type = conv_type;
                if (!(*ret_bat)) {
                        return createException(MAL, "pyapi.eval",
-                                                                  "SQLSTATE 
----- !"MAL_MALLOC_FAIL " string conversion BAT.");
+                                                                  "SQLSTATE 
HY001 !"MAL_MALLOC_FAIL " string conversion BAT.");
                }
                BATloop(b, p, q)
                {
@@ -1022,7 +1022,7 @@ str ConvertFromSQLType(BAT *b, sql_subty
                        }
                        if (BUNappend(*ret_bat, result, FALSE) != GDK_SUCCEED) {
                                BBPunfix((*ret_bat)->batCacheid);
-                               throw(MAL, "pyapi.eval", "SQLSTATE ----- 
!"MAL_MALLOC_FAIL);
+                               throw(MAL, "pyapi.eval", "SQLSTATE HY001 
!"MAL_MALLOC_FAIL);
                        }
                }
                if (result) {
diff --git a/sql/backends/monet5/UDF/pyapi/convert_loops.h 
b/sql/backends/monet5/UDF/pyapi/convert_loops.h
--- a/sql/backends/monet5/UDF/pyapi/convert_loops.h
+++ b/sql/backends/monet5/UDF/pyapi/convert_loops.h
@@ -504,7 +504,7 @@
                        }                                                       
           \
                        utf8_string = GDKzalloc(utf8_size);                     
           \
                        if (utf8_string == NULL) {                      \
-                               msg = createException(MAL, "pyapi.eval", 
"SQLSTATE -----!"MAL_MALLOC_FAIL); \
+                               msg = createException(MAL, "pyapi.eval", 
"SQLSTATE HY001 !"MAL_MALLOC_FAIL); \
                                goto wrapup;                            \
                        }                                               \
                        for (iu = 0; iu < ret->count; iu++) {                   
           \
diff --git a/sql/backends/monet5/UDF/pyapi/formatinput.c 
b/sql/backends/monet5/UDF/pyapi/formatinput.c
--- a/sql/backends/monet5/UDF/pyapi/formatinput.c
+++ b/sql/backends/monet5/UDF/pyapi/formatinput.c
@@ -23,7 +23,7 @@ PyObject *PyCodeObject_ParseString(char 
        size_t i, j;
        hex[2] = '\0';
        if (code_copy == NULL) {
-               *msg = createException(MAL, "pyapi.eval", "SQLSTATE ----- 
!"MAL_MALLOC_FAIL);
+               *msg = createException(MAL, "pyapi.eval", "SQLSTATE HY001 
!"MAL_MALLOC_FAIL);
                return NULL;
        }
        // decode hex codes (e.g. \x00) in the string to the actual numeric
@@ -120,7 +120,7 @@ char *FormatCode(char *code, char **args
        statements_per_level =
                (size_t *)GDKzalloc(max_indentation * sizeof(size_t));
        if (indentation_levels == NULL || statements_per_level == NULL) {
-               *msg = createException(MAL, "pyapi.eval", "SQLSTATE ----- 
!"MAL_MALLOC_FAIL);
+               *msg = createException(MAL, "pyapi.eval", "SQLSTATE HY001 
!"MAL_MALLOC_FAIL);
                goto finally;
        }
 
@@ -224,14 +224,14 @@ char *FormatCode(char *code, char **args
                                        size_t *new_statements_per_level;
                                        if (new_indentation == NULL) {
                                                *msg =
-                                                       createException(MAL, 
"pyapi.eval", "SQLSTATE ----- !"MAL_MALLOC_FAIL);
+                                                       createException(MAL, 
"pyapi.eval", "SQLSTATE HY001 !"MAL_MALLOC_FAIL);
                                                goto finally;
                                        }
                                        new_statements_per_level =
                                                GDKzalloc(2 * max_indentation * 
sizeof(size_t));
                                        if (new_statements_per_level == NULL) {
                                                *msg =
-                                                       createException(MAL, 
"pyapi.eval", "SQLSTATE ----- !"MAL_MALLOC_FAIL);
+                                                       createException(MAL, 
"pyapi.eval", "SQLSTATE HY001 !"MAL_MALLOC_FAIL);
                                                goto finally;
                                        }
 
@@ -296,7 +296,7 @@ char *FormatCode(char *code, char **args
        // Allocate space for the function
        newcode = GDKzalloc(size);
        if (newcode == NULL) {
-               *msg = createException(MAL, "pyapi.eval", "SQLSTATE ----- 
!"MAL_MALLOC_FAIL);
+               *msg = createException(MAL, "pyapi.eval", "SQLSTATE HY001 
!"MAL_MALLOC_FAIL);
                goto finally;
        }
        initial_spaces = 0;
diff --git a/sql/backends/monet5/UDF/pyapi/pyapi.c 
b/sql/backends/monet5/UDF/pyapi/pyapi.c
--- a/sql/backends/monet5/UDF/pyapi/pyapi.c
+++ b/sql/backends/monet5/UDF/pyapi/pyapi.c
@@ -208,7 +208,7 @@ static str PyAPIeval(Client cntxt, MalBl
        args = (str *)GDKzalloc(pci->argc * sizeof(str));
        pyreturn_values = GDKzalloc(pci->retc * sizeof(PyReturn));
        if (args == NULL || pyreturn_values == NULL) {
-               throw(MAL, "pyapi.eval", "SQLSTATE ----- !"MAL_MALLOC_FAIL " 
arguments.");
+               throw(MAL, "pyapi.eval", "SQLSTATE HY001 !"MAL_MALLOC_FAIL " 
arguments.");
        }
 
        if ((pci->argc - (pci->retc + 2)) * sizeof(PyInput) > 0) {
@@ -218,7 +218,7 @@ static str PyAPIeval(Client cntxt, MalBl
                if (pyinput_values == NULL) {
                        GDKfree(args);
                        GDKfree(pyreturn_values);
-                       throw(MAL, "pyapi.eval", "SQLSTATE ----- 
!"MAL_MALLOC_FAIL " input values.");
+                       throw(MAL, "pyapi.eval", "SQLSTATE HY001 
!"MAL_MALLOC_FAIL " input values.");
                }
        }
 
@@ -338,7 +338,7 @@ static str PyAPIeval(Client cntxt, MalBl
                mmap_sizes = GDKzalloc(mmap_count * sizeof(size_t));
                if (mmap_ptrs == NULL || mmap_sizes == NULL) {
                        msg = createException(MAL, "pyapi.eval",
-                                                                 "SQLSTATE 
----- !"MAL_MALLOC_FAIL " mmap values.");
+                                                                 "SQLSTATE 
HY001 !"MAL_MALLOC_FAIL " mmap values.");
                        goto wrapup;
                }
 
@@ -458,7 +458,7 @@ static str PyAPIeval(Client cntxt, MalBl
                                                                
GDKzalloc(sizeof(BAT *) * output->nr_cols);
                                                        if (!result_columns) {
                                                                msg = 
createException(MAL, "pyapi.eval",
-                                                                               
                          "SQLSTATE ----- !"MAL_MALLOC_FAIL
+                                                                               
                          "SQLSTATE HY001 !"MAL_MALLOC_FAIL
                                                                                
                          " result column set.");
                                                                goto wrapup;
                                                        }
@@ -684,7 +684,7 @@ static str PyAPIeval(Client cntxt, MalBl
                        exprStr = GDKzalloc(length + 1);
                        if (exprStr == NULL) {
                                msg = createException(MAL, "pyapi.eval",
-                                                                         
"SQLSTATE ----- !"MAL_MALLOC_FAIL " function body string.");
+                                                                         
"SQLSTATE HY001 !"MAL_MALLOC_FAIL " function body string.");
                                goto wrapup;
                        }
                        if (fread(exprStr, 1, length, fp) != length) {
@@ -833,7 +833,7 @@ static str PyAPIeval(Client cntxt, MalBl
                        group_counts = GDKzalloc(group_count * sizeof(size_t));
                        if (group_counts == NULL) {
                                msg = createException(MAL, "pyapi.eval",
-                                                                         
"SQLSTATE ----- !"MAL_MALLOC_FAIL " group count array.");
+                                                                         
"SQLSTATE HY001 !"MAL_MALLOC_FAIL " group count array.");
                                goto aggrwrapup;
                        }
 
@@ -1287,12 +1287,12 @@ returnvalues:
                        if (bat_type != TYPE_str) {
                                if (VALinit(&stk->stk[pci->argv[i]], bat_type, 
Tloc(b, 0)) ==
                                        NULL)
-                                       msg = createException(MAL, 
"pyapi.eval", "SQLSTATE ----- !"MAL_MALLOC_FAIL);
+                                       msg = createException(MAL, 
"pyapi.eval", "SQLSTATE HY001 !"MAL_MALLOC_FAIL);
                        } else {
                                BATiter li = bat_iterator(b);
                                if (VALinit(&stk->stk[pci->argv[i]], bat_type,
                                                        BUNtail(li, 0)) == NULL)
-                                       msg = createException(MAL, 
"pyapi.eval", "SQLSTATE ----- !"MAL_MALLOC_FAIL);
+                                       msg = createException(MAL, 
"pyapi.eval", "SQLSTATE HY001 !"MAL_MALLOC_FAIL);
                        }
                }
                if (argnode) {
@@ -1642,7 +1642,7 @@ static void ComputeParallelAggregation(A
                                }
 
                                if (vararray == NULL) {
-                                       p->msg = createException(MAL, 
"pyapi.eval", "SQLSTATE ----- !"MAL_MALLOC_FAIL
+                                       p->msg = createException(MAL, 
"pyapi.eval", "SQLSTATE HY001 !"MAL_MALLOC_FAIL
                                                                                
         " to create NumPy array.");
                                        goto wrapup;
                                }
diff --git a/sql/backends/monet5/UDF/pyapi/pyloader.c 
b/sql/backends/monet5/UDF/pyapi/pyloader.c
--- a/sql/backends/monet5/UDF/pyapi/pyloader.c
+++ b/sql/backends/monet5/UDF/pyapi/pyloader.c
@@ -70,7 +70,7 @@ PYFUNCNAME(PyAPIevalLoader)(Client cntxt
 
        args = (str *)GDKzalloc(pci->argc * sizeof(str));
        if (!args) {
-               throw(MAL, "pyapi.eval", "SQLSTATE ----- !"MAL_MALLOC_FAIL " 
arguments.");
+               throw(MAL, "pyapi.eval", "SQLSTATE HY001 !"MAL_MALLOC_FAIL " 
arguments.");
        }
 
        // Analyse the SQL_Func structure to get the parameter names
@@ -97,7 +97,7 @@ PYFUNCNAME(PyAPIevalLoader)(Client cntxt
        pArgs = PyTuple_New(argcount - pci->retc - 2 + additional_columns);
        if (!pArgs) {
                msg = createException(MAL, "pyapi.eval_loader",
-                                                         "SQLSTATE ----- 
!"MAL_MALLOC_FAIL "python object");
+                                                         "SQLSTATE HY001 
!"MAL_MALLOC_FAIL "python object");
                goto wrapup;
        }
 
@@ -138,7 +138,7 @@ PYFUNCNAME(PyAPIevalLoader)(Client cntxt
                cols = GDKzalloc(sizeof(sql_emit_col) * pci->retc);
                if (!cols) {
                        msg = createException(MAL, "pyapi.eval_loader",
-                                                                 "SQLSTATE 
----- !"MAL_MALLOC_FAIL "column list");
+                                                                 "SQLSTATE 
HY001 !"MAL_MALLOC_FAIL "column list");
                        goto wrapup;
                }
                i = 0;
@@ -165,7 +165,7 @@ PYFUNCNAME(PyAPIevalLoader)(Client cntxt
        pEmit = PyEmit_Create(cols, retvals);
        if (!pConnection || !pEmit) {
                msg = createException(MAL, "pyapi.eval_loader",
-                                                         "SQLSTATE ----- 
!"MAL_MALLOC_FAIL "python object");
+                                                         "SQLSTATE HY001 
!"MAL_MALLOC_FAIL "python object");
                goto wrapup;
        }
 
diff --git a/sql/backends/monet5/UDF/pyapi/type_conversion.c 
b/sql/backends/monet5/UDF/pyapi/type_conversion.c
--- a/sql/backends/monet5/UDF/pyapi/type_conversion.c
+++ b/sql/backends/monet5/UDF/pyapi/type_conversion.c
@@ -97,7 +97,7 @@ str pyobject_to_str(PyObject **ptr, size
                utf8_string = (str)malloc(pyobject_get_size(obj) * 
sizeof(char));
                if (!utf8_string) {
                        msg = createException(MAL, "pyapi.eval",
-                                                                 "SQLSTATE 
----- !"MAL_MALLOC_FAIL "python string");
+                                                                 "SQLSTATE 
HY001 !"MAL_MALLOC_FAIL "python string");
                        goto wrapup;
                }
                *value = utf8_string;
diff --git a/sql/backends/monet5/vaults/bam/bam_export.c 
b/sql/backends/monet5/vaults/bam/bam_export.c
--- a/sql/backends/monet5/vaults/bam/bam_export.c
+++ b/sql/backends/monet5/vaults/bam/bam_export.c
@@ -94,7 +94,7 @@ fill_bam_alig(str qname, sht flag, str r
                c->l_qname = strlen(qname) + 1;
                if(alloc_data(b, doff + c->l_qname) == NULL) {
                        throw(MAL, "fill_bam_alig",
-                               FILL_BAM_ALIG_ERR MAL_MALLOC_FAIL, 
alignment_nr);
+                               "SQLSTATE HY001 !" MAL_MALLOC_FAIL " allignment 
%d", alignment_nr);
                }
                memcpy(b->data + doff, qname, c->l_qname);
                doff += c->l_qname;
@@ -132,7 +132,7 @@ fill_bam_alig(str qname, sht flag, str r
                        }
                        if (alloc_data(b, doff + c->n_cigar * 4) == NULL) {
                                throw(MAL, "fill_bam_alig",
-                                       FILL_BAM_ALIG_ERR MAL_MALLOC_FAIL, 
alignment_nr);
+                                       "SQLSTATE HY001 !" MAL_MALLOC_FAIL " 
alignment nr %d", alignment_nr);
                        }
                        cigar_enc = bam1_cigar(b);
                        for (i = 0, s = cigar; i != c->n_cigar; ++i) {
@@ -184,7 +184,7 @@ fill_bam_alig(str qname, sht flag, str r
                        p = (uint8_t*)alloc_data(b, doff + c->l_qseq + 
(c->l_qseq+1)/2);
                        if(p == NULL) {
                                throw(MAL, "fill_bam_alig",
-                                       FILL_BAM_ALIG_ERR MAL_MALLOC_FAIL, 
alignment_nr);
+                                       "SQLSTATE HY001 !" MAL_MALLOC_FAIL " 
alignment nr %d", alignment_nr);
                        }
                        p += doff;
                        memset(p, 0, (c->l_qseq+1)/2);
@@ -302,7 +302,7 @@ write_header(stream *output, bam_field f
 
        /* Start by building the table with sequences */
        if((sq_table = GDKmalloc(sq_table_size * sizeof(str))) == NULL) {
-               msg = createException(MAL, "write_header", "SQLSTATE ----- 
!"MAL_MALLOC_FAIL);
+               msg = createException(MAL, "write_header", "SQLSTATE HY001 
!"MAL_MALLOC_FAIL);
                goto cleanup;
        }
 
@@ -342,7 +342,7 @@ write_header(stream *output, bam_field f
                        int new_size = sq_table_size * 2;
                        str *tmp;
                        if((tmp = GDKrealloc(sq_table, new_size * sizeof(str))) 
== NULL) {
-                               msg = createException(MAL, "write_header", 
"SQLSTATE ----- !"MAL_MALLOC_FAIL);
+                               msg = createException(MAL, "write_header", 
"SQLSTATE HY001 !"MAL_MALLOC_FAIL);
                                goto cleanup;
                        }
                        sq_table = tmp;
@@ -352,7 +352,7 @@ write_header(stream *output, bam_field f
 
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to