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
d8a4d6a8
Commit
d8a4d6a8
authored
Mar 14, 2002
by
bar@gw.udmsearch.izhnet.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove default_charset_info
parent
ea6fbd4c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
12 deletions
+22
-12
sql/field.h
sql/field.h
+1
-0
sql/filesort.cc
sql/filesort.cc
+17
-9
sql/opt_range.cc
sql/opt_range.cc
+4
-3
No files found.
sql/field.h
View file @
d8a4d6a8
...
...
@@ -251,6 +251,7 @@ class Field_str :public Field {
friend
class
create_field
;
void
make_field
(
Send_field
*
);
uint
size_of
()
const
{
return
sizeof
(
*
this
);
}
inline
CHARSET_INFO
*
charset
()
const
{
return
field_charset
;
}
inline
int
cmp_image
(
char
*
buff
,
uint
length
)
{
if
(
binary
())
...
...
sql/filesort.cc
View file @
d8a4d6a8
...
...
@@ -205,7 +205,7 @@ ha_rows filesort(TABLE *table, SORT_FIELD *sortorder, uint s_length,
err:
#ifdef USE_STRCOLL
if
(
use_strcoll
(
default_charset_info
)
)
if
(
param
.
tmp_buffer
)
x_free
(
param
.
tmp_buffer
);
#endif
x_free
((
gptr
)
sort_keys
);
...
...
@@ -470,6 +470,9 @@ static void make_sortkey(register SORTPARAM *param,
switch
(
sort_field
->
result_type
)
{
case
STRING_RESULT
:
{
// BAR TODO: need checking that it is really Field_str based class
CHARSET_INFO
*
cs
=
((
Field_str
*
)(
sort_field
->
field
))
->
charset
();
if
(
item
->
maybe_null
)
*
to
++=
1
;
/* All item->str() to use some extra byte for end null.. */
...
...
@@ -495,7 +498,7 @@ static void make_sortkey(register SORTPARAM *param,
length
=
sort_field
->
length
;
}
#ifdef USE_STRCOLL
if
(
use_strcoll
(
default_charset_info
))
if
(
use_strcoll
(
cs
))
{
if
(
item
->
binary
)
{
...
...
@@ -512,8 +515,7 @@ static void make_sortkey(register SORTPARAM *param,
memcpy
(
param
->
tmp_buffer
,
from
,
length
);
from
=
param
->
tmp_buffer
;
}
uint
tmp_length
=
my_strnxfrm
(
default_charset_info
,
to
,
sort_field
->
length
,
uint
tmp_length
=
my_strnxfrm
(
cs
,
to
,
sort_field
->
length
,
(
unsigned
char
*
)
from
,
length
);
if
(
tmp_length
<
sort_field
->
length
)
bzero
((
char
*
)
to
+
tmp_length
,
sort_field
->
length
-
tmp_length
);
...
...
@@ -526,7 +528,7 @@ static void make_sortkey(register SORTPARAM *param,
memcpy
(
to
,
res
->
ptr
(),
length
);
bzero
((
char
*
)
to
+
length
,
diff
);
if
(
!
item
->
binary
)
case_sort
(
default_charset_info
,
(
char
*
)
to
,
length
);
case_sort
(
cs
,
(
char
*
)
to
,
length
);
#ifdef USE_STRCOLL
}
#endif
...
...
@@ -923,8 +925,10 @@ sortlength(SORT_FIELD *sortorder, uint s_length)
{
sortorder
->
length
=
sortorder
->
field
->
pack_length
();
#ifdef USE_STRCOLL
if
(
use_strcoll
(
default_charset_info
)
&&
!
sortorder
->
field
->
binary
())
sortorder
->
length
=
sortorder
->
length
*
default_charset_info
->
strxfrm_multiply
;
// BAR TODO: need checking that it is really Field_str based class
CHARSET_INFO
*
cs
=
((
Field_str
*
)(
sortorder
->
field
))
->
charset
();
if
(
use_strcoll
(
cs
)
&&
!
sortorder
->
field
->
binary
())
sortorder
->
length
=
sortorder
->
length
*
cs
->
strxfrm_multiply
;
#endif
}
if
(
sortorder
->
field
->
maybe_null
())
...
...
@@ -932,12 +936,16 @@ sortlength(SORT_FIELD *sortorder, uint s_length)
}
else
{
#ifdef USE_STRCOLL
// BAR TODO: need checking that it is really Field_str based class
CHARSET_INFO
*
cs
=
((
Field_str
*
)(
sortorder
->
field
))
->
charset
();
#endif
switch
((
sortorder
->
result_type
=
sortorder
->
item
->
result_type
()))
{
case
STRING_RESULT
:
sortorder
->
length
=
sortorder
->
item
->
max_length
;
#ifdef USE_STRCOLL
if
(
use_strcoll
(
default_charset_info
)
&&
!
sortorder
->
item
->
binary
)
sortorder
->
length
=
sortorder
->
length
*
default_charset_info
->
strxfrm_multiply
;
if
(
use_strcoll
(
cs
)
&&
!
sortorder
->
item
->
binary
)
sortorder
->
length
=
sortorder
->
length
*
cs
->
strxfrm_multiply
;
#endif
break
;
case
INT_RESULT
:
...
...
sql/opt_range.cc
View file @
d8a4d6a8
...
...
@@ -974,9 +974,10 @@ get_mm_leaf(PARAM *param, Field *field, KEY_PART *key_part,
&
min_length
,
&
max_length
);
else
{
CHARSET_INFO
*
charset
=
((
Field_str
*
)(
field
))
->
charset
();
#ifdef USE_STRCOLL
if
(
use_strcoll
(
default_charset_info
))
like_error
=
my_like_range
(
default_charset_info
,
if
(
use_strcoll
(
charset
))
like_error
=
my_like_range
(
charset
,
res
->
ptr
(),
res
->
length
(),
wild_prefix
,
field_length
,
min_str
+
maybe_null
,
max_str
+
maybe_null
,
&
min_length
,
&
max_length
);
...
...
@@ -985,7 +986,7 @@ get_mm_leaf(PARAM *param, Field *field, KEY_PART *key_part,
like_error
=
like_range
(
res
->
ptr
(),
res
->
length
(),
wild_prefix
,
field_length
,
min_str
+
offset
,
max_str
+
offset
,
default_charset_info
->
max_sort_char
,
charset
->
max_sort_char
,
&
min_length
,
&
max_length
);
}
if
(
like_error
)
// Can't optimize with LIKE
...
...
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