Update of /cvsroot/monetdb/sql/src/backends/monet5
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv10474/src/backends/monet5

Modified Files:
        sql_gencode.mx 
Log Message:
propagated changes of Tuesday Jun 10 2008 - Wednesday Jun 11 2008
from the SQL_2-24 branch to the development trunk

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2008/06/10 - romulog:
        
src/test/Skyserver/Skyserver_dropFunctions_v6.sql,1.1.2.8(SQL_2-24,Stable_DailyBuild-11)
        
src/test/Skyserver/Skyserver_functions_v6.sql,1.1.2.11(SQL_2-24,Stable_DailyBuild-11)
add missing function...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2008/06/11 - nielsnes: src/storage/bat/bat_storage.mx,1.16.2.3(SQL_2-24)
        src/storage/bat/bat_utils.mx,1.4.4.1(SQL_2-24)
make all bats read_only, we use forced inserts/appends anyway
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2008/06/11 - nielsnes:
        
src/test/BugTracker/Tests/copy_decimal.SF-1582957.stable.err,1.6.4.1(SQL_2-24)
        
src/test/BugTracker/Tests/copy_overflow_null_bug.SF-1842550.stable.err,1.2.4.1(SQL_2-24)
        src/test/copy/Tests/null_as_string_errors.stable.err,1.1.2.1(SQL_2-24)
        
src/test/copy/Tests/null_as_string_errors.stable.err.Five,1.1.2.1(SQL_2-24)
new asci_io/table error messages
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2008/06/11 - nielsnes: src/test/bugs/Tests/All,1.112.2.4(SQL_2-24)
        src/test/bugs/Tests/order_limit_offset_bug.sql,1.1.2.1(SQL_2-24)
        src/test/bugs/Tests/order_limit_offset_bug.stable.err,1.1.2.1(SQL_2-24)
        src/test/bugs/Tests/order_limit_offset_bug.stable.out,1.1.2.1(SQL_2-24)
test script for bug in order/limit/offset handling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2008/06/11 - nielsnes: src/backends/monet4/sql_gencode.mx,1.174.2.2(SQL_2-24)
        src/backends/monet5/sql_gencode.mx,1.275.2.2(SQL_2-24)
fixes for the limit/offset with order bug
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Index: sql_gencode.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql_gencode.mx,v
retrieving revision 1.276
retrieving revision 1.277
diff -u -d -r1.276 -r1.277
--- sql_gencode.mx      5 Jun 2008 09:22:46 -0000       1.276
+++ sql_gencode.mx      11 Jun 2008 21:38:19 -0000      1.277
@@ -596,17 +596,26 @@
                                q = pushArgument(mb, q, topn);
                                l = getDestVar(q);
 
-                               /* As the result of the topn isn't sorted
-                                  we take the lower (according to the order
-                                  direction (size-offset)) to
-                                  get the correct output. */ 
+                               /* since both arguments of algebra.slice are 
+                                  inclusive correct the LIMIT value by 
+                                  substracting 1 */
                                if (s->op2.stval->op1.aval->data.val.ival) {
-                                       name = "topn_max";
-                                       if ((s->flag-1) > 0)
-                                               name = "topn_min"; 
+                                       q = newStmt1(mb, calcRef, "-");
+                                       q = pushArgument(mb, q, topn);
+                                       q = pushInt(mb, q, 1);
+                                       len = getDestVar(q);
 
-                                       q = newStmt(mb, "pqueue", name);
-                                       q = pushArgument(mb,q, l);
+                                       if ((s->flag-1) > 0) {
+                                               q = newStmt1(mb, algebraRef, 
"sortTail");
+                                       } else {
+                                               q = newStmt1(mb, algebraRef, 
"sortReverseTail");
+                                       }
+                                       q = pushArgument(mb, q, l);
+                                       l = getDestVar(q);
+
+                                       q = newStmt1(mb, algebraRef, "slice");
+                                       q = pushArgument(mb, q, l);
+                                       q = pushArgument(mb, q, offset);
                                        q = pushArgument(mb, q, len);
                                        l = getDestVar(q);
                                }
@@ -642,14 +651,13 @@
                case st_order:{
                        int l = _dumpstmt(sql, mb, s->op1.stval);
 
-                       q = newStmt1(mb, algebraRef, "sortTail" );
+                       if( s->flag > 0){
+                               q = newStmt1(mb, algebraRef, "sortTail");
+                       } else {
+                               q = newStmt1(mb, algebraRef, "sortReverseTail");
+                       }
                        q = pushArgument(mb, q, l);
                        s->nr = getDestVar(q);
-                       if( s->flag == 0){
-                               q = newStmt1(mb, algebraRef,"sortReverseTail");
-                               q= pushArgument(mb,q,s->nr);
-                               s->nr = getDestVar(q);
-                       }
                } break;
                case st_reorder:{
                        int l = _dumpstmt(sql, mb, s->op1.stval);


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to