Changeset: 1a07fe7edd70 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1a07fe7edd70
Modified Files:
        monetdb5/optimizer/opt_mergetable.c
        sql/test/BugTracker-2010/Tests/limit_in_prepare.Bug-2552.stable.out
Branch: Jul2017
Log Message:

fixed problem with the push select and mergetable optimizers with limit in sub 
queries


diffs (30 lines):

diff --git a/monetdb5/optimizer/opt_mergetable.c 
b/monetdb5/optimizer/opt_mergetable.c
--- a/monetdb5/optimizer/opt_mergetable.c
+++ b/monetdb5/optimizer/opt_mergetable.c
@@ -112,8 +112,13 @@ mat_add_var(matlist_t *ml, InstrPtr q, I
        dst->pm = parentmat;
        dst->packed = 0;
        dst->pushed = pushed;
-       if (ml->vars[var] < 0)
+       if (ml->vars[var] < 0 || dst->type != mat_ext) {
+               if (ml->vars[var] >= 0) {
+                       ml->v[ml->vars[var]].packed = 1;
+                       ml->v[ml->vars[var]].pushed = 1;
+               }
                ml->vars[var] = ml->top;
+       }
        ++ml->top;
 }
 
diff --git 
a/sql/test/BugTracker-2010/Tests/limit_in_prepare.Bug-2552.stable.out 
b/sql/test/BugTracker-2010/Tests/limit_in_prepare.Bug-2552.stable.out
--- a/sql/test/BugTracker-2010/Tests/limit_in_prepare.Bug-2552.stable.out
+++ b/sql/test/BugTracker-2010/Tests/limit_in_prepare.Bug-2552.stable.out
@@ -108,7 +108,7 @@ Ready.
 % sys.tbls,    sys.tbls,       sys.tbls,       sys.tbls,       sys.tbls,       
sys.tbls,       sys.tbls,       sys.tbls # table_name
 % name,        schema_id,      query,  type,   system, commit_action,  
readonly,       temporary # name
 % varchar,     int,    varchar,        smallint,       boolean,        
smallint,       boolean,        smallint # type
-% 12,  4,      379,    1,      5,      1,      5,      1 # length
+% 12,  4,      169,    1,      5,      1,      5,      1 # length
 [ "schemas",   2000,   NULL,   0,      true,   0,      false,  0       ]
 [ "types",     2000,   NULL,   0,      true,   0,      false,  0       ]
 [ "functions", 2000,   NULL,   0,      true,   0,      false,  0       ]
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to