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
edf6ad90
Commit
edf6ad90
authored
Mar 03, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #2959 UTF8 charset breaks joins with mixed column/string constant
parent
1e3fadeb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
1 deletion
+46
-1
mysql-test/r/ctype_utf8.result
mysql-test/r/ctype_utf8.result
+25
-0
mysql-test/t/ctype_utf8.test
mysql-test/t/ctype_utf8.test
+19
-0
sql/item.h
sql/item.h
+2
-1
No files found.
mysql-test/r/ctype_utf8.result
View file @
edf6ad90
...
...
@@ -169,3 +169,28 @@ hex(s1)
drop table t1;
create table t1 (a text character set utf8, primary key(a(360)));
ERROR 42000: Specified key was too long; max key length is 1000 bytes
CREATE TABLE t1 ( a varchar(10) ) CHARACTER SET utf8;
INSERT INTO t1 VALUES ( 'test' );
SELECT a.a, b.a FROM t1 a, t1 b WHERE a.a = b.a;
a a
test test
SELECT a.a, b.a FROM t1 a, t1 b WHERE a.a = 'test' and b.a = 'test';
a a
test test
SELECT a.a, b.a FROM t1 a, t1 b WHERE a.a = b.a and a.a = 'test';
a a
test test
DROP TABLE t1;
create table t1 (a char(255) character set utf8);
insert into t1 values('b'),('b');
select * from t1 where a = 'b';
a
b
b
select * from t1 where a = 'b' and a = 'b';
a
b
b
select * from t1 where a = 'b' and a != 'b';
a
drop table t1;
mysql-test/t/ctype_utf8.test
View file @
edf6ad90
...
...
@@ -105,3 +105,22 @@ drop table t1;
#
--
error
1071
create
table
t1
(
a
text
character
set
utf8
,
primary
key
(
a
(
360
)));
#
# Bug 2959
# UTF8 charset breaks joins with mixed column/string constant
#
CREATE
TABLE
t1
(
a
varchar
(
10
)
)
CHARACTER
SET
utf8
;
INSERT
INTO
t1
VALUES
(
'test'
);
SELECT
a
.
a
,
b
.
a
FROM
t1
a
,
t1
b
WHERE
a
.
a
=
b
.
a
;
SELECT
a
.
a
,
b
.
a
FROM
t1
a
,
t1
b
WHERE
a
.
a
=
'test'
and
b
.
a
=
'test'
;
SELECT
a
.
a
,
b
.
a
FROM
t1
a
,
t1
b
WHERE
a
.
a
=
b
.
a
and
a
.
a
=
'test'
;
DROP
TABLE
t1
;
create
table
t1
(
a
char
(
255
)
character
set
utf8
);
insert
into
t1
values
(
'b'
),(
'b'
);
select
*
from
t1
where
a
=
'b'
;
select
*
from
t1
where
a
=
'b'
and
a
=
'b'
;
select
*
from
t1
where
a
=
'b'
and
a
!=
'b'
;
drop
table
t1
;
sql/item.h
View file @
edf6ad90
...
...
@@ -533,7 +533,8 @@ class Item_string :public Item
bool
eq
(
const
Item
*
item
,
bool
binary_cmp
)
const
;
Item
*
new_item
()
{
return
new
Item_string
(
name
,
str_value
.
ptr
(),
max_length
,
&
my_charset_bin
);
return
new
Item_string
(
name
,
str_value
.
ptr
(),
str_value
.
length
(),
&
my_charset_bin
);
}
String
*
const_string
()
{
return
&
str_value
;
}
inline
void
append
(
char
*
str
,
uint
length
)
{
str_value
.
append
(
str
,
length
);
}
...
...
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