Hi, Oleksandr,

On Oct 13, Oleksandr Byelkin wrote:
> revision-id: 19772f9c277 (mariadb-10.3.36-90-g19772f9c277)
> parent(s): e05ab0cfc5f
> author: Oleksandr Byelkin
> committer: Oleksandr Byelkin
> timestamp: 2022-10-12 15:59:46 +0200
> message:
> 
> MDEV-29748 ASAN errors or server crash in File_parser::parse upon concurrent 
> view operations
> 
> Prevent simultaniouse access to a view table SHARE (and so its MEM_ROOT) from 
> different threads.

If you're writing into share, why not to do it when a share is
populated, then you wouldn't need a mutex. And it'd be a logical place
to initialize the share anyway. Doing it at some arbitrary point in time
later looks strange.

I mean, why not to call this mariadb_view_version_get after the line

      share->view_def= sql_parse_prepare(&pathstr, &share->mem_root, true);

where it logically belongs?

> +  mysql_mutex_lock(&share->LOCK_share);
>  
>    if (!(share->tabledef_version.str=
>          (uchar*) alloc_root(&share->mem_root,
>                              MICROSECOND_TIMESTAMP_BUFFER_SIZE)))

Regards,
Sergei
VP of MariaDB Server Engineering
and secur...@mariadb.org

_______________________________________________
Mailing list: https://launchpad.net/~maria-developers
Post to     : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp

Reply via email to