-
Notifications
You must be signed in to change notification settings - Fork 180
Solution #194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Solution #194
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,8 @@ | ||
| -- Use our database | ||
| USE ShopDB; | ||
|
|
||
| -- Some data should be created outside the transaction (here) | ||
|
|
||
| -- Start the transaction | ||
| START TRANSACTION; | ||
|
|
||
| -- And some data should be created inside the transaction | ||
| USE ShopDB; | ||
|
|
||
| INSERT INTO Orders (CustomerID, Date) VALUES (1, '2023-01-01'); | ||
| SET @OrderID = LAST_INSERT_ID(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| START TRANSACTION; | ||
| INSERT INTO OrderItems (OrderID, ProductID, Count) VALUES (@OrderID, 1, 1); | ||
| UPDATE Products SET WarehouseAmount = WarehouseAmount - 1 WHERE ID = 1; | ||
| COMMIT; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per checklist item #18 and the previous review, the
Orderstable insert is still executed before the transaction rather than afterCOMMIT;. The tests expect the order creation to happen outside and after the transactional block that handlesOrderItemsandProducts, so you should move this statement belowCOMMIT;.