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