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
a89259fa
Commit
a89259fa
authored
Jun 30, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge gleb.loc:/home/uchum/work/bk/5.0-opt-29205
into gleb.loc:/home/uchum/work/bk/5.0-opt
parents
6a00ce71
db397d16
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
3 deletions
+71
-3
mysql-test/r/ctype_utf8.result
mysql-test/r/ctype_utf8.result
+37
-0
mysql-test/t/ctype_utf8.test
mysql-test/t/ctype_utf8.test
+25
-0
sql/item.cc
sql/item.cc
+9
-3
No files found.
mysql-test/r/ctype_utf8.result
View file @
a89259fa
...
@@ -1657,3 +1657,40 @@ colA colB colA colB
...
@@ -1657,3 +1657,40 @@ colA colB colA colB
1 foo 1 foo
1 foo 1 foo
2 foo bar 2 foo bar
2 foo bar 2 foo bar
DROP TABLE t1, t2;
DROP TABLE t1, t2;
SELECT 'н1234567890' UNION SELECT _binary '1';
н1234567890
н1234567890
1
SELECT 'н1234567890' UNION SELECT 1;
н1234567890
н1234567890
1
SELECT '1' UNION SELECT 'н1234567890';
1
1
н1234567890
SELECT 1 UNION SELECT 'н1234567890';
1
1
н1234567890
CREATE TABLE t1 (c VARCHAR(11)) CHARACTER SET utf8;
CREATE TABLE t2 (b CHAR(1) CHARACTER SET binary, i INT);
INSERT INTO t1 (c) VALUES ('н1234567890');
INSERT INTO t2 (b, i) VALUES ('1', 1);
SELECT c FROM t1 UNION SELECT b FROM t2;
c
н1234567890
1
SELECT c FROM t1 UNION SELECT i FROM t2;
c
н1234567890
1
SELECT b FROM t2 UNION SELECT c FROM t1;
b
1
н1234567890
SELECT i FROM t2 UNION SELECT c FROM t1;
i
1
н1234567890
DROP TABLE t1, t2;
mysql-test/t/ctype_utf8.test
View file @
a89259fa
...
@@ -1338,3 +1338,28 @@ INSERT INTO t2 (colA, colB) VALUES (1, 'foo'),(2, 'foo bar');
...
@@ -1338,3 +1338,28 @@ INSERT INTO t2 (colA, colB) VALUES (1, 'foo'),(2, 'foo bar');
SELECT
*
FROM
t1
JOIN
t2
ON
t1
.
colA
=
t2
.
colA
AND
t1
.
colB
=
t2
.
colB
SELECT
*
FROM
t1
JOIN
t2
ON
t1
.
colA
=
t2
.
colA
AND
t1
.
colB
=
t2
.
colB
WHERE
t1
.
colA
<
3
;
WHERE
t1
.
colA
<
3
;
DROP
TABLE
t1
,
t2
;
DROP
TABLE
t1
,
t2
;
#
# Bug#29205: truncation of UTF8 values when the UNION statement
# forces collation to the binary charset
#
SELECT
'н1234567890'
UNION
SELECT
_binary
'1'
;
SELECT
'н1234567890'
UNION
SELECT
1
;
SELECT
'1'
UNION
SELECT
'н1234567890'
;
SELECT
1
UNION
SELECT
'н1234567890'
;
CREATE
TABLE
t1
(
c
VARCHAR
(
11
))
CHARACTER
SET
utf8
;
CREATE
TABLE
t2
(
b
CHAR
(
1
)
CHARACTER
SET
binary
,
i
INT
);
INSERT
INTO
t1
(
c
)
VALUES
(
'н1234567890'
);
INSERT
INTO
t2
(
b
,
i
)
VALUES
(
'1'
,
1
);
SELECT
c
FROM
t1
UNION
SELECT
b
FROM
t2
;
SELECT
c
FROM
t1
UNION
SELECT
i
FROM
t2
;
SELECT
b
FROM
t2
UNION
SELECT
c
FROM
t1
;
SELECT
i
FROM
t2
UNION
SELECT
c
FROM
t1
;
DROP
TABLE
t1
,
t2
;
sql/item.cc
View file @
a89259fa
...
@@ -6595,9 +6595,15 @@ bool Item_type_holder::join_types(THD *thd, Item *item)
...
@@ -6595,9 +6595,15 @@ bool Item_type_holder::join_types(THD *thd, Item *item)
expansion of the size of the values because of character set
expansion of the size of the values because of character set
conversions.
conversions.
*/
*/
if
(
collation
.
collation
!=
&
my_charset_bin
)
{
max_length
=
max
(
old_max_chars
*
collation
.
collation
->
mbmaxlen
,
max_length
=
max
(
old_max_chars
*
collation
.
collation
->
mbmaxlen
,
display_length
(
item
)
/
item
->
collation
.
collation
->
mbmaxlen
*
display_length
(
item
)
/
item
->
collation
.
collation
->
mbmaxlen
*
collation
.
collation
->
mbmaxlen
);
collation
.
collation
->
mbmaxlen
);
}
else
set_if_bigger
(
max_length
,
display_length
(
item
));
break
;
break
;
}
}
case
REAL_RESULT
:
case
REAL_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