Following changes from #15222, a query that selects a single cast statement for a number field causes an error. That’s because yiisoft/yii2/db/Query->normalizeSelect() looks for commas to split the select string into an array of values. Now that we’re casting decimals to decimal(65,16) (for MySQL) and not just decimal, the comma inside there was being matched by normalizeSelect(), causing the raw query to look like:
SELECT DISTINCT CAST((`elements_sites`.`content`->>'$.\"<uid>\"') AS DECIMAL(65, `16))`
instead of
SELECT DISTINCT CAST((`elements_sites`.`content`->>'$.\"<uid>\"') AS DECIMAL(65, 16))
Fixed by excluding commas preceded by an opening parenthesis and two digits.
Description
Following changes from #15222, a query that selects a single cast statement for a number field causes an error. That’s because
yiisoft/yii2/db/Query->normalizeSelect()
looks for commas to split theselect
string into an array of values. Now that we’re casting decimals todecimal(65,16)
(for MySQL) and not justdecimal
, the comma inside there was being matched bynormalizeSelect()
, causing the raw query to look like:instead of
Fixed by excluding commas preceded by an opening parenthesis and two digits.
Related issues
15271