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 km...@apache.org on 2007/09/12 01:29:25 UTC
svn commit: r574726 -
/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java
Author: kmarsden
Date: Tue Sep 11 16:29:24 2007
New Revision: 574726
URL: http://svn.apache.org/viewvc?rev=574726&view=rev
Log:
DERBY-2972 (followup) Change postive lock table test to use parameter markers instead of casts
Modified:
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java?rev=574726&r1=574725&r2=574726&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java Tue Sep 11 16:29:24 2007
@@ -1078,9 +1078,12 @@
s.executeUpdate("insert into lockfunctesttable values(1)");
// This statement should error because of collation mismatch
assertStatementError("42818",s,"select * from SYSCS_DIAG.LOCK_TABLE where tablename = 'LOCKFUNCTESTTABLE'");
- // we have to cast for it to work.
- rs = s.executeQuery("select * from SYSCS_DIAG.LOCK_TABLE where CAST(tablename as VARCHAR(128))= 'LOCKFUNCTESTTABLE'");
+ // we have to use parameter markers for it to work.
+ ps = prepareStatement("select * from SYSCS_DIAG.LOCK_TABLE where tablename = ?");
+ ps.setString(1,"LOCKFUNCTESTTABLE");
+ rs = ps.executeQuery();
JDBC.assertDrainResults(rs,2);
+
s.executeUpdate("drop table lockfunctesttable");