Bugs in error message where using derived table and join in MySQL-4.1

Bugs in error message where using derived table and join in MySQL-4.1

am 27.11.2002 11:41:06 von Jocelyn Fournier

Hi,

How-to-repeat :

SELECT 1 FROM (SELECT 1),(SELECT 1);
ERROR 1066: Not unique table/alias: ''

If you try to add one alias :

mysql> SELECT 1 FROM (SELECT 1),(SELECT 1) as t2;
+---+
| 1 |
+---+
| 1 |
+---+

It works.

Then, if you try to do a LEFT JOIN, you'll get the following error :

mysql> SELECT 1 FROM (SELECT 1) LEFT JOIN (SELECT 1) as t2 USING (t);
ERROR 1109: Unknown table 'taist.' in on clause

mysql> SELECT 1 FROM (SELECT 1 as a) as t LEFT JOIN (SELECT 1 as a) as t2
USING (a);
ERROR 1109: Unknown table 'taist.t' in on clause

(BTW there is a small imprecision here, since there is no 'on' clause ;))


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-thread13126@lists.mysql.com
To unsubscribe, e-mail

Re: Bugs in error message where using derived table and join in MySQL-4.1

am 27.11.2002 19:17:02 von Sinisa Milivojevic

Jocelyn Fournier writes:
> Hi,
>
> How-to-repeat :
>
> SELECT 1 FROM (SELECT 1),(SELECT 1);
> ERROR 1066: Not unique table/alias: ''

Yes, the above is error.

We shall change it in case of the derived tables to be more meaningfull.

> mysql> SELECT 1 FROM (SELECT 1) LEFT JOIN (SELECT 1) as t2 USING (t);
> ERROR 1109: Unknown table 'taist.' in on clause
>

This is also OK, but we shall still make another error for such cases.

> mysql> SELECT 1 FROM (SELECT 1 as a) as t LEFT JOIN (SELECT 1 as a) as t2
> USING (a);
> ERROR 1109: Unknown table 'taist.t' in on clause
>

I was not able to reproduce the above with latest build. This is what
I did:

mysql -e "select * from (select 1 a) t left join (select 1 a) u using(a)"
+---+---+
| a | a |
+---+---+
| 1 | 1 |
+---+---+

mysql -e "select * from (select 1 as a) as t left join (select 1 as a) as u using(a)"
+---+---+
| a | a |
+---+---+
| 1 | 1 |
+---+---+


--
Regards,
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer
/_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus
<___/ 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-thread13129@lists.mysql.com
To unsubscribe, e-mail

Re: Bugs in error message where using derived table and join in MySQL-4.1

am 27.11.2002 19:58:20 von Sinisa Milivojevic

Jocelyn Fournier writes:
> Hi,
>
> To reproduce the latest bug, you need to select a database :
>
> mysql> use taist;
> Database changed
> mysql> SELECT 1 FROM (SELECT 1 as a) as t LEFT JOIN (SELECT 1 as a) as t2
> USING(a);
> ERROR 1109: Unknown table 'taist.t' in on clause
>
> Regards,
> Jocelyn

Yes, you are quite right.

Thanks for clearing it out.

--
Regards,
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer
/_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus
<___/ 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-thread13131@lists.mysql.com
To unsubscribe, e-mail

Re: Bugs in error message where using derived table and join in MySQL-4.1

am 28.11.2002 19:17:54 von Jocelyn Fournier

Hi,

To reproduce the latest bug, you need to select a database :

[root@forum] /home/joce> mysql -uroot -p
<19:15:03
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 913692 to server version: 4.1.0-alpha

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
Type 'help [[%]function name[%]]' to get help on usage of function.
mysql> SELECT 1 FROM (SELECT 1 as a) as t LEFT JOIN (SELECT 1 as a) as t2
USING(a);
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (0.00 sec)

mysql> use taist;
Database changed
mysql> SELECT 1 FROM (SELECT 1 as a) as t LEFT JOIN (SELECT 1 as a) as t2
USING(a);
ERROR 1109: Unknown table 'taist.t' in on clause

Regards,
Jocelyn
----- Original Message -----
From: "Sinisa Milivojevic"
To:
Cc:
Sent: Wednesday, November 27, 2002 6:17 PM
Subject: Re: Bugs in error message where using derived table and join in
MySQL-4.1


> Jocelyn Fournier writes:
> > Hi,
> >
> > How-to-repeat :
> >
> > SELECT 1 FROM (SELECT 1),(SELECT 1);
> > ERROR 1066: Not unique table/alias: ''
>
> Yes, the above is error.
>
> We shall change it in case of the derived tables to be more meaningfull.
>
> > mysql> SELECT 1 FROM (SELECT 1) LEFT JOIN (SELECT 1) as t2 USING (t);
> > ERROR 1109: Unknown table 'taist.' in on clause
> >
>
> This is also OK, but we shall still make another error for such cases.
>
> > mysql> SELECT 1 FROM (SELECT 1 as a) as t LEFT JOIN (SELECT 1 as a) as
t2
> > USING (a);
> > ERROR 1109: Unknown table 'taist.t' in on clause
> >
>
> I was not able to reproduce the above with latest build. This is what
> I did:
>
> mysql -e "select * from (select 1 a) t left join (select 1 a) u using(a)"
> +---+---+
> | a | a |
> +---+---+
> | 1 | 1 |
> +---+---+
>
> mysql -e "select * from (select 1 as a) as t left join (select 1 as a) as
u using(a)"
> +---+---+
> | a | a |
> +---+---+
> | 1 | 1 |
> +---+---+
>
>
> --
> Regards,
> __ ___ ___ ____ __
> / |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic
> / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer
> /_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus
> <___/ 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-thread13130@lists.mysql.com
To unsubscribe, e-mail