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
7fce07d5
Commit
7fce07d5
authored
May 14, 2002
by
bar@gw.udmsearch.izhnet.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Now several character sets can live in the same table,
However some hacks were used while waiting for new FRM file
parent
f3dc0a80
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
2 deletions
+33
-2
sql/field.h
sql/field.h
+1
-0
sql/filesort.cc
sql/filesort.cc
+9
-1
sql/ha_heap.cc
sql/ha_heap.cc
+1
-1
sql/table.cc
sql/table.cc
+21
-0
sql/table.h
sql/table.h
+1
-0
No files found.
sql/field.h
View file @
7fce07d5
...
...
@@ -252,6 +252,7 @@ class Field_str :public Field {
void
make_field
(
Send_field
*
);
uint
size_of
()
const
{
return
sizeof
(
*
this
);
}
inline
CHARSET_INFO
*
charset
()
const
{
return
field_charset
;
}
inline
void
set_charset
(
CHARSET_INFO
*
charset
)
{
field_charset
=
charset
;
}
inline
int
cmp_image
(
char
*
buff
,
uint
length
)
{
if
(
binary
())
...
...
sql/filesort.cc
View file @
7fce07d5
...
...
@@ -77,10 +77,18 @@ ha_rows filesort(TABLE *table, SORT_FIELD *sortorder, uint s_length,
SORTPARAM
param
;
DBUG_ENTER
(
"filesort"
);
DBUG_EXECUTE
(
"info"
,
TEST_filesort
(
sortorder
,
s_length
,
special
););
CHARSET_INFO
*
charset
=
table
->
table_charset
;
uint
i
;
#ifdef SKIP_DBUG_IN_FILESORT
DBUG_PUSH
(
""
);
/* No DBUG here */
#endif
// BAR TODO: this is not absolutely correct, but OK for now
for
(
i
=
0
;
i
<
table
->
fields
;
i
++
)
if
(
!
table
->
field
[
i
]
->
binary
())
charset
=
((
Field_str
*
)(
table
->
field
[
i
]))
->
charset
();
// /BAR TODO
outfile
=
table
->
io_cache
;
my_b_clear
(
&
tempfile
);
my_b_clear
(
&
buffpek_pointers
);
...
...
@@ -129,7 +137,7 @@ ha_rows filesort(TABLE *table, SORT_FIELD *sortorder, uint s_length,
records
=
param
.
max_rows
;
/* purecov: inspected */
#ifdef USE_STRCOLL
if
(
use_strcoll
(
default_charset_info
)
&&
if
(
use_strcoll
(
charset
)
&&
!
(
param
.
tmp_buffer
=
my_malloc
(
param
.
sort_length
,
MYF
(
MY_WME
))))
goto
err
;
#endif
...
...
sql/ha_heap.cc
View file @
7fce07d5
...
...
@@ -85,7 +85,7 @@ int ha_heap::open(const char *name, int mode, uint test_if_locked)
seg
->
start
=
(
uint
)
key_part
->
offset
;
seg
->
length
=
(
uint
)
key_part
->
length
;
seg
->
flag
=
0
;
seg
->
charset
=
default_charset_info
;
seg
->
charset
=
field
->
binary
()
?
NULL
:
((
Field_str
*
)
field
)
->
charset
()
;
if
(
field
->
null_ptr
)
{
seg
->
null_bit
=
field
->
null_bit
;
...
...
sql/table.cc
View file @
7fce07d5
...
...
@@ -341,6 +341,15 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
(
hash_get_key
)
get_field_name
,
0
,
HASH_CASE_INSENSITIVE
);
// BAR: dirty hack while waiting for new FRM
// BAR: take a charset information from table name
{
const
char
*
csname
=
strstr
(
alias
,
"_cs_"
);
if
(
!
csname
||
!
(
outparam
->
table_charset
=
get_charset_by_name
(
csname
+
4
,
MYF
(
MY_WME
))))
outparam
->
table_charset
=
default_charset_info
;
}
for
(
i
=
0
;
i
<
outparam
->
fields
;
i
++
,
strpos
+=
11
,
field_ptr
++
)
{
uint
pack_flag
=
uint2korr
(
strpos
+
6
);
...
...
@@ -357,6 +366,18 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
(
TYPELIB
*
)
0
),
outparam
->
fieldnames
.
type_names
[
i
],
outparam
);
if
(
!
reg_field
->
binary
())
{
// BAR: dirty hack while waiting for new FRM
// BAR: take a charset information from field name
Field_str
*
str_field
=
(
Field_str
*
)
reg_field
;
const
char
*
csname
=
strstr
(
str_field
->
field_name
,
"_cs_"
);
CHARSET_INFO
*
fcs
;
if
(
!
csname
||
(
!
(
fcs
=
get_charset_by_name
(
csname
+
4
,
MYF
(
MY_WME
)))))
fcs
=
outparam
->
table_charset
;
str_field
->
set_charset
(
fcs
);
}
if
(
!
(
reg_field
->
flags
&
NOT_NULL_FLAG
))
{
if
((
null_bit
<<=
1
)
==
256
)
...
...
sql/table.h
View file @
7fce07d5
...
...
@@ -104,6 +104,7 @@ struct st_table {
*
rowid_field
;
Field_timestamp
*
timestamp_field
;
my_string
comment
;
/* Comment about table */
CHARSET_INFO
*
table_charset
;
/* Default charset of string fields */
REGINFO
reginfo
;
/* field connections */
MEM_ROOT
mem_root
;
GRANT_INFO
grant
;
...
...
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