Myrna van Lunteren <[EMAIL PROTECTED]> writes:
> On 03 Feb 2006 22:30:46 +0100, Knut Anders Hatlen <[EMAIL PROTECTED]>
> wrote:
> >
> > Hi,
> >
> > I have a question about a test case for DERBY-44 (which appears to
> > have been fixed by Myrna).
> >
> > In jdbcapi/parameterMetaDataJdbc30.java, I found this test case:
> >
> > // variation, and also test out empty string in the escape (jira 44).
> > System.out.println("variation 1, testing jira 44");
> > ps = con.prepareStatement("select * from sys.systables where tablename
> > like ? escape ?");
> > ps.setString (1, "SYS%");
> > ps.setString (2, "");
> > paramMetaData = ps.getParameterMetaData();
> > System.out.println("parameters count for prepared statement is " +
> > paramMetaData.getParameterCount());
> > dumpParameterMetaData(paramMetaData);
> > ps.execute();
> >
> > I wonder what the purpose of this test is. Is it to test that the
> > escape keyword is accepted by the SQL parser/compiler, or is it to
> > test that specifiying an empty escape string shouldn't cause
> > ps.execute() to fail?
>
> It was not at all clear, but after much digging through old tests and
> repros ;-)
> it appears this test is trying to make sure ERROR 22019 is returned. At one
> point, passing on the empty string in a piece of code like this would
> generate an StringIndexOutOfBoundsException instead of ERROR 22019 on the
> ps.execute().
Thank you for doing the historical research! :)
It is ERROR 22019 I am seeing. Funny thing, though, that this error is
not expected in any of the frameworks.
I guess it's okay to replace the ps.execute() line with
ResultSet rs = ps.executeQuery();
rs.next();
so that we get ERROR 22019 in all frameworks. Hopefully, no one thinks
it's a problem that DerbyNetClient fails on execute() and embedded and
DerbyNet fail on next().
--
Knut Anders