db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r482426 - in /db/derby/code/trunk/java: engine/org/apache/derby/catalog/ engine/org/apache/derby/impl/jdbc/ engine/org/apache/derby/impl/sql/catalog/ engine/org/apache/derby/impl/sql/compile/ testing/org/apache/derbyTesting/functionTests/ma...
Date Tue, 05 Dec 2006 00:18:20 GMT
Author: djd
Date: Mon Dec  4 16:18:17 2006
New Revision: 482426

URL: http://svn.apache.org/viewvc?view=rev&rev=482426
Log:
DERBY-1808 Add inbuilt functions SIGN, SQRT, RAND, RANDOM, COSH, COT, SINH and TANH
Patch contributed by  Richard Wheeldon Email: richard@rswheeldon.com

Removed:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk14/metadata.out
Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/catalog/SystemProcedures.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/metadata.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/odbc_metadata.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/metadata.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/odbc_metadata.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/metadata.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/odbc_metadata.out

Modified: db/derby/code/trunk/java/engine/org/apache/derby/catalog/SystemProcedures.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/catalog/SystemProcedures.java?view=diff&rev=482426&r1=482425&r2=482426
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/catalog/SystemProcedures.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/catalog/SystemProcedures.java Mon Dec
 4 16:18:17 2006
@@ -34,6 +34,7 @@
 import java.sql.DatabaseMetaData;
 import java.util.StringTokenizer;
 import java.util.NoSuchElementException;
+import java.util.Random;
 
 import org.apache.derby.jdbc.InternalDriver;
 import org.apache.derby.iapi.db.Factory;
@@ -1277,4 +1278,65 @@
 	{
 		return StrictMath.log(value) / LOG10;
 	}
+
+	/**
+	 * Cotangent function. SYSFUN.COT
+	 * @see http://mathworld.wolfram.com/Cotangent.html
+	 * @return 1 / tan(x)
+	 */
+	public static double COT(double value)
+	{
+		return 1.0 / StrictMath.tan(value);
+	}
+
+	/**
+	 * Hyperbolic Cosine function. SYSFUN.COSH
+	 * @see http://mathworld.wolfram.com/HyperbolicFunctions.html
+	 * @return 1/2 (e^x + e^-x)
+	 */
+	public static double COSH(double value)
+	{
+		return (StrictMath.exp(value) + StrictMath.exp(-value)) / 2.0;
+	}
+
+	/**
+	 * Hyperbolic Sine function. SYSFUN.SINH
+	 * @see http://mathworld.wolfram.com/HyperbolicFunctions.html
+	 * @return 1/2 (e^x - e^-x)
+	 */
+	public static double SINH(double value)
+	{
+		return (StrictMath.exp(value) - StrictMath.exp(-value)) / 2.0;
+	}
+
+	/**
+	 * Hyperbolic Tangent function. SYSFUN.TANH
+	 * @see http://mathworld.wolfram.com/HyperbolicFunctions.html
+	 * @return (e^x - e^-x) / (e^x + e^-x)
+	 */
+	public static double TANH(double value)
+	{
+		return (StrictMath.exp(value) - StrictMath.exp(-value)) /
+			(StrictMath.exp(value) + StrictMath.exp(-value));
+	}
+
+	/**
+	 * Method to return the sign of the given value.
+	 * SYSFUN.SIGN().
+	 * @return 0, 1 or -1
+	 */
+	public static int SIGN(double value)
+	{
+		return value < 0 ? -1 : value > 0 ? 1 : 0;
+	}
+
+	/**
+	 * Pseudo-random number function.
+	 * @return a random number
+	 */
+	public static double RAND(int seed)
+	{
+		return (new Random(seed)).nextDouble();
+	}
+
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java?view=diff&rev=482426&r1=482425&r2=482426
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
Mon Dec  4 16:18:17 2006
@@ -84,6 +84,7 @@
  * database, come from a separate InstructionReader.  Note that in that case it
  * probably doesn't make sense to allow an instruction to specify a query.
  *
+ * @see http://java.sun.com/products/jdbc/download.html#corespec30
  * @author ames
  */
 public class EmbedDatabaseMetaData extends ConnectionChild 
@@ -451,17 +452,18 @@
 
     /**
      * Get a comma separated list of JDBC escaped numeric functions.
-     * Must be a complete or sub set of functions in appendix C.1
+     * Must be a complete or sub set of functions in appendix C.1 
+     * of JDBC 3.0 specification (pp. 183).
      * @return the list
      */
 	public String getNumericFunctions() {
-		return "ABS,ACOS,ASIN,ATAN,CEILING,COS,DEGREES,EXP,FLOOR,LOG,LOG10,MOD,PI,RADIANS,SIN,SQRT,TAN";
+		return "ABS,ACOS,ASIN,ATAN,CEILING,COS,COT,DEGREES,EXP,FLOOR,LOG,LOG10,MOD,PI,RADIANS,RAND,SIGN,SIN,SQRT,TAN";
 	}
 
     /**
      * Get a comma separated list of JDBC escaped string functions.
      * Must be a complete or sub set of functions in appendix C.2
-     * of JDBC 3.0 specification.
+     * of JDBC 3.0 specification (pp. 184).
      * @return the list
      */
 	public String getStringFunctions() {
@@ -471,7 +473,7 @@
     /**
      * Get a comma separated list of JDBC escaped system functions.
      * Must be a complete or sub set of functions in appendix C.4
-     * of JDBC 3.0 specification.
+     * of JDBC 3.0 specification (pp. 185).
      * @return the list
      */
 	public String getSystemFunctions()  {

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java?view=diff&rev=482426&r1=482425&r2=482426
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
Mon Dec  4 16:18:17 2006
@@ -234,7 +234,14 @@
 			{"EXP", "DOUBLE", "java.lang.StrictMath", "exp(double)", "DOUBLE"},
 			{"CEIL", "DOUBLE", "java.lang.StrictMath", "ceil(double)", "DOUBLE"},
 			{"CEILING", "DOUBLE", "java.lang.StrictMath", "ceil(double)", "DOUBLE"}, // Same as CEIL
-			{"FLOOR", "DOUBLE", "java.lang.StrictMath", "floor(double)", "DOUBLE"},			
+			{"FLOOR", "DOUBLE", "java.lang.StrictMath", "floor(double)", "DOUBLE"},
+			{"SIGN", "INTEGER", "org.apache.derby.catalog.SystemProcedures", "SIGN(double)", "DOUBLE"},
+			{"RANDOM", "DOUBLE", "java.lang.StrictMath", "random()", null},
+			{"RAND", "DOUBLE", "org.apache.derby.catalog.SystemProcedures", "RAND(int)", "INTEGER"},
// Escape function spec.
+			{"COT", "DOUBLE", "org.apache.derby.catalog.SystemProcedures", "COT(double)", "DOUBLE"},
+			{"COSH", "DOUBLE", "org.apache.derby.catalog.SystemProcedures", "COSH(double)", "DOUBLE"},
+			{"SINH", "DOUBLE", "org.apache.derby.catalog.SystemProcedures", "SINH(double)", "DOUBLE"},
+			{"TANH", "DOUBLE", "org.apache.derby.catalog.SystemProcedures", "TANH(double)", "DOUBLE"}
 	};
 	
 	/**

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj?view=diff&rev=482426&r1=482425&r2=482426
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj Mon Dec
 4 16:18:17 2006
@@ -1011,7 +1011,8 @@
     */
 	private static final String[] ESCAPED_SYSFUN_FUNCTIONS =
         {"ACOS", "ASIN", "ATAN", "COS", "SIN", "TAN", "PI",
-         "DEGREES", "RADIANS", "EXP", "LOG", "LOG10", "CEILING", "FLOOR" };
+         "DEGREES", "RADIANS", "EXP", "LOG", "LOG10", "CEILING", "FLOOR",
+         "SIGN", "RAND", "COT" };
        
     /**
        Convert a JDBC escaped function name to a function

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/metadata.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/metadata.out?view=diff&rev=482426&r1=482425&r2=482426
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/metadata.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/metadata.out
Mon Dec  4 16:18:17 2006
@@ -75,7 +75,7 @@
 storesLowerCaseQuotedIdentifiers(): false
 storesMixedCaseQuotedIdentifiers(): true
 getIdentifierQuoteString(): "
-getNumericFunctions(): ABS,ACOS,ASIN,ATAN,CEILING,COS,DEGREES,EXP,FLOOR,LOG,LOG10,MOD,PI,RADIANS,SIN,SQRT,TAN
+getNumericFunctions(): ABS,ACOS,ASIN,ATAN,CEILING,COS,COT,DEGREES,EXP,FLOOR,LOG,LOG10,MOD,PI,RADIANS,RAND,SIGN,SIN,SQRT,TAN
 getStringFunctions(): CONCAT,LENGTH,LCASE,LOCATE,LTRIM,RTRIM,SUBSTRING,UCASE
 getSystemFunctions(): USER
 getTimeDateFunctions(): CURDATE,CURTIME,HOUR,MINUTE,MONTH,SECOND,TIMESTAMPADD,TIMESTAMPDIFF,YEAR
@@ -485,6 +485,7 @@
 Executing VALUES { fn ATAN(14.10) } --   = >1.49<  << 
 Executing VALUES { fn CEILING(3.45) } --   = >4.0<  << 
 Executing VALUES { fn COS(1.2) } --   = >0.36<  << 
+Executing VALUES { fn COT(3.4) } --   = >3.78<  << 
 Executing VALUES { fn DEGREES(2.1) } --   = >120.<  << 
 Executing VALUES { fn EXP(2.3) } --   = >9.97<  << 
 Executing VALUES { fn FLOOR(3.22) } --   = >3.0<  << 
@@ -493,22 +494,18 @@
 Executing VALUES { fn MOD(124, 7) } --   = >5<  << 
 Executing VALUES { fn PI() } --   = >3.14<  << 
 Executing VALUES { fn RADIANS(54) } --   = >0.94<  << 
+Executing VALUES { fn RAND(17) } --   = >0.73<  << 
+Executing VALUES { fn SIGN(-34) } --   = >-1<  << 
 Executing VALUES { fn SIN(0.32) } --   = >0.31<  << 
 Executing VALUES { fn SQRT(6.22) } --   = >2.49<  << 
 Executing VALUES { fn TAN(0.57) } --   = >0.64<  << 
 TEST FUNCTIONS NOT DECLARED IN DATABASEMETADATA LIST
 Executing VALUES { fn ATAN2(0.56, 1.2) } -- 
 SQLSTATE(42X01): Syntax error: Encountered "ATAN2" at line 1, column 13.
-Executing VALUES { fn COT(3.4) } -- 
-SQLSTATE(42X01): Syntax error: Encountered "COT" at line 1, column 13.
 Executing VALUES { fn POWER(2, 3) } -- 
 SQLSTATE(42X01): Syntax error: Encountered "POWER" at line 1, column 13.
-Executing VALUES { fn RAND(17) } -- 
-SQLSTATE(42X01): Syntax error: Encountered "RAND" at line 1, column 13.
 Executing VALUES { fn ROUND(345.345, 1) } -- 
 SQLSTATE(42X01): Syntax error: Encountered "ROUND" at line 1, column 13.
-Executing VALUES { fn SIGN(-34) } -- 
-SQLSTATE(42X01): Syntax error: Encountered "SIGN" at line 1, column 13.
 Executing VALUES { fn TRUNCATE(345.395, 1) } -- 
 SQLSTATE(42X01): Syntax error: Encountered "TRUNCATE" at line 1, column 13.
 Test escaped string functions - JDBC 3.0 C.2

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/odbc_metadata.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/odbc_metadata.out?view=diff&rev=482426&r1=482425&r2=482426
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/odbc_metadata.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/odbc_metadata.out
Mon Dec  4 16:18:17 2006
@@ -105,7 +105,7 @@
 storesLowerCaseQuotedIdentifiers(): false
 storesMixedCaseQuotedIdentifiers(): true
 getIdentifierQuoteString(): "
-getNumericFunctions(): ABS,ACOS,ASIN,ATAN,CEILING,COS,DEGREES,EXP,FLOOR,LOG,LOG10,MOD,PI,RADIANS,SIN,SQRT,TAN
+getNumericFunctions(): ABS,ACOS,ASIN,ATAN,CEILING,COS,COT,DEGREES,EXP,FLOOR,LOG,LOG10,MOD,PI,RADIANS,RAND,SIGN,SIN,SQRT,TAN
 getStringFunctions(): CONCAT,LENGTH,LCASE,LOCATE,LTRIM,RTRIM,SUBSTRING,UCASE
 getSystemFunctions(): USER
 getTimeDateFunctions(): CURDATE,CURTIME,HOUR,MINUTE,MONTH,SECOND,TIMESTAMPADD,TIMESTAMPDIFF,YEAR
@@ -516,6 +516,7 @@
 Executing VALUES { fn ATAN(14.10) } --   = >1.49<  << 
 Executing VALUES { fn CEILING(3.45) } --   = >4.0<  << 
 Executing VALUES { fn COS(1.2) } --   = >0.36<  << 
+Executing VALUES { fn COT(3.4) } --   = >3.78<  << 
 Executing VALUES { fn DEGREES(2.1) } --   = >120.<  << 
 Executing VALUES { fn EXP(2.3) } --   = >9.97<  << 
 Executing VALUES { fn FLOOR(3.22) } --   = >3.0<  << 
@@ -524,22 +525,18 @@
 Executing VALUES { fn MOD(124, 7) } --   = >5<  << 
 Executing VALUES { fn PI() } --   = >3.14<  << 
 Executing VALUES { fn RADIANS(54) } --   = >0.94<  << 
+Executing VALUES { fn RAND(17) } --   = >0.73<  << 
+Executing VALUES { fn SIGN(-34) } --   = >-1<  << 
 Executing VALUES { fn SIN(0.32) } --   = >0.31<  << 
 Executing VALUES { fn SQRT(6.22) } --   = >2.49<  << 
 Executing VALUES { fn TAN(0.57) } --   = >0.64<  << 
 TEST FUNCTIONS NOT DECLARED IN DATABASEMETADATA LIST
 Executing VALUES { fn ATAN2(0.56, 1.2) } -- 
 SQLSTATE(42X01): Syntax error: Encountered "ATAN2" at line 1, column 13.
-Executing VALUES { fn COT(3.4) } -- 
-SQLSTATE(42X01): Syntax error: Encountered "COT" at line 1, column 13.
 Executing VALUES { fn POWER(2, 3) } -- 
 SQLSTATE(42X01): Syntax error: Encountered "POWER" at line 1, column 13.
-Executing VALUES { fn RAND(17) } -- 
-SQLSTATE(42X01): Syntax error: Encountered "RAND" at line 1, column 13.
 Executing VALUES { fn ROUND(345.345, 1) } -- 
 SQLSTATE(42X01): Syntax error: Encountered "ROUND" at line 1, column 13.
-Executing VALUES { fn SIGN(-34) } -- 
-SQLSTATE(42X01): Syntax error: Encountered "SIGN" at line 1, column 13.
 Executing VALUES { fn TRUNCATE(345.395, 1) } -- 
 SQLSTATE(42X01): Syntax error: Encountered "TRUNCATE" at line 1, column 13.
 Test escaped string functions - JDBC 3.0 C.2

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/metadata.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/metadata.out?view=diff&rev=482426&r1=482425&r2=482426
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/metadata.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/metadata.out
Mon Dec  4 16:18:17 2006
@@ -162,7 +162,7 @@
 storesLowerCaseQuotedIdentifiers(): false
 storesMixedCaseQuotedIdentifiers(): true
 getIdentifierQuoteString(): "
-getNumericFunctions(): ABS,ACOS,ASIN,ATAN,CEILING,COS,DEGREES,EXP,FLOOR,LOG,LOG10,MOD,PI,RADIANS,SIN,SQRT,TAN
+getNumericFunctions(): ABS,ACOS,ASIN,ATAN,CEILING,COS,COT,DEGREES,EXP,FLOOR,LOG,LOG10,MOD,PI,RADIANS,RAND,SIGN,SIN,SQRT,TAN
 getStringFunctions(): CONCAT,LENGTH,LCASE,LOCATE,LTRIM,RTRIM,SUBSTRING,UCASE
 getSystemFunctions(): USER
 getTimeDateFunctions(): CURDATE,CURTIME,HOUR,MINUTE,MONTH,SECOND,TIMESTAMPADD,TIMESTAMPDIFF,YEAR
@@ -578,6 +578,7 @@
 Executing VALUES { fn ATAN(14.10) } --   = >1.49<  << 
 Executing VALUES { fn CEILING(3.45) } --   = >4.0<  << 
 Executing VALUES { fn COS(1.2) } --   = >0.36<  << 
+Executing VALUES { fn COT(3.4) } --   = >3.78<  << 
 Executing VALUES { fn DEGREES(2.1) } --   = >120.<  << 
 Executing VALUES { fn EXP(2.3) } --   = >9.97<  << 
 Executing VALUES { fn FLOOR(3.22) } --   = >3.0<  << 
@@ -586,22 +587,18 @@
 Executing VALUES { fn MOD(124, 7) } --   = >5<  << 
 Executing VALUES { fn PI() } --   = >3.14<  << 
 Executing VALUES { fn RADIANS(54) } --   = >0.94<  << 
+Executing VALUES { fn RAND(17) } --   = >0.73<  << 
+Executing VALUES { fn SIGN(-34) } --   = >-1<  << 
 Executing VALUES { fn SIN(0.32) } --   = >0.31<  << 
 Executing VALUES { fn SQRT(6.22) } --   = >2.49<  << 
 Executing VALUES { fn TAN(0.57) } --   = >0.64<  << 
 TEST FUNCTIONS NOT DECLARED IN DATABASEMETADATA LIST
 Executing VALUES { fn ATAN2(0.56, 1.2) } -- 
 SQLSTATE(42X01): Syntax error: Encountered "ATAN2" at line 1, column 13.
-Executing VALUES { fn COT(3.4) } -- 
-SQLSTATE(42X01): Syntax error: Encountered "COT" at line 1, column 13.
 Executing VALUES { fn POWER(2, 3) } -- 
 SQLSTATE(42X01): Syntax error: Encountered "POWER" at line 1, column 13.
-Executing VALUES { fn RAND(17) } -- 
-SQLSTATE(42X01): Syntax error: Encountered "RAND" at line 1, column 13.
 Executing VALUES { fn ROUND(345.345, 1) } -- 
 SQLSTATE(42X01): Syntax error: Encountered "ROUND" at line 1, column 13.
-Executing VALUES { fn SIGN(-34) } -- 
-SQLSTATE(42X01): Syntax error: Encountered "SIGN" at line 1, column 13.
 Executing VALUES { fn TRUNCATE(345.395, 1) } -- 
 SQLSTATE(42X01): Syntax error: Encountered "TRUNCATE" at line 1, column 13.
 Test escaped string functions - JDBC 3.0 C.2

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/odbc_metadata.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/odbc_metadata.out?view=diff&rev=482426&r1=482425&r2=482426
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/odbc_metadata.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/odbc_metadata.out
Mon Dec  4 16:18:17 2006
@@ -192,7 +192,7 @@
 storesLowerCaseQuotedIdentifiers(): false
 storesMixedCaseQuotedIdentifiers(): true
 getIdentifierQuoteString(): "
-getNumericFunctions(): ABS,ACOS,ASIN,ATAN,CEILING,COS,DEGREES,EXP,FLOOR,LOG,LOG10,MOD,PI,RADIANS,SIN,SQRT,TAN
+getNumericFunctions(): ABS,ACOS,ASIN,ATAN,CEILING,COS,COT,DEGREES,EXP,FLOOR,LOG,LOG10,MOD,PI,RADIANS,RAND,SIGN,SIN,SQRT,TAN
 getStringFunctions(): CONCAT,LENGTH,LCASE,LOCATE,LTRIM,RTRIM,SUBSTRING,UCASE
 getSystemFunctions(): USER
 getTimeDateFunctions(): CURDATE,CURTIME,HOUR,MINUTE,MONTH,SECOND,TIMESTAMPADD,TIMESTAMPDIFF,YEAR
@@ -609,6 +609,7 @@
 Executing VALUES { fn ATAN(14.10) } --   = >1.49<  << 
 Executing VALUES { fn CEILING(3.45) } --   = >4.0<  << 
 Executing VALUES { fn COS(1.2) } --   = >0.36<  << 
+Executing VALUES { fn COT(3.4) } --   = >3.78<  << 
 Executing VALUES { fn DEGREES(2.1) } --   = >120.<  << 
 Executing VALUES { fn EXP(2.3) } --   = >9.97<  << 
 Executing VALUES { fn FLOOR(3.22) } --   = >3.0<  << 
@@ -617,22 +618,18 @@
 Executing VALUES { fn MOD(124, 7) } --   = >5<  << 
 Executing VALUES { fn PI() } --   = >3.14<  << 
 Executing VALUES { fn RADIANS(54) } --   = >0.94<  << 
+Executing VALUES { fn RAND(17) } --   = >0.73<  << 
+Executing VALUES { fn SIGN(-34) } --   = >-1<  << 
 Executing VALUES { fn SIN(0.32) } --   = >0.31<  << 
 Executing VALUES { fn SQRT(6.22) } --   = >2.49<  << 
 Executing VALUES { fn TAN(0.57) } --   = >0.64<  << 
 TEST FUNCTIONS NOT DECLARED IN DATABASEMETADATA LIST
 Executing VALUES { fn ATAN2(0.56, 1.2) } -- 
 SQLSTATE(42X01): Syntax error: Encountered "ATAN2" at line 1, column 13.
-Executing VALUES { fn COT(3.4) } -- 
-SQLSTATE(42X01): Syntax error: Encountered "COT" at line 1, column 13.
 Executing VALUES { fn POWER(2, 3) } -- 
 SQLSTATE(42X01): Syntax error: Encountered "POWER" at line 1, column 13.
-Executing VALUES { fn RAND(17) } -- 
-SQLSTATE(42X01): Syntax error: Encountered "RAND" at line 1, column 13.
 Executing VALUES { fn ROUND(345.345, 1) } -- 
 SQLSTATE(42X01): Syntax error: Encountered "ROUND" at line 1, column 13.
-Executing VALUES { fn SIGN(-34) } -- 
-SQLSTATE(42X01): Syntax error: Encountered "SIGN" at line 1, column 13.
 Executing VALUES { fn TRUNCATE(345.395, 1) } -- 
 SQLSTATE(42X01): Syntax error: Encountered "TRUNCATE" at line 1, column 13.
 Test escaped string functions - JDBC 3.0 C.2

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/metadata.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/metadata.out?view=diff&rev=482426&r1=482425&r2=482426
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/metadata.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/metadata.out
Mon Dec  4 16:18:17 2006
@@ -162,7 +162,7 @@
 storesLowerCaseQuotedIdentifiers(): false
 storesMixedCaseQuotedIdentifiers(): true
 getIdentifierQuoteString(): "
-getNumericFunctions(): ABS,ACOS,ASIN,ATAN,CEILING,COS,DEGREES,EXP,FLOOR,LOG,LOG10,MOD,PI,RADIANS,SIN,SQRT,TAN
+getNumericFunctions(): ABS,ACOS,ASIN,ATAN,CEILING,COS,COT,DEGREES,EXP,FLOOR,LOG,LOG10,MOD,PI,RADIANS,RAND,SIGN,SIN,SQRT,TAN
 getStringFunctions(): CONCAT,LENGTH,LCASE,LOCATE,LTRIM,RTRIM,SUBSTRING,UCASE
 getSystemFunctions(): USER
 getTimeDateFunctions(): CURDATE,CURTIME,HOUR,MINUTE,MONTH,SECOND,TIMESTAMPADD,TIMESTAMPDIFF,YEAR
@@ -578,6 +578,7 @@
 Executing VALUES { fn ATAN(14.10) } --   = >1.49<  << 
 Executing VALUES { fn CEILING(3.45) } --   = >4.0<  << 
 Executing VALUES { fn COS(1.2) } --   = >0.36<  << 
+Executing VALUES { fn COT(3.4) } --   = >3.78<  << 
 Executing VALUES { fn DEGREES(2.1) } --   = >120.<  << 
 Executing VALUES { fn EXP(2.3) } --   = >9.97<  << 
 Executing VALUES { fn FLOOR(3.22) } --   = >3.0<  << 
@@ -586,22 +587,18 @@
 Executing VALUES { fn MOD(124, 7) } --   = >5<  << 
 Executing VALUES { fn PI() } --   = >3.14<  << 
 Executing VALUES { fn RADIANS(54) } --   = >0.94<  << 
+Executing VALUES { fn RAND(17) } --   = >0.73<  << 
+Executing VALUES { fn SIGN(-34) } --   = >-1<  << 
 Executing VALUES { fn SIN(0.32) } --   = >0.31<  << 
 Executing VALUES { fn SQRT(6.22) } --   = >2.49<  << 
 Executing VALUES { fn TAN(0.57) } --   = >0.64<  << 
 TEST FUNCTIONS NOT DECLARED IN DATABASEMETADATA LIST
 Executing VALUES { fn ATAN2(0.56, 1.2) } -- 
 SQLSTATE(42X01): Syntax error: Encountered "ATAN2" at line 1, column 13.
-Executing VALUES { fn COT(3.4) } -- 
-SQLSTATE(42X01): Syntax error: Encountered "COT" at line 1, column 13.
 Executing VALUES { fn POWER(2, 3) } -- 
 SQLSTATE(42X01): Syntax error: Encountered "POWER" at line 1, column 13.
-Executing VALUES { fn RAND(17) } -- 
-SQLSTATE(42X01): Syntax error: Encountered "RAND" at line 1, column 13.
 Executing VALUES { fn ROUND(345.345, 1) } -- 
 SQLSTATE(42X01): Syntax error: Encountered "ROUND" at line 1, column 13.
-Executing VALUES { fn SIGN(-34) } -- 
-SQLSTATE(42X01): Syntax error: Encountered "SIGN" at line 1, column 13.
 Executing VALUES { fn TRUNCATE(345.395, 1) } -- 
 SQLSTATE(42X01): Syntax error: Encountered "TRUNCATE" at line 1, column 13.
 Test escaped string functions - JDBC 3.0 C.2

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/odbc_metadata.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/odbc_metadata.out?view=diff&rev=482426&r1=482425&r2=482426
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/odbc_metadata.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/odbc_metadata.out
Mon Dec  4 16:18:17 2006
@@ -192,7 +192,7 @@
 storesLowerCaseQuotedIdentifiers(): false
 storesMixedCaseQuotedIdentifiers(): true
 getIdentifierQuoteString(): "
-getNumericFunctions(): ABS,ACOS,ASIN,ATAN,CEILING,COS,DEGREES,EXP,FLOOR,LOG,LOG10,MOD,PI,RADIANS,SIN,SQRT,TAN
+getNumericFunctions(): ABS,ACOS,ASIN,ATAN,CEILING,COS,COT,DEGREES,EXP,FLOOR,LOG,LOG10,MOD,PI,RADIANS,RAND,SIGN,SIN,SQRT,TAN
 getStringFunctions(): CONCAT,LENGTH,LCASE,LOCATE,LTRIM,RTRIM,SUBSTRING,UCASE
 getSystemFunctions(): USER
 getTimeDateFunctions(): CURDATE,CURTIME,HOUR,MINUTE,MONTH,SECOND,TIMESTAMPADD,TIMESTAMPDIFF,YEAR
@@ -609,6 +609,7 @@
 Executing VALUES { fn ATAN(14.10) } --   = >1.49<  << 
 Executing VALUES { fn CEILING(3.45) } --   = >4.0<  << 
 Executing VALUES { fn COS(1.2) } --   = >0.36<  << 
+Executing VALUES { fn COT(3.4) } --   = >3.78<  << 
 Executing VALUES { fn DEGREES(2.1) } --   = >120.<  << 
 Executing VALUES { fn EXP(2.3) } --   = >9.97<  << 
 Executing VALUES { fn FLOOR(3.22) } --   = >3.0<  << 
@@ -617,22 +618,18 @@
 Executing VALUES { fn MOD(124, 7) } --   = >5<  << 
 Executing VALUES { fn PI() } --   = >3.14<  << 
 Executing VALUES { fn RADIANS(54) } --   = >0.94<  << 
+Executing VALUES { fn RAND(17) } --   = >0.73<  << 
+Executing VALUES { fn SIGN(-34) } --   = >-1<  << 
 Executing VALUES { fn SIN(0.32) } --   = >0.31<  << 
 Executing VALUES { fn SQRT(6.22) } --   = >2.49<  << 
 Executing VALUES { fn TAN(0.57) } --   = >0.64<  << 
 TEST FUNCTIONS NOT DECLARED IN DATABASEMETADATA LIST
 Executing VALUES { fn ATAN2(0.56, 1.2) } -- 
 SQLSTATE(42X01): Syntax error: Encountered "ATAN2" at line 1, column 13.
-Executing VALUES { fn COT(3.4) } -- 
-SQLSTATE(42X01): Syntax error: Encountered "COT" at line 1, column 13.
 Executing VALUES { fn POWER(2, 3) } -- 
 SQLSTATE(42X01): Syntax error: Encountered "POWER" at line 1, column 13.
-Executing VALUES { fn RAND(17) } -- 
-SQLSTATE(42X01): Syntax error: Encountered "RAND" at line 1, column 13.
 Executing VALUES { fn ROUND(345.345, 1) } -- 
 SQLSTATE(42X01): Syntax error: Encountered "ROUND" at line 1, column 13.
-Executing VALUES { fn SIGN(-34) } -- 
-SQLSTATE(42X01): Syntax error: Encountered "SIGN" at line 1, column 13.
 Executing VALUES { fn TRUNCATE(345.395, 1) } -- 
 SQLSTATE(42X01): Syntax error: Encountered "TRUNCATE" at line 1, column 13.
 Test escaped string functions - JDBC 3.0 C.2



Mime
View raw message