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
f84f6d5c
Commit
f84f6d5c
authored
Mar 29, 2004
by
bar@bar.intranet.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Checking Thai sort order and trailing spaces handling
parent
699dafef
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2863 additions
and
27 deletions
+2863
-27
mysql-test/r/ctype_tis620.result
mysql-test/r/ctype_tis620.result
+2763
-0
mysql-test/t/ctype_tis620.test
mysql-test/t/ctype_tis620.test
+30
-0
strings/ctype-tis620.c
strings/ctype-tis620.c
+70
-27
No files found.
mysql-test/r/ctype_tis620.result
View file @
f84f6d5c
This diff is collapsed.
Click to expand it.
mysql-test/t/ctype_tis620.test
View file @
f84f6d5c
This diff is collapsed.
Click to expand it.
strings/ctype-tis620.c
View file @
f84f6d5c
...
...
@@ -64,7 +64,7 @@
#define X L_MIDDLE
int
t_ctype
[][
TOT_LEVELS
]
=
{
static
int
t_ctype
[][
TOT_LEVELS
]
=
{
/*0x00*/
{
IGNORE
,
IGNORE
,
IGNORE
,
IGNORE
,
X
},
/*0x01*/
{
IGNORE
,
IGNORE
,
IGNORE
,
IGNORE
,
X
},
/*0x02*/
{
IGNORE
,
IGNORE
,
IGNORE
,
IGNORE
,
X
},
...
...
@@ -324,7 +324,7 @@ int t_ctype[][TOT_LEVELS] = {
/*0xFF*/
{
255
/*IGNORE*/
,
IGNORE
,
IGNORE
,
IGNORE
,
X
},
};
uchar
NEAR
ctype_tis620
[
257
]
=
static
uchar
NEAR
ctype_tis620
[
257
]
=
{
0
,
/* For standard library */
32
,
32
,
32
,
32
,
32
,
32
,
32
,
32
,
32
,
40
,
40
,
40
,
40
,
40
,
32
,
32
,
...
...
@@ -345,7 +345,7 @@ uchar NEAR ctype_tis620[257] =
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
};
uchar
NEAR
to_lower_tis620
[]
=
static
uchar
NEAR
to_lower_tis620
[]
=
{
'\000'
,
'\001'
,
'\002'
,
'\003'
,
'\004'
,
'\005'
,
'\006'
,
'\007'
,
'\010'
,
'\011'
,
'\012'
,
'\013'
,
'\014'
,
'\015'
,
'\016'
,
'\017'
,
...
...
@@ -381,7 +381,7 @@ uchar NEAR to_lower_tis620[]=
(
uchar
)
'\370'
,(
uchar
)
'\371'
,(
uchar
)
'\372'
,(
uchar
)
'\373'
,(
uchar
)
'\374'
,(
uchar
)
'\375'
,(
uchar
)
'\376'
,(
uchar
)
'\377'
,
};
uchar
NEAR
to_upper_tis620
[]
=
static
uchar
NEAR
to_upper_tis620
[]
=
{
'\000'
,
'\001'
,
'\002'
,
'\003'
,
'\004'
,
'\005'
,
'\006'
,
'\007'
,
'\010'
,
'\011'
,
'\012'
,
'\013'
,
'\014'
,
'\015'
,
'\016'
,
'\017'
,
...
...
@@ -417,7 +417,7 @@ uchar NEAR to_upper_tis620[]=
(
uchar
)
'\370'
,(
uchar
)
'\371'
,(
uchar
)
'\372'
,(
uchar
)
'\373'
,(
uchar
)
'\374'
,(
uchar
)
'\375'
,(
uchar
)
'\376'
,(
uchar
)
'\377'
,
};
uchar
NEAR
sort_order_tis620
[]
=
static
uchar
NEAR
sort_order_tis620
[]
=
{
'\000'
,
'\001'
,
'\002'
,
'\003'
,
'\004'
,
'\005'
,
'\006'
,
'\007'
,
'\010'
,
'\011'
,
'\012'
,
'\013'
,
'\014'
,
'\015'
,
'\016'
,
'\017'
,
...
...
@@ -526,6 +526,7 @@ static uint thai2sortable(uchar *tstr, uint len)
Ret: strcmp result
*/
static
int
my_strnncoll_tis620
(
CHARSET_INFO
*
cs
__attribute__
((
unused
)),
const
uchar
*
s1
,
uint
len1
,
const
uchar
*
s2
,
uint
len2
)
...
...
@@ -551,18 +552,70 @@ int my_strnncoll_tis620(CHARSET_INFO *cs __attribute__((unused)),
}
/*
TODO: Has to be fixed like strnncollsp in ctype-simple.c
*/
static
int
my_strnncollsp_tis620
(
CHARSET_INFO
*
cs
,
const
uchar
*
s
,
uint
slen
,
const
uchar
*
t
,
uint
tlen
)
int
my_strnncollsp_tis620
(
CHARSET_INFO
*
cs
__attribute__
((
unused
)),
const
uchar
*
a0
,
uint
a_length
,
const
uchar
*
b0
,
uint
b_length
)
{
for
(
;
slen
&&
s
[
slen
-
1
]
==
' '
;
slen
--
);
for
(
;
tlen
&&
t
[
tlen
-
1
]
==
' '
;
tlen
--
);
return
my_strnncoll_tis620
(
cs
,
s
,
slen
,
t
,
tlen
);
uchar
buf
[
80
]
;
uchar
*
end
,
*
a
,
*
b
;
uint
length
;
int
res
=
0
;
int
alloced
=
0
;
a
=
buf
;
if
((
a_length
+
b_length
+
2
)
>
(
int
)
sizeof
(
buf
))
{
a
=
(
uchar
*
)
malloc
(
a_length
+
b_length
);
alloced
=
1
;
}
b
=
a
+
a_length
+
1
;
memcpy
((
char
*
)
a
,
(
char
*
)
a0
,
a_length
);
a
[
a_length
]
=
0
;
/* if length(a0)> len1, need to put 'end of string' */
memcpy
((
char
*
)
b
,
(
char
*
)
b0
,
b_length
);
b
[
b_length
]
=
0
;
/* put end of string */
a_length
=
thai2sortable
(
a
,
a_length
);
b_length
=
thai2sortable
(
b
,
b_length
);
end
=
a
+
(
length
=
min
(
a_length
,
b_length
));
while
(
a
<
end
)
{
if
(
*
a
++
!=
*
b
++
)
{
res
=
((
int
)
a
[
-
1
]
-
(
int
)
b
[
-
1
]);
goto
ret
;
}
}
if
(
a_length
!=
b_length
)
{
int
swap
=
0
;
/*
Check the next not space character of the longer key. If it's < ' ',
then it's smaller than the other key.
*/
if
(
a_length
<
b_length
)
{
/* put shorter key in s */
a_length
=
b_length
;
a
=
b
;
swap
=
-
1
;
/* swap sign of result */
}
for
(
end
=
a
+
a_length
-
length
;
a
<
end
;
a
++
)
{
if
(
*
a
!=
' '
)
{
res
=
((
int
)
*
a
-
(
int
)
' '
)
^
swap
;
goto
ret
;
}
}
}
ret:
if
(
alloced
)
free
(
a
);
return
res
;
}
...
...
@@ -573,6 +626,7 @@ int my_strnncollsp_tis620(CHARSET_INFO * cs,
Ret: Conveted string size
*/
static
int
my_strnxfrm_tis620
(
CHARSET_INFO
*
cs
__attribute__
((
unused
)),
uchar
*
dest
,
uint
len
,
const
uchar
*
src
,
uint
srclen
)
...
...
@@ -583,18 +637,6 @@ int my_strnxfrm_tis620(CHARSET_INFO *cs __attribute__((unused)),
}
/*
strcoll replacment, compare 2 strings
Arg: 2 strings
Ret: strcmp result
*/
int
my_strcoll_tis620
(
const
uchar
*
s1
,
const
uchar
*
s2
)
{
return
my_strnncoll_tis620
((
CHARSET_INFO
*
)
0
,
s1
,
strlen
((
char
*
)
s1
),
s2
,
strlen
((
char
*
)
s1
));
}
/*
Convert SQL LIKE string to C string
...
...
@@ -614,6 +656,7 @@ int my_strcoll_tis620(const uchar * s1, const uchar * s2)
#define max_sort_chr ((char) 255)
static
my_bool
my_like_range_tis620
(
CHARSET_INFO
*
cs
__attribute__
((
unused
)),
const
char
*
ptr
,
uint
ptr_length
,
pbool
escape
,
pbool
w_one
,
pbool
w_many
,
...
...
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