sqlitebrowser / sqlitebrowser/sqlitebrowser
Foreign Key Constraint Changed Erroneously
まだ誰も着手していません。
- 主要言語
- C++
- スター
- 24.6k
- フォーク
- 2.4k
- 平均マージ
- 3日 49分
- マージ済み PR(30日)
- 3
説明
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
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、Windows 10 上で SQLite 3.46.1 を使用し、長時間のデータ入力セッション中に Database Structure タブを使って、DB4S v3.13.1 の外部キー変更を再現します。選択した参照テーブルと列を、行を挿入した後に生成される制約と比較します。誤ったテーブルまたは列によってユーザーの選択が置き換えられなくなったこと、または原因が再現可能なケースとともに文書化されたことをもって完了とします。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- cpp, sqlite
- 領域
- database, desktop
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100