Bug #101368 charset assignment does not take any effect in str2my_decimal

Submitted: 29 Oct 2020 7:36 Modified: 29 Oct 2020 12:57
Reporter: Li Zhong Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any

[29 Oct 2020 7:36] Li Zhong
Description:
In sql/my_decimal.cc str2my_decimal(uint mask, const char *from, size_t length, const CHARSET_INFO *charset, my_decimal *decimal_value):
 
Line 251:     charset = &my_charset_bin;

This assignment does not truly assign where charset points to with my_charset_bin (which should have been *charset = my_charset_bin). 

On the other hand, if regarding it as a value assignment, the value of charset itself no longer get used in this function, which is strange.

How to repeat:
In source code of mysql-8.0.21
[29 Oct 2020 12:57] MySQL Verification Team
Hi Mr. Zhong,

Thank you for your bug report.

However, this is not a bug.

The described assignment is there to reset the parameter to its default value. Since the left side in question is a pointer to the structure of the same type as the right value, it makes lots of sense.

Not a bug.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.039 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.