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
2fbee31f
Commit
2fbee31f
authored
Jan 12, 2011
by
Martin Hansson
Browse files
Options
Browse Files
Download
Plain Diff
Merge of fix for Bug#58207.
parents
4e41f535
3c5662c1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
1 deletion
+27
-1
mysql-test/r/subselect4.result
mysql-test/r/subselect4.result
+11
-0
mysql-test/t/subselect4.test
mysql-test/t/subselect4.test
+10
-0
sql/sql_select.cc
sql/sql_select.cc
+6
-1
No files found.
mysql-test/r/subselect4.result
View file @
2fbee31f
...
...
@@ -164,6 +164,17 @@ a b
2 NULL
DROP TABLE t1, t2, t3, t4, t5;
#
# Bug#58207: invalid memory reads when using default column value and
# tmptable needed
#
CREATE TABLE t(a VARCHAR(245) DEFAULT
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
INSERT INTO t VALUES (''),(''),(''),(''),(''),(''),(''),(''),(''),(''),('');
SELECT * FROM (SELECT default(a) FROM t GROUP BY a) d;
default(a)
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
DROP TABLE t;
#
# End of 5.1 tests.
#
#
...
...
mysql-test/t/subselect4.test
View file @
2fbee31f
...
...
@@ -136,6 +136,16 @@ SELECT * FROM t1 WHERE NULL NOT IN ( SELECT c FROM t2 WHERE c = 1 AND c <> 1 );
DROP
TABLE
t1
,
t2
,
t3
,
t4
,
t5
;
--
echo
#
--
echo
# Bug#58207: invalid memory reads when using default column value and
--
echo
# tmptable needed
--
echo
#
CREATE
TABLE
t
(
a
VARCHAR
(
245
)
DEFAULT
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
);
INSERT
INTO
t
VALUES
(
''
),(
''
),(
''
),(
''
),(
''
),(
''
),(
''
),(
''
),(
''
),(
''
),(
''
);
SELECT
*
FROM
(
SELECT
default
(
a
)
FROM
t
GROUP
BY
a
)
d
;
DROP
TABLE
t
;
--
echo
#
--
echo
# End of 5.1 tests.
...
...
sql/sql_select.cc
View file @
2fbee31f
...
...
@@ -10042,7 +10042,12 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
convert_blob_length
);
if
(
orig_type
==
Item
::
REF_ITEM
&&
orig_modify
)
((
Item_ref
*
)
orig_item
)
->
set_result_field
(
result
);
if
(
field
->
field
->
eq_def
(
result
))
/*
Fields that are used as arguments to the DEFAULT() function already have
their data pointers set to the default value during name resulotion. See
Item_default_value::fix_fields.
*/
if
(
orig_type
!=
Item
::
DEFAULT_VALUE_ITEM
&&
field
->
field
->
eq_def
(
result
))
*
default_field
=
field
->
field
;
return
result
;
}
...
...
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