Changeset: 9c469fe01f95 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9c469fe01f95
Modified Files:
        sql/server/rel_optimizer.c
        sql/server/rel_prop.c
        sql/server/rel_prop.h
        sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out
Branch: default
Log Message:

small fix, don't keep on adding same property


diffs (85 lines):

diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c
--- a/sql/server/rel_optimizer.c
+++ b/sql/server/rel_optimizer.c
@@ -284,7 +284,8 @@ rel_properties(mvc *sql, global_props *g
        switch (rel->op) {
        case op_basetable:
        case op_table:
-               rel->p = prop_create(sql->sa, PROP_COUNT, rel->p);
+               if (!find_prop(rel->p, PROP_COUNT))
+                       rel->p = prop_create(sql->sa, PROP_COUNT, rel->p);
                break;
        case op_join: 
                join_properties(sql, rel);
@@ -2271,7 +2272,7 @@ exps_merge_rse( mvc *sql, list *l, list 
                                list_merge(exps, re->r, NULL);
                                fnd = exp_in(sql->sa, le->l, exps, cmp_in);
                        } else if (le->f && re->f && /* merge ranges */
-                                  le->flag == re->flag) {
+                                  le->flag == re->flag && le->flag <= cmp_lt) {
                                sql_subfunc *min = sql_bind_func(sql->sa, 
sql->session->schema, "sql_min", exp_subtype(le->r), exp_subtype(re->r), 
F_FUNC);
                                sql_subfunc *max = sql_bind_func(sql->sa, 
sql->session->schema, "sql_max", exp_subtype(le->f), exp_subtype(re->f), 
F_FUNC);
                                sql_exp *mine, *maxe;
diff --git a/sql/server/rel_prop.c b/sql/server/rel_prop.c
--- a/sql/server/rel_prop.c
+++ b/sql/server/rel_prop.c
@@ -71,7 +71,7 @@ find_prop( prop *p, int kind)
        return p;
 }
 
-char *
+const char *
 propkind2string( prop *p)
 {
        switch(p->kind) {
diff --git a/sql/server/rel_prop.h b/sql/server/rel_prop.h
--- a/sql/server/rel_prop.h
+++ b/sql/server/rel_prop.h
@@ -41,7 +41,7 @@ extern prop * prop_create( sql_allocator
 extern prop * prop_copy( sql_allocator *sa, prop *p);
 extern prop * prop_remove( prop *plist, prop *p);
 extern prop * find_prop( prop *p, int kind);
-extern char * propkind2string( prop *p);
+extern const char * propkind2string( prop *p);
 extern char * propvalue2string( prop *p);
 
 #endif /* _REL_PROP_H_ */
diff --git a/sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out 
b/sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out
--- a/sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out
+++ b/sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out
@@ -29,30 +29,30 @@ Ready.
 # 13:30:19 >  Mtimeout -timeout 60  java nl.cwi.monetdb.client.JdbcClient -h 
rig -p 39462 -d mTests_src_test_BugTracker -f 
"../../../../../source/sql/src/test/BugTracker/Tests/jdbc_no_debug.SF-1739356-data.sql"
 # 13:30:19 >  
 
-+---------------------------------------------------------------------------------------------------------------------------------------+
++-------------------------------------------------------------------------------------------------------------------------+
 | rel                                                                          
                                                                                
                                                                                
                             |
-+=======================================================================================================================================+
++=========================================================================================================================+
 | project (                                                                    
                                                                                
                                                                                
                             |
 | | group by (                                                                 
                                                                                
                                                                                
                             |
 | | | union (                                                                  
                                    |
 | | | | group by (                                                             
                                    |
 | | | | | project (                                                            
                                                                                
                                                                                
                             |
 | | | | | | select (                                                           
                                                                                
                                                                                
                             |
-| | | | | | | table(sys._tables) [ _tables.id as p.id, _tables.type as p.type, 
_tables.%TID% NOT NULL as p.%TID% ] COUNT  COUNT  COUNT  |
+| | | | | | | table(sys._tables) [ _tables.id as p.id, _tables.type as p.type, 
_tables.%TID% NOT NULL as p.%TID% ] COUNT  |
 | | | | | | ) [ p.type < smallint[tinyint "2"] ]                               
                                    |
 | | | | | ) [ p.id as tables.id ]                                              
                                    |
 | | | | ) [  ] [ sys.count() NOT NULL as L1 ],                                 
                                    |
 | | | | group by (                                                             
                                    |
 | | | | | project (                                                            
                                                                                
                                                                                
                             |
 | | | | | | select (                                                           
                                                                                
                                                                                
                             |
-| | | | | | | table(tmp._tables) [ _tables.id as t.id, _tables.type as t.type, 
_tables.%TID% NOT NULL as t.%TID% ] COUNT  COUNT  COUNT  |
+| | | | | | | table(tmp._tables) [ _tables.id as t.id, _tables.type as t.type, 
_tables.%TID% NOT NULL as t.%TID% ] COUNT  |
 | | | | | | ) [ t.type < smallint[tinyint "2"] ]                               
                                    |
 | | | | | ) [ t.id as tables.id ]                                              
                                    |
 | | | | ) [  ] [ sys.count() NOT NULL as L1 ]                                  
                                    |
 | | | ) [ L1 ]                                                                 
                                    |
 | | ) [  ] [ sys.sum no nil (L1) as L1 ]                                       
                                    |
 | ) [ L1 NOT NULL ]                                                            
                                                                                
                                                                                
                             |
-+---------------------------------------------------------------------------------------------------------------------------------------+
++-------------------------------------------------------------------------------------------------------------------------+
 20 rows
 
 
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to