<single-table> Incorrect "Duplicate column name" with prepared statements in maria-5.3-mwl106
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| MariaDB |
Fix Released
|
Medium
|
Igor Babaev | ||
Bug Description
Not reproducible in maria-5.3. When executing a prepared statement twice, the second execution results in a 1060: 'Duplicate column name ''' error.
Test case:
CREATE TABLE t1 (
f1 integer,
f2 integer,
f3 integer
);
INSERT INTO t1 VALUES (2, 0, 0),(2,0,0);
CREATE VIEW v1 AS SELECT * FROM t1;
PREPARE st1 FROM "
SELECT
alias1.f1 AS field1,
alias1.f2 AS field2,
alias1.f3 AS field3
FROM ( v1 AS alias1 JOIN ( t1 AS alias2 JOIN t1 AS alias3 ON 1 = 1 ) ON 1 = 1 )
";
EXECUTE st1;
--error 0
EXECUTE st1;
bzr version-info:
revision-id: <email address hidden>
date: 2011-06-05 21:54:25 -0700
build-date: 2011-06-06 09:58:05 +0300
revno: 3027
branch-nick: maria-5.3-mwl106
Related branches
| Changed in maria: | |
| milestone: | none → 5.3 |
| assignee: | nobody → Igor Babaev (igorb-seattle) |
| summary: |
- Incorrect "Duplicate column name" with prepared statements in - maria-5.3-mwl106 + <single-table> Incorrect "Duplicate column name" with prepared + statements in maria-5.3-mwl106 |
| Changed in maria: | |
| status: | New → Confirmed |
| importance: | Undecided → Medium |
| Changed in maria: | |
| status: | Confirmed → In Progress |
| Changed in maria: | |
| status: | Fix Committed → Fix Released |

I failed to reproduce this bug on the maria-5.3-mwl106 tree before the fix for bug #793386 (as well as after that fix).
I had:
MariaDB [test]> CREATE TABLE t1 (
-> f1 integer,
-> f2 integer,
-> f3 integer
-> );
Query OK, 0 rows affected (0.00 sec)
MariaDB [test]> INSERT INTO t1 VALUES (2, 0, 0),(2,0,0);
Query OK, 2 rows affected (0.00 sec)
Records: 2 Duplicates: 0 Warnings: 0
MariaDB [test]>
MariaDB [test]> CREATE VIEW v1 AS SELECT * FROM t1;
Query OK, 0 rows affected (0.01 sec)
MariaDB [test]>
MariaDB [test]> PREPARE st1 FROM "
"> SELECT
"> alias1.f1 AS field1,
"> alias1.f2 AS field2,
"> alias1.f3 AS field3
"> FROM ( v1 AS alias1 JOIN ( t1 AS alias2 JOIN t1 AS alias3 ON 1 = 1 ) ON 1 = 1 )
"> ";
Query OK, 0 rows affected (0.00 sec)
Statement prepared
MariaDB [test]> --+---- ----+-- ------+ --+---- ----+-- ------+ --+---- ----+-- ------+
MariaDB [test]> EXECUTE st1;
+------
| field1 | field2 | field3 |
+------
| 2 | 0 | 0 |
| 2 | 0 | 0 |
| 2 | 0 | 0 |
| 2 | 0 | 0 |
| 2 | 0 | 0 |
| 2 | 0 | 0 |
| 2 | 0 | 0 |
| 2 | 0 | 0 |
+------
8 rows in set (0.00 sec)
MariaDB [test]> EXECUTE st1; --+---- ----+-- ------+ --+---- ----+-- ------+ --+---- ----+-- ------+
+------
| field1 | field2 | field3 |
+------
| 2 | 0 | 0 |
| 2 | 0 | 0 |
| 2 | 0 | 0 |
| 2 | 0 | 0 |
| 2 | 0 | 0 |
| 2 | 0 | 0 |
| 2 | 0 | 0 |
| 2 | 0 | 0 |
+------
8 rows in set (0.01 sec)
Philip,
If the bug is still reproducible I need more details: I need revision # and the specification of the platform where we have the failure.