Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.1.67, 5.2.14, 5.3.12, 5.5(EOL), 10.0(EOL)
-
12.04.5 LTS (GNU/Linux 3.13.0-40-generic x86_64) - replacement of MySQL 5.6
14.04.1 LTS (GNU/Linux 3.13.0-40-generic x86_64) - clean install
Description
Error occurs when using backticks in HAVING clause with function (e.g. UPPER, CONCAT, DATE_FORMAT, etc...).
Views are afected by this behavior - forcing backticks.
How to simulate
CREATE TABLE `articles` (
|
`id` int(11) NOT NULL,
|
`title` varchar(45) DEFAULT NULL,
|
PRIMARY KEY (`id`)
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
INSERT INTO `articles` VALUES ('1', 'Judge delays Oscar Pistorius ruling');
|
INSERT INTO `articles` VALUES ('2', 'Warner dedicates century to Hughes');
|
INSERT INTO `articles` VALUES ('3', 'Torture report: Battle lines being drawn');
|
SELECT `id`, SHA1(`title`) AS `column_1`
|
FROM `articles`
|
HAVING `column_1` LIKE '5%';
|
|
-- 1 row(s) returned
|
SELECT `id`, SHA1(`title`) AS `column_1`
|
FROM `articles`
|
HAVING UPPER(column_1) LIKE '5%';
|
|
-- 1 row(s) returned
|
SELECT `id`, SHA1(`title`) AS `column_1`
|
FROM `articles`
|
HAVING UPPER(`column_1`) LIKE '5%';
|
|
-- Error Code: 1054. Unknown column 'column_1' in 'having clause'
|
Works well on:
- MySQL 5.5 - clean install,
- MySQL 5.6 - upgrade from MySQL 5.5
- MySQL 5.6 - clean install (sql_mode=NO_ENGINE_SUBSTITUTION)
Throws an error code with unknown column:
- MariaDB 10.0.15 - clean install
- MariaDB 10.0.15 - replacement of MySQL 5.6 (sql_mode=NO_ENGINE_SUBSTITUTION)
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
Labels | mariadb | upstream-fixed |
Assignee | Elena Stepanova [ elenst ] |
Fix Version/s | 10.0 [ 16000 ] |
Affects Version/s | 5.3.12 [ 12000 ] | |
Affects Version/s | 5.2.14 [ 12101 ] | |
Affects Version/s | 5.1.67 [ 12100 ] | |
Affects Version/s | 10.0 [ 16000 ] | |
Affects Version/s | 5.5 [ 15800 ] | |
Affects Version/s | 10.0.15 [ 17300 ] | |
Assignee | Elena Stepanova [ elenst ] |
Assignee | Jan Lindström [ jplindst ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Attachment | patch.diff [ 36701 ] |
Assignee | Jan Lindström [ jplindst ] | Sergei Golubchik [ serg ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Attachment | patch.diff [ 36701 ] |
Attachment | patch.diff [ 36702 ] |
Assignee | Sergei Golubchik [ serg ] | Sergei Petrunia [ psergey ] |
Assignee | Sergei Petrunia [ psergey ] | Oleksandr Byelkin [ sanja ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Assignee | Oleksandr Byelkin [ sanja ] | Jan Lindström [ jplindst ] |
Fix Version/s | 10.0.18 [ 18702 ] | |
Fix Version/s | 5.5.43 [ 18601 ] | |
Fix Version/s | 10.0 [ 16000 ] |
Status | Stalled [ 10000 ] | In Progress [ 3 ] |
Component/s | Parser [ 10201 ] | |
Resolution | Fixed [ 1 ] | |
Status | In Progress [ 3 ] | Closed [ 6 ] |
Workflow | MariaDB v2 [ 58922 ] | MariaDB v3 [ 67390 ] |
Workflow | MariaDB v3 [ 67390 ] | MariaDB v4 [ 148609 ] |
I assume "Works well on MySQL 5.5" is a typo, you meant 5.6?