db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davi...@apache.org
Subject svn commit: r386169 [24/36] - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master: DerbyNet/jdk16/ DerbyNetClient/jdk16/ jdk16/
Date Wed, 15 Mar 2006 21:31:59 GMT
Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/testij.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/testij.out?rev=386169&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/testij.out
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/testij.out
Wed Mar 15 13:31:53 2006
@@ -0,0 +1,59 @@
+Testing various ij connections and comments in front of selects
+org.apache.derby.tools.ij xxxFILTERED_TESTIJSOURCExxx
+ij> driver 'org.apache.derby.jdbc.ClientDriver';
+ij> --Bug 4632  Make the db italian to make sure string selects  are working
+connect 'jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/wombat;create=true;territory=it' USER
'dbadmin' PASSWORD 'dbadmin';
+ij> connect 'jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/wombat' USER 'dbadmin' PASSWORD
'dbadbmin';
+ij(CONNECTION1)> -- this is a comment, a comment in front of a select should not cause
an error
+select * from sys.systables where 1=0;
+TABLEID |TABLENAME |& |SCHEMAID |&
+-----
+0 rows selected
+ij(CONNECTION1)> -- this is a comment, a comment in front of a values clauses should not
cause an error
+values(1);
+1          
+-----
+1          
+1 row selected
+ij(CONNECTION1)> -- Try some URL attributes
+disconnect all;
+ij> connect 'jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/junk;create=true' USER 'dbadmin'
PASSWORD 'dbadbmin';
+ij> select * from APP.notthere;
+ERROR 42X05: Table 'APP.NOTTHERE' does not exist. : 
+ij> -- examples from the docs
+connect 'jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/wombat;create=true;user=judy;password=judy';
+ij(CONNECTION1)> connect 'jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/./wombat;user=judy;password=judy';
+ij(CONNECTION2)> connect 'jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/toursDB';
+ERROR 08004: The application server rejected establishment of the connection.  An attempt
was made to access a database, toursDB, which was not found.
+ij(CONNECTION2)> connect 'jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/toursDB' USER 'dbadmin'
PASSWORD 'dbadbmin';
+ERROR 08004: The application server rejected establishment of the connection.  An attempt
was made to access a database, toursDB, which was not found.
+ij(CONNECTION2)> connect 'jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/wombat' USER 'APP'
PASSWORD 'APP';
+ij(CONNECTION3)> connect  'jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/my-db-name;create=true;user=usr;password=pwd';
+ij(CONNECTION4)> connect 'jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/my-db-name;upgrade=true;user=usr;password=pwd';
+ij(CONNECTION5)> connect 'jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/my-db-name;shutdown=true;user=usr;password=pwd';
+ERROR 08006: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: Database 'my-db-name'
shutdown.
+ij(CONNECTION5)> connect 'jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/./my-dbname;create=true;user=usr;password=pwd';
+ij(CONNECTION6)> connect 'jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/./my-dbname;create=true;user=usr;password=pwd';
+ij(CONNECTION7)> connect 'jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/toursDB' USER 'dbadmin'
PASSWORD 'dbadbmin';
+ERROR 08004: The application server rejected establishment of the connection.  An attempt
was made to access a database, toursDB, which was not found.
+ij(CONNECTION7)> connect 'jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/wombat' USER 'APP'
PASSWORD 'APP';
+ij(CONNECTION8)> connect  'jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/my-db-name;create=true;user=usr;password=pwd';
+ij(CONNECTION9)> connect 'jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/my-db-name;upgrade=true;user=usr;password=pwd';
+ij(CONNECTION10)> connect 'jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/my-db-name;shutdown=true;user=usr;password=pwd';
+ERROR 08006: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: Database 'my-db-name'
shutdown.
+ij(CONNECTION10)> -- Database names with /'s
+connect 'jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/./my-dbname;create=true;user=usr;password=pwd';
+ij(CONNECTION11)> connect 'jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/./my-dbname;create=true;user=usr;password=pwd';
+ij(CONNECTION12)> -- retrieveMessageText Testing
+connect 'jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/my-db-name;create=true;user=usr;password=pwd;retrieveMessageText=false';
+ij(CONNECTION13)> -- Should not get message text
+select * from APP.notthere;
+ERROR 42X05: DERBY SQL error: SQLCODE: -1, SQLSTATE: 42X05, SQLERRMC: Table 'APP.NOTTHERE'
does not exist.
+ij(CONNECTION13)> connect 'jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/my-db-name;create=true;user=usr;password=pwd;retrieveMessageText=true';
+ij(CONNECTION14)> -- Should see message text
+select * from APP.notthere;
+ERROR 42X05: Table 'APP.NOTTHERE' does not exist. : 
+ij(CONNECTION14)> -- just user security mechanism
+connect 'jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/my-db-name;create=true;user=usr;retrieveMessageText=true';
+ij(CONNECTION15)> connect 'jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/wombat' USER 'APP';
+ij(CONNECTION16)> 

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/unaryArithmeticDynamicParameter.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/unaryArithmeticDynamicParameter.out?rev=386169&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/unaryArithmeticDynamicParameter.out
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/unaryArithmeticDynamicParameter.out
Wed Mar 15 13:31:53 2006
@@ -0,0 +1,172 @@
+Test using parameters for unary minus and unary plus
+insert into t1 values(?,+?,-?,?)
+? parameter type is INTEGER
+unary +? parameter type is SMALLINT
+unary -? parameter type is DOUBLE
+select * from t1 where -? in (select c21 from t2)
+unary -? parameter type is INTEGER
+	 C11,C12,C13,C14
+	 --- --- --- ---
+	{1,1,1.1,abc}
+	{-1,-1,-1.0,def}
+select * from t1 where c11 = -? and c12 = +? and c13 = ?
+unary -? parameter type is INTEGER
+unary +? parameter type is SMALLINT
+? parameter type is DOUBLE
+	 C11,C12,C13,C14
+	 --- --- --- ---
+	{1,1,1.1,abc}
+	 C11,C12,C13,C14
+	 --- --- --- ---
+	{-1,-1,-1.0,def}
+select * from t1 where -? = ABS_FUNCT(+?)
+unary -? parameter type is INTEGER
+unary +? parameter type is INTEGER
+	 C11,C12,C13,C14
+	 --- --- --- ---
+	{1,1,1.1,abc}
+	{-1,-1,-1.0,def}
+select * from t1 where -? = max_cni(-5,-1)
+unary -? parameter type is INTEGER
+	 C11,C12,C13,C14
+	 --- --- --- ---
+	{1,1,1.1,abc}
+	{-1,-1,-1.0,def}
+select * from t1 where -? = max_cni(-?,+?)
+unary -? parameter type is INTEGER
+unary -? parameter type is INTEGER
+unary +? parameter type is INTEGER
+	 C11,C12,C13,C14
+	 --- --- --- ---
+	{1,1,1.1,abc}
+	{-1,-1,-1.0,def}
+Try the function again. But use, use sqrt(+?) & abs(-?) functions to send params
+select * from t1 where -? = max_cni(abs(-?), sqrt(+?))
+unary -? parameter type is INTEGER
+unary -? parameter type is DOUBLE
+unary +? parameter type is DOUBLE
+	 C11,C12,C13,C14
+	 --- --- --- ---
+	{1,1,1.1,abc}
+	{-1,-1,-1.0,def}
+select * from t1 where c11 between -? and +?
+unary -? parameter type is INTEGER
+unary +? parameter type is INTEGER
+	 C11,C12,C13,C14
+	 --- --- --- ---
+	{1,1,1.1,abc}
+select * from t1 where +? not in (-?, +?, 2, ?)
+unary +? parameter type is INTEGER
+unary -? parameter type is INTEGER
+unary +? parameter type is INTEGER
+? parameter type is INTEGER
+	 C11,C12,C13,C14
+	 --- --- --- ---
+	{1,1,1.1,abc}
+	{-1,-1,-1.0,def}
+select * from t1 where +? < c12
+unary +? parameter type is SMALLINT
+	 C11,C12,C13,C14
+	 --- --- --- ---
+	{1,1,1.1,abc}
+select * from t1 where -? = c11 + ?
+unary -? parameter type is INTEGER
+? parameter type is INTEGER
+	 C11,C12,C13,C14
+	 --- --- --- ---
+	{-1,-1,-1.0,def}
+select * from t1 where c11 + ? = -?
+? parameter type is INTEGER
+unary -? parameter type is INTEGER
+	 C11,C12,C13,C14
+	 --- --- --- ---
+	{-1,-1,-1.0,def}
+select * from t1 where c11 + c12 = -?
+unary -? parameter type is INTEGER
+	 C11,C12,C13,C14
+	 --- --- --- ---
+	{-1,-1,-1.0,def}
+select * from t1 where -? not in (select c21+? from t2)
+unary -? parameter type is INTEGER
+? parameter type is INTEGER
+	 C11,C12,C13,C14
+	 --- --- --- ---
+	{1,1,1.1,abc}
+	{-1,-1,-1.0,def}
+select cast(-? as smallint), cast(+? as int) from t1
+unary -? parameter type is SMALLINT
+unary +? parameter type is INTEGER
+	 1,2
+	 - -
+	{-2,2}
+	{-2,2}
+select nullif(-?,c11) from t1
+unary -? parameter type is INTEGER
+	 1
+	 -
+	{-22}
+	{-22}
+select sqrt(-?) from t1
+unary -? parameter type is DOUBLE
+	 1
+	 -
+	{8.0}
+	{8.0}
+select * from t1 where c11 = any (select -? from t2)
+SQL State : 42X34
+Got expected exception There is a ? parameter in the select list.  This is not allowed. :

+Negative test - -?/+? at the beginning and/ at the end of where clause
+select * from t1 where -? and c11=c11 or +?
+SQL State : 42X19
+Got expected exception The WHERE or HAVING clause or CHECK CONSTRAINT definition is a 'PARAMETER'
expression.  It must be a BOOLEAN expression. : 
+Negative test - -?/+? in like escape function
+select * from sys.systables where tablename like -? escape +?
+SQL State : 42X37
+Got expected exception The unary '-' operator is not allowed on the 'VARCHAR' type. : 
+Negative test - -?/+? in binary timestamp function
+select timestamp(-?,+?) from t1
+SQL State : 42X37
+Got expected exception The unary '-' operator is not allowed on the 'DATE' type. : 
+Negative test - -? in unary timestamp function
+select timestamp(-?) from t1
+SQL State : 42X36
+Got expected exception The 'timestamp' operator is not allowed to take a ? parameter as an
operand. : 
+Negative test - -? in views
+create view v1 as select * from t1 where c11 = -?
+SQL State : 42X98
+Got expected exception Parameters are not allowed in a VIEW definition. : 
+Negative test - -? in inner join
+select * from t1 inner join t1 as t333 on -?
+SQL State : 42X37
+Got expected exception The unary '-' operator is not allowed on the 'BOOLEAN' type. : 
+Negative test - -? by itself in where clause
+select * from t1 where -?
+SQL State : 42X19
+Got expected exception The WHERE or HAVING clause or CHECK CONSTRAINT definition is a 'PARAMETER'
expression.  It must be a BOOLEAN expression. : 
+Negative test - -? is null not allowed because is null allowed on char types only
+select * from t1 where -? is null
+SQL State : 42X37
+Got expected exception The unary '-' operator is not allowed on the 'VARCHAR' type. : 
+select case when -?=c11 then -? else c12 end from t1
+unary -? parameter type is INTEGER
+unary -? parameter type is SMALLINT
+	 1
+	 -
+	{1}
+	{-22}
+Negative test - unary plus parameters on both sides of / operator
+select * from t1 where c11 = ?/-?
+SQL State : 42X35
+Got expected exception It is not allowed for both operands of '/' to be ? parameters. : 
+Negative test - unary plus in | | operation
+select c11 | | +? from t1
+SQL State : 42X37
+Got expected exception The unary '+' operator is not allowed on the 'VARCHAR' type. : 
+Negative test - unary minus for char column
+select * from t1 where c14 = -?
+SQL State : 42X37
+Got expected exception The unary '-' operator is not allowed on the 'CHAR' type. : 
+Negative test - unary plus for char column
+select * from t1 where c14 like +?
+SQL State : 42X37
+Got expected exception The unary '+' operator is not allowed on the 'CHAR' type. : 



Mime
View raw message