Changeset: 2a6a37e51130 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/2a6a37e51130
Modified Files:
        sql/server/rel_dump.c
Branch: default
Log Message:

Order by operator and big endian fixes on remote plans


diffs (74 lines):

diff --git a/sql/server/rel_dump.c b/sql/server/rel_dump.c
--- a/sql/server/rel_dump.c
+++ b/sql/server/rel_dump.c
@@ -934,14 +934,29 @@ parse_atom(mvc *sql, char *r, int *pos, 
                atom *a = atom_general(sql->sa, tpe, st);
                if (tpe->type->eclass == EC_NUM) { /* needs to set the number 
of digits */
 #ifdef HAVE_HGE
-                       hge value = a->data.val.hval;
+                       hge value = 0;
                        const hge one = 1;
 #else
-                       lng value = a->data.val.lval;
+                       lng value = 0;
                        const lng one = 1;
 #endif
                        int bits = (int) digits2bits((unsigned) strlen(st)), 
obits = bits;
 
+#ifdef HAVE_HGE
+                       if (a->data.vtype == TYPE_hge) {
+                               value = a->data.val.hval;
+                       } else
+#endif
+                       if (a->data.vtype == TYPE_lng) {
+                               value = a->data.val.lval;
+                       } else if (a->data.vtype == TYPE_int) {
+                               value = a->data.val.ival;
+                       } else if (a->data.vtype == TYPE_sht) {
+                               value = a->data.val.shval;
+                       } else {
+                               value = a->data.val.btval;
+                       }
+
                        while (bits > 0 && (bits == sizeof(value) * 8 || (one 
<< (bits - 1)) > value))
                                bits--;
                        if (bits != obits && (bits == 8 || bits == 16 || bits 
== 32 || bits == 64))
@@ -1345,6 +1360,18 @@ exp_read(mvc *sql, sql_rel *lrel, sql_re
                return NULL;
        }
 
+       /* [ ASC ] */
+       if (strncmp(r+*pos, "ASC",  strlen("ASC")) == 0) {
+               (*pos)+= (int) strlen("ASC");
+               skipWS(r, pos);
+               set_ascending(exp);
+       }
+       /* [ NULLS LAST ] */
+       if (strncmp(r+*pos, "NULLS LAST",  strlen("NULLS LAST")) == 0) {
+               (*pos)+= (int) strlen("NULLS LAST");
+               skipWS(r, pos);
+               set_nulls_last(exp);
+       }
        /* [ NOT NULL ] */
        if (strncmp(r+*pos, "NOT NULL",  strlen("NOT NULL")) == 0) {
                (*pos)+= (int) strlen("NOT NULL");
@@ -1472,19 +1499,6 @@ exp_read(mvc *sql, sql_rel *lrel, sql_re
                }
        }
 
-       /* [ ASC ] */
-       if (strncmp(r+*pos, "ASC",  strlen("ASC")) == 0) {
-               (*pos)+= (int) strlen("ASC");
-               skipWS(r, pos);
-               set_ascending(exp);
-       }
-       /* [ NULLS LAST ] */
-       if (strncmp(r+*pos, "NULLS LAST",  strlen("NULLS LAST")) == 0) {
-               (*pos)+= (int) strlen("NULLS LAST");
-               skipWS(r, pos);
-               set_nulls_last(exp);
-       }
-
        /* as alias */
        if (!in_cmp && strncmp(r+*pos, "as", 2) == 0) {
                (*pos)+=2;
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to