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
7831b79f
Commit
7831b79f
authored
Jan 26, 2016
by
Vladislav Vaintroub
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '10.1' of
http://github.com/MariaDB/server
into 10.1
parents
c76ab94f
77c75a46
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
8 deletions
+10
-8
sql/item_strfunc.cc
sql/item_strfunc.cc
+3
-3
sql/item_strfunc.h
sql/item_strfunc.h
+6
-4
storage/spider/spd_db_mysql.cc
storage/spider/spd_db_mysql.cc
+1
-1
No files found.
sql/item_strfunc.cc
View file @
7831b79f
...
@@ -3404,7 +3404,7 @@ String *Item_func_conv_charset::val_str(String *str)
...
@@ -3404,7 +3404,7 @@ String *Item_func_conv_charset::val_str(String *str)
String
*
arg
=
args
[
0
]
->
val_str
(
str
);
String
*
arg
=
args
[
0
]
->
val_str
(
str
);
String_copier_for_item
copier
(
current_thd
);
String_copier_for_item
copier
(
current_thd
);
return
((
null_value
=
args
[
0
]
->
null_value
||
return
((
null_value
=
args
[
0
]
->
null_value
||
copier
.
copy_with_warn
(
co
nv_charset
,
&
tmp_value
,
copier
.
copy_with_warn
(
co
llation
.
collation
,
&
tmp_value
,
arg
->
charset
(),
arg
->
ptr
(),
arg
->
charset
(),
arg
->
ptr
(),
arg
->
length
(),
arg
->
length
())))
?
arg
->
length
(),
arg
->
length
())))
?
0
:
&
tmp_value
;
0
:
&
tmp_value
;
...
@@ -3412,7 +3412,7 @@ String *Item_func_conv_charset::val_str(String *str)
...
@@ -3412,7 +3412,7 @@ String *Item_func_conv_charset::val_str(String *str)
void
Item_func_conv_charset
::
fix_length_and_dec
()
void
Item_func_conv_charset
::
fix_length_and_dec
()
{
{
collation
.
set
(
conv_charset
,
DERIVATION_IMPLICIT
);
DBUG_ASSERT
(
collation
.
derivation
==
DERIVATION_IMPLICIT
);
fix_char_length
(
args
[
0
]
->
max_char_length
());
fix_char_length
(
args
[
0
]
->
max_char_length
());
}
}
...
@@ -3421,7 +3421,7 @@ void Item_func_conv_charset::print(String *str, enum_query_type query_type)
...
@@ -3421,7 +3421,7 @@ void Item_func_conv_charset::print(String *str, enum_query_type query_type)
str
->
append
(
STRING_WITH_LEN
(
"convert("
));
str
->
append
(
STRING_WITH_LEN
(
"convert("
));
args
[
0
]
->
print
(
str
,
query_type
);
args
[
0
]
->
print
(
str
,
query_type
);
str
->
append
(
STRING_WITH_LEN
(
" using "
));
str
->
append
(
STRING_WITH_LEN
(
" using "
));
str
->
append
(
co
nv_charset
->
csname
);
str
->
append
(
co
llation
.
collation
->
csname
);
str
->
append
(
')'
);
str
->
append
(
')'
);
}
}
...
...
sql/item_strfunc.h
View file @
7831b79f
...
@@ -959,20 +959,22 @@ class Item_func_conv_charset :public Item_str_func
...
@@ -959,20 +959,22 @@ class Item_func_conv_charset :public Item_str_func
String
tmp_value
;
String
tmp_value
;
public:
public:
bool
safe
;
bool
safe
;
CHARSET_INFO
*
conv_charset
;
// keep it public
Item_func_conv_charset
(
THD
*
thd
,
Item
*
a
,
CHARSET_INFO
*
cs
)
:
Item_func_conv_charset
(
THD
*
thd
,
Item
*
a
,
CHARSET_INFO
*
cs
)
:
Item_str_func
(
thd
,
a
)
Item_str_func
(
thd
,
a
)
{
conv_charset
=
cs
;
use_cached_value
=
0
;
safe
=
0
;
}
{
collation
.
set
(
cs
,
DERIVATION_IMPLICIT
);
use_cached_value
=
0
;
safe
=
0
;
}
Item_func_conv_charset
(
THD
*
thd
,
Item
*
a
,
CHARSET_INFO
*
cs
,
bool
cache_if_const
)
:
Item_func_conv_charset
(
THD
*
thd
,
Item
*
a
,
CHARSET_INFO
*
cs
,
bool
cache_if_const
)
:
Item_str_func
(
thd
,
a
)
Item_str_func
(
thd
,
a
)
{
{
co
nv_charset
=
cs
;
co
llation
.
set
(
cs
,
DERIVATION_IMPLICIT
)
;
if
(
cache_if_const
&&
args
[
0
]
->
const_item
()
&&
!
args
[
0
]
->
is_expensive
())
if
(
cache_if_const
&&
args
[
0
]
->
const_item
()
&&
!
args
[
0
]
->
is_expensive
())
{
{
uint
errors
=
0
;
uint
errors
=
0
;
String
tmp
,
*
str
=
args
[
0
]
->
val_str
(
&
tmp
);
String
tmp
,
*
str
=
args
[
0
]
->
val_str
(
&
tmp
);
if
(
!
str
||
str_value
.
copy
(
str
->
ptr
(),
str
->
length
(),
if
(
!
str
||
str_value
.
copy
(
str
->
ptr
(),
str
->
length
(),
str
->
charset
(),
c
onv_charset
,
&
errors
))
str
->
charset
(),
c
s
,
&
errors
))
null_value
=
1
;
null_value
=
1
;
use_cached_value
=
1
;
use_cached_value
=
1
;
str_value
.
mark_as_const
();
str_value
.
mark_as_const
();
...
...
storage/spider/spd_db_mysql.cc
View file @
7831b79f
...
@@ -4041,7 +4041,7 @@ int spider_db_mysql_util::open_item_func(
...
@@ -4041,7 +4041,7 @@ int spider_db_mysql_util::open_item_func(
{
{
Item_func_conv_charset
*
item_func_conv_charset
=
Item_func_conv_charset
*
item_func_conv_charset
=
(
Item_func_conv_charset
*
)
item_func
;
(
Item_func_conv_charset
*
)
item_func
;
CHARSET_INFO
*
conv_charset
=
item_func_conv_charset
->
co
nv_charset
;
CHARSET_INFO
*
conv_charset
=
item_func_conv_charset
->
co
llation
.
collation
;
uint
cset_length
=
strlen
(
conv_charset
->
csname
);
uint
cset_length
=
strlen
(
conv_charset
->
csname
);
if
(
str
->
reserve
(
SPIDER_SQL_USING_LEN
+
cset_length
))
if
(
str
->
reserve
(
SPIDER_SQL_USING_LEN
+
cset_length
))
DBUG_RETURN
(
HA_ERR_OUT_OF_MEM
);
DBUG_RETURN
(
HA_ERR_OUT_OF_MEM
);
...
...
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