Bug 1987298 Comment 4 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

SQLite allows `NULL` in primary key [1]. In this case, primary key is not unique (!). You can insert multiple records with the same primary key. So `moz_openpages_temp` does not work as expected.
IMO you should not use `NULL` for `moz_openpages_temp.groupId` to avoid this SQLite "feature". For example, use empty string to represent null group id on `moz_openpages_temp` and convert between empty string and null when reading or writing to the table.

[1] https://stackoverflow.com/questions/64753105/why-can-i-add-null-value-to-primary-key-in-sqlite
SQLite allows `NULL` in primary key [1]. In this case, primary key is not unique (!)[2]. You can insert multiple records with the same primary key. So `moz_openpages_temp` does not work as expected.
IMO you should not use `NULL` for `moz_openpages_temp.groupId` to avoid this SQLite "feature". For example, use empty string to represent null group id on `moz_openpages_temp` and convert between empty string and null when reading or writing to the table.

[1] https://stackoverflow.com/questions/64753105/why-can-i-add-null-value-to-primary-key-in-sqlite
[2] https://sqlite.org/lang_createtable.html#the_primary_key
> For the purposes of determining the uniqueness of primary key values, NULL values are considered distinct from all other values, including other NULLs.

Back to Bug 1987298 Comment 4