Strange cyclic reference error with MySQL-4.1

Strange cyclic reference error with MySQL-4.1

am 09.01.2003 00:39:00 von Jocelyn Fournier

Hi,

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 |
+---+---+------------+
1 row in set (0.00 sec)

works fine.

What's wrong with the first query ? :)

Regards,
Jocelyn

------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread13429@lists.mysql.com
To unsubscribe, e-mail

Re: Strange cyclic reference error with MySQL-4.1

am 30.01.2003 13:38:53 von Sanja Byelkin

Hi!

On Wed, Jan 08, 2003 at 11:39:00PM -0000, Jocelyn Fournier wrote:
> Hi,
>
> 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 |
> +---+---+------------+
> 1 row in set (0.00 sec)
>
> works fine.
>
> What's wrong with the first query ? :)

Thank you for bug report. It was error in cycle detection algorithm. But I
removed it completely because now we have even more strict mechanism to
checking references. Patch is committed.

--
For technical support contracts, visit https://order.mysql.com/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Oleksandr Byelkin
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer
/_/ /_/\_, /___/\___\_\___/ Lugansk, Ukraine
<___/ www.mysql.com

------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread13639@lists.mysql.com
To unsubscribe, e-mail