Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
5ba109c4
Commit
5ba109c4
authored
Mar 07, 2014
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug#45227: Lost HAVING clause led to a wrong result.
- Backport testcase from mysql-5.6
parent
f20cab1a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
117 additions
and
0 deletions
+117
-0
mysql-test/r/select.result
mysql-test/r/select.result
+31
-0
mysql-test/r/select_jcl6.result
mysql-test/r/select_jcl6.result
+31
-0
mysql-test/r/select_pkeycache.result
mysql-test/r/select_pkeycache.result
+31
-0
mysql-test/t/select.test
mysql-test/t/select.test
+24
-0
No files found.
mysql-test/r/select.result
View file @
5ba109c4
...
@@ -5191,6 +5191,37 @@ WHERE t2.pk <> 2;
...
@@ -5191,6 +5191,37 @@ WHERE t2.pk <> 2;
pk i pk i pk i
pk i pk i pk i
DROP TABLE t1,t2,t_empty;
DROP TABLE t1,t2,t_empty;
End of 5.1 tests
End of 5.1 tests
#
# Bug#45227: Lost HAVING clause led to a wrong result.
#
CREATE TABLE `CC` (
`int_nokey` int(11) NOT NULL,
`int_key` int(11) NOT NULL,
`varchar_key` varchar(1) NOT NULL,
`varchar_nokey` varchar(1) NOT NULL,
KEY `int_key` (`int_key`),
KEY `varchar_key` (`varchar_key`)
);
INSERT INTO `CC` VALUES
(0,8,'q','q'),(5,8,'m','m'),(7,3,'j','j'),(1,2,'z','z'),(8,2,'a','a'),(2,6,'',''),(1,8,'e'
,'e'),(8,9,'t','t'),(5,2,'q','q'),(4,6,'b','b'),(5,5,'w','w'),(3,2,'m','m'),(0,4,'x','x'),
(8,9,'',''),(0,6,'w','w'),(4,5,'x','x'),(0,0,'e','e'),(0,0,'e','e'),(2,8,'p','p'),(0,0,'x'
,'x');
EXPLAIN SELECT `varchar_nokey` G1 FROM CC WHERE `int_nokey` AND `int_key` <= 4
HAVING G1 ORDER BY `varchar_key` LIMIT 6 ;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE CC range int_key int_key 4 NULL 10 Using index condition; Using where; Using filesort
SELECT `varchar_nokey` G1 FROM CC WHERE `int_nokey` AND `int_key` <= 4
HAVING G1 ORDER BY `varchar_key` LIMIT 6 ;
G1
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'z'
Warning 1292 Truncated incorrect DOUBLE value: 'a'
Warning 1292 Truncated incorrect DOUBLE value: 'q'
Warning 1292 Truncated incorrect DOUBLE value: 'm'
Warning 1292 Truncated incorrect DOUBLE value: 'j'
DROP TABLE CC;
# End of test#45227
#
#
# BUG#776274: substitution of a single row table
# BUG#776274: substitution of a single row table
#
#
...
...
mysql-test/r/select_jcl6.result
View file @
5ba109c4
...
@@ -5202,6 +5202,37 @@ WHERE t2.pk <> 2;
...
@@ -5202,6 +5202,37 @@ WHERE t2.pk <> 2;
pk i pk i pk i
pk i pk i pk i
DROP TABLE t1,t2,t_empty;
DROP TABLE t1,t2,t_empty;
End of 5.1 tests
End of 5.1 tests
#
# Bug#45227: Lost HAVING clause led to a wrong result.
#
CREATE TABLE `CC` (
`int_nokey` int(11) NOT NULL,
`int_key` int(11) NOT NULL,
`varchar_key` varchar(1) NOT NULL,
`varchar_nokey` varchar(1) NOT NULL,
KEY `int_key` (`int_key`),
KEY `varchar_key` (`varchar_key`)
);
INSERT INTO `CC` VALUES
(0,8,'q','q'),(5,8,'m','m'),(7,3,'j','j'),(1,2,'z','z'),(8,2,'a','a'),(2,6,'',''),(1,8,'e'
,'e'),(8,9,'t','t'),(5,2,'q','q'),(4,6,'b','b'),(5,5,'w','w'),(3,2,'m','m'),(0,4,'x','x'),
(8,9,'',''),(0,6,'w','w'),(4,5,'x','x'),(0,0,'e','e'),(0,0,'e','e'),(2,8,'p','p'),(0,0,'x'
,'x');
EXPLAIN SELECT `varchar_nokey` G1 FROM CC WHERE `int_nokey` AND `int_key` <= 4
HAVING G1 ORDER BY `varchar_key` LIMIT 6 ;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE CC range int_key int_key 4 NULL 10 Using index condition; Using where; Rowid-ordered scan; Using filesort
SELECT `varchar_nokey` G1 FROM CC WHERE `int_nokey` AND `int_key` <= 4
HAVING G1 ORDER BY `varchar_key` LIMIT 6 ;
G1
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'j'
Warning 1292 Truncated incorrect DOUBLE value: 'z'
Warning 1292 Truncated incorrect DOUBLE value: 'a'
Warning 1292 Truncated incorrect DOUBLE value: 'q'
Warning 1292 Truncated incorrect DOUBLE value: 'm'
DROP TABLE CC;
# End of test#45227
#
#
# BUG#776274: substitution of a single row table
# BUG#776274: substitution of a single row table
#
#
...
...
mysql-test/r/select_pkeycache.result
View file @
5ba109c4
...
@@ -5191,6 +5191,37 @@ WHERE t2.pk <> 2;
...
@@ -5191,6 +5191,37 @@ WHERE t2.pk <> 2;
pk i pk i pk i
pk i pk i pk i
DROP TABLE t1,t2,t_empty;
DROP TABLE t1,t2,t_empty;
End of 5.1 tests
End of 5.1 tests
#
# Bug#45227: Lost HAVING clause led to a wrong result.
#
CREATE TABLE `CC` (
`int_nokey` int(11) NOT NULL,
`int_key` int(11) NOT NULL,
`varchar_key` varchar(1) NOT NULL,
`varchar_nokey` varchar(1) NOT NULL,
KEY `int_key` (`int_key`),
KEY `varchar_key` (`varchar_key`)
);
INSERT INTO `CC` VALUES
(0,8,'q','q'),(5,8,'m','m'),(7,3,'j','j'),(1,2,'z','z'),(8,2,'a','a'),(2,6,'',''),(1,8,'e'
,'e'),(8,9,'t','t'),(5,2,'q','q'),(4,6,'b','b'),(5,5,'w','w'),(3,2,'m','m'),(0,4,'x','x'),
(8,9,'',''),(0,6,'w','w'),(4,5,'x','x'),(0,0,'e','e'),(0,0,'e','e'),(2,8,'p','p'),(0,0,'x'
,'x');
EXPLAIN SELECT `varchar_nokey` G1 FROM CC WHERE `int_nokey` AND `int_key` <= 4
HAVING G1 ORDER BY `varchar_key` LIMIT 6 ;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE CC range int_key int_key 4 NULL 10 Using index condition; Using where; Using filesort
SELECT `varchar_nokey` G1 FROM CC WHERE `int_nokey` AND `int_key` <= 4
HAVING G1 ORDER BY `varchar_key` LIMIT 6 ;
G1
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'z'
Warning 1292 Truncated incorrect DOUBLE value: 'a'
Warning 1292 Truncated incorrect DOUBLE value: 'q'
Warning 1292 Truncated incorrect DOUBLE value: 'm'
Warning 1292 Truncated incorrect DOUBLE value: 'j'
DROP TABLE CC;
# End of test#45227
#
#
# BUG#776274: substitution of a single row table
# BUG#776274: substitution of a single row table
#
#
...
...
mysql-test/t/select.test
View file @
5ba109c4
...
@@ -4363,6 +4363,30 @@ DROP TABLE t1,t2,t_empty;
...
@@ -4363,6 +4363,30 @@ DROP TABLE t1,t2,t_empty;
--
echo
End
of
5.1
tests
--
echo
End
of
5.1
tests
--
echo
#
--
echo
# Bug#45227: Lost HAVING clause led to a wrong result.
--
echo
#
CREATE
TABLE
`CC`
(
`int_nokey`
int
(
11
)
NOT
NULL
,
`int_key`
int
(
11
)
NOT
NULL
,
`varchar_key`
varchar
(
1
)
NOT
NULL
,
`varchar_nokey`
varchar
(
1
)
NOT
NULL
,
KEY
`int_key`
(
`int_key`
),
KEY
`varchar_key`
(
`varchar_key`
)
);
INSERT
INTO
`CC`
VALUES
(
0
,
8
,
'q'
,
'q'
),(
5
,
8
,
'm'
,
'm'
),(
7
,
3
,
'j'
,
'j'
),(
1
,
2
,
'z'
,
'z'
),(
8
,
2
,
'a'
,
'a'
),(
2
,
6
,
''
,
''
),(
1
,
8
,
'e'
,
'e'
),(
8
,
9
,
't'
,
't'
),(
5
,
2
,
'q'
,
'q'
),(
4
,
6
,
'b'
,
'b'
),(
5
,
5
,
'w'
,
'w'
),(
3
,
2
,
'm'
,
'm'
),(
0
,
4
,
'x'
,
'x'
),
(
8
,
9
,
''
,
''
),(
0
,
6
,
'w'
,
'w'
),(
4
,
5
,
'x'
,
'x'
),(
0
,
0
,
'e'
,
'e'
),(
0
,
0
,
'e'
,
'e'
),(
2
,
8
,
'p'
,
'p'
),(
0
,
0
,
'x'
,
'x'
);
EXPLAIN
SELECT
`varchar_nokey`
G1
FROM
CC
WHERE
`int_nokey`
AND
`int_key`
<=
4
HAVING
G1
ORDER
BY
`varchar_key`
LIMIT
6
;
SELECT
`varchar_nokey`
G1
FROM
CC
WHERE
`int_nokey`
AND
`int_key`
<=
4
HAVING
G1
ORDER
BY
`varchar_key`
LIMIT
6
;
DROP
TABLE
CC
;
--
echo
# End of test#45227
--
echo
#
--
echo
#
--
echo
# BUG#776274: substitution of a single row table
--
echo
# BUG#776274: substitution of a single row table
--
echo
#
--
echo
#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment