db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andre...@apache.org
Subject svn commit: r425726 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/sql/compile/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/functionTests/tests/lang/
Date Wed, 26 Jul 2006 13:05:03 GMT
Author: andreask
Date: Wed Jul 26 06:05:02 2006
New Revision: 425726

URL: http://svn.apache.org/viewvc?rev=425726&view=rev
Log:
DERBY-1587 INTEGER function cannot be abbreviated by INT. Fix consists of one LOC change in
sqlgrammar.jj and updates of master files. Contributed by Yip Nig

Modified:
    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/cast.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/checkConstraint.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ejbql.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/joins.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/valuesclause.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/valuesclause.sql

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?rev=425726&r1=425725&r2=425726&view=diff
==============================================================================
--- 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 Wed Jul
26 06:05:02 2006
@@ -6475,6 +6475,7 @@
 		getToken(1).kind == CHAR ||
 		getToken(1).kind == VARCHAR ||
 		getToken(1).kind == INTEGER ||
+		getToken(1).kind == INT || 
 		getToken(1).kind == SMALLINT ||
 		getToken(1).kind == LONGINT ||
                 getToken(1).kind == YEAR ||

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/cast.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/cast.out?rev=425726&r1=425725&r2=425726&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/cast.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/cast.out
Wed Jul 26 06:05:02 2006
@@ -1538,7 +1538,9 @@
 0 rows inserted/updated/deleted
 ij> -- bug 5421 - support db2 udb compatible built-in functions
 values CHAR(INT(67890));
-ERROR 42X01: Syntax error: Encountered "INT" at line 2, column 13.
+1          
+-----------
+67890      
 ij> values CHAR(INTEGER(12345));
 1          
 -----------

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/checkConstraint.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/checkConstraint.out?rev=425726&r1=425725&r2=425726&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/checkConstraint.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/checkConstraint.out
Wed Jul 26 06:05:02 2006
@@ -249,19 +249,19 @@
 ij> -- beetle 5805 - support built-in function INT
 -- should fail until beetle 5805 is implemented
 create table intTab (c1 int check(INT(1) = c1));
-ERROR 42X01: Syntax error: Encountered "INT" at line 3, column 35.
+0 rows inserted/updated/deleted
 ij> insert into intTab values 1;
-ERROR 42X05: Table/View 'INTTAB' does not exist.
+1 row inserted/updated/deleted
 ij> -- this insert should fail, does not satisfy check constraint
 insert into intTab values 2;
-ERROR 42X05: Table/View 'INTTAB' does not exist.
+ERROR 23513: The check constraint 'xxxxGENERATED-IDxxxx' was violated while performing an
INSERT or UPDATE on table 'APP.INTTAB'.
 ij> create table maxIntTab (c1 int check(INT(2147483647) > c1));
-ERROR 42X01: Syntax error: Encountered "INT" at line 1, column 38.
+0 rows inserted/updated/deleted
 ij> insert into maxIntTab values 1;
-ERROR 42X05: Table/View 'MAXINTTAB' does not exist.
+1 row inserted/updated/deleted
 ij> -- this insert should fail, does not satisfy check constraint
 insert into maxIntTab values 2147483647;
-ERROR 42X05: Table/View 'MAXINTTAB' does not exist.
+ERROR 23513: The check constraint 'xxxxGENERATED-IDxxxx' was violated while performing an
INSERT or UPDATE on table 'APP.MAXINTTAB'.
 ij> rollback;
 ij> -- verify that inserts, updates and statements with forced constraints are
 -- indeed dependent on the constraints

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ejbql.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ejbql.out?rev=425726&r1=425725&r2=425726&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ejbql.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ejbql.out
Wed Jul 26 06:05:02 2006
@@ -1388,26 +1388,46 @@
 -- Basic
 -- beetle 5805 - support INT[EGER] built-in function
 values{fn abs(INT(' 0')               )};
-ERROR 42X01: Syntax error: Encountered "INT" at line 7, column 15.
+1          
+-----------
+0          
 ij> values{fn abs(INT('-0')               )};
-ERROR 42X01: Syntax error: Encountered "INT" at line 1, column 15.
+1          
+-----------
+0          
 ij> values{fn abs(INT(' 1')               )};
-ERROR 42X01: Syntax error: Encountered "INT" at line 1, column 15.
+1          
+-----------
+1          
 ij> values{fn abs(INT('-1')               )};
-ERROR 42X01: Syntax error: Encountered "INT" at line 1, column 15.
+1          
+-----------
+1          
 ij> values{fn abs(INT(' 1000000')         )};
-ERROR 42X01: Syntax error: Encountered "INT" at line 1, column 15.
+1          
+-----------
+1000000    
 ij> values{fn abs(INT('-1000000')         )};
-ERROR 42X01: Syntax error: Encountered "INT" at line 1, column 15.
+1          
+-----------
+1000000    
 ij> values{fn abs(INT(' 2147483647')      )};
-ERROR 42X01: Syntax error: Encountered "INT" at line 1, column 15.
+1          
+-----------
+2147483647 
 ij> values{fn abs(INT('-2147483648') + 1  )};
-ERROR 42X01: Syntax error: Encountered "INT" at line 1, column 15.
+1          
+-----------
+2147483647 
 ij> -- Error
 values{fn abs(INT('-2147483648')      )};
-ERROR 42X01: Syntax error: Encountered "INT" at line 2, column 15.
+1          
+-----------
+ERROR 22003: The resulting value is outside the range for the data type INTEGER.
 ij> values{fn abs(INT(' 2147483647') + 1  )};
-ERROR 42X01: Syntax error: Encountered "INT" at line 1, column 15.
+1          
+-----------
+ERROR 22003: The resulting value is outside the range for the data type INTEGER.
 ij> -- Smallint
 -- Basic
 -- beetle 5807 - support SMALLINT built-in function
@@ -3377,7 +3397,9 @@
 -- Integer
 -- Basic
 values{ fn sqrt(INT('0'))};
-ERROR 42X01: Syntax error: Encountered "INT" at line 6, column 17.
+1                     
+----------------------
+0.0                   
 ij> -- Smallint
 -- Basic
 -- beetle 5805 - support INT[EGER] built-in function

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/joins.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/joins.out?rev=425726&r1=425725&r2=425726&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/joins.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/joins.out
Wed Jul 26 06:05:02 2006
@@ -294,9 +294,13 @@
 ij> -- beetle 5421
 -- INT built-in function
 select t1_c1 from t1, t2 where INT(t1_c1) = t2_c1;
-ERROR 42X01: Syntax error: Encountered "INT" at line 3, column 32.
+T1_C1      
+-----------
+1          
+2          
 ij> select t1_c1 from t1, t2 where t1_c1 = INT(2147483647) and INT(2147483647) = t2_c1;
-ERROR 42X01: Syntax error: Encountered "INT" at line 1, column 40.
+T1_C1      
+-----------
 ij> -- transitive closure - verify join condition doesn't get dropped
 create table x(c1 int);
 0 rows inserted/updated/deleted

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/valuesclause.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/valuesclause.out?rev=425726&r1=425725&r2=425726&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/valuesclause.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/valuesclause.out
Wed Jul 26 06:05:02 2006
@@ -526,4 +526,13 @@
 ij> -- this test runs in SPS mode too, hence adding a comment line before the sql, so
we get correct column number in error message in both SPS and non-SPS mode
 select new java.lang.String('asdf') = 'asdf' from t1;
 ERROR 42X01: Syntax error: java.lang.String.
+ij> -- DERBY-1587
+VALUES INTEGER(1.5);
+1          
+-----------
+1          
+ij> VALUES INT(1.5);
+1          
+-----------
+1          
 ij> 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/valuesclause.sql
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/valuesclause.sql?rev=425726&r1=425725&r2=425726&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/valuesclause.sql
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/valuesclause.sql
Wed Jul 26 06:05:02 2006
@@ -307,3 +307,6 @@
 -- this test runs in SPS mode too, hence adding a comment line before the sql, so we get
correct column number in error message in both SPS and non-SPS mode
 select new java.lang.String('asdf') = 'asdf' from t1;
 
+-- DERBY-1587
+VALUES INTEGER(1.5);
+VALUES INT(1.5);



Mime
View raw message