Bug #52686 Explain complains about a syntax error, but without it it works
Submitted: 8 Apr 2010 10:22 Modified: 8 Apr 2010 11:17
Reporter: Cyril SCETBON Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.1.43 OS:Any
Assigned to: CPU Architecture:Any
Tags: explain, MySQL, syntax

[8 Apr 2010 10:22] Cyril SCETBON
Description:
when I execute my request without explain it works. But if I try to explain it MySQL complains about a SQL syntax error

How to repeat:
mysql [localhost] {msandbox} (test) > create table t3(id1 int,id2 int,id3 int,id4 int,id5 int,id6 int,id7 int);
Query OK, 0 rows affected (0.01 sec)

mysql [localhost] {msandbox} (test) > insert into t3 select 1,2,3,4,5,6,7;
Query OK, 1 row affected (0.00 sec)
Records: 1  Duplicates: 0  Warnings: 0

mysql [localhost] {msandbox} (test) > explain insert into t3 select 1,2,3,4,5,6,7;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insert into t3 select 1,2,3,4,5,6,7' at line 1
[8 Apr 2010 10:28] Sveta Smirnova
Thank you for the report.

EXPLAIN is supported only for SELECT statements, so this is not a bug.
[8 Apr 2010 10:29] Sveta Smirnova
There is feature request: bug #35355 about support of EXPLAIN for DML statements.
[8 Apr 2010 11:17] Cyril SCETBON
ok forget it, I forgot it after playing with oracle :(

I support the feature request too !

thanks