Changeset: 931b28c2fd4b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=931b28c2fd4b
Modified Files:
        sql/backends/monet5/sql_result.c
Branch: protocol
Log Message:

Compute print width before any type conversions take place.


diffs (27 lines):

diff --git a/sql/backends/monet5/sql_result.c b/sql/backends/monet5/sql_result.c
--- a/sql/backends/monet5/sql_result.c
+++ b/sql/backends/monet5/sql_result.c
@@ -1902,9 +1902,14 @@ int mvc_export_resultset_prot10(mvc *m, 
                int retval = -1;
                int convert_to_string = 
!type_supports_binary_transfer(c->type.type);
                sql_type *type = c->type.type;
+               lng print_width = 0;
                
                iterators[i] = bat_iterator(b);
 
+               if (compute_lengths) {
+                       print_width = get_print_width(mtype, type->eclass, 
c->type.digits, c->type.scale, type_has_tz(&c->type), p ? 0 : 
iterators[i].b->batCacheid, p ? p : c->p);
+               }
+
                if (type->eclass == EC_TIMESTAMP) {
                        // timestamps are converted to Unix Timestamps
                        mtype = TYPE_lng;
@@ -2007,7 +2012,7 @@ int mvc_export_resultset_prot10(mvc *m, 
                }
 
                if (compute_lengths) {
-                       if (!mnstr_writeLng(s, get_print_width(mtype, 
type->eclass, c->type.digits, c->type.scale, type_has_tz(&c->type), p ? 0 : 
iterators[i].b->batCacheid, p ? p : c->p))) {
+                       if (!mnstr_writeLng(s, print_width)) {
                                fres = -1;
                                goto cleanup;
                        }
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to