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
5be0d3ff
Commit
5be0d3ff
authored
Dec 20, 2002
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
less default_charset_info
parent
ffe7c5d6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
30 deletions
+38
-30
sql/item_func.cc
sql/item_func.cc
+4
-4
sql/item_strfunc.cc
sql/item_strfunc.cc
+9
-6
sql/mysqld.cc
sql/mysqld.cc
+8
-6
sql/sql_class.cc
sql/sql_class.cc
+6
-5
sql/sql_help.cc
sql/sql_help.cc
+11
-9
No files found.
sql/item_func.cc
View file @
5be0d3ff
...
...
@@ -1883,7 +1883,7 @@ longlong Item_func_set_last_insert_id::val_int()
longlong
Item_func_benchmark
::
val_int
()
{
char
buff
[
MAX_FIELD_WIDTH
];
String
tmp
(
buff
,
sizeof
(
buff
),
default_charset_info
);
String
tmp
(
buff
,
sizeof
(
buff
),
NULL
);
THD
*
thd
=
current_thd
;
for
(
ulong
loop
=
0
;
loop
<
loop_count
&&
!
thd
->
killed
;
loop
++
)
...
...
@@ -2029,7 +2029,7 @@ Item_func_set_user_var::update()
case
STRING_RESULT
:
{
char
buffer
[
MAX_FIELD_WIDTH
];
String
tmp
(
buffer
,
sizeof
(
buffer
),
default_charset_info
);
String
tmp
(
buffer
,
sizeof
(
buffer
),
NULL
);
(
void
)
val_str
(
&
tmp
);
break
;
}
...
...
@@ -2221,7 +2221,7 @@ longlong Item_func_inet_aton::val_int()
char
c
=
'.'
;
// we mark c to indicate invalid IP in case length is 0
char
buff
[
36
];
String
*
s
,
tmp
(
buff
,
sizeof
(
buff
),
default_charset_info
);
String
*
s
,
tmp
(
buff
,
sizeof
(
buff
),
NULL
);
if
(
!
(
s
=
args
[
0
]
->
val_str
(
&
tmp
)))
// If null value
goto
err
;
null_value
=
0
;
...
...
@@ -2275,7 +2275,7 @@ void Item_func_match::init_search(bool no_order)
String
*
ft_tmp
=
0
;
char
tmp1
[
FT_QUERY_MAXLEN
];
String
tmp2
(
tmp1
,
sizeof
(
tmp1
),
default_charset_info
);
String
tmp2
(
tmp1
,
sizeof
(
tmp1
),
NULL
);
// MATCH ... AGAINST (NULL) is meaningless, but possible
if
(
!
(
ft_tmp
=
key_item
()
->
val_str
(
&
tmp2
)))
...
...
sql/item_strfunc.cc
View file @
5be0d3ff
...
...
@@ -1438,6 +1438,8 @@ String *Item_func_soundex::val_str(String *str)
{
String
*
res
=
args
[
0
]
->
val_str
(
str
);
char
last_ch
,
ch
;
CHARSET_INFO
*
cs
=
my_charset_latin1
;
if
((
null_value
=
args
[
0
]
->
null_value
))
return
0
;
/* purecov: inspected */
...
...
@@ -1445,22 +1447,23 @@ String *Item_func_soundex::val_str(String *str)
return
str
;
/* purecov: inspected */
char
*
to
=
(
char
*
)
tmp_value
.
ptr
();
char
*
from
=
(
char
*
)
res
->
ptr
(),
*
end
=
from
+
res
->
length
();
while
(
from
!=
end
&&
my_isspace
(
str
->
charset
(),
*
from
))
// Skip pre-space
tmp_value
.
set_charset
(
cs
);
while
(
from
!=
end
&&
my_isspace
(
cs
,
*
from
))
// Skip pre-space
from
++
;
/* purecov: inspected */
if
(
from
==
end
)
return
&
empty_string
;
// No alpha characters.
*
to
++
=
my_toupper
(
str
->
charset
(),
*
from
);
// Copy first letter
last_ch
=
get_scode
(
str
->
charset
(),
from
);
// code of the first letter
*
to
++
=
my_toupper
(
cs
,
*
from
);
// Copy first letter
last_ch
=
get_scode
(
cs
,
from
);
// code of the first letter
// for the first 'double-letter check.
// Loop on input letters until
// end of input (null) or output
// letter code count = 3
for
(
from
++
;
from
<
end
;
from
++
)
{
if
(
!
my_isalpha
(
str
->
charset
()
,
*
from
))
if
(
!
my_isalpha
(
cs
,
*
from
))
continue
;
ch
=
get_scode
(
str
->
charset
()
,
from
);
ch
=
get_scode
(
cs
,
from
);
if
((
ch
!=
'0'
)
&&
(
ch
!=
last_ch
))
// if not skipped or double
{
*
to
++
=
ch
;
// letter, copy to output
...
...
sql/mysqld.cc
View file @
5be0d3ff
...
...
@@ -34,6 +34,8 @@
#include <ft_global.h>
#include <assert.h>
#define mysqld_charset my_charset_latin1
#ifndef DBUG_OFF
#define ONE_THREAD
#endif
...
...
@@ -981,7 +983,7 @@ static void set_user(const char *user)
{
// allow a numeric uid to be used
const
char
*
pos
;
for
(
pos
=
user
;
my_isdigit
(
system_charset_info
,
*
pos
);
pos
++
)
;
for
(
pos
=
user
;
my_isdigit
(
mysqld_charset
,
*
pos
);
pos
++
)
;
if
(
*
pos
)
// Not numeric id
{
fprintf
(
stderr
,
"Fatal error: Can't change to run as user '%s' ; Please check that the user exists!
\n
"
,
user
);
...
...
@@ -4373,7 +4375,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
exit
(
1
);
}
val
=
p
--
;
while
(
my_isspace
(
system_charset_info
,
*
p
)
&&
p
>
argument
)
while
(
my_isspace
(
mysqld_charset
,
*
p
)
&&
p
>
argument
)
*
p
--
=
0
;
if
(
p
==
argument
)
{
...
...
@@ -4383,7 +4385,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
}
*
val
=
0
;
val
+=
2
;
while
(
*
val
&&
my_isspace
(
system_charset_info
,
*
val
))
while
(
*
val
&&
my_isspace
(
mysqld_charset
,
*
val
))
*
val
++
;
if
(
!*
val
)
{
...
...
@@ -4525,7 +4527,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
have_symlink
=
SHOW_OPTION_DISABLED
;
break
;
case
(
int
)
OPT_BIND_ADDRESS
:
if
(
argument
&&
my_isdigit
(
system_charset_info
,
argument
[
0
]))
if
(
argument
&&
my_isdigit
(
mysqld_charset
,
argument
[
0
]))
{
my_bind_addr
=
(
ulong
)
inet_addr
(
argument
);
}
...
...
@@ -4938,8 +4940,8 @@ static ulong find_bit_type(const char *x, TYPELIB *bit_lib)
j
=
pos
;
while
(
j
!=
end
)
{
if
(
my_toupper
(
system_charset_info
,
*
i
++
)
!=
my_toupper
(
system_charset_info
,
*
j
++
))
if
(
my_toupper
(
mysqld_charset
,
*
i
++
)
!=
my_toupper
(
mysqld_charset
,
*
j
++
))
goto
skipp
;
}
found_int
=
bit
;
...
...
sql/sql_class.cc
View file @
5be0d3ff
...
...
@@ -526,7 +526,7 @@ bool select_send::send_data(List<Item> &items)
List_iterator_fast
<
Item
>
li
(
items
);
Protocol
*
protocol
=
thd
->
protocol
;
char
buff
[
MAX_FIELD_WIDTH
];
String
buffer
(
buff
,
sizeof
(
buff
),
system_charset_info
);
String
buffer
(
buff
,
sizeof
(
buff
),
NULL
);
DBUG_ENTER
(
"send_data"
);
protocol
->
prepare_for_resend
();
...
...
@@ -649,7 +649,7 @@ bool select_export::send_data(List<Item> &items)
DBUG_ENTER
(
"send_data"
);
char
buff
[
MAX_FIELD_WIDTH
],
null_buff
[
2
],
space
[
MAX_FIELD_WIDTH
];
bool
space_inited
=
0
;
String
tmp
(
buff
,
sizeof
(
buff
),
default_charset_info
),
*
res
;
String
tmp
(
buff
,
sizeof
(
buff
),
NULL
),
*
res
;
tmp
.
length
(
0
);
if
(
unit
->
offset_limit_cnt
)
...
...
@@ -710,10 +710,11 @@ bool select_export::send_data(List<Item> &items)
pos
++
)
{
#ifdef USE_MB
if
(
use_mb
(
default_charset_info
))
CHARSET_INFO
*
res_charset
=
res
->
charset
();
if
(
use_mb
(
res_charset
))
{
int
l
;
if
((
l
=
my_ismbchar
(
default_charset_info
,
pos
,
end
)))
if
((
l
=
my_ismbchar
(
res_charset
,
pos
,
end
)))
{
pos
+=
l
-
1
;
continue
;
...
...
@@ -856,7 +857,7 @@ bool select_dump::send_data(List<Item> &items)
{
List_iterator_fast
<
Item
>
li
(
items
);
char
buff
[
MAX_FIELD_WIDTH
];
String
tmp
(
buff
,
sizeof
(
buff
),
default_charset_info
),
*
res
;
String
tmp
(
buff
,
sizeof
(
buff
),
NULL
),
*
res
;
tmp
.
length
(
0
);
Item
*
item
;
DBUG_ENTER
(
"send_data"
);
...
...
sql/sql_help.cc
View file @
5be0d3ff
...
...
@@ -22,6 +22,8 @@
** Get help on string
***************************************************************************/
#define help_charset my_charset_latin1
MI_INFO
*
open_help_file
(
THD
*
thd
,
const
char
*
name
)
{
char
path
[
FN_REFLEN
];
...
...
@@ -104,21 +106,21 @@ int search_functions(MI_INFO *file_leafs, const char *mask,
leaf
.
prepare_fields
();
const
char
*
lname
=
leaf
.
get_name
();
if
(
wild_case_compare
(
system_charset_info
,
lname
,
mask
))
if
(
wild_case_compare
(
help_charset
,
lname
,
mask
))
continue
;
count
++
;
if
(
count
>
2
)
{
String
*
s
=
new
String
(
lname
,
system_charset_info
);
String
*
s
=
new
String
(
lname
,
help_charset
);
if
(
!
s
->
copy
())
names
->
push_back
(
s
);
}
else
if
(
count
==
1
)
{
*
description
=
new
String
(
leaf
.
get_description
(),
system_charset_info
);
*
example
=
new
String
(
leaf
.
get_example
(),
system_charset_info
);
*
name
=
new
String
(
lname
,
system_charset_info
);
*
description
=
new
String
(
leaf
.
get_description
(),
help_charset
);
*
example
=
new
String
(
leaf
.
get_example
(),
help_charset
);
*
name
=
new
String
(
lname
,
help_charset
);
(
*
description
)
->
copy
();
(
*
example
)
->
copy
();
(
*
name
)
->
copy
();
...
...
@@ -132,7 +134,7 @@ int search_functions(MI_INFO *file_leafs, const char *mask,
*
description
=
0
;
*
example
=
0
;
String
*
s
=
new
String
(
lname
,
system_charset_info
);
String
*
s
=
new
String
(
lname
,
help_charset
);
if
(
!
s
->
copy
())
names
->
push_back
(
s
);
}
...
...
@@ -203,14 +205,14 @@ int search_categories(THD *thd,
category
.
prepare_fields
();
const
char
*
lname
=
category
.
get_name
();
if
(
mask
&&
wild_case_compare
(
system_charset_info
,
lname
,
mask
))
if
(
mask
&&
wild_case_compare
(
help_charset
,
lname
,
mask
))
continue
;
count
++
;
if
(
count
==
1
&&
res_id
)
*
res_id
=
category
.
get_cat_id
();
String
*
s
=
new
String
(
lname
,
system_charset_info
);
String
*
s
=
new
String
(
lname
,
help_charset
);
if
(
!
s
->
copy
())
names
->
push_back
(
s
);
}
...
...
@@ -282,7 +284,7 @@ int get_all_names_for_category(THD *thd,MI_INFO *file_leafs,
(
const
byte
*
)
&
leaf_id
,
4
,
HA_READ_KEY_EXACT
))
{
leaf
.
prepare_fields
();
String
*
s
=
new
String
(
leaf
.
get_name
(),
system_charset_info
);
String
*
s
=
new
String
(
leaf
.
get_name
(),
help_charset
);
if
(
!
s
->
copy
())
res
->
push_back
(
s
);
}
...
...
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