trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sure...@apache.org
Subject [1/2] trafodion git commit: fix TRAFODION-2930 [FIRST N] will cause sqlci core dump
Date Fri, 02 Feb 2018 04:08:48 GMT
Repository: trafodion
Updated Branches:
  refs/heads/master 3e149d2c3 -> e392ffc44


fix TRAFODION-2930 [FIRST N] will cause sqlci core dump


Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/28e0c559
Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/28e0c559
Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/28e0c559

Branch: refs/heads/master
Commit: 28e0c559180a0fca488047c29e993a21eef15a5a
Parents: 6d38e58
Author: kakaxi3019 <jupiter3019@163.com>
Authored: Thu Feb 1 01:23:46 2018 +0000
Committer: kakaxi3019 <jupiter3019@163.com>
Committed: Thu Feb 1 01:23:46 2018 +0000

----------------------------------------------------------------------
 core/sql/executor/ExFirstN.cpp | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/28e0c559/core/sql/executor/ExFirstN.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExFirstN.cpp b/core/sql/executor/ExFirstN.cpp
index 0937eea..a8e562e 100644
--- a/core/sql/executor/ExFirstN.cpp
+++ b/core/sql/executor/ExFirstN.cpp
@@ -202,7 +202,14 @@ short ExFirstNTcb::work()
 	    // 0 means process all but don't return any rows.
 	    // -1 means get all rows. Should not reach this state.
 	    // <-1 means return the last '-(N+2)' rows.
-            effectiveFirstN_ = firstnTdb().firstNRows();
+            //TRAFODION-2930
+            //fix [first 600000000000] crash
+	    //effectiveFirstN_ = firstnTdb().firstNRows();
+            Int64 nFirstN = firstnTdb().firstNRows();
+            Int64 nMaxInt = INT_MAX;
+            effectiveFirstN_ = Lng32( min( nMaxInt,nFirstN ) );
+            //TRAFODION-2930
+
             returnedSoFar_ = 0;
 
             if (firstnTdb().firstNRowsExpr_)


Mime
View raw message