[Phpmyadmin-devel] Re: SQL Parser

Jocelyn Fournier joc at presence-pc.com
Thu Jul 11 11:52:03 CEST 2002


Hi,

> Look at the result of this query (the error that happens)
> SELECT + /* foo */ 20;
> Now compare it with this:
> SELECT - /* foo */ 20;
> the second one should give an error as well, but it doesn't.
> 

I think it's more linked to the following behaviour :

mysql> SELECT- 20;
+------+
| - 20 |
+------+
|  -20 |
+------+
1 row in set (0.00 sec)

mysql> SELECT+ 20;
ERROR 1064: You have an error in your SQL syntax near '+ 20' at line 1
mysql> SELECT + 20;
ERROR 1064: You have an error in your SQL syntax near '+ 20' at line 1
mysql> SELECT - 20;
+------+
| - 20 |
+------+
|  -20 |
+------+
1 row in set (0.00 sec)

mysql> SELECT -20;
+-----+
| -20 |
+-----+
| -20 |
+-----+
1 row in set (0.00 sec)

mysql> SELECT +20;
+-----+
| +20 |
+-----+
|  20 |
+-----+
1 row in set (0.00 sec)

(the - is oddly treated here)

Regards,
  Jocelyn





More information about the Developers mailing list