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
b7776f83
Commit
b7776f83
authored
Nov 08, 2004
by
bar@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ctype_ujis.result, ctype_ujis.test, field.cc:
Bug#6345 Unexpected behaviour with partial indices
parent
681b6e95
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
82 additions
and
2 deletions
+82
-2
mysql-test/r/ctype_ujis.result
mysql-test/r/ctype_ujis.result
+40
-0
mysql-test/t/ctype_ujis.test
mysql-test/t/ctype_ujis.test
+36
-0
sql/field.cc
sql/field.cc
+6
-2
No files found.
mysql-test/r/ctype_ujis.result
View file @
b7776f83
...
...
@@ -126,3 +126,43 @@ Field Type Null Key Default Extra
a char(1)
b enum('あ','い') YES NULL
DROP TABLE t1;
CREATE TABLE t1
(
a INTEGER NOT NULL,
b VARCHAR(50) NOT NULL DEFAULT '',
PRIMARY KEY (a),
KEY b (b(10))
) TYPE=InnoDB CHARACTER SET 'ujis' COLLATE 'ujis_japanese_ci';
INSERT INTO t1 (a, b) VALUES (0, 'aaabbbcccddd');
INSERT INTO t1 (a, b) VALUES (1, 'eeefffggghhh');
INSERT INTO t1 (a, b) VALUES (2, 'iiijjjkkkl');
SELECT t1.* FROM t1 WHERE b='aaabbbcccddd' ORDER BY a;
a b
0 aaabbbcccddd
SELECT t1.* FROM t1 WHERE b='eeefffggghhh' ORDER BY a;
a b
1 eeefffggghhh
SELECT t1.* FROM t1 WHERE b='iiijjjkkkl' ORDER BY a;
a b
2 iiijjjkkkl
DROP TABLE t1;
CREATE TABLE t1
(
a INTEGER NOT NULL,
b VARCHAR(50) NOT NULL DEFAULT '',
PRIMARY KEY (a),
KEY b (b(10))
) TYPE=MyISAM CHARACTER SET 'ujis' COLLATE 'ujis_japanese_ci';
INSERT INTO t1 (a, b) VALUES (0, 'aaabbbcccddd');
INSERT INTO t1 (a, b) VALUES (1, 'eeefffggghhh');
INSERT INTO t1 (a, b) VALUES (2, 'iiijjjkkkl');
SELECT t1.* FROM t1 WHERE b='aaabbbcccddd' ORDER BY a;
a b
0 aaabbbcccddd
SELECT t1.* FROM t1 WHERE b='eeefffggghhh' ORDER BY a;
a b
1 eeefffggghhh
SELECT t1.* FROM t1 WHERE b='iiijjjkkkl' ORDER BY a;
a b
2 iiijjjkkkl
DROP TABLE t1;
mysql-test/t/ctype_ujis.test
View file @
b7776f83
...
...
@@ -83,3 +83,39 @@ CREATE TABLE t1 (
SHOW
CREATE
TABLE
t1
;
SHOW
COLUMNS
FROM
t1
;
DROP
TABLE
t1
;
#
# Bug #6345 Unexpected behaviour with partial indices
#
--
disable_warnings
CREATE
TABLE
t1
(
a
INTEGER
NOT
NULL
,
b
VARCHAR
(
50
)
NOT
NULL
DEFAULT
''
,
PRIMARY
KEY
(
a
),
KEY
b
(
b
(
10
))
)
TYPE
=
InnoDB
CHARACTER
SET
'ujis'
COLLATE
'ujis_japanese_ci'
;
--
enable_warnings
INSERT
INTO
t1
(
a
,
b
)
VALUES
(
0
,
'aaabbbcccddd'
);
INSERT
INTO
t1
(
a
,
b
)
VALUES
(
1
,
'eeefffggghhh'
);
INSERT
INTO
t1
(
a
,
b
)
VALUES
(
2
,
'iiijjjkkkl'
);
SELECT
t1
.*
FROM
t1
WHERE
b
=
'aaabbbcccddd'
ORDER
BY
a
;
SELECT
t1
.*
FROM
t1
WHERE
b
=
'eeefffggghhh'
ORDER
BY
a
;
SELECT
t1
.*
FROM
t1
WHERE
b
=
'iiijjjkkkl'
ORDER
BY
a
;
DROP
TABLE
t1
;
--
disable_warnings
CREATE
TABLE
t1
(
a
INTEGER
NOT
NULL
,
b
VARCHAR
(
50
)
NOT
NULL
DEFAULT
''
,
PRIMARY
KEY
(
a
),
KEY
b
(
b
(
10
))
)
TYPE
=
MyISAM
CHARACTER
SET
'ujis'
COLLATE
'ujis_japanese_ci'
;
--
enable_warnings
INSERT
INTO
t1
(
a
,
b
)
VALUES
(
0
,
'aaabbbcccddd'
);
INSERT
INTO
t1
(
a
,
b
)
VALUES
(
1
,
'eeefffggghhh'
);
INSERT
INTO
t1
(
a
,
b
)
VALUES
(
2
,
'iiijjjkkkl'
);
SELECT
t1
.*
FROM
t1
WHERE
b
=
'aaabbbcccddd'
ORDER
BY
a
;
SELECT
t1
.*
FROM
t1
WHERE
b
=
'eeefffggghhh'
ORDER
BY
a
;
SELECT
t1
.*
FROM
t1
WHERE
b
=
'iiijjjkkkl'
ORDER
BY
a
;
DROP
TABLE
t1
;
sql/field.cc
View file @
b7776f83
...
...
@@ -4401,10 +4401,14 @@ int Field_string::cmp(const char *a_ptr, const char *b_ptr)
(
const
uchar
*
)
b_ptr
,
field_length
);
}
return
my_strnncoll
(
field_charset
,(
const
uchar
*
)
a_ptr
,
field_length
,
(
const
uchar
*
)
b_ptr
,
field_length
);
uint
char_len
=
field_length
/
field_charset
->
mbmaxlen
;
uint
a_len
=
my_charpos
(
field_charset
,
a_ptr
,
a_ptr
+
field_length
,
char_len
);
uint
b_len
=
my_charpos
(
field_charset
,
b_ptr
,
b_ptr
+
field_length
,
char_len
);
return
my_strnncoll
(
field_charset
,(
const
uchar
*
)
a_ptr
,
a_len
,
(
const
uchar
*
)
b_ptr
,
b_len
);
}
void
Field_string
::
sort_string
(
char
*
to
,
uint
length
)
{
uint
tmp
=
my_strnxfrm
(
field_charset
,
...
...
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