You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by dj...@apache.org on 2007/01/20 00:18:26 UTC
svn commit: r498002 - in
/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests:
master/ master/j9_13/ master/j9_22/ suites/ tests/lang/
Author: djd
Date: Fri Jan 19 15:18:24 2007
New Revision: 498002
URL: http://svn.apache.org/viewvc?view=rev&rev=498002
Log:
Switch four lang SQL scripts from test harness tests to be run under JUnit with LangScripts
aggregate,bit.sql,LOB.sql and nulls.sql
Removed:
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/j9_13/aggregate.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/j9_22/aggregate.out
Modified:
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/LOB.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/aggregate.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/bit.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/nulls.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbylang.runall
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangScripts.java
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/nulls.sql
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/LOB.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/LOB.out?view=diff&rev=498002&r1=498001&r2=498002
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/LOB.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/LOB.out Fri Jan 19 15:18:24 2007
@@ -17,8 +17,11 @@
-- This test lang/LOB.sql still includes tests for
-- DB2 UDB incompatible datatype NCLOB.
-- Still waiting for DB2 UDB compatible functionality for NCLOB to be implemented
+
-- Also note that in DB2 UDB, to create BLOB and CLOB strings greater than 1 gigabyte,
-- the NOT LOGGED option must be specified (SQLSTATE 42993).
+
+
-- test that BLOB/CLOB are not reserved words
create table blob(a int);
0 rows inserted/updated/deleted
@@ -113,6 +116,7 @@
ij> select 1 from b where cast('1' as nclob(1)) = cast('1' as nclob(1));
ERROR 0A000: Feature not implemented: NCLOB.
ij> -- NCLOB is comparable with CLOB
+
select 1 from b where cast('1' as nclob(10)) = cast('1' as clob(10));
ERROR 0A000: Feature not implemented: NCLOB.
ij> select 1 from b where cast('1' as clob(10)) = cast('1' as nclob(10));
@@ -337,6 +341,7 @@
-- beetle 5282
-- <,> <=, >= operands are not supported in db2 but supported in cloudscape
-- compare w. integer/char types are also not ok
+
-- CLOB testing
CREATE TABLE testoperatorclob (colone clob(1K));
0 rows inserted/updated/deleted
@@ -541,6 +546,7 @@
ij> values {fn length(cast('foo' as nclob(10)))};
ERROR 0A000: Feature not implemented: NCLOB.
ij> -- Longvarchar negative tests
+
create table testPredicate1 (c1 long varchar);
0 rows inserted/updated/deleted
ij> create table testPredicate2 (c1 long varchar);
@@ -593,6 +599,7 @@
ij> drop table testpredicate2;
0 rows inserted/updated/deleted
ij> -- CLOB/BLOB limits and sizes
+
-- FAIL - bigger than 2G or 2Gb with no modifier
create table DB2LIM.FB1(FB1C BLOB(3G));
ERROR 42X44: Invalid length '3G' in column specification.
@@ -702,6 +709,7 @@
GC4 |GC4C |CLOB(2147483647)
ij> --- CHAR/VARCHAR and LOBs. (beetle 5741)
--- test that we can insert CHAR/VARCHAR directly
+
CREATE TABLE b (colone blob(1K));
0 rows inserted/updated/deleted
ij> VALUES '50';
@@ -845,4 +853,4 @@
ERROR 0A000: Feature not implemented: NCLOB.
ij> DROP TABLE n;
0 rows inserted/updated/deleted
-ij>
+ij>
\ No newline at end of file
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/aggregate.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/aggregate.out?view=diff&rev=498002&r1=498001&r2=498002
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/aggregate.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/aggregate.out Fri Jan 19 15:18:24 2007
@@ -14,6 +14,7 @@
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
+
-- ** insert aggregatesPositive.sql
autocommit on;
ij> -- General aggregate tests. Aggregate
@@ -24,6 +25,7 @@
-- INSERT SELECT is also in the specific aggregate tests.
--
-- need to add: objects
+
create table t1 (c1 int, c2 int);
0 rows inserted/updated/deleted
ij> create table t2 (c1 int, c2 int);
@@ -550,6 +552,7 @@
ij> --------------------------------------
-- Having
--------------------------------------
+
-- having with agg on a join
select max(t1.c1), max(t2.c2)
from t1, t2
@@ -641,6 +644,7 @@
NULL |1
WARNING 01003: Null values were eliminated from the argument of a column function.
ij> --- tests of exact numeric results
+
create table bd (i decimal(31,30));
0 rows inserted/updated/deleted
ij> insert into bd values(0.1);
@@ -804,6 +808,7 @@
ij> --------------------------------------
-- NEGATIVE TESTS
--------------------------------------
+
-- only a single distinct is supported
select sum(distinct i), sum(distinct l) from t;
ERROR 42Z02: Multiple DISTINCT aggregates are not supported at this time.
@@ -855,6 +860,7 @@
ij> drop table t4;
0 rows inserted/updated/deleted
ij> -- beetle 5122, aggregate on JoinNode
+
CREATE TABLE DOCUMENT_VERSION
(
DOCUMENT_ID INT,
@@ -911,6 +917,7 @@
-- query rewriting which the parser undertakes for grouped
-- and aggregated queries.
--
+
create table bug280
(
a int,
@@ -985,4 +992,4 @@
1 |1
ij> drop table bug280;
0 rows inserted/updated/deleted
-ij>
+ij>
\ No newline at end of file
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/bit.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/bit.out?view=diff&rev=498002&r1=498001&r2=498002
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/bit.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/bit.out Fri Jan 19 15:18:24 2007
@@ -17,6 +17,7 @@
--
-- Test the builtin type 'bit'
-- Specifically the base-16, hex bit literal
+
-- stupid test of literals
values(X'aAff');
1
@@ -206,6 +207,7 @@
ij> --
-- select comparisons
--
+
create table t (b10 char(20) for bit data, vb10 varchar(20) for bit data, b16 char(2) for bit data, vb16 varchar(2) for bit data, lbv LONG VARCHAR FOR BIT DATA, c20 char(20), cv20 varchar(20));
0 rows inserted/updated/deleted
ij> insert into t values (null, null, null, null, null, 'null', 'null columns');
@@ -316,10 +318,12 @@
ij> select vb10 from t where vb10 < X'0000000010';
VB10
----------------------------------------
+
0000000001
ij> select vb10 from t where vb10 <= X'0000000011';
VB10
----------------------------------------
+
0000000001
0000000011
ij> select vb10 from t where vb10 >= X'0000000011';
@@ -331,6 +335,7 @@
ij> select vb10 from t where vb10 <> X'0000000011';
VB10
----------------------------------------
+
0000000001
1111111111
11
@@ -374,9 +379,11 @@
ij> select vb16 from t where vb16 < X'0000000010';
VB16
----
+
ij> select vb16 from t where vb16 <= X'0000000011';
VB16
----
+
ij> select vb16 from t where vb16 >= X'0000000011';
VB16
----
@@ -387,6 +394,7 @@
ij> select vb16 from t where vb16 <> X'0000000011';
VB16
----
+
01
03
ff
@@ -443,6 +451,7 @@
1
--------------------------------------------------------------------------------------------------------------------------------
NULL
+
00000000010000000001
030000000011
11111111111111111111
@@ -451,6 +460,7 @@
1
--------------------------------------------------------------------------------------------------------------------------------
NULL
+
00000000010000000001
000000001103
11111111111111111111
@@ -696,6 +706,7 @@
ERROR 22001: A truncation error was encountered trying to shrink CHAR () FOR BIT DATA '11111111111111111110' to length 9.
ij> AUTOCOMMIT OFF;
ij> -- bug 5160 - incorrect typing of VALUES table constructor on an insert;
+
create table iv (id int, vc varchar(12));
0 rows inserted/updated/deleted
ij> insert into iv values (1, 'abc'), (2, 'defghijk'), (3, 'lmnopqrstcc');
@@ -764,7 +775,9 @@
0 rows inserted/updated/deleted
ij> -- bug 5306 -- incorrect padding of VALUES table constructor on an insert,
-- when implicit casting (bit->char or char->bit) is used.
+
-- 5306: Char -> For Bit Data Types
+
create table bitTable (id int, bv LONG VARCHAR FOR BIT DATA);
0 rows inserted/updated/deleted
ij> insert into bitTable values (1, X'031'), (2, X'032'), (3, X'');
@@ -781,6 +794,7 @@
ij> drop table bitTable;
0 rows inserted/updated/deleted
ij> -- 5306: Bit -> Char
+
create table charTable (id int, cv long varchar);
0 rows inserted/updated/deleted
ij> insert into charTable values (1, x'0101'), (2, x'00101100101001'), (3, x'');
@@ -799,6 +813,7 @@
ij> drop table charTable;
0 rows inserted/updated/deleted
ij> -- Verify that 5306 still works with Union.
+
create table pt5 (b5 char(2) for bit data);
0 rows inserted/updated/deleted
ij> create table pt10 (b10 char (4) for bit data);
@@ -814,6 +829,7 @@
ij> drop table pt10;
0 rows inserted/updated/deleted
ij> -- beetle 5612
+
create table t5612 (c1 char(10), c2 varchar(10), c3 long varchar);
0 rows inserted/updated/deleted
ij> insert into t5612 values (X'00680069', X'00680069', X'00680069');
@@ -824,6 +840,7 @@
ij> values cast(X'00680069' as char(30)), cast(X'00680069' as varchar(30)), cast(X'00680069' as long varchar);
ERROR 42846: Cannot convert types 'CHAR () FOR BIT DATA' to 'CHAR'.
ij> -- DERBY-1085
+
create table npetest1 (col1 varchar(36) for bit data not null, constraint pknpe1 primary key (col1));
0 rows inserted/updated/deleted
ij> create table npetest2 (col2 varchar(36) for bit data, constraint fknpe1 foreign key (col2) references npetest1(col1) on delete cascade);
@@ -851,4 +868,4 @@
0 rows inserted/updated/deleted
ij> drop table npetest1;
0 rows inserted/updated/deleted
-ij>
+ij>
\ No newline at end of file
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/nulls.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/nulls.out?view=diff&rev=498002&r1=498001&r2=498002
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/nulls.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/nulls.out Fri Jan 19 15:18:24 2007
@@ -38,13 +38,13 @@
ij> drop table a;
0 rows inserted/updated/deleted
ij> -- create table with not null column and unique key should work
-create table a (a int not null unique );
+create table a (a int not null constraint auniq unique );
0 rows inserted/updated/deleted
ij> insert into a values (1);
1 row inserted/updated/deleted
ij> -- second insert should fail
insert into a values (1);
-ERROR 23505: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'xxxxGENERATED-IDxxxx' defined on 'A'.
+ERROR 23505: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'AUNIQ' defined on 'A'.
ij> drop table a;
0 rows inserted/updated/deleted
ij> -- alter nullability on a unique column should fail
@@ -236,4 +236,4 @@
0 rows inserted/updated/deleted
ij> drop table a7;
0 rows inserted/updated/deleted
-ij>
+ij>
\ No newline at end of file
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbylang.runall
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbylang.runall?view=diff&rev=498002&r1=498001&r2=498002
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbylang.runall (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbylang.runall Fri Jan 19 15:18:24 2007
@@ -5,15 +5,12 @@
lang/AggregateClassLoading.java
lang/CharUTF8.java
lang/DB2IsolationLevels.sql
-lang/LOB.sql
lang/LOBDB2compatibility.sql
-lang/aggregate.sql
lang/aggregateOptimization.sql
lang/altertable.sql
lang/altertableDropColumn.sql
lang/authorize.sql
lang/autoincrement.sql
-lang/bit.sql
lang/bug4356.java
lang/bug5052rts.java
lang/bug5054.java
@@ -81,7 +78,6 @@
lang/modifyColumn.sql
lang/nestedCommit.sql
lang/nonreserved.sql
-lang/nulls.sql
lang/openScans.sql
lang/optimizerOverrides.sql
lang/orderby.sql
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangScripts.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangScripts.java?view=diff&rev=498002&r1=498001&r2=498002
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangScripts.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangScripts.java Fri Jan 19 15:18:24 2007
@@ -59,14 +59,20 @@
/**
* Language SQL scripts (.sql files) that only run in embedded.
+ * Most tests that are testing SQL functionality can just
+ * run in emebdded.
*/
private static final String[] EMBEDDED_TESTS = {
"aggbuiltin",
+ "aggregate",
"arithmetic",
+ "bit",
"comparisons",
"delete",
"depend",
"insert",
+ "LOB",
+ "nulls",
"schemas",
"select",
"stringtypes",
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/nulls.sql
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/nulls.sql?view=diff&rev=498002&r1=498001&r2=498002
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/nulls.sql (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/nulls.sql Fri Jan 19 15:18:24 2007
@@ -39,7 +39,7 @@
drop table a;
-- create table with not null column and unique key should work
-create table a (a int not null unique );
+create table a (a int not null constraint auniq unique );
insert into a values (1);
-- second insert should fail
insert into a values (1);