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
aebd2397
Commit
aebd2397
authored
Jun 17, 2024
by
Yuchen Pei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-34404 Use safe_str in spider udfs to avoid passing NULL str
parent
8b169949
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
sql/sql_class.h
sql/sql_class.h
+1
-1
storage/spider/spd_copy_tables.cc
storage/spider/spd_copy_tables.cc
+1
-1
storage/spider/spd_direct_sql.cc
storage/spider/spd_direct_sql.cc
+1
-1
No files found.
sql/sql_class.h
View file @
aebd2397
...
@@ -4580,7 +4580,7 @@ class THD: public THD_count, /* this must be first */
...
@@ -4580,7 +4580,7 @@ class THD: public THD_count, /* this must be first */
to
->
length
=
db
.
length
;
to
->
length
=
db
.
length
;
return
to
->
str
==
NULL
;
/* True on error */
return
to
->
str
==
NULL
;
/* True on error */
}
}
/* Get db name or "".
Use for printing current db
*/
/* Get db name or "". */
const
char
*
get_db
()
const
char
*
get_db
()
{
return
safe_str
(
db
.
str
);
}
{
return
safe_str
(
db
.
str
);
}
...
...
storage/spider/spd_copy_tables.cc
View file @
aebd2397
...
@@ -52,7 +52,7 @@ int spider_udf_set_copy_tables_param_default(
...
@@ -52,7 +52,7 @@ int spider_udf_set_copy_tables_param_default(
copy_tables
->
database_length
=
SPIDER_THD_db_length
(
copy_tables
->
trx
->
thd
);
copy_tables
->
database_length
=
SPIDER_THD_db_length
(
copy_tables
->
trx
->
thd
);
if
(
if
(
!
(
copy_tables
->
database
=
spider_create_string
(
!
(
copy_tables
->
database
=
spider_create_string
(
SPIDER_THD_db_str
(
copy_tables
->
trx
->
thd
),
copy_tables
->
trx
->
thd
->
get_db
(
),
copy_tables
->
database_length
))
copy_tables
->
database_length
))
)
{
)
{
my_error
(
ER_OUT_OF_RESOURCES
,
MYF
(
0
),
HA_ERR_OUT_OF_MEM
);
my_error
(
ER_OUT_OF_RESOURCES
,
MYF
(
0
),
HA_ERR_OUT_OF_MEM
);
...
...
storage/spider/spd_direct_sql.cc
View file @
aebd2397
...
@@ -1109,7 +1109,7 @@ int spider_udf_set_direct_sql_param_default(
...
@@ -1109,7 +1109,7 @@ int spider_udf_set_direct_sql_param_default(
direct_sql
->
tgt_default_db_name_length
=
SPIDER_THD_db_length
(
trx
->
thd
);
direct_sql
->
tgt_default_db_name_length
=
SPIDER_THD_db_length
(
trx
->
thd
);
if
(
if
(
!
(
direct_sql
->
tgt_default_db_name
=
spider_create_string
(
!
(
direct_sql
->
tgt_default_db_name
=
spider_create_string
(
SPIDER_THD_db_str
(
trx
->
thd
),
trx
->
thd
->
get_db
(
),
direct_sql
->
tgt_default_db_name_length
))
direct_sql
->
tgt_default_db_name_length
))
)
{
)
{
my_error
(
ER_OUT_OF_RESOURCES
,
MYF
(
0
),
HA_ERR_OUT_OF_MEM
);
my_error
(
ER_OUT_OF_RESOURCES
,
MYF
(
0
),
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