db-mysql icon indicating copy to clipboard operation
db-mysql copied to clipboard

Possible Bug value typecast in ColumnSchema for JSON DB data type

Open andryluthfi opened this issue 2 years ago • 2 comments

PHP Warning — Yiisoft\ErrorHandler\Exception\ErrorException Array to string conversion

i think this occurs when phpTypecast call more than one time.

  • 1st call: Convert string (direct value from DB) to array
  • 2nd call: Convert array to array
Q A
Is bugfix? ✔️
New feature?
Breaks BC?
Fixed issues

andryluthfi avatar May 22 '23 18:05 andryluthfi

PR Summary

  • Function phpTypecast() Updated The function now handles JSON columns more efficiently by converting them to arrays when necessary, enhancing data handling.

what-the-diff[bot] avatar May 22 '23 18:05 what-the-diff[bot]

Need a unit test, i could add it.

Thks.

terabytesoftw avatar May 22 '23 18:05 terabytesoftw

Done by https://github.com/yiisoft/db/pull/752

Tigrov avatar Aug 19 '24 06:08 Tigrov