Bugs item #648807, was opened at 2002-12-05 04:44
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=648807&group_id=22866

Category: JBossTest
Group: v4.0
Status: Closed
Resolution: Fixed
Priority: 5
Submitted By: David Jencks (d_jencks)
Assigned to: Peter Fagerlund (peter_f)
Summary: databaseMetaData.getTables has changed

Initial Comment:
Apparently there is a problem of some sort with hslqdb 1.7.1 and 
databaseMetaData.getTables not reporting that a table already 
exists.

This can be seen by running 
org.jboss.test.bmp.test.BMPUnitTestCase twice after a clean 
build on jboss 4 (head).  The first run succeeds, but the second 
fails due to an attempt to create an existing table.

----------------------------------------------------------------------

Comment By: Fred Toussi (fredt)
Date: 2002-12-05 18:39

Message:
Logged In: YES 
user_id=150940

Peter asked me to clarify. HSQLDB behaviour is correct. Both 
comments by Jeremy Boynes (jboynes) are also correct. 
According to the SQL standard, an unquoted 
lowercase/mixedcase identifier is translated by the parser into an 
all-uppercase name, whereas a quoted identifier retains its exact 
case. The database stores the identifier after such translation. So 
CREATE TABLE simpleBean ... is translated into CREATE 
TABLE "SIMPLEBEAN" ... or CREATE TABLE SIMPLEBEAN. 
But CREATE TABLE "simpleBean" .. is not translated.

In JDBC, an identifier is submitted in the exact case that the 
database stored it. Identifiers are also returned in the exact case 
by various MetaData methods.

In the example of two tables named "simpleBean" 
and "SIMPLEBEAN" the name submitted must match the case 
that the DB engine stored after translation.

----------------------------------------------------------------------

Comment By: Jeremy Boynes (jboynes)
Date: 2002-12-05 07:37

Message:
Logged In: YES 
user_id=378919

I also meant to add, I believe (but can't verify) the
standard says the unquoted name should match to a quoted
name containing only uppercase letters i.e simpleBean is the
same as "SIMPLEBEAN" which is why the search must use all
uppercase characters

----------------------------------------------------------------------

Comment By: Jeremy Boynes (jboynes)
Date: 2002-12-05 07:30

Message:
Logged In: YES 
user_id=378919

The SQL standard says unquoted identifiers are
case-insensitive but quoted ones are case-sensitive. So a
database supporting quoted identifers may have two
_different_ tables called, for example, "simpleBean" and
"SIMPLEBEAN". hsqldb 1.6 did not support quoted identifiers
so probably allowed case-insensitve metadata searches to
match identifier lookup. When support for quoted identifiers
was added in 1.7 they would have had to change the search
behaviour to case-sensitive to distinguish the two tables
above. This is consistent with other platforms e.g. Oracle.

----------------------------------------------------------------------

Comment By: David Jencks (d_jencks)
Date: 2002-12-05 07:10

Message:
Logged In: YES 
user_id=60525

Following a comment in a patch for 3.2, I changed all the sql identifiers 
to uppercase which fixes the immediate problem with the test case.  I'm 
still curious why a lowercase string won't retrieve the table name: this 
seems to me to be a bug in hsqldb.  Comments, peter?
thanks
david jencks

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=648807&group_id=22866


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to