pgsqlを使って、注文する時に、エラーが生じてしまいました
- Dominant language
- PHP
- Stars
- 13
- Forks
- 26
- PR merge metrics
- No merged PRs in 30d
Description
## 概要(Overview)
●pgsqlを使って、注文する時に、エラーが生じてしまいました。
●mysqlを使って、そんなエラーが発生していません。
## 期待する内容(Expect) or 要望 (Requirement)
●注文が正常に完了できたいです。
## 再現手順(Procedure)
①会員を作成して、一回目の購入は数量にて「任意」で入力します。→注文がOKです。
②販売価格(円)に「1100000」を設定。
③二回目の購入: 数量に「8417」にします。(税金はデフォルトです)
④ご注文内容のご確認へ移す
⑤注文するボタンを押すと、エラーが発生してしまいました。
●エラーログ
[2017-12-28 12:21:05,288552] front.ERROR [3b13d993] [3a3ad52b] [1] [ShoppingController:confirm:245] - 予期しないエラー
["An exception occurred while executing 'UPDATE dtb_customer SET last_buy_date = ?, buy_times = ?, buy_total = ?, update_date = ? WHERE customer_id = ?'
with params [\"2017-12-28 12:21:05\", 2, 19999388000, \"2017-12-28 12:21:05\", 1]:\n\nSQLSTATE[22003]:
Numeric value out of range: 7 ERROR: numeric field overflow\nDETAIL: A field with precision 10, scale 0 must round to an absolute value less than 10^10."] [
POST, /ec-cube-pg/html/index_dev.php/shopping/confirm, ::1, http://localhost:41837/ec-cube-pg/html/index_dev.php/shopping, Mozilla/5.0
(Windows NT 6.1; WOW64) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2]
●理由は「一回目」と「二回目」の購入の合計がオーバーフローしてしまいましたからです。
### 環境 (environment)
+ EC-CUBE: master(>3.0.15)
+ PHP: 7.1
+ DB:
- PostgreSQL 9.6
Contributor guide
Research direction
Reproduce the PostgreSQL purchase flow using the listed steps, then inspect ShoppingController:confirm around line 245 and the dtb_customer update for buy_total. Compare the PostgreSQL schema with the logged precision-10 overflow and verify that the second purchase completes successfully without breaking the existing MySQL behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, php, postgresql
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100