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
ee177d07
Commit
ee177d07
authored
Jul 31, 2002
by
bar@bar.udmsearch.izhnet.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some more speedup in charsets handling
parent
c0190125
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
28 deletions
+24
-28
mysys/charset.c
mysys/charset.c
+24
-11
sql/init.cc
sql/init.cc
+0
-17
No files found.
mysys/charset.c
View file @
ee177d07
...
...
@@ -128,6 +128,24 @@ static my_bool read_charset_index(myf myflags)
return
FALSE
;
}
static
void
set_max_sort_char
(
CHARSET_INFO
*
cs
)
{
uchar
max_char
;
uint
i
;
if
(
!
cs
->
sort_order
)
return
;
max_char
=
cs
->
sort_order
[(
uchar
)
cs
->
max_sort_char
];
for
(
i
=
0
;
i
<
256
;
i
++
)
{
if
((
uchar
)
cs
->
sort_order
[
i
]
>
max_char
)
{
max_char
=
(
uchar
)
cs
->
sort_order
[
i
];
cs
->
max_sort_char
=
(
char
)
i
;
}
}
}
static
my_bool
init_available_charsets
(
myf
myflags
)
{
...
...
@@ -150,8 +168,10 @@ static my_bool init_available_charsets(myf myflags)
/* Copy compiled charsets */
for
(
cs
=
compiled_charsets
;
cs
->
name
;
cs
++
)
{
all_charsets
[
cs
->
number
]
=
cs
[
0
];
set_max_sort_char
(
&
all_charsets
[
cs
->
number
]);
}
error
=
read_charset_index
(
myflags
);
charset_initialized
=
1
;
pthread_mutex_unlock
(
&
THR_LOCK_charset
);
...
...
@@ -363,6 +383,8 @@ static CHARSET_INFO *add_charset(uint cs_number, myf flags)
cs
->
mb_wc
=
my_mb_wc_8bit
;
cs
->
wc_mb
=
my_wc_mb_8bit
;
set_max_sort_char
(
cs
);
return
cs
;
}
...
...
@@ -404,19 +426,10 @@ static CHARSET_INFO *get_internal_charset(uint cs_number, myf flags)
*/
pthread_mutex_lock
(
&
THR_LOCK_charset
);
/*
FIXME: it's faster to use this code, but max_sort_char is
not initialized here, so LIKE doesn't work later
cs
=
&
all_charsets
[
cs_number
];
if
(
!
(
cs
->
state
&
(
MY_CS_COMPILED
|
MY_CS_LOADED
)))
cs
=
add_charset
(
cs_number
,
flags
);
*/
if
(
!
(
cs
=
find_compiled_charset
(
cs_number
)))
cs
=
add_charset
(
cs_number
,
flags
);
pthread_mutex_unlock
(
&
THR_LOCK_charset
);
return
cs
;
}
...
...
sql/init.cc
View file @
ee177d07
...
...
@@ -53,23 +53,6 @@ void unireg_init(ulong options)
}
specialflag
|=
options
;
/* Set options from argv */
// The following is needed because of like optimization in select.cc
for
(
cs
=
compiled_charsets
;
cs
->
number
;
cs
++
)
{
uchar
max_char
;
if
(
!
cs
->
sort_order
)
continue
;
max_char
=
cs
->
sort_order
[(
uchar
)
cs
->
max_sort_char
];
for
(
i
=
0
;
i
<
256
;
i
++
)
{
if
((
uchar
)
cs
->
sort_order
[
i
]
>
max_char
)
{
max_char
=
(
uchar
)
cs
->
sort_order
[
i
];
cs
->
max_sort_char
=
(
char
)
i
;
}
}
}
thread_stack_min
=
thread_stack
-
STACK_MIN_SIZE
;
DBUG_VOID_RETURN
;
}
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