Hi, Thanks a lot! I can now reproduce the problem very easily now using:
drop table test; create table test(id varchar(1) primary key) as select 'X'; select * from test where id = 'X1'; Probably (not sure yet) H2 converts the 'X1' is first to varchar(1) (truncating the '1') and then compares. Regards, Thomas On Sun, Jan 24, 2010 at 7:13 PM, Martin Cordova <[email protected]> wrote: > Hi Thomas, the database was populated with a script, which was > generated using the last stable version. I migrated to the latest > version to get rid of this problem. I created an empty database, and > then run the script. > > I am using server mode, using this startup command: > > @java -cp h2*.jar -Dh2.baseDir="C:/h2db/data" > -Dh2.cacheSizeDefault=65536 -Xms64M -Xmx256M org.h2.tools.Server -tcp > -tcpShutdownForce -tcpAllowOthers > > A tomcat server connects to the database using this URL: > > <Resource name="jdbc/dinamica" auth="Container" > type="javax.sql.DataSource" > initialSize="5" maxActive="100" maxIdle="10" maxWait="3000" > username="sa" password="basica" > driverClassName="org.h2.Driver" > url="jdbc:h2:tcp://localhost/demodb"/> > > Only one user using the webapp. I also used Eclipse with a JDBC plugin > to access the database and reproduce the problem. > > Regards, > Martin > > > On Sun, Jan 24, 2010 at 1:00 PM, Thomas Mueller > <[email protected]> wrote: >> Hi, >> >> Thanks for your mail. Unfortunately, a screenshot is not enough to >> reproduce the problem. Could you send me the database, or a >> reproducible test case? My test case is: >> >> create table test(id varchar primary key); >> insert into test select x from system_range(1, 10000); >> select * from test where id = '100xx'; >> drop table test; >> >> I have a few more questions: >> - What is your database URL? >> - Did you use multiple connections? >> - With which version of H2 was this database created? You can find it >> out using: select * from information_schema.settings where >> name='CREATE_BUILD' - or have a look in the SQL script created by the >> recover tool. >> - Did the application run out of memory (once, or multiple times)? >> - Do you use any settings or special features (for example, the >> setting LOG=0, or two phase commit, linked tables, cache settings)? >> - Do you use any H2-specific system properties? >> - Is the application multi-threaded? >> - How big is the database (file sizes)? >> - How much heap memory does the Java process have? >> - Is the database usually closed normally, or is process terminated >> forcefully or the computer switched off? >> - Is it possible to reproduce this problem using a fresh database >> (sometimes, or always)? >> - Are there any exceptions (maybe in the .trace.db file)? >> >> Regards, >> Thomas >> >> On Sun, Jan 24, 2010 at 12:51 AM, Martin Cordova >> <[email protected]> wrote: >>> Hello, I am using latest H2 version. The problem is this: >>> >>> This query returns 1 row as expected: >>> >>> SELECT * FROM DEMO.CUSTOMERS where customerid = 'BERGS' >>> >>> There is only 1 record with a value of 'BERGS' in this column, which >>> is a PK for the "customers" table. >>> >>> This query also returns the same row! >>> >>> SELECT * FROM DEMO.CUSTOMERS where customerid = 'BERGSxx' >>> >>> There is no record with a value of "BERGSxx", and it is returning the >>> same row as above. >>> >>> It seems to me that the "=" is not working as expected. >>> >>> This behaviour was also confirmed (using the same database) with the >>> last stable version. >>> >>> Regards, >>> Martin Cordova >>> -- >>> Dinamica - Simple Ajax/J2EE framework >>> http://www.martincordova.com >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "H2 Database" group. >>> To post to this group, send email to [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]. >>> For more options, visit this group at >>> http://groups.google.com/group/h2-database?hl=en. >>> >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "H2 Database" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/h2-database?hl=en. >> >> > > > > -- > Registra tus gastos gratis! > Flexible y fácil de usar > http://www.martincordova.com/gastos > > -- > You received this message because you are subscribed to the Google Groups "H2 > Database" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/h2-database?hl=en. > > -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
