Activities

July 10
László Csontos updated LPS-48408.
László Csontos updated LPS-44946.
7:17 AM
László Csontos updated LPS-48408.
7:17 AM
László Csontos added LPS-48408.
July 9
László Csontos updated LPS-39295.
9:58 AM
László Csontos commented on LPS-31710.
9:56 AM This is also an issue on DB2 ... {code} db2 => create table test (a int, b int) DB20000I The SQL command completed successfully. db2 => insert into test (b) values (1) DB20000I The SQL command completed successfully. db2 => insert into test (b) values (1) DB20000I The SQL command completed successfully. db2 => create unique index test_ix on test (a, b) DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL0603N A unique index cannot be created because the table contains data that would result in duplicate index entries. SQLSTATE=23515 db2 => select * from test A B ----------- ----------- - 1 - 1 2 record(s) selected. {code} ... and on Oracle. {code} SQL> create table test (a int, b int); Table created. SQL> insert into test (b) values (1); 1 row created. SQL> insert into test (b) values (1); 1 row created. SQL> create unique index test_ix on test (a, b); create unique index test_ix on test (a, b) * ERROR at line 1: ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys found {code} When a unique index is created, some databases don't differentiate between NULL and NULL in this case. For that reason they treat these two records equivalent. On MySQL this isn't and issue. {code} mysql> create table test (a int, b int); Query OK, 0 rows affected (0.02 sec) mysql> insert into test (b) values (1); Query OK, 1 row affected (0.01 sec) mysql> insert into test (b) values (1); Query OK, 1 row affected (0.01 sec) mysql> create unique index test_ix on test (a, b); Query OK, 0 rows affected (0.03 sec) Records: 0 Duplicates: 0 Warnings: 0 {code}
László Csontos updated LPS-31710.
9:56 AM
July 8
László Csontos updated LPS-47431.
4:31 AM
László Csontos updated LPS-31710.
László Csontos updated LPS-31710.
Subscribe to László Csontos's activities. (Opens New Window)