Bug #84053 | unreasonable behavior for union bit type with string | ||
---|---|---|---|
Submitted: | 5 Dec 2016 8:04 | Modified: | 7 Dec 2016 4:09 |
Reporter: | 帅 Bang | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 5.6, 5.7 | OS: | Linux |
Assigned to: | MySQL Verification Team | CPU Architecture: | Any |
[5 Dec 2016 8:04]
帅 Bang
[7 Dec 2016 4:09]
MySQL Verification Team
Hi, If you look at the manual you see: If the data types of corresponding SELECT columns do not match, the types and lengths of the columns in the UNION result take into account the values retrieved by all of the SELECT statements. Looking at your query the data type of the first and second select do not match. The context you are talking about is "local" - inside a single SELECT, it is not a context of "outer" query, namely the main UNION query in this example, so the behavior is expected. The local context returns 1 and 2 and then the union handles the mismatched columns the way it did. kind regards Bogdan Kecman