Bug #116737 Change the types of all ACL variables to Access_bitmask
Submitted: 21 Nov 2:37 Modified: 24 Nov 9:12
Reporter: Mike Wang (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Security: Privileges Severity:S3 (Non-critical)
Version:9.1.0 OS:Any
Assigned to: Georgi Kodinov CPU Architecture:Any
Tags: Contribution

[21 Nov 2:37] Mike Wang
Description:
Related to Bug#35507223 and commit 89c0115d873016f23003603d042155cbf2287571 @Daniel Blanchard

This change made all ACL bitmask variables explicitly 32 bits, but there are still some variables left not changed to `Access_bitmask`.

I suggest changing them all to `Access_bitmask` for safety and maintainability.

How to repeat:
mkdir build
cd build
sed -i 's/" -Werror"/" -Wconversion"/g' ../cmake/maintainer.cmake
cmake .. -DCMAKE_INSTALL_PREFIX="$HOME/mysql" -DWITH_DEBUG=1
make -j$(nproc) 2>build.stderr.log

grep 'warning:.*Access_bitmask' build.stderr.log | sort -u

Suggested fix:
The build logs are as below. Fix them by changing the variable types to `Access_bitmask`.

/home/repo/mysql-server/sql/auth/partial_revokes.cc:188:43: warning: conversion from ‘long unsigned int’ to ‘Access_bitmask’ {aka ‘unsigned int’} may change value [-Wconversion]
/home/repo/mysql-server/sql/event_data_objects.cc:1203:70: warning: conversion from ‘ulong’ {aka ‘long unsigned int’} to ‘Access_bitmask’ {aka ‘unsigned int’} may change value [-Wconversion]
/home/repo/mysql-server/sql/event_data_objects.cc:1211:50: warning: conversion from ‘ulong’ {aka ‘long unsigned int’} to ‘Access_bitmask’ {aka ‘unsigned int’} may change value [-Wconversion]
/home/repo/mysql-server/sql/server_component/persistent_dynamic_loader.cc:159:35: warning: conversion from ‘ulong’ {aka ‘long unsigned int’} to ‘Access_bitmask’ {aka ‘unsigned int’} may change value [-Wconversion]
/home/repo/mysql-server/sql/sql_db.cc:1369:52: warning: conversion from ‘ulong’ {aka ‘long unsigned int’} to ‘Access_bitmask’ {aka ‘unsigned int’} may change value [-Wconversion]
/home/repo/mysql-server/sql/sql_insert.cc:1061:44: warning: conversion from ‘ulong’ {aka ‘long unsigned int’} to ‘Access_bitmask’ {aka ‘unsigned int’} may change value [-Wconversion]
/home/repo/mysql-server/sql/sql_insert.cc:1061:55: warning: conversion from ‘ulong’ {aka ‘long unsigned int’} to ‘Access_bitmask’ {aka ‘unsigned int’} may change value [-Wconversion]
/home/repo/mysql-server/sql/sql_insert.cc:439:35: warning: conversion from ‘ulong’ {aka ‘long unsigned int’} to ‘Access_bitmask’ {aka ‘unsigned int’} may change value [-Wconversion]
/home/repo/mysql-server/sql/sql_parse.cc:1802:64: warning: conversion from ‘long unsigned int’ to ‘Access_bitmask’ {aka ‘unsigned int’} may change value [-Wconversion]
/home/repo/mysql-server/sql/sql_update.cc:150:36: warning: conversion from ‘long int’ to ‘Access_bitmask’ {aka ‘unsigned int’} may change value [-Wconversion]
/home/repo/mysql-server/sql/sql_update.cc:152:35: warning: conversion from ‘long int’ to ‘Access_bitmask’ {aka ‘unsigned int’} may change value [-Wconversion]
[21 Nov 3:15] Mike Wang
PR: https://github.com/mysql/mysql-server/pull/579
[21 Nov 15:46] OCA Admin
Contribution submitted via Github - Bug#116737: Change the types of all ACL variables to Access_bitmask 
(*) Contribution by Mike Wang (Github MikeWang000000, mysql-server/pull/579): https://bugs.mysql.com/bug.php?id=116737

I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: git_patch_2191183011.txt (text/plain), 6.62 KiB.

[24 Nov 9:12] MySQL Verification Team
Hello Mike Wang,

Thank you for the report and contribution.

regards,
Umesh