Bug #38 Strange occurance of ERROR 1243: Cyclic reference on subqueries
Submitted: 25 Jan 2003 16:14 Modified: 30 Jan 2003 13:35
Reporter: Alexander Keremidarski Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1 OS:Any (any)
Assigned to: CPU Architecture:Any

[25 Jan 2003 16:14] Alexander Keremidarski
Description:
Cyclic reference on subqueries Error occurs with query where it does not sound logical

How to repeat:
How-to-repeat :

mysql> SELECT 1 as a,(SELECT a+a) b,(SELECT b);
ERROR 1243: Cyclic reference on subqueries

However

mysql> SELECT 1 as a,(SELECT a+a) b,(SELECT 1);
+---+---+------------+
| a | b | (SELECT 1) |
+---+---+------------+
| 1 | 2 |          1 |
+---+---+------------+
1 row in set (0.00 sec)

mysql> SELECT 1 as a,(SELECT a) b,(SELECT b);
+---+---+------------+
| a | b | (SELECT b) |
+---+---+------------+
| 1 | 1 |          1 |
+---+---+------------+

(original Jocelyn question): What's wrong with the first query ?