[MDEV-356] Certain VIEWs not restorable from mysqldump Created: 2012-06-19 Updated: 2015-01-12 Resolved: 2014-11-13 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Views |
| Affects Version/s: | 5.5.24, 10.0 |
| Fix Version/s: | 5.5.39, 10.0.14 |
| Type: | Bug | Priority: | Major |
| Reporter: | Hartmut Holzgraefe | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | upstream-fixed | ||
| Environment: |
linux |
||
| Attachments: |
|
| Description |
|
(see also http://bugs.mysql.com/bug.php?id=65675 ) Description: Incorrect column name '' under certain conditions, e.g. when having a constant blank string in one query that is part of a UNION, e.g. CREATE VIEW v1 AS SELECT id FROM table UNION SELECT ' '; becomes CREATE VIEW `v1` AS SELECT `id` AS `id` FROM `table` UNION SELECT ' ' AS `` in SHOW CREATE VIEW ouput (and so in mysqldump output, too). This rewritten statement fails as `` is not a valid alias. The UNION trick is necessary to reproduce this, a simple CREATE VIEW v2 AS SELECT ' '; becomes CREATE VIEW `v2` AS SELECT ' ' AS `Name_exp_1` How to repeat: Suggested fix: |
| Comments |
| Comment by Sergei Golubchik [ 2013-01-01 ] |
|
fixed in mysql-5.7.0 |
| Comment by James Briggs [ 2014-09-13 ] |
|
Also exhibits a query rewrite bug with AS. |
| Comment by Hartmut Holzgraefe [ 2014-10-30 ] |
|
5.7 Fix seems to be in this changeset https://github.com/mysql/mysql-server/commit/e1b1e0f7435116e123decb5ad18fe351a9114102 I tried a backport to MariaDB 10.0 in the attached patched, a quick test show that my original test case works without problem now. I didn't run a full test so I don't know whether this has any nasty side effects ... |
| Comment by Sergei Golubchik [ 2014-11-13 ] |
|
I cannot repeat it. Your test case doesn't end up having AS ``. Looks like it was fixed few months ago in 5.5. |
| Comment by Hartmut Holzgraefe [ 2015-01-12 ] |
|
Yes, it is no longer reproducible starting with MariaDB 5.5.39 |