inserting null on an autoincrement primary key prevents cleanup
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 38/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- php
- 領域
- databases, testing-qa
調査の方向性
まず、自動インクリメント主キーを使用して haveInDatabase(table, ['id' => null, ...]) のケースを再現し、その後、teardown cleanup のために挿入された ID がどのように記録されるかを追跡します。生成された主キーの値が保持され、cleanup 中に挿入された行が削除され、かつ autoincrement 列が主キーではないケースを壊さないことを確認できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
When I have a table with a primary key column that's also increment, it's valid to set it to null on the insert statement. the last insert it will then return the auto increment value, which is the primary key in that case.
As already noticed in #44, the auto increment column doesn't have to be part of the primary key, so the return value of last insert id ironically doesn't necessarily belong to the primary key. However, #44 also broke the case, which one might perceive as more common, that the last insert id may also be the primary key.
So, haveInDatabase(table, ['id' => null, ...]) with id as autoincrement and pk will lead to the id being set to null for cleanup, which results in the row not being removed at teardown.
I have prepared a fix for this case, which hopefully is specific enough to not interfere with other use cases.
- 主要言語
- PHP
- スター
- 23
- フォーク
- 31
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Codeception/module-db のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
Codeception/module-db#87 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
Codeception/module-db#85 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
Codeception/module-db#68 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
Codeception/module-db#67 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
Codeception/module-db#54 ·
Codeception/module-db の issue をすべて見る
似ている issue
-
status/awaiting_triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
WordPress/plugin-check#1486 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
az-digital/az_quickstart#6019 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
grokability/snipe-it#19688 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100