db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1455992 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/NullsTest.java
Date Wed, 13 Mar 2013 15:12:50 GMT
Author: kahatlen
Date: Wed Mar 13 15:12:50 2013
New Revision: 1455992

URL: http://svn.apache.org/r1455992
Log:
DERBY-6075: Add negative test for unsupported syntax

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/NullsTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/NullsTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/NullsTest.java?rev=1455992&r1=1455991&r2=1455992&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/NullsTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/NullsTest.java
Wed Mar 13 15:12:50 2013
@@ -51,6 +51,9 @@ public class NullsTest extends BaseJDBCT
     public void testCreate() throws SQLException{
         Statement st = createStatement();
 
+        // A column cannot be declared explicitly nullable.
+        assertCompileError("42X01", "create table a(a1 int null)");
+
         //Trying to define null and not null for a column
         String sql = "create table a(a1 int null not null)";
         assertStatementError("42X01", st, sql);
@@ -117,6 +120,9 @@ public class NullsTest extends BaseJDBCT
                 "constraint ap1 primary key";
         assertStatementError("42X01", st, sql);
 
+        // Adding explicitly nullable column should fail.
+        assertCompileError("42X01", "alter table a add column a3 int null");
+
         //Alter table table level primary key constraint on nullable column
         //doesn't give an error
         sql = "alter table a add constraint ap1 primary key(a1,a2)";



Mime
View raw message