Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDEV-35975 Server crashes after CREATE VIEW as SELECT ST_COLLECT... #3805

Open
wants to merge 1 commit into
base: bb-11.7-mdev-34120-gis-functions
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions mysql-test/main/spatial_utility_function_collect.result
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,10 @@ tb1 CREATE TABLE `tb1` (
`(ST_collect(( POINTFROMTEXT(' POINT( 4 1 ) ') )) )` geometry DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
DROP TABLE tb1;
#
# MDEV-35975 Server crashes after CREATE VIEW as SELECT ST_COLLECT
#
create view v1 as SELECT ST_COLLECT(ST_GEOMFROMTEXT('POINT(0 0)'));
drop view v1;
create view v1 as SELECT GROUP_CONCAT(ST_GEOMFROMTEXT('POINT(0 0)'));
drop view v1;
8 changes: 8 additions & 0 deletions mysql-test/main/spatial_utility_function_collect.test
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,11 @@ SELECT ST_astext(ST_collect(( POINTFROMTEXT(' POINT( 4 1 ) ') )));
CREATE TABLE tb1 AS SELECT (ST_collect(( POINTFROMTEXT(' POINT( 4 1 ) ') )) );
SHOW CREATE TABLE tb1;
DROP TABLE tb1;

--echo #
--echo # MDEV-35975 Server crashes after CREATE VIEW as SELECT ST_COLLECT
--echo #
create view v1 as SELECT ST_COLLECT(ST_GEOMFROMTEXT('POINT(0 0)'));
drop view v1;
create view v1 as SELECT GROUP_CONCAT(ST_GEOMFROMTEXT('POINT(0 0)'));
drop view v1;
2 changes: 2 additions & 0 deletions sql/item_sum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4818,6 +4818,8 @@ const Type_handler *Item_func_collect::type_handler() const

bool Item_func_collect::fix_fields_impl(THD *thd,Item **)
{
if (arg_count)
memcpy (orig_args, args, sizeof (Item *) * arg_count);
max_length= UINT_MAX32;
return FALSE;
}