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
545d8a5b
Commit
545d8a5b
authored
Jun 23, 2010
by
Tor Didriksen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport of Bug#53236 Segfault in DTCollation::set(DTCollation&)
Don't call member functions for a NIL pointer.
parent
da4d2327
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
4 deletions
+56
-4
mysql-test/r/subselect4.result
mysql-test/r/subselect4.result
+25
-0
mysql-test/t/subselect4.test
mysql-test/t/subselect4.test
+29
-0
sql/sql_select.cc
sql/sql_select.cc
+2
-4
No files found.
mysql-test/r/subselect4.result
View file @
545d8a5b
...
...
@@ -59,3 +59,28 @@ FROM t3 WHERE 1 = 0 GROUP BY 1;
(SELECT 1 FROM t1,t2 WHERE t2.b > t3.b)
DROP TABLE t1,t2,t3;
End of 5.0 tests.
#
# Bug#53236 Segfault in DTCollation::set(DTCollation&)
#
CREATE TABLE t1 (
pk INTEGER AUTO_INCREMENT,
col_varchar VARCHAR(1),
PRIMARY KEY (pk)
)
;
INSERT INTO t1 (col_varchar)
VALUES
('w'),
('m')
;
SELECT table1.pk
FROM ( t1 AS table1 JOIN t1 AS table2 ON (table1.col_varchar =
table2.col_varchar) )
WHERE ( 1, 2 ) IN ( SELECT SUBQUERY1_t1.pk AS SUBQUERY1_field1,
SUBQUERY1_t1.pk AS SUBQUERY1_field2
FROM ( t1 AS SUBQUERY1_t1 JOIN t1 AS SUBQUERY1_t2
ON (SUBQUERY1_t2.col_varchar =
SUBQUERY1_t1.col_varchar) ) )
;
pk
drop table t1;
mysql-test/t/subselect4.test
View file @
545d8a5b
...
...
@@ -62,3 +62,32 @@ FROM t3 WHERE 1 = 0 GROUP BY 1;
DROP
TABLE
t1
,
t2
,
t3
;
--
echo
End
of
5.0
tests
.
--
echo
#
--
echo
# Bug#53236 Segfault in DTCollation::set(DTCollation&)
--
echo
#
CREATE
TABLE
t1
(
pk
INTEGER
AUTO_INCREMENT
,
col_varchar
VARCHAR
(
1
),
PRIMARY
KEY
(
pk
)
)
;
INSERT
INTO
t1
(
col_varchar
)
VALUES
(
'w'
),
(
'm'
)
;
SELECT
table1
.
pk
FROM
(
t1
AS
table1
JOIN
t1
AS
table2
ON
(
table1
.
col_varchar
=
table2
.
col_varchar
)
)
WHERE
(
1
,
2
)
IN
(
SELECT
SUBQUERY1_t1
.
pk
AS
SUBQUERY1_field1
,
SUBQUERY1_t1
.
pk
AS
SUBQUERY1_field2
FROM
(
t1
AS
SUBQUERY1_t1
JOIN
t1
AS
SUBQUERY1_t2
ON
(
SUBQUERY1_t2
.
col_varchar
=
SUBQUERY1_t1
.
col_varchar
)
)
)
;
drop
table
t1
;
sql/sql_select.cc
View file @
545d8a5b
...
...
@@ -8629,10 +8629,9 @@ change_cond_ref_to_const(THD *thd, I_List<COND_CMP> *save_list,
left_item
->
collation
.
collation
==
value
->
collation
.
collation
))
{
Item
*
tmp
=
value
->
clone_item
();
tmp
->
collation
.
set
(
right_item
->
collation
);
if
(
tmp
)
{
tmp
->
collation
.
set
(
right_item
->
collation
);
thd
->
change_item_tree
(
args
+
1
,
tmp
);
func
->
update_used_tables
();
if
((
functype
==
Item_func
::
EQ_FUNC
||
functype
==
Item_func
::
EQUAL_FUNC
)
...
...
@@ -8653,10 +8652,9 @@ change_cond_ref_to_const(THD *thd, I_List<COND_CMP> *save_list,
right_item
->
collation
.
collation
==
value
->
collation
.
collation
))
{
Item
*
tmp
=
value
->
clone_item
();
tmp
->
collation
.
set
(
left_item
->
collation
);
if
(
tmp
)
{
tmp
->
collation
.
set
(
left_item
->
collation
);
thd
->
change_item_tree
(
args
,
tmp
);
value
=
tmp
;
func
->
update_used_tables
();
...
...
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