hsqldb and case sensitivity

View: New views
2 Messages — Rating Filter:   Alert me  

hsqldb and case sensitivity

by Erick Erickson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Using Grails 1.0.3 and Groovy 1.5.6

I *swear* I've asked this before, but I sure can't find it in the
archive.

HSQLDB is, by default, case sensitive. I can't find any way to turn
case sensitivity off. The only thing I could find by googling and
searching the archives was SET IGNORECASE TRUE. But
my (simple-minded) attempt to do this through a Sql.execute
call didn't make any difference.

I'm also unclear how to set this before any domain classes
are turned into tables. What this usually means is that I'm
looking in the completely wrong place.


This causes me grief when I try to run integration tests. I want
to be sure that we handle case insensitivity consistently
between MySql (where case does not matter in our definitions)
and integration tests. If I strain, I can make the case that my
code could mess up because of case *outside* of the db
queries....

One can certainly argue that since these are different databases,
making HSQLDB behave case-insensitively is pretty silly since
tests and production use *different* databases. Spending time
with tests that fail because of case is a waste. But if there's an
easy way to do this, it would make my life a bit easier...

Thanks
Erick

Re: hsqldb and case sensitivity

by Erick Erickson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

*bump*

On Tue, Oct 7, 2008 at 11:35 AM, Erick Erickson <erickerickson@...> wrote:
Using Grails 1.0.3 and Groovy 1.5.6

I *swear* I've asked this before, but I sure can't find it in the
archive.

HSQLDB is, by default, case sensitive. I can't find any way to turn
case sensitivity off. The only thing I could find by googling and
searching the archives was SET IGNORECASE TRUE. But
my (simple-minded) attempt to do this through a Sql.execute
call didn't make any difference.

I'm also unclear how to set this before any domain classes
are turned into tables. What this usually means is that I'm
looking in the completely wrong place.


This causes me grief when I try to run integration tests. I want
to be sure that we handle case insensitivity consistently
between MySql (where case does not matter in our definitions)
and integration tests. If I strain, I can make the case that my
code could mess up because of case *outside* of the db
queries....

One can certainly argue that since these are different databases,
making HSQLDB behave case-insensitively is pretty silly since
tests and production use *different* databases. Spending time
with tests that fail because of case is a waste. But if there's an
easy way to do this, it would make my life a bit easier...

Thanks
Erick

LightInTheBox - Buy quality products at wholesale price!