db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r911952 - in /db/derby/code/trunk/java: testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/functionTests/tests/tools/ tools/org/apache/derby/impl/tools/ij/
Date Fri, 19 Feb 2010 19:36:36 GMT
Author: kahatlen
Date: Fri Feb 19 19:36:36 2010
New Revision: 911952

URL: http://svn.apache.org/viewvc?rev=911952&view=rev
Log:
DERBY-4553: In ij GETCURRENTROWNUMBER directly writes its result to output

Patch contributed by Sylvain Leroux <sylvain@chicoree.fr>

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij7.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij7.sql
    db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ij.jj
    db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ijVectorResult.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij7.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij7.out?rev=911952&r1=911951&r2=911952&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij7.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij7.out
Fri Feb 19 19:36:36 2010
@@ -179,6 +179,13 @@
 TABLE_SCHEM         |TABLE_NAME                    |REMARKS             
 ------------------------------------------------------------------------
 USER1               |T3                            |                    
+ij> --
+-- DERBY-4553
+--
+GET SCROLL INSENSITIVE CURSOR CURS AS 'SELECT * FROM APP.T1';
+ij> GETCURRENTROWNUMBER CURS;
+0
+ij> CLOSE CURS;
 ij> -- DERBY-2019: ensure that tables with mixed-case names can be described:
 SET SCHEMA APP;
 0 rows inserted/updated/deleted

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij7.sql
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij7.sql?rev=911952&r1=911951&r2=911952&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij7.sql
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij7.sql
Fri Feb 19 19:36:36 2010
@@ -59,6 +59,13 @@
 SHOW FUNCTIONS;
 SHOW SYNONYMS IN USER1;
 
+--
+-- DERBY-4553
+--
+GET SCROLL INSENSITIVE CURSOR CURS AS 'SELECT * FROM APP.T1';
+GETCURRENTROWNUMBER CURS;
+CLOSE CURS;
+
 -- DERBY-2019: ensure that tables with mixed-case names can be described:
 SET SCHEMA APP;
 create table "CamelCaseTable" (c1 int, c2 varchar(20));

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ij.jj
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ij.jj?rev=911952&r1=911951&r2=911952&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ij.jj (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ij.jj Fri Feb 19 19:36:36
2010
@@ -2428,8 +2428,7 @@
 		rs = (ResultSet) s.getCursor(c);
 		JDBCDisplayUtil.checkNotNull(rs,"cursor");
 
-	LocalizedResource.OutputWriter().println(utilInstance.getCurrentRowNumber(rs));
-		return null;
+		return new ijVectorResult(utilInstance.getCurrentRowNumber(rs), null);
 	}
 }
 

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ijVectorResult.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ijVectorResult.java?rev=911952&r1=911951&r2=911952&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ijVectorResult.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ijVectorResult.java Fri
Feb 19 19:36:36 2010
@@ -25,7 +25,7 @@
 import java.sql.SQLWarning;
 
 /**
- * This is an impl for a simple Vector of strings.
+ * This is an impl for a simple Vector of objects.
  *
  */
 class ijVectorResult extends ijResultImpl {
@@ -38,6 +38,22 @@
 		warns = w;
 	}
 
+	/**
+	 * Initialize a new vector containing only one object.
+	 */
+	ijVectorResult(Object value, SQLWarning w) {
+		this(new Vector(1), w);
+		vec.add(value);
+	}
+
+	/**
+	 * Initialize a new vector containing only one integer value.
+	 */
+	ijVectorResult(int value, SQLWarning w) {
+		this(new Integer(value), w);
+	}
+
+
 	public boolean isVector() { return true; }
 
 	public Vector getVector() { return vec; }



Mime
View raw message