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
41956bee
Commit
41956bee
authored
Aug 02, 2006
by
jimw@rama.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge rama.(none):/home/jimw/my/mysql-5.0-16881
into rama.(none):/home/jimw/my/mysql-5.0-16502
parents
95b3b2ea
ad78212d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
4 deletions
+24
-4
mysql-test/r/union.result
mysql-test/r/union.result
+5
-0
mysql-test/t/union.test
mysql-test/t/union.test
+7
-0
sql/item.cc
sql/item.cc
+12
-4
No files found.
mysql-test/r/union.result
View file @
41956bee
...
...
@@ -1351,3 +1351,8 @@ drop table t1;
(select avg(1)) union (select avg(1)) union (select avg(1));
avg(1)
NULL
select _utf8'12' union select _latin1'12345';
12
12
12345
End of 5.0 tests
mysql-test/t/union.test
View file @
41956bee
...
...
@@ -841,3 +841,10 @@ drop table t1;
(
select
avg
(
1
))
union
(
select
avg
(
1
))
union
(
select
avg
(
1
))
union
(
select
avg
(
1
))
union
(
select
avg
(
1
))
union
(
select
avg
(
1
));
#
# Bug #16881: password() and union select
# (The issue was poor handling of character set aggregation.)
#
select
_utf8
'12'
union
select
_latin1
'12345'
;
--
echo
End
of
5.0
tests
sql/item.cc
View file @
41956bee
...
...
@@ -6053,14 +6053,13 @@ bool Item_type_holder::join_types(THD *thd, Item *item)
max_length
=
my_decimal_precision_to_length
(
precision
,
decimals
,
unsigned_flag
);
}
else
max_length
=
max
(
max_length
,
display_length
(
item
));
switch
(
Field
::
result_merge_type
(
fld_type
))
{
case
STRING_RESULT
:
{
const
char
*
old_cs
,
*
old_derivation
;
uint32
old_max_chars
=
max_length
/
collation
.
collation
->
mbmaxlen
;
old_cs
=
collation
.
collation
->
name
;
old_derivation
=
collation
.
derivation_name
();
if
(
collation
.
aggregate
(
item
->
collation
,
MY_COLL_ALLOW_CONV
))
...
...
@@ -6072,6 +6071,14 @@ bool Item_type_holder::join_types(THD *thd, Item *item)
"UNION"
);
DBUG_RETURN
(
TRUE
);
}
/*
To figure out max_length, we have to take into account possible
expansion of the size of the values because of character set
conversions.
*/
max_length
=
max
(
old_max_chars
*
collation
.
collation
->
mbmaxlen
,
display_length
(
item
)
/
item
->
collation
.
collation
->
mbmaxlen
*
collation
.
collation
->
mbmaxlen
);
break
;
}
case
REAL_RESULT
:
...
...
@@ -6090,7 +6097,8 @@ bool Item_type_holder::join_types(THD *thd, Item *item)
max_length
=
(
fld_type
==
MYSQL_TYPE_FLOAT
)
?
FLT_DIG
+
6
:
DBL_DIG
+
7
;
break
;
}
default:
;
default:
max_length
=
max
(
max_length
,
display_length
(
item
));
};
maybe_null
|=
item
->
maybe_null
;
get_full_info
(
item
);
...
...
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