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
99e2a821
Commit
99e2a821
authored
Sep 22, 2003
by
bar@bar.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 1350 fix
parent
b201d496
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
46 deletions
+57
-46
extra/comp_err.c
extra/comp_err.c
+0
-2
include/m_ctype.h
include/m_ctype.h
+1
-0
mysys/charset.c
mysys/charset.c
+34
-34
sql/derror.cc
sql/derror.cc
+12
-6
sql/sql_show.cc
sql/sql_show.cc
+10
-4
No files found.
extra/comp_err.c
View file @
99e2a821
...
...
@@ -71,14 +71,12 @@ int main(int argc,char *argv[])
goto
end
;
}
#ifdef NEEDS_FIXES
if
(
!
(
csnum
=
get_charset_number
(
charset_name
,
MY_CS_PRIMARY
)))
{
fprintf
(
stderr
,
"Unknown character '%s' in '%s'
\n
"
,
charset_name
,
*
argv
);
fclose
(
from
);
goto
end
;
}
#endif
if
(
remember_rows
(
from
,
'}'
)
<
0
)
/* Remember rows */
{
...
...
include/m_ctype.h
View file @
99e2a821
...
...
@@ -63,6 +63,7 @@ typedef struct unicase_info_st
#define MY_CS_STRNXFRM 64
/* if strnxfrm is used for sort */
#define MY_CS_UNICODE 128
/* is a charset is full unicode */
#define MY_CS_NONTEXT 256
/* if a charset is not sprintf() compatible */
#define MY_CS_AVAILABLE 512
/* If either compiled-in or loaded*/
#define MY_CHARSET_UNDEFINED 0
...
...
mysys/charset.c
View file @
99e2a821
...
...
@@ -226,7 +226,6 @@ static my_bool create_fromuni(CHARSET_INFO *cs)
static
void
simple_cs_copy_data
(
CHARSET_INFO
*
to
,
CHARSET_INFO
*
from
)
{
to
->
number
=
from
->
number
?
from
->
number
:
to
->
number
;
to
->
state
|=
from
->
state
;
if
(
from
->
csname
)
to
->
csname
=
my_once_strdup
(
from
->
csname
,
MYF
(
MY_WME
));
...
...
@@ -282,8 +281,6 @@ static int add_collation(CHARSET_INFO *cs)
{
if
(
!
all_charsets
[
cs
->
number
])
{
if
(
cs
->
state
&
MY_CS_COMPILED
)
goto
clear
;
if
(
!
(
all_charsets
[
cs
->
number
]
=
(
CHARSET_INFO
*
)
my_once_alloc
(
sizeof
(
CHARSET_INFO
),
MYF
(
0
))))
return
MY_XML_ERROR
;
...
...
@@ -296,6 +293,8 @@ static int add_collation(CHARSET_INFO *cs)
if
(
cs
->
binary_number
==
cs
->
number
)
cs
->
state
|=
MY_CS_BINSORT
;
all_charsets
[
cs
->
number
]
->
state
|=
cs
->
state
;
if
(
!
(
all_charsets
[
cs
->
number
]
->
state
&
MY_CS_COMPILED
))
{
simple_cs_init_functions
(
all_charsets
[
cs
->
number
]);
...
...
@@ -304,15 +303,14 @@ static int add_collation(CHARSET_INFO *cs)
{
all_charsets
[
cs
->
number
]
->
state
|=
MY_CS_LOADED
;
}
all_charsets
[
cs
->
number
]
->
state
|=
MY_CS_AVAILABLE
;
}
else
{
CHARSET_INFO
*
dst
=
all_charsets
[
cs
->
number
];
dst
->
state
|=
cs
->
state
;
if
(
cs
->
comment
)
dst
->
comment
=
my_once_strdup
(
cs
->
comment
,
MYF
(
MY_WME
));
}
clear:
cs
->
number
=
0
;
cs
->
primary_number
=
0
;
cs
->
binary_number
=
0
;
...
...
@@ -389,77 +387,79 @@ char *get_charsets_dir(char *buf)
CHARSET_INFO
*
all_charsets
[
256
];
CHARSET_INFO
*
default_charset_info
=
&
my_charset_latin1
;
#define MY_ADD_CHARSET(x) all_charsets[(x)->number]=(x)
static
void
add_compiled_collation
(
CHARSET_INFO
*
cs
)
{
all_charsets
[
cs
->
number
]
=
cs
;
cs
->
state
|=
MY_CS_AVAILABLE
;
}
static
my_bool
init_compiled_charsets
(
myf
flags
__attribute__
((
unused
)))
{
CHARSET_INFO
*
cs
;
MY_ADD_CHARSET
(
&
my_charset_bin
);
add_compiled_collation
(
&
my_charset_bin
);
MY_ADD_CHARSET
(
&
my_charset_latin1
);
MY_ADD_CHARSET
(
&
my_charset_latin1_bin
);
MY_ADD_CHARSET
(
&
my_charset_latin1_german2_ci
);
add_compiled_collation
(
&
my_charset_latin1
);
add_compiled_collation
(
&
my_charset_latin1_bin
);
add_compiled_collation
(
&
my_charset_latin1_german2_ci
);
#ifdef HAVE_CHARSET_big5
MY_ADD_CHARSET
(
&
my_charset_big5_chinese_ci
);
MY_ADD_CHARSET
(
&
my_charset_big5_bin
);
add_compiled_collation
(
&
my_charset_big5_chinese_ci
);
add_compiled_collation
(
&
my_charset_big5_bin
);
#endif
#ifdef HAVE_CHARSET_cp1250
MY_ADD_CHARSET
(
&
my_charset_cp1250_czech_ci
);
add_compiled_collation
(
&
my_charset_cp1250_czech_ci
);
#endif
#ifdef HAVE_CHARSET_latin2
MY_ADD_CHARSET
(
&
my_charset_latin2_czech_ci
);
add_compiled_collation
(
&
my_charset_latin2_czech_ci
);
#endif
#ifdef HAVE_CHARSET_euckr
MY_ADD_CHARSET
(
&
my_charset_euckr_korean_ci
);
MY_ADD_CHARSET
(
&
my_charset_euckr_bin
);
add_compiled_collation
(
&
my_charset_euckr_korean_ci
);
add_compiled_collation
(
&
my_charset_euckr_bin
);
#endif
#ifdef HAVE_CHARSET_gb2312
MY_ADD_CHARSET
(
&
my_charset_gb2312_chinese_ci
);
MY_ADD_CHARSET
(
&
my_charset_gb2312_bin
);
add_compiled_collation
(
&
my_charset_gb2312_chinese_ci
);
add_compiled_collation
(
&
my_charset_gb2312_bin
);
#endif
#ifdef HAVE_CHARSET_gbk
MY_ADD_CHARSET
(
&
my_charset_gbk_chinese_ci
);
MY_ADD_CHARSET
(
&
my_charset_gbk_bin
);
add_compiled_collation
(
&
my_charset_gbk_chinese_ci
);
add_compiled_collation
(
&
my_charset_gbk_bin
);
#endif
#ifdef HAVE_CHARSET_sjis
MY_ADD_CHARSET
(
&
my_charset_sjis_japanese_ci
);
MY_ADD_CHARSET
(
&
my_charset_sjis_bin
);
add_compiled_collation
(
&
my_charset_sjis_japanese_ci
);
add_compiled_collation
(
&
my_charset_sjis_bin
);
#endif
#ifdef HAVE_CHARSET_tis620
MY_ADD_CHARSET
(
&
my_charset_tis620_thai_ci
);
MY_ADD_CHARSET
(
&
my_charset_tis620_bin
);
add_compiled_collation
(
&
my_charset_tis620_thai_ci
);
add_compiled_collation
(
&
my_charset_tis620_bin
);
#endif
#ifdef HAVE_CHARSET_ucs2
MY_ADD_CHARSET
(
&
my_charset_ucs2_general_ci
);
MY_ADD_CHARSET
(
&
my_charset_ucs2_bin
);
add_compiled_collation
(
&
my_charset_ucs2_general_ci
);
add_compiled_collation
(
&
my_charset_ucs2_bin
);
#endif
#ifdef HAVE_CHARSET_ujis
MY_ADD_CHARSET
(
&
my_charset_ujis_japanese_ci
);
MY_ADD_CHARSET
(
&
my_charset_ujis_bin
);
add_compiled_collation
(
&
my_charset_ujis_japanese_ci
);
add_compiled_collation
(
&
my_charset_ujis_bin
);
#endif
#ifdef HAVE_CHARSET_utf8
MY_ADD_CHARSET
(
&
my_charset_utf8_general_ci
);
MY_ADD_CHARSET
(
&
my_charset_utf8_bin
);
add_compiled_collation
(
&
my_charset_utf8_general_ci
);
add_compiled_collation
(
&
my_charset_utf8_bin
);
#endif
/* Copy compiled charsets */
for
(
cs
=
compiled_charsets
;
cs
->
name
;
cs
++
)
{
all_charsets
[
cs
->
number
]
=
cs
;
}
add_compiled_collation
(
cs
);
return
FALSE
;
}
...
...
@@ -570,7 +570,7 @@ static CHARSET_INFO *get_internal_charset(uint cs_number, myf flags)
cs
=
all_charsets
[
cs_number
];
if
(
cs
&&
!
(
cs
->
state
&
(
MY_CS_COMPILED
|
MY_CS_LOADED
)
))
if
(
cs
&&
!
(
cs
->
state
&
MY_CS_COMPILED
)
&&
!
(
cs
->
state
&
MY_CS_LOADED
))
{
strxmov
(
get_charsets_dir
(
buf
),
cs
->
csname
,
".xml"
,
NullS
);
my_read_charset_file
(
buf
,
flags
);
...
...
sql/derror.cc
View file @
99e2a821
...
...
@@ -67,10 +67,18 @@ static void read_texts(const char *file_name,const char ***point,
goto
err
;
/* purecov: inspected */
textcount
=
head
[
4
];
if
(
!
head
[
30
])
{
sql_print_error
(
"No character set information in '%s'. \
You probably haven't reinstalled the latest file version."
,
name
);
goto
err1
;
}
if
(
!
(
cset
=
get_charset
(
head
[
30
],
MYF
(
MY_WME
))))
{
funktpos
=
3
;
goto
err
;
sql_print_error
(
"Character set #%d is not supported for messagefile '%s'"
,
(
int
)
head
[
30
],
name
);
goto
err1
;
}
length
=
uint2korr
(
head
+
6
);
count
=
uint2korr
(
head
+
8
);
...
...
@@ -112,9 +120,6 @@ Check that the above file is the right version for this program!",
err:
switch
(
funktpos
)
{
case
3
:
buff
=
"Character set is not supported for messagefile '%s'"
;
break
;
case
2
:
buff
=
"Not enough memory for messagefile '%s'"
;
break
;
...
...
@@ -125,9 +130,10 @@ Check that the above file is the right version for this program!",
buff
=
"Can't find messagefile '%s'"
;
break
;
}
sql_print_error
(
buff
,
name
);
err1:
if
(
file
!=
FERR
)
VOID
(
my_close
(
file
,
MYF
(
MY_WME
)));
sql_print_error
(
buff
,
name
);
unireg_abort
(
1
);
}
/* read_texts */
...
...
sql/sql_show.cc
View file @
99e2a821
...
...
@@ -1497,11 +1497,15 @@ int mysqld_show_collations(THD *thd, const char *wild)
for
(
cs
=
all_charsets
;
cs
<
all_charsets
+
255
;
cs
++
)
{
CHARSET_INFO
**
cl
;
if
(
!
cs
[
0
]
||
!
(
cs
[
0
]
->
state
&
MY_CS_AVAILABLE
)
||
!
(
cs
[
0
]
->
state
&
MY_CS_PRIMARY
))
continue
;
for
(
cl
=
all_charsets
;
cl
<
all_charsets
+
255
;
cl
++
)
{
if
(
!
cs
[
0
]
||
!
cl
[
0
]
||
!
my_charset_same
(
cs
[
0
],
cl
[
0
])
||
!
(
cs
[
0
]
->
state
&
MY_CS_PRIMARY
))
if
(
!
cl
[
0
]
||
!
(
cl
[
0
]
->
state
&
MY_CS_AVAILABLE
)
||
!
my_charset_same
(
cs
[
0
],
cl
[
0
]))
continue
;
if
(
cs
[
0
]
&&
!
(
wild
&&
wild
[
0
]
&&
if
(
!
(
wild
&&
wild
[
0
]
&&
wild_case_compare
(
system_charset_info
,
cl
[
0
]
->
name
,
wild
)))
{
if
(
write_collation
(
protocol
,
cl
[
0
]))
...
...
@@ -1545,8 +1549,10 @@ int mysqld_show_charsets(THD *thd, const char *wild)
for
(
cs
=
all_charsets
;
cs
<
all_charsets
+
255
;
cs
++
)
{
if
(
cs
[
0
]
&&
(
cs
[
0
]
->
state
&
MY_CS_PRIMARY
)
&&
!
(
wild
&&
wild
[
0
]
&&
wild_case_compare
(
system_charset_info
,
cs
[
0
]
->
name
,
wild
)))
if
(
cs
[
0
]
&&
(
cs
[
0
]
->
state
&
MY_CS_PRIMARY
)
&&
(
cs
[
0
]
->
state
&
MY_CS_AVAILABLE
)
&&
!
(
wild
&&
wild
[
0
]
&&
wild_case_compare
(
system_charset_info
,
cs
[
0
]
->
csname
,
wild
)))
{
if
(
write_charset
(
protocol
,
cs
[
0
]))
goto
err
;
...
...
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