Bug #84603 | Multiple reselects of the same UUID() subquery column produces different values | ||
---|---|---|---|
Submitted: | 23 Jan 2017 1:18 | Modified: | 1 Feb 2017 16:51 |
Reporter: | David Bruck | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Data Types | Severity: | S3 (Non-critical) |
Version: | 14.14 | OS: | Windows (10) |
Assigned to: | CPU Architecture: | Any | |
Tags: | MySQL, subquery, UUID |
[23 Jan 2017 1:18]
David Bruck
[23 Jan 2017 1:41]
David Bruck
Workaround by adding an otherwise unused variable: SELECT CONCAT('A: ', A, ', ', B, '-----', B) C FROM ( SELECT @unused := #otherwise useless variable UUID() B ,A FROM ( SELECT 1 A UNION ALL SELECT 2 ) IQ ) OQ;
[1 Feb 2017 16:51]
MySQL Verification Team
Hi! I fail to see where is a bug here !!!! As our manual clearly explains: " A UUID is designed as a number that is globally unique in space and time. Two calls to UUID() are expected to generate two different values " That means that if you have a table t1 with 1000 rows, then the query: SELEECT UUID() from t1; will produce 1000 different values. That is exactly what happens in your nested query.