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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
8e4fef51
Commit
8e4fef51
authored
Jan 12, 2011
by
Martin Hansson
Browse files
Options
Browse Files
Download
Plain Diff
Merge of fix for Bug#58207.
parents
ec472d9e
73d88e80
Changes
3
Show 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 @
8e4fef51
...
...
@@ -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 @
8e4fef51
...
...
@@ -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 @
8e4fef51
...
...
@@ -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