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
8f1b5b48
Commit
8f1b5b48
authored
Feb 03, 2004
by
bar@bar.intranet.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #2619 ucs2 LIKE comparison fails in some cases
parent
c4728c27
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
6 deletions
+55
-6
mysql-test/r/func_like.result
mysql-test/r/func_like.result
+30
-0
mysql-test/t/func_like.test
mysql-test/t/func_like.test
+19
-0
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+6
-6
No files found.
mysql-test/r/func_like.result
View file @
8f1b5b48
...
...
@@ -104,3 +104,33 @@ a
DROP TABLE t1;
SET NAMES cp1250;
CREATE TABLE t1 (a varchar(250) NOT NULL) DEFAULT CHARACTER SET=cp1250;
INSERT INTO t1 VALUES
('Techni Tapes Sp. z o.o.'),
('Pojazdy Szynowe PESA Bydgoszcz SA Holding'),
('AKAPESTER 1 P.P.H.U.'),
('Pojazdy Szynowe PESA Bydgoszcz S A Holding'),
('PPUH PESKA-I Maria Struniarska');
select * from t1 where a like '%PESA%';
a
Pojazdy Szynowe PESA Bydgoszcz SA Holding
Pojazdy Szynowe PESA Bydgoszcz S A Holding
select * from t1 where a like '%PESA %';
a
Pojazdy Szynowe PESA Bydgoszcz SA Holding
Pojazdy Szynowe PESA Bydgoszcz S A Holding
select * from t1 where a like '%PES%';
a
Techni Tapes Sp. z o.o.
Pojazdy Szynowe PESA Bydgoszcz SA Holding
AKAPESTER 1 P.P.H.U.
Pojazdy Szynowe PESA Bydgoszcz S A Holding
PPUH PESKA-I Maria Struniarska
select * from t1 where a like '%PESKA%';
a
PPUH PESKA-I Maria Struniarska
select * from t1 where a like '%ESKA%';
a
PPUH PESKA-I Maria Struniarska
DROP TABLE t1;
mysql-test/t/func_like.test
View file @
8f1b5b48
...
...
@@ -44,3 +44,22 @@ SELECT * FROM t1 WHERE a LIKE '%
SELECT
*
FROM
t1
WHERE
a
LIKE
'%'
;
DROP
TABLE
t1
;
# Bug #2547 Strange "like" behaviour in tables with default charset=cp1250
# Test like with non-default character set using TurboBM
#
SET
NAMES
cp1250
;
CREATE
TABLE
t1
(
a
varchar
(
250
)
NOT
NULL
)
DEFAULT
CHARACTER
SET
=
cp1250
;
INSERT
INTO
t1
VALUES
(
'Techni Tapes Sp. z o.o.'
),
(
'Pojazdy Szynowe PESA Bydgoszcz SA Holding'
),
(
'AKAPESTER 1 P.P.H.U.'
),
(
'Pojazdy Szynowe PESA Bydgoszcz S A Holding'
),
(
'PPUH PESKA-I Maria Struniarska'
);
select
*
from
t1
where
a
like
'%PESA%'
;
select
*
from
t1
where
a
like
'%PESA %'
;
select
*
from
t1
where
a
like
'%PES%'
;
select
*
from
t1
where
a
like
'%PESKA%'
;
select
*
from
t1
where
a
like
'%ESKA%'
;
DROP
TABLE
t1
;
sql/item_cmpfunc.cc
View file @
8f1b5b48
...
...
@@ -2197,11 +2197,11 @@ void Item_func_like::turboBM_compute_suffixes(int *suff)
int
f
=
0
;
int
g
=
plm1
;
int
*
const
splm1
=
suff
+
plm1
;
CHARSET_INFO
*
cs
=
system_charset_info
;
// QQ Needs to be fixed
CHARSET_INFO
*
cs
=
cmp
.
cmp_collation
.
collation
;
*
splm1
=
pattern_len
;
if
(
c
mp
.
cmp_collation
.
collation
==
&
my_charset_bin
)
if
(
c
s
==
&
my_charset_bin
)
{
int
i
;
for
(
i
=
pattern_len
-
2
;
i
>=
0
;
i
--
)
...
...
@@ -2299,12 +2299,12 @@ void Item_func_like::turboBM_compute_bad_character_shifts()
int
*
end
=
bmBc
+
alphabet_size
;
int
j
;
const
int
plm1
=
pattern_len
-
1
;
CHARSET_INFO
*
cs
=
system_charset_info
;
// QQ Needs to be fixed
CHARSET_INFO
*
cs
=
cmp
.
cmp_collation
.
collation
;
for
(
i
=
bmBc
;
i
<
end
;
i
++
)
*
i
=
pattern_len
;
if
(
c
mp
.
cmp_collation
.
collation
==
&
my_charset_bin
)
if
(
c
s
==
&
my_charset_bin
)
{
for
(
j
=
0
;
j
<
plm1
;
j
++
)
bmBc
[(
uint
)
(
uchar
)
pattern
[
j
]]
=
plm1
-
j
;
...
...
@@ -2329,13 +2329,13 @@ bool Item_func_like::turboBM_matches(const char* text, int text_len) const
int
shift
=
pattern_len
;
int
j
=
0
;
int
u
=
0
;
CHARSET_INFO
*
cs
=
cmp
.
cmp_collation
.
collation
;
// QQ Needs to be fixed
CHARSET_INFO
*
cs
=
cmp
.
cmp_collation
.
collation
;
const
int
plm1
=
pattern_len
-
1
;
const
int
tlmpl
=
text_len
-
pattern_len
;
/* Searching */
if
(
c
mp
.
cmp_collation
.
collation
==
&
my_charset_bin
)
if
(
c
s
==
&
my_charset_bin
)
{
while
(
j
<=
tlmpl
)
{
...
...
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