Bug #4612 Views: Use of view based on table with a delimited name returns syntax error
Submitted: 19 Jul 2004 2:21 Modified: 20 Jul 2004 23:23
Reporter: Trudy Pelzer Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.1-alpha-debug OS:Linux (SuSE 8.2)
Assigned to: Oleksandr Byelkin CPU Architecture:Any

[19 Jul 2004 2:21] Trudy Pelzer
Description:
if one creates a view (e.g. ab) based on a single underlying table that has a delimited name (e.g. `a``b`), the result of a SELECT from the view is this error:
ERROR 1064 (42000): You have an error in your SQL syntax; ...

But the view was accepted at CREATE VIEW time and does have a valid definition.

This is possibly related to Bug #4609.

How to repeat:
create table `a``b` (col1 char(2));
create view ab as select * from `a``b`;
select * from ab;
ERROR 1064 (42000): You have an error in your SQL syntax; ...
[19 Jul 2004 19:23] Aleksey Kishkin
verified on slackware 9
[20 Jul 2004 17:54] Oleksandr Byelkin
ChangeSet 
  1.1713 04/07/20 18:51:02 bell@sanja.is.com.ua +5 -0 
  fixed quoting of identifiers in VIEWs (BUG#4613)
[20 Jul 2004 23:23] Oleksandr Byelkin
Thank you for bugreport. Patch for this bug is pushed to our source repository.