cuba icon indicating copy to clipboard operation
cuba copied to clipboard

No validation for creation new user with existing login for HSQLDB

Open maistrenkoIulia opened this issue 5 years ago • 1 comments

Environment

  • Platform version: 7.2.6

  • Database: HSQLDB

  • Operating system: Windows

Description of the bug or enhancement

  • Minimal reproducible example create new project -> start app login as Admin -> Administration - Users create new user with login = admin, pass = 1 -> OK
  • Expected behavior "User with the same login already exists"
  • Actual behavior no validation error

maistrenkoIulia avatar Jul 17 '20 07:07 maistrenkoIulia

This is a known issue for HSQL and it stems from the fact that HSQL follows SQL standard when treating nulls in indexes but doesn't support partial indexes:

http://www.hsqldb.org/doc/1.8/guide/ch02.html

A row, in which the value for any of the UNIQUE constraint columns is NULL, can always be added to the table. So multiple rows can contain the same values for the UNIQUE columns if one of the values is NULL.

In other DBMS we use partial indexes (Postgres), triggers (MySQL) or the DBMS just doesn't conform to the standard and ignores nulls in unique indexes (MS SQL, Oracle).

We consider HSQL as prototype-only DB, so we can live with this issue.

knstvk avatar Aug 17 '20 05:08 knstvk