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
a1e52014
Commit
a1e52014
authored
Mar 24, 2017
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-12357 Invalid read of size 8 in Type_aggregator::Type_aggregator()
parent
552072e4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
41 deletions
+53
-41
sql/mysqld.cc
sql/mysqld.cc
+8
-0
sql/sql_type.cc
sql/sql_type.cc
+34
-39
sql/sql_type.h
sql/sql_type.h
+11
-2
No files found.
sql/mysqld.cc
View file @
a1e52014
...
...
@@ -2221,6 +2221,7 @@ void clean_up(bool print_message)
#endif
wsrep_thr_deinit
();
my_uuid_end
();
delete
type_handler_data
;
delete
binlog_filter
;
delete
global_rpl_filter
;
end_ssl
();
...
...
@@ -4126,6 +4127,13 @@ static int init_common_variables()
sf_malloc_dbug_id
=
mariadb_dbug_id
;
#endif
if
(
!
(
type_handler_data
=
new
Type_handler_data
)
||
type_handler_data
->
init
())
{
sql_perror
(
"Could not allocate type_handler_data"
);
return
1
;
}
max_system_variables
.
pseudo_thread_id
=
~
(
my_thread_id
)
0
;
server_start_time
=
flush_status_time
=
my_time
(
0
);
my_disable_copystat_in_redel
=
1
;
...
...
sql/sql_type.cc
View file @
a1e52014
...
...
@@ -57,47 +57,40 @@ Type_handler_geometry type_handler_geometry;
#endif
Type_aggregator
type_aggregator_for_result
;
Type_aggregator
type_aggregator_for_comparison
;
class
Static_data_initializer
bool
Type_handler_data
::
init
()
{
public:
static
Static_data_initializer
m_singleton
;
Static_data_initializer
()
{
#ifdef HAVE_SPATIAL
type_aggregator_for_result
.
add
(
&
type_handler_geometry
,
&
type_handler_null
,
&
type_handler_geometry
);
type_aggregator_for_result
.
add
(
&
type_handler_geometry
,
&
type_handler_geometry
,
&
type_handler_geometry
);
type_aggregator_for_result
.
add
(
&
type_handler_geometry
,
&
type_handler_blob
,
&
type_handler_long_blob
);
type_aggregator_for_result
.
add
(
&
type_handler_geometry
,
&
type_handler_varchar
,
&
type_handler_long_blob
);
type_aggregator_for_result
.
add
(
&
type_handler_geometry
,
&
type_handler_string
,
&
type_handler_long_blob
);
type_aggregator_for_comparison
.
add
(
&
type_handler_geometry
,
&
type_handler_geometry
,
&
type_handler_geometry
);
type_aggregator_for_comparison
.
add
(
&
type_handler_geometry
,
&
type_handler_null
,
&
type_handler_geometry
);
type_aggregator_for_comparison
.
add
(
&
type_handler_geometry
,
&
type_handler_long_blob
,
&
type_handler_long_blob
);
return
m_type_aggregator_for_result
.
add
(
&
type_handler_geometry
,
&
type_handler_null
,
&
type_handler_geometry
)
||
m_type_aggregator_for_result
.
add
(
&
type_handler_geometry
,
&
type_handler_geometry
,
&
type_handler_geometry
)
||
m_type_aggregator_for_result
.
add
(
&
type_handler_geometry
,
&
type_handler_blob
,
&
type_handler_long_blob
)
||
m_type_aggregator_for_result
.
add
(
&
type_handler_geometry
,
&
type_handler_varchar
,
&
type_handler_long_blob
)
||
m_type_aggregator_for_result
.
add
(
&
type_handler_geometry
,
&
type_handler_string
,
&
type_handler_long_blob
)
||
m_
type_aggregator_for_comparison
.
add
(
&
type_handler_geometry
,
&
type_handler_geometry
,
&
type_handler_geometry
)
||
m_
type_aggregator_for_comparison
.
add
(
&
type_handler_geometry
,
&
type_handler_null
,
&
type_handler_geometry
)
||
m_
type_aggregator_for_comparison
.
add
(
&
type_handler_geometry
,
&
type_handler_long_blob
,
&
type_handler_long_blob
);
#endif
}
};
return
false
;
}
Static_data_initializer
Static_data_initializer
::
m_singleton
;
Type_handler_data
*
type_handler_data
=
NULL
;
void
Type_std_attributes
::
set
(
const
Field
*
field
)
...
...
@@ -293,7 +286,8 @@ Type_handler_hybrid_field_type::aggregate_for_result(const Type_handler *other)
Type_handler
::
aggregate_for_result_traditional
(
m_type_handler
,
other
);
return
false
;
}
other
=
type_aggregator_for_result
.
find_handler
(
m_type_handler
,
other
);
other
=
type_handler_data
->
m_type_aggregator_for_result
.
find_handler
(
m_type_handler
,
other
);
if
(
!
other
)
return
true
;
m_type_handler
=
other
;
...
...
@@ -407,7 +401,8 @@ Type_handler_hybrid_field_type::aggregate_for_comparison(const Type_handler *h)
if
(
!
m_type_handler
->
is_traditional_type
()
||
!
h
->
is_traditional_type
())
{
h
=
type_aggregator_for_comparison
.
find_handler
(
m_type_handler
,
h
);
h
=
type_handler_data
->
m_type_aggregator_for_comparison
.
find_handler
(
m_type_handler
,
h
);
if
(
!
h
)
return
true
;
m_type_handler
=
h
;
...
...
sql/sql_type.h
View file @
a1e52014
...
...
@@ -1522,7 +1522,16 @@ class Type_aggregator
}
};
extern
Type_aggregator
type_aggregator_for_result
;
extern
Type_aggregator
type_aggregator_for_comparison
;
class
Type_handler_data
{
public:
Type_aggregator
m_type_aggregator_for_result
;
Type_aggregator
m_type_aggregator_for_comparison
;
bool
init
();
};
extern
Type_handler_data
*
type_handler_data
;
#endif
/* SQL_TYPE_H_INCLUDED */
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