[fix](type) fix DECIMAL scale when cast function on fe
Proposed changes
Issue Number: close #12717
Problem summary
根据cast传递的DECIMAL类型的精度来处理DECIMAL数据.
before: MySQL [test]> select cast('135.759999999' as DECIMAL(10,3)); +----------------------------------------+ | CAST('135.759999999' AS DECIMAL(10,3)) | +----------------------------------------+ | 135.759999999 | +----------------------------------------+ 1 row in set (0.00 sec)
now: MySQL [stage]> select cast('135.759999999' as DECIMAL(10,3)); +----------------------------------------+ | CAST('135.759999999' AS DECIMAL(10,3)) | +----------------------------------------+ | 135.759 | +----------------------------------------+ 1 row in set (0.01 sec)
Checklist(Required)
- Does it affect the original behavior:
- [x] Yes
- [ ] No
- [ ] I don't know
- Has unit tests been added:
- [ ] Yes
- [ ] No
- [x] No Need
- Has document been added or modified:
- [ ] Yes
- [ ] No
- [x] No Need
- Does it need to update dependencies:
- [ ] Yes
- [x] No
- Are there any changes that cannot be rolled back:
- [ ] Yes (If Yes, please explain WHY)
- [x] No
Further comments
If this is a relatively large or complex change, kick off the discussion at [email protected] by explaining why you chose the solution you did and what alternatives you considered, etc...