haveInDatabase() is not usable inside a transaction on PostgreSQL
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 42/100
調査の方向性
haveInDatabase() のエントリーポイントから開始し、トランザクション内で PostgreSQL を使用した場合の lastInsertId() の呼び出しを追跡します。名前が PostgreSQL の生成した名前と異なる主キーシーケンスを使ってケースを再現し、データベースステートメントがトランザクションを暗黙的に中断せずに成功すること、および後続のステートメントが失敗しないことを確認します。
索引モデルが issue の本文から書いたものです。
説明
Our tables have PK sequences with different names than the ones postgres generates automatically. Because of that the lastInsertId() call inside haveInDatabase() generates a silent error.
When you use the method in a transaction, you don't see the actual error but the transaction is marked as "aborted" and you get exception and test fail on the next db statement. Without a transaction the test works fine but leaves other residues, which I hoped to clear by rollback. It took some time to debug and find the actual cause.
I did not find any warning about such limitation or previous mentions of it.
As a workaround I used INSERT .. RETURNING.
- 主要言語
- PHP
- スター
- 23
- フォーク
- 31
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Codeception/module-db のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
Codeception/module-db#85 ·
-
Make optional the auto-erase of the records, added by `haveInDatabase()`対応中かも @iliayatsenko が 723 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
Codeception/module-db#68 · コメント 1 件 ·
-
Fix a confusion between 'cleanup' and 'skip_cleanup_if_failed' configuration params対応中かも @iliayatsenko が 723 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
Codeception/module-db#67 ·
-
inserting null on an autoincrement primary key prevents cleanup対応中かも @jtopenpetition が 1261 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
Codeception/module-db#58 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
Codeception/module-db#54 ·
Codeception/module-db の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
taskforcesh/bullmq#5238 ·
メンテナーはふだん 1 日以内に返信
-
[Bug] v-change-database-password reports success but doesn't change the password when MySQL validate_password rejects it対応中かも @bfs2021 が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Automattic/jetpack#55517 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
-
area/import type/enhancement when/later
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信