Empty some values of mysqli_get_charset()#21361
Empty some values of mysqli_get_charset()#21361kamil-tekiela wants to merge 3 commits intophp:masterfrom
Conversation
Girgias
left a comment
There was a problem hiding this comment.
I think the rationale makes sense. I'd add some comments for the properties you are adding that these are kept due to BC reasons.
|
I wouldn't skip/remove the charset->id check, since an error can indicate that a new character set/collation is not supported by mysqlnd. Instead we should obtain the character sets from information_schema.collations and check if the id is part of the list: get_charset.php: then in test: |
Right, but what impact would that have on mysqlnd? Wouldn't it be better to test the actual functionality that relies on it? If a new collation appears that's unsupported by mysqlnd then either the handshake or the |
stateanddirwere already constants.commentwas undocumented and probably exposed unintentionally, as it doesn't report anything useful.numberis emptied because this value probably should not be exposed to the users. It can be misleading. The value represents the ID that PHP associates with that character set based on the IDs of the default collations on the server (which can change so it can never be relied upon).Before anyone asks about BC: this function never promised that the values wouldn't change. In the past, it has changed depending on which driver was used. I doubt anyone uses this useless function, but to keep the BC to minimum, the structure remains as documented in the PHP manual. Using the old values could even be considered a programming error as they haven't got a meaning outside of mysqlnd internals.
See #21338