[h2] index problem

2022-12-25 Thread mche...@gmail.com
hi, i got 18 millions role, i select and order with a column with index, 
very fast. Then i manually changed nearly all the values of that column, 
select become very slow, seems the index won't rebuild after i changed the 
column values, how to prevent it?
thanks

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/3a8b2b13-ee49-44d1-bd39-4aee71d4300fn%40googlegroups.com.


[h2] Re: Getting names of unique constraints via hibernate

2022-12-25 Thread Evgenij Ryazanov
Hello!

H2 doesn't return names of constrains in these exceptions (maybe it will in 
future versions). If you need to find name of constraint, you need to check 
INFORMATION_SCHEMA.TABLE_CONSTRAINTS table. You need only rows where 
TABLE_SCHEMA and TABLE_NAME match schema and name of updated table.

* For primary key violations situation is simple, because a table may have 
only one such constraint, so you need a row with CONSTRAINT_TYPE = 'PRIMARY 
KEY'.

* For unique index violations you need to read index name from exception 
and find a row with matched names in INDEX_SCHEMA and INDEX_NAME columns. *If 
there is no such row, it isn't a violation of a unique constraint, but it 
is a violation of unique index (and you already know name of this index), 
unique indexes may exist without constraints*. Alternatively you can parse 
column names from exception and search them in 
INFORMATION_SCHEMA.KEY_COLUMN_USAGE, but such check will be significantly 
more complicated than check by index name.

Names of both primary key and unique constraints can be read from 
CONSTRAINT_SCHEMA and CONSTRAINT_NAME columns in matched rows.

Indexes used by constraint may have any names, there is no mandatory 
suffix. Constraints can and will use any compatible existing index instead 
of own one if such index already exist, so you cannot determine name of 
constraint from name of its index without 
INFORMATION_SCHEMA.TABLE_CONSTRAINTS table.

There is also a special case for names in exceptions. It is possible to 
create an index with non-ASCII or non-printable characters. Index PUBLIC.Ä 
(or PUBLIC.U&"\00c4", both names are equivalent in SQL) will be reported as 
"PUBLIC.U&""\\00c4"" in exception, but you need to find a row with INDEX_NAME 
= 'Ä' (or INDEX_NAME = U&'\00c4').

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/c3d147b9-0339-4fd7-8113-f115068b144bn%40googlegroups.com.


[h2] Getting names of unique constraints via hibernate

2022-12-25 Thread Tadashi Shibata
I need to fix hibernate so that I can get names of unique constraints from 
exceptions.
I made a fix and it works fine at least for me.
Before pull request, there are two points I want to know:
- I can not extract constraint name from the message in case of primary key 
constraint violation even when it is explicitly named, can I?
- I'm going to leave suffix sometimes added by H2 Database. Should I remove 
it? (Although I don't know the naming rule)
Those two points don't matter for me but it should be good also for others.

BR,
Tadashi

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/99956287-5f5e-4b81-804a-51c36f52ee2fn%40googlegroups.com.


[h2] H2Database 1.4.x security backports

2022-12-25 Thread Boris Unckel
Please find some backports of CVE fixes for H2Database 1.4.x here:

https://github.com/boris-unckel/h2database/releases

Initially done to keep a fork of WF26.x fixed, it seems some other 
libraries have transitive dependencies to these old versions.
At all: It's better to migrate to the latest original version, which we 
will do as soon as possible.

Happy Christmas

Boris

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/ec5f9612-44e7-4404-b01f-92e840edc1d4n%40googlegroups.com.