Changeset: be31eb57b206 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=be31eb57b206
Modified Files:
        .hgignore
        sql/ChangeLog.Jun2010
        sql/src/common/sql_types.mx
        sql/src/server/rel_select.mx
Branch: default
Log Message:

Merge with Jun2010 branch.


diffs (truncated from 2020 to 300 lines):

diff -r 8bdb6ffa54c6 -r be31eb57b206 .hgignore
--- a/.hgignore Tue Jul 20 08:38:55 2010 +0200
+++ b/.hgignore Tue Jul 20 14:26:19 2010 +0200
@@ -50,6 +50,8 @@
 ^java/NT/.*\.jar$
 ^java/NT/nl/
 ^java/NT/tests/
+^java/build/
+^java/jars/
 ^pathfinder/NT/compiler/
 ^pathfinder/NT/modules/
 ^pathfinder/NT/runtime/
diff -r 8bdb6ffa54c6 -r be31eb57b206 sql/ChangeLog.Jun2010
--- a/sql/ChangeLog.Jun2010     Tue Jul 20 08:38:55 2010 +0200
+++ b/sql/ChangeLog.Jun2010     Tue Jul 20 14:26:19 2010 +0200
@@ -1,6 +1,10 @@
 # ChangeLog file for sql
 # This file is updated with Maddlog
 
+* Tue Jul 20 2010 Sjoerd Mullender <[email protected]>
+- Fixed bug 2624: function returning decimal returned result that was
+  scaled incorrectly.
+
 * Sun Jul 18 2010 Stefan Manegold <[email protected]>
 - fixed bug 2622 "LIMIT & OFFSET ignored on 64-bit big-endian when
   combined with GROUP BY"
diff -r 8bdb6ffa54c6 -r be31eb57b206 sql/src/common/sql_types.mx
--- a/sql/src/common/sql_types.mx       Tue Jul 20 08:38:55 2010 +0200
+++ b/sql/src/common/sql_types.mx       Tue Jul 20 14:26:19 2010 +0200
@@ -704,13 +704,12 @@
 {
        if (strcmp(f->base.name, name) == 0) {
                if (list_length(f->ops) == nrargs) {
-                       int scale = 0;
                        sql_subfunc *fres = ZNEW(sql_subfunc);
 
                        sql_ref_init(&(fres->ref));
                        fres->func = f;
                        if (f->res.type)
-                               sql_init_subtype(&fres->res, f->res.type, 
f->res.digits, scale);
+                               sql_init_subtype(&fres->res, f->res.type, 
f->res.digits, f->res.scale);
                        if (f->res.comp_type) 
                                fres->res.comp_type = f->res.comp_type;
                        return fres;
diff -r 8bdb6ffa54c6 -r be31eb57b206 sql/src/server/rel_select.mx
--- a/sql/src/server/rel_select.mx      Tue Jul 20 08:38:55 2010 +0200
+++ b/sql/src/server/rel_select.mx      Tue Jul 20 14:26:19 2010 +0200
@@ -19,7 +19,7 @@
 
 @f rel_select
 @a N.J. Nes
-...@* 
+...@*
 
 @h
 #ifndef _REL_SELECT_H_
@@ -84,8 +84,8 @@
 
 #include "sql_config.h"
 #include "rel_select.h"
-#include "sql_semantic.h"      /* TODO this dependency should be removed, move
-                                  the dependend code into sql_mvc */
+#include "sql_semantic.h"      /* TODO this dependency should be removed, move
+                                  the dependent code into sql_mvc */
 #include "sql_privileges.h"
 #include "sql_env.h"
 #include "rel_exp.h"
@@ -99,23 +99,23 @@
 #define ERR_AMBIGUOUS          050000
 
 sql_rel *
-rel_dup(sql_rel *r) 
+rel_dup(sql_rel *r)
 {
        sql_ref_inc(&r->ref);
        return r;
 }
 
-static void 
+static void
 rel_destroy_(sql_rel *rel)
 {
-       if (!rel) 
+       if (!rel)
                return;
        if (rel->exps)
                list_destroy(rel->exps);
-       if (is_join(rel->op) || 
-                       is_semi(rel->op) || 
-                       is_select(rel->op) || 
-                       is_set(rel->op) || 
+       if (is_join(rel->op) ||
+                       is_semi(rel->op) ||
+                       is_select(rel->op) ||
+                       is_set(rel->op) ||
                        rel->op == op_topn) {
                if (rel->l)
                        rel_destroy(rel->l);
@@ -140,10 +140,10 @@
        }
 }
 
-void 
+void
 rel_destroy(sql_rel *rel)
 {
-       if (!rel) 
+       if (!rel)
                return;
        if (sql_ref_dec(&rel->ref) > 0)
                return;
@@ -169,16 +169,16 @@
 }
 
 static void
-rel_setsubquery(sql_rel*r) 
+rel_setsubquery(sql_rel*r)
 {
        if (r->l && !is_base(r->op))
                rel_setsubquery(r->l);
-       if (r->r && is_join(r->op)) 
+       if (r->r && is_join(r->op))
                rel_setsubquery(r->r);
        set_subquery(r);
 }
 
-/* we don't name relations directly, but sometimes we need the relation 
+/* we don't name relations directly, but sometimes we need the relation
    name. So we look it up in the first expression
  */
 char *
@@ -210,7 +210,7 @@
        if (is_project(r->op) && r->exps) {
                node *ne = r->exps->h;
 
-               for (; ne; ne = ne->next) 
+               for (; ne; ne = ne->next)
                        exp_setname( ne->data, nme, NULL );
        }
        /* op_projects can have a order by list */
@@ -218,14 +218,14 @@
                list *exps = r->r;
                node *ne = exps->h;
 
-               for (; ne; ne = ne->next) 
+               for (; ne; ne = ne->next)
                        exp_setname( ne->data, nme, NULL );
        }
        return r;
 }
 
-static sql_exp * 
-exp_alias_or_copy( mvc *sql, char *tname, char *cname, sql_rel *orel, sql_exp 
*old, int settname) 
+static sql_exp *
+exp_alias_or_copy( mvc *sql, char *tname, char *cname, sql_rel *orel, sql_exp 
*old, int settname)
 {
        if (settname && !tname)
                tname = old->rname;
@@ -247,7 +247,7 @@
 
 /* return all expressions, with table name == tname */
 static list *
-rel_table_projections( mvc *sql, sql_rel *rel, char *tname ) 
+rel_table_projections( mvc *sql, sql_rel *rel, char *tname )
 {
        list *exps;
 
@@ -267,7 +267,7 @@
        case op_right:
        case op_full:
                exps = rel_table_projections( sql, rel->l, tname);
-               if (exps) 
+               if (exps)
                        return exps;
                return rel_table_projections( sql, rel->r, tname);
        case op_semi:
@@ -292,9 +292,9 @@
                        for (en = rel->exps->h; en; en = en->next) {
                                sql_exp *e = en->data;
                                /* first check alias */
-                               if (!is_intern(e) && e->rname && 
strcmp(e->rname, tname) == 0) 
+                               if (!is_intern(e) && e->rname && 
strcmp(e->rname, tname) == 0)
                                        append(exps, exp_alias_or_copy(sql, 
tname, exp_name(e), rel, e, 1));
-                               if (!is_intern(e) && !e->rname && e->l && 
strcmp(e->l, tname) == 0) 
+                               if (!is_intern(e) && !e->rname && e->l && 
strcmp(e->l, tname) == 0)
                                        append(exps, exp_alias_or_copy(sql, 
tname, exp_name(e), rel, e, 1));
                        }
                        if (exps && list_length(exps))
@@ -305,9 +305,9 @@
        }
 }
 
-/* find the path to the relation containing the base of the expression 
-       (e_column), in most cases this means go down the join tree and 
-       find the base column. 
+/* find the path to the relation containing the base of the expression
+       (e_column), in most cases this means go down the join tree and
+       find the base column.
  */
 static int
 rel_bind_path_(sql_rel *rel, sql_exp *e, list *path )
@@ -318,10 +318,10 @@
        case op_join:
        case op_left:
        case op_right:
-       case op_full: 
+       case op_full:
                /* first right (possible subquery) */
                found = rel_bind_path_(rel->r, e, path);
-               if (!found) 
+               if (!found)
                        found = rel_bind_path_(rel->l, e, path);
                break;
        case op_semi:
@@ -340,15 +340,15 @@
                        assert(0);
                        break;
                }
-       case op_groupby: 
+       case op_groupby:
        case op_project:
        case op_table:
-       case op_basetable: 
+       case op_basetable:
                if (!rel->exps)
                        break;
-               if (!found && e->l && exps_bind_column2(rel->exps, e->l, e->r)) 
+               if (!found && e->l && exps_bind_column2(rel->exps, e->l, e->r))
                        found = 1;
-               if (!found && !e->l && exps_bind_column(rel->exps, e->r, NULL)) 
+               if (!found && !e->l && exps_bind_column(rel->exps, e->r, NULL))
                        found = 1;
                break;
        case op_insert:
@@ -366,22 +366,22 @@
 static list *
 rel_bind_path(sql_rel *rel, sql_exp *e )
 {
-       list *path = new_rel_list(); 
-
-       if (e->type == e_convert) 
+       list *path = new_rel_list();
+
+       if (e->type == e_convert)
                e = e->l;
        if (e->type == e_column) {
                if (rel) {
                        if (!rel_bind_path_(rel, e, path)) {
                                /* something is wrong */
-                               list_destroy(path); 
+                               list_destroy(path);
                                return NULL;
                        }
                }
                return path;
        }
        /* default the top relation */
-       append(path, rel); 
+       append(path, rel);
        return path;
 }
 
@@ -407,7 +407,7 @@
        case op_groupby:
        case op_project:
        case op_table:
-       case op_basetable: 
+       case op_basetable:
 
        case op_union:
        case op_except:
@@ -418,7 +418,7 @@
                        exps = new_exp_list();
                        for (en = rel->exps->h; en; en = en->next) {
                                sql_exp *e = en->data;
-                               if (intern || !is_intern(e)) 
+                               if (intern || !is_intern(e))
                                        append(exps, exp_alias_or_copy(sql, 
tname, exp_name(e), rel, e, settname));
                        }
                        return exps;
@@ -445,7 +445,7 @@
 }
 
 sql_rel *
-rel_copy( sql_rel *i ) 
+rel_copy( sql_rel *i )
 {
        sql_rel *rel = rel_create();
 
@@ -458,7 +458,7 @@
                rel->l = i->l;
                break;
        case op_table:
-               rel->l = exp_dup(i->l); 
+               rel->l = exp_dup(i->l);
                break;
        case op_groupby:
                rel->l = rel_copy(i->l);
@@ -486,7 +486,7 @@
 }
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to