db icon indicating copy to clipboard operation
db copied to clipboard

Wrong ColumnSchema::getColumnPhpType for decimal type

Open Gerych1984 opened this issue 3 years ago • 3 comments

Good day. I have my own custom realization for AR::save with ignored not changed rows (for multiple updates from cron). But today i found that it sometimes not works. It was happend if row have decimal DB type, because ColumnSchema::getColumnPhpType returns string for this type (mybe some other types). And as result i have for example string "10" as current value and string "10.00" as oldValue.

Gerych1984 avatar Jan 27 '22 10:01 Gerych1984

Could you write the structure of the table, and if the error occurs in AR or DB, to reproduce it correctly, thanks.

terabytesoftw avatar Jan 27 '22 12:01 terabytesoftw

Thanks for posting in our issue tracker. In order to properly assist you, we need additional information:

  • When does the issue occur?
  • What do you see?
  • What was the expected result?
  • Can you supply us with a stacktrace? (optional)
  • Do you have exact code to reproduce it? Maybe a PHPUnit tests that fails? (optional)

Thanks!

This is an automated comment, triggered by adding the label status:need more info.

yii-bot avatar Jan 27 '22 12:01 yii-bot

Could you write the structure of the table, and if the error occurs in AR or DB, to reproduce it correctly, thanks.

src.zip

Hi - this attached archive contains migration, my abstract record, AR to work with test table and test command. i'm using pgsql and i have that test result. As you can see - decimal returns and casted to string instead of float Снимок экрана от 2022-01-27 21-40-47

Gerych1984 avatar Jan 27 '22 18:01 Gerych1984

@Gerych1984 check please

darkdef avatar Feb 06 '23 18:02 darkdef