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
2338e2ea
Commit
2338e2ea
authored
Aug 12, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LIKE didn't work with non-default charset
parent
253b2a96
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
88 additions
and
1 deletion
+88
-1
mysql-test/r/func_like.result
mysql-test/r/func_like.result
+67
-0
mysql-test/t/func_like.test
mysql-test/t/func_like.test
+20
-0
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+1
-1
No files found.
mysql-test/r/func_like.result
View file @
2338e2ea
...
@@ -37,3 +37,70 @@ select * from t1 where a like "%abc\d%";
...
@@ -37,3 +37,70 @@ select * from t1 where a like "%abc\d%";
a
a
abcd
abcd
drop table t1;
drop table t1;
SET NAMES koi8r;
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET koi8r);
INSERT INTO t1 VALUES (''),(''),(''),(''),(''),('');
INSERT INTO t1 VALUES (''),(''),(''),('');
INSERT INTO t1 VALUES (''),(''),(''),('');
INSERT INTO t1 VALUES (''),(''),(''),('');
SELECT * FROM t1 WHERE a LIKE '%%';
a
SELECT * FROM t1 WHERE a LIKE '%%';
a
SELECT * FROM t1 WHERE a LIKE '%';
a
DROP TABLE t1;
mysql-test/t/func_like.test
View file @
2338e2ea
...
@@ -24,3 +24,23 @@ select * from t1 where a like "%abcd%";
...
@@ -24,3 +24,23 @@ select * from t1 where a like "%abcd%";
select
*
from
t1
where
a
like
"%abc\d%"
;
select
*
from
t1
where
a
like
"%abc\d%"
;
drop
table
t1
;
drop
table
t1
;
#
# Test like with non-default character set
#
SET
NAMES
koi8r
;
CREATE
TABLE
t1
(
a
VARCHAR
(
10
)
CHARACTER
SET
koi8r
);
INSERT
INTO
t1
VALUES
(
''
),(
''
),(
''
),(
''
),(
''
),(
''
);
INSERT
INTO
t1
VALUES
(
''
),(
''
),(
''
),(
''
);
INSERT
INTO
t1
VALUES
(
''
),(
''
),(
''
),(
''
);
INSERT
INTO
t1
VALUES
(
''
),(
''
),(
''
),(
''
);
SELECT
*
FROM
t1
WHERE
a
LIKE
'%%'
;
SELECT
*
FROM
t1
WHERE
a
LIKE
'%%'
;
SELECT
*
FROM
t1
WHERE
a
LIKE
'%'
;
DROP
TABLE
t1
;
sql/item_cmpfunc.cc
View file @
2338e2ea
...
@@ -2139,7 +2139,7 @@ bool Item_func_like::turboBM_matches(const char* text, int text_len) const
...
@@ -2139,7 +2139,7 @@ bool Item_func_like::turboBM_matches(const char* text, int text_len) const
int
shift
=
pattern_len
;
int
shift
=
pattern_len
;
int
j
=
0
;
int
j
=
0
;
int
u
=
0
;
int
u
=
0
;
CHARSET_INFO
*
cs
=
system_charset_info
;
// QQ Needs to be fixed
CHARSET_INFO
*
cs
=
cmp
.
cmp_collation
.
collation
;
// QQ Needs to be fixed
const
int
plm1
=
pattern_len
-
1
;
const
int
plm1
=
pattern_len
-
1
;
const
int
tlmpl
=
text_len
-
pattern_len
;
const
int
tlmpl
=
text_len
-
pattern_len
;
...
...
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