1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Added 'const' to arguments in get_one_option and find_typeset()

One should not change the program arguments!
This change also reduces warnings from the icc compiler.

Almost all changes are just syntax changes (adding const to
'get_one_option function' declarations).

Other changes:
- Added a few cast of 'argument' from 'const char*' to 'char *'. This
  was mainly in calls to 'external' functions we don't have control of.
- Ensure that all reset of 'password command line argument' are similar.
  (In almost all cases it was just adding a comment and a cast)
- In mysqlbinlog.cc and mysqld.cc there was a few cases that changed
  the command line argument. These places where changed to instead allocate
  the option in a MEM_ROOT to avoid changing the argument. Some of this
  code was changed to ensure that different programs did parsing the
  same way. Added a test case for the changes in mysqlbinlog.cc
- Changed a few variables that took their value from command line options
  from 'char *' to 'const char *'.
This commit is contained in:
Monty
2021-02-05 14:57:46 +02:00
parent e30a3048da
commit 5d6ad2ad66
53 changed files with 300 additions and 165 deletions

View File

@ -4043,8 +4043,10 @@ static my_option *construct_help_options(MEM_ROOT *mem_root,
DBUG_RETURN(opts);
}
extern "C" my_bool mark_changed(const struct my_option *, char *, const char *);
my_bool mark_changed(const struct my_option *opt, char *, const char *filename)
extern "C" my_bool mark_changed(const struct my_option *, const char *,
const char *);
my_bool mark_changed(const struct my_option *opt, const char *,
const char *filename)
{
if (opt->app_type)
{