sqlitebrowser / sqlitebrowser/sqlitebrowser

Foreign Key Constraint Changed Erroneously

Abierto
#3,862 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
C++
Estrellas
24.6k
Forks
2.4k
Merge medio
3 d 49 min
PR fusionados (30 d)
3

Descripción

Details for the issue

What did you do?

I was attempting to add a record to a table which had a field with a foreign key constraint to another table.

What did you expect to see?

I expected that adding the record with a valid value for the field with the FK would be successful.

What did you see instead?

A foreign key constraint error would be thrown. I confirmed the value existed in the referenced table in the FK. Afterwards, I checked the FK constraint using the Database Structure tab to verify it was correct. However, the FK was changed to reference a different table. Which I thought was odd because I didn't change it. So I changed it back to the reference the correct table. However, after trying to add the new record I again was met with the same foreign key constraint error. I then went back to the Database Structure tab only to find that the FK reference table had been changed back to the wrong table again. I went back and forth several times with no luck. For some reason the FK reference table kept reverting back to the wrong table even though I corrected it and no error was shown. I tried closing the database and reopening. I tried closing the program and reopening but nothing worked. Eventually, I tried just adding the record using a valid value for the incorrectly referenced table just to see if I could add the row. I was able to. I was then able to change the referenced table for the FK to the correct one using the Database Structure tab finally. However, the referenced column changed erroneously the first time I tried to a column that I didn't select. I tried again to change it to the correct column and finally it took and everything looks good again for the FK. I was able to modify the row to the correct values finally.

I've been using this database without modification to the structure for a while now. I've added many rows to the tables I've described here without issue. This error occurred during a fairly long session of data entry (1-2 hours) where I was adding rows to the same tables. It was very strange but at the moment everything seems ok.

Useful extra information

DB4S v3.13.1 [built for x86_64-little_endian-llp64] on Windows 10 Version 2009 (winnt/10.0.22631) [x86_64]
using SQLite Version 3.46.1
and Qt 5.15.2

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza reproduciendo los cambios de claves foráneas en DB4S v3.13.1 con SQLite 3.46.1 en Windows 10, usando la pestaña Database Structure durante una sesión prolongada de introducción de datos. Compara la tabla y la columna de referencia seleccionadas con la restricción resultante después de insertar una fila. Se considera terminado cuando la tabla o columna incorrecta ya no reemplaza la selección del usuario, o cuando la causa está documentada con un caso reproducible.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
cpp, sqlite
Área
database, desktop
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.