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
ccc28f46
Commit
ccc28f46
authored
Sep 17, 2003
by
hf@deer.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-4.1
into deer.(none):/home/hf/work/mysql-4.1.stmt
parents
ddbca417
731b8392
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
21 deletions
+49
-21
extra/comp_err.c
extra/comp_err.c
+11
-3
include/my_sys.h
include/my_sys.h
+3
-1
mysys/charset.c
mysys/charset.c
+23
-16
sql/derror.cc
sql/derror.cc
+11
-0
sql/share/Makefile.am
sql/share/Makefile.am
+1
-1
No files found.
extra/comp_err.c
View file @
ccc28f46
...
...
@@ -42,11 +42,12 @@ static int copy_rows(FILE *to);
int
main
(
int
argc
,
char
*
argv
[])
{
uint
csnum
=
0
;
int
i
,
error
,
files
,
length
;
uchar
head
[
32
];
FILE
*
from
,
*
to
;
MY_INIT
(
argv
[
0
]);
get_options
(
&
argc
,
&
argv
);
error
=
1
;
row_count
=
files
=
0
;
...
...
@@ -70,6 +71,13 @@ int main(int argc,char *argv[])
goto
end
;
}
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
;
}
if
(
remember_rows
(
from
,
'}'
)
<
0
)
/* Remember rows */
{
fprintf
(
stderr
,
"Can't find textrows in '%s'
\n
"
,
*
argv
);
...
...
@@ -100,7 +108,8 @@ int main(int argc,char *argv[])
{
int2store
(
head
+
10
+
i
+
i
,
file_row_pos
[
i
]);
}
head
[
30
]
=
csnum
;
fseek
(
to
,
0l
,
0
);
if
(
fwrite
(
head
,
1
,
32
,
to
)
!=
32
)
goto
end
;
...
...
@@ -144,7 +153,6 @@ static void get_options(register int *argc,register char **argv[])
printf
(
"%s (Compile errormessage) Ver 1.3
\n
"
,
progname
);
break
;
case
'C'
:
printf
(
"pos=%s
\n
"
,
pos
+
1
);
charsets_dir
=
pos
+
1
;
*
(
pos
--
)
=
'\0'
;
break
;
...
...
include/my_sys.h
View file @
ccc28f46
...
...
@@ -209,8 +209,10 @@ extern CHARSET_INFO *default_charset_info;
extern
CHARSET_INFO
*
all_charsets
[
256
];
extern
CHARSET_INFO
compiled_charsets
[];
extern
uint
get_charset_number
(
const
char
*
cs_name
);
extern
uint
get_charset_number
(
const
char
*
cs_name
,
uint
cs_flags
);
extern
uint
get_collation_number
(
const
char
*
name
);
extern
const
char
*
get_charset_name
(
uint
cs_number
);
extern
CHARSET_INFO
*
get_charset
(
uint
cs_number
,
myf
flags
);
extern
CHARSET_INFO
*
get_charset_by_name
(
const
char
*
cs_name
,
myf
flags
);
extern
CHARSET_INFO
*
get_charset_by_csname
(
const
char
*
cs_name
,
...
...
mysys/charset.c
View file @
ccc28f46
...
...
@@ -278,7 +278,7 @@ static my_bool simple_cs_is_full(CHARSET_INFO *cs)
static
int
add_collation
(
CHARSET_INFO
*
cs
)
{
if
(
cs
->
name
&&
(
cs
->
number
||
(
cs
->
number
=
get_c
harset
_number
(
cs
->
name
))))
if
(
cs
->
name
&&
(
cs
->
number
||
(
cs
->
number
=
get_c
ollation
_number
(
cs
->
name
))))
{
if
(
!
all_charsets
[
cs
->
number
])
{
...
...
@@ -513,7 +513,7 @@ void free_charsets(void)
}
uint
get_c
harset_number
(
const
char
*
charset_
name
)
uint
get_c
ollation_number
(
const
char
*
name
)
{
CHARSET_INFO
**
cs
;
if
(
init_available_charsets
(
MYF
(
0
)))
/* If it isn't initialized */
...
...
@@ -522,12 +522,27 @@ uint get_charset_number(const char *charset_name)
for
(
cs
=
all_charsets
;
cs
<
all_charsets
+
255
;
++
cs
)
{
if
(
cs
[
0
]
&&
cs
[
0
]
->
name
&&
!
my_strcasecmp
(
&
my_charset_latin1
,
cs
[
0
]
->
name
,
charset_
name
))
!
my_strcasecmp
(
&
my_charset_latin1
,
cs
[
0
]
->
name
,
name
))
return
cs
[
0
]
->
number
;
}
return
0
;
/* this mimics find_type() */
}
uint
get_charset_number
(
const
char
*
charset_name
,
uint
cs_flags
)
{
CHARSET_INFO
**
cs
;
if
(
init_available_charsets
(
MYF
(
0
)))
/* If it isn't initialized */
return
0
;
for
(
cs
=
all_charsets
;
cs
<
all_charsets
+
255
;
++
cs
)
{
if
(
cs
[
0
]
&&
cs
[
0
]
->
csname
&&
(
cs
[
0
]
->
state
&
cs_flags
)
&&
!
my_strcasecmp
(
&
my_charset_latin1
,
cs
[
0
]
->
csname
,
charset_name
))
return
cs
[
0
]
->
number
;
}
return
0
;
}
const
char
*
get_charset_name
(
uint
charset_number
)
{
...
...
@@ -593,7 +608,7 @@ CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags)
CHARSET_INFO
*
cs
;
(
void
)
init_available_charsets
(
MYF
(
0
));
/* If it isn't initialized */
cs_number
=
get_c
harset
_number
(
cs_name
);
cs_number
=
get_c
ollation
_number
(
cs_name
);
cs
=
cs_number
?
get_internal_charset
(
cs_number
,
flags
)
:
NULL
;
if
(
!
cs
&&
(
flags
&
MY_WME
))
...
...
@@ -611,23 +626,15 @@ CHARSET_INFO *get_charset_by_csname(const char *cs_name,
uint
cs_flags
,
myf
flags
)
{
CHARSET_INFO
*
cs
=
NULL
;
CHARSET_INFO
*
*
cs
s
;
uint
cs_number
;
CHARSET_INFO
*
c
s
;
DBUG_ENTER
(
"get_charset_by_csname"
);
DBUG_PRINT
(
"enter"
,(
"name: '%s'"
,
cs_name
));
(
void
)
init_available_charsets
(
MYF
(
0
));
/* If it isn't initialized */
for
(
css
=
all_charsets
;
css
<
all_charsets
+
255
;
++
css
)
{
if
(
css
[
0
]
&&
(
css
[
0
]
->
state
&
cs_flags
)
&&
css
[
0
]
->
csname
&&
!
my_strcasecmp
(
&
my_charset_latin1
,
css
[
0
]
->
csname
,
cs_name
))
{
cs
=
css
[
0
]
->
number
?
get_internal_charset
(
css
[
0
]
->
number
,
flags
)
:
NULL
;
break
;
}
}
cs_number
=
get_charset_number
(
cs_name
,
cs_flags
);
cs
=
cs_number
?
get_internal_charset
(
cs_number
,
flags
)
:
NULL
;
if
(
!
cs
&&
(
flags
&
MY_WME
))
{
...
...
sql/derror.cc
View file @
ccc28f46
...
...
@@ -49,6 +49,7 @@ static void read_texts(const char *file_name,const char ***point,
char
name
[
FN_REFLEN
];
const
char
*
buff
;
uchar
head
[
32
],
*
pos
;
CHARSET_INFO
*
cset
;
DBUG_ENTER
(
"read_texts"
);
*
point
=
0
;
// If something goes wrong
...
...
@@ -65,6 +66,13 @@ static void read_texts(const char *file_name,const char ***point,
head
[
2
]
!=
2
||
head
[
3
]
!=
1
)
goto
err
;
/* purecov: inspected */
textcount
=
head
[
4
];
if
(
!
(
cset
=
get_charset
(
head
[
30
],
MYF
(
MY_WME
))))
{
funktpos
=
3
;
goto
err
;
}
length
=
uint2korr
(
head
+
6
);
count
=
uint2korr
(
head
+
8
);
if
(
count
<
error_messages
)
...
...
@@ -104,6 +112,9 @@ 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
;
...
...
sql/share/Makefile.am
View file @
ccc28f46
...
...
@@ -30,7 +30,7 @@ install-data-local:
fix_errors
:
for
lang
in
@AVAILABLE_LANGUAGES@
;
\
do
\
../../extra/comp_err
$(srcdir)
/
$$
lang/errmsg.txt
$(srcdir)
/
$$
lang/errmsg.sys
;
\
../../extra/comp_err
-C
$(srcdir)
/charsets/
$(srcdir)
/
$$
lang/errmsg.txt
$(srcdir)
/
$$
lang/errmsg.sys
;
\
done
# Don't update the files from bitkeeper
...
...
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