Commit graph

93 commits

Author SHA1 Message Date
Marko Mäkelä
2719cc4925 Merge 10.11 into 11.4 2024-12-02 11:35:34 +02:00
Marko Mäkelä
3d23adb766 Merge 10.6 into 10.11 2024-11-29 13:43:17 +02:00
Marko Mäkelä
7d4077cc11 Merge 10.5 into 10.6 2024-11-29 12:37:46 +02:00
Monty
142851f120 Update my_print_defaults to accept --mariadbd as an option
--mariadbd and --mysqld are now synonymes for my_print_defaults

Other things
- Removed safemalloc warnings when using an unknown argument to
  my_print_defaults
2024-11-26 14:23:31 +02:00
Marko Mäkelä
590036b021 Merge 10.11 into 11.0 2023-12-20 16:05:20 +02:00
Marko Mäkelä
2b99e5f7ef Merge 10.6 into 10.11 2023-12-20 15:58:36 +02:00
Marko Mäkelä
2b01e5103d Merge 10.5 into 10.6 2023-12-19 18:41:42 +02:00
Marko Mäkelä
4ae105a37d Merge 10.4 into 10.5 2023-12-18 08:59:07 +02:00
Sisi Huang
c5d7036e1a MDEV-32942 Fix Memory Leak in my_print_defaults with Non-Existing Config Files 2023-12-15 10:22:40 +11:00
Marko Mäkelä
4c355d4e81 Merge 10.11 into 11.0 2023-03-17 15:03:17 +02:00
Monty
ceb0e7f944 Fixes to mysql_install_db
- Change to use 'mariadbd' instead of 'mysqld' in help texts and other
  visible places.
- Start binary 'mariadbd' instead of 'mysqld'. This will remove a warning
  in 11.0 when running mysql_install_db.
- Use my_print_defaults --mariadbd instead of --mysqld
- Use --skip-log-error if the user don't have access to log-error file.
  This it needed to allow mysql_install_db to work silenty for users that
  has not write access to /var/log.

Other things:
- Updated my_print_defaults to support --mariadbd
2023-03-10 11:04:49 +02:00
Sergei Golubchik
eb26bf6e09 unify client/tool version string
it should now always be

/path/to/exe Ver <tool version> Distrib <server version> for <OS> (<ARCH>)

in all tools and clients
2023-01-19 12:39:28 +01:00
Rucha Deodhar
5217211e07 MDEV-26238: Remove inconsistent behaviour of --default-* options
in my_print_defaults

Analysis: --defaults* option is recognized anywhere in the commandline
instead of only at the beginning because handle_options() recognizes
options in any order.
Fix: use get_defaults_options() which recognizes --defaults* options only at
the beginning. After this is done, we only want to recognize other options
given in any order which can be done using handle_options(). So only skip
--defaults* options and pass rest of them to handle_options().
Also, removed -e, -g and -c because only my_print_defaults supports them.
2022-01-26 18:43:06 +01:00
Oleksandr Byelkin
6efb5e9f5e Merge branch '10.5' into 10.6 2021-08-02 10:11:41 +02:00
Rucha Deodhar
0805cdebd3 MDEV-25908: -e does not work for my_print_defaults
Analysis: get_defaults_options() rewrites the value for my_defaults_file,
my_defaults_extra_file and  my_defaults_group_suffix to 0. So the config file
can't be read.
Fix: Let handle_options() handle --defaults* option and create a new command
line to pass it to load_defaults().
2021-07-26 13:54:01 +05:30
Monty
b6ff139aa3 Reduce usage of strlen()
Changes:
- To detect automatic strlen() I removed the methods in String that
  uses 'const char *' without a length:
  - String::append(const char*)
  - Binary_string(const char *str)
  - String(const char *str, CHARSET_INFO *cs)
  - append_for_single_quote(const char *)
  All usage of append(const char*) is changed to either use
  String::append(char), String::append(const char*, size_t length) or
  String::append(LEX_CSTRING)
- Added STRING_WITH_LEN() around constant string arguments to
  String::append()
- Added overflow argument to escape_string_for_mysql() and
  escape_quotes_for_mysql() instead of returning (size_t) -1 on overflow.
  This was needed as most usage of the above functions never tested the
  result for -1 and would have given wrong results or crashes in case
  of overflows.
- Added Item_func_or_sum::func_name_cstring(), which returns LEX_CSTRING.
  Changed all Item_func::func_name()'s to func_name_cstring()'s.
  The old Item_func_or_sum::func_name() is now an inline function that
  returns func_name_cstring().str.
- Changed Item::mode_name() and Item::func_name_ext() to return
  LEX_CSTRING.
- Changed for some functions the name argument from const char * to
  to const LEX_CSTRING &:
  - Item::Item_func_fix_attributes()
  - Item::check_type_...()
  - Type_std_attributes::agg_item_collations()
  - Type_std_attributes::agg_item_set_converter()
  - Type_std_attributes::agg_arg_charsets...()
  - Type_handler_hybrid_field_type::aggregate_for_result()
  - Type_handler_geometry::check_type_geom_or_binary()
  - Type_handler::Item_func_or_sum_illegal_param()
  - Predicant_to_list_comparator::add_value_skip_null()
  - Predicant_to_list_comparator::add_value()
  - cmp_item_row::prepare_comparators()
  - cmp_item_row::aggregate_row_elements_for_comparison()
  - Cursor_ref::print_func()
- Removes String_space() as it was only used in one cases and that
  could be simplified to not use String_space(), thanks to the fixed
  my_vsnprintf().
- Added some const LEX_CSTRING's for common strings:
  - NULL_clex_str, DATA_clex_str, INDEX_clex_str.
- Changed primary_key_name to a LEX_CSTRING
- Renamed String::set_quick() to String::set_buffer_if_not_allocated() to
  clarify what the function really does.
- Rename of protocol function:
  bool store(const char *from, CHARSET_INFO *cs) to
  bool store_string_or_null(const char *from, CHARSET_INFO *cs).
  This was done to both clarify the difference between this 'store' function
  and also to make it easier to find unoptimal usage of store() calls.
- Added Protocol::store(const LEX_CSTRING*, CHARSET_INFO*)
- Changed some 'const char*' arrays to instead be of type LEX_CSTRING.
- class Item_func_units now used LEX_CSTRING for name.

Other things:
- Fixed a bug in mysql.cc:construct_prompt() where a wrong escape character
  in the prompt would cause some part of the prompt to be duplicated.
- Fixed a lot of instances where the length of the argument to
  append is known or easily obtain but was not used.
- Removed some not needed 'virtual' definition for functions that was
  inherited from the parent. I added override to these.
- Fixed Ordered_key::print() to preallocate needed buffer. Old code could
  case memory overruns.
- Simplified some loops when adding char * to a String with delimiters.
2021-05-19 22:27:48 +02:00
Marko Mäkelä
80ed136e6d Merge 10.4 into 10.5 2021-04-21 09:01:01 +03:00
Marko Mäkelä
a0588d54a2 Merge 10.3 into 10.4 2021-04-21 07:58:42 +03:00
Ian Gilfillan
2557064873 MDEV-25354: Fix my_print_defaults wording 2021-04-14 14:57:32 +10:00
Monty
5d6ad2ad66 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 *'.
2021-02-08 12:16:29 +02:00
Sergei Golubchik
7c58e97bf6 perfschema memory related instrumentation changes 2020-03-10 19:24:22 +01:00
Sergei Golubchik
f217612fad MDEV-12684 Show what config file a sysvar got a value from
change get_one_option() prototype to pass the filename and
not to pass the redundant optid.
2019-10-14 10:29:30 +02:00
Sergei Golubchik
f7b8d14490 cleanup: don't use my_getopt_is_args_separator()
only my_getopt should use it, because it changes my_getopt's behavior.
If one simply wants to skip the separator - don't ask it to be added
in the first place
2019-10-14 10:29:30 +02:00
Sergei Golubchik
3e56972712 cleanup: unify --defaults* option handling
process all --defaults* options uniformly,
get rid of special case for --no-defaults and --print-defaults
use realpath instead of blindly concatenating pwd and relative path.
2019-10-14 10:29:30 +02:00
Oleksandr Byelkin
c07325f932 Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
Vicențiu Ciorbaru
cb248f8806 Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
Vicențiu Ciorbaru
5543b75550 Update FSF Address
* Update wrong zip-code
2019-05-11 21:29:06 +03:00
Daniel Black
92bde77826 my_print_defaults: remove --config-file/extra-file
There have been deprecated since before 5.5

Closes #548
2018-10-31 16:06:15 +01:00
Marko Mäkelä
84129fb1b5 After-merge fix for commit 98eb9518db
The merge only covered 10.1 up to
commit 4d248974e0.

Actually merge the changes up to
commit 0a534348c7.

Also, remove the unused InnoDB field trx_t::abort_type.
2018-03-16 15:49:53 +02:00
Sergey Vojtovich
0a534348c7 MDEV-14265 - RPMLint warning: shared-lib-calls-exit
Eliminated last exit() call from libmysqld.
2018-03-16 13:26:52 +04:00
Sergei Golubchik
2aa51f528f Various compier warnings
gcc 5.4 and 7.1, Debug and Release builds
2017-10-22 14:51:45 +02:00
Sergei Golubchik
9d2e2d7533 Merge branch '10.0' into 10.1 2017-10-22 13:03:41 +02:00
Sergei Golubchik
da4503e956 Merge branch '5.5' into 10.0 2017-10-18 15:14:39 +02:00
Sergei Golubchik
d76f5774fe MDEV-13459 Warnings, when compiling with gcc-7.x
mostly caused by -Wimplicit-fallthrough
2017-10-17 07:37:39 +02:00
Monty
3bde13932e Minor cleanups, fix compiler warnings 2014-08-09 13:22:01 +03:00
Sergei Golubchik
b7b5f6f1ab 10.0-monty merge
includes:
* remove some remnants of "Bug#14521864: MYSQL 5.1 TO 5.5 BUGS PARTITIONING"
* introduce LOCK_share, now LOCK_ha_data is strictly for engines
* rea_create_table() always creates .par file (even in "frm-only" mode)
* fix a 5.6 bug, temp file leak on dummy ALTER TABLE
2013-07-21 16:39:19 +02:00
Michael Widenius
068c61978e Temporary commit of 10.0-merge 2013-03-26 00:03:13 +02:00
Sergei Golubchik
3bfd88d1d6 MDEV-4068 rpm scriptlet chown command dangerous
add --mysqld option to my_print_defaults
change server-postin script to use that
2013-03-06 09:32:13 +01:00
Vladislav Vaintroub
2451628923 Fixed some simple warnings on Windows. 2012-04-13 19:44:22 +02:00
Sergei Golubchik
4f435bddfd 5.3 merge 2012-01-13 15:50:02 +01:00
Michael Widenius
6920457142 Merge with MariaDB 5.1 2011-11-24 18:48:58 +02:00
Michael Widenius
a8d03ab235 Initail merge with MySQL 5.1 (XtraDB still needs to be merged)
Fixed up copyright messages.
2011-11-21 19:13:14 +02:00
Sergei Golubchik
0e007344ea mysql-5.5.18 merge 2011-11-03 19:17:05 +01:00
Sergei Golubchik
76f0b94bb0 merge with 5.3
sql/sql_insert.cc:
  CREATE ... IF NOT EXISTS may do nothing, but
  it is still not a failure. don't forget to my_ok it.
  ******
  CREATE ... IF NOT EXISTS may do nothing, but
  it is still not a failure. don't forget to my_ok it.
sql/sql_table.cc:
  small cleanup
  ******
  small cleanup
2011-10-19 21:45:18 +02:00
Sergei Golubchik
9809f05199 5.5-merge 2011-07-02 22:08:51 +02:00
Kent Boortz
68f00a5686 Updated/added copyright headers 2011-06-30 17:37:13 +02:00
Kent Boortz
02e07e3b51 Updated/added copyright headers 2011-06-30 17:46:53 +02:00
Michael Widenius
0fae0335d4 Ensure that all clients reads the appropriate 'client', client-mariadb and 'mariadb' sections from my.cnf
The mysqld server and all clients now reads the new client-server section
Fixed that mysqldumpslow supports new slow log formats and new mysqld --slow- options


client/mysql.cc:
  Read also client-server and client-mariadb sections.
client/mysql_upgrade.c:
  Read also client-server and client-mariadb sections.
client/mysqladmin.cc:
  Read also client-server and client-mariadb sections.
client/mysqlbinlog.cc:
  Read also client-server and client-mariadb sections.
client/mysqlcheck.c:
  Read also client-server and client-mariadb sections.
client/mysqldump.c:
  Read also client-server and client-mariadb sections.
client/mysqlimport.c:
  Read also client-server and client-mariadb sections.
client/mysqlshow.c:
  Read also client-server and client-mariadb sections.
client/mysqltest.cc:
  Read also client-server and client-mariadb sections.
extra/my_print_defaults.c:
  Updated help text
scripts/mysql_fix_privilege_tables.sh:
  Read also sections client client-server client-mariadb
scripts/mysql_install_db.pl.in:
  Also allow --data=* option
  Read also groups mariadb, server and client-server.
scripts/mysql_install_db.sh:
  Also allow --data=* option
  Read also groups mariadb, server and client-server.
  Added --lose-skip-pbxt to bootstrap
scripts/mysql_secure_installation.sh:
  Read also groups client-server and client-mariadb
scripts/mysqld_multi.sh:
  Read also group mariadb
scripts/mysqld_safe.sh:
  Read also groups mariadb server and client-server
scripts/mysqldumpslow.sh:
  Fixed to support new slow log formats
  Added sorting on -ae (aggregated number of retreived rows) and e (retrieved rows)
  Read also group 'mariadb'
  If there is many instances of same option, use last one.
  Get slow log file from options log-slow-queries=filename or query-log-file=filename
  Added support for future --log-basename option
sql-common/client.c:
  Read also groups 'client-server' and 'client-mariadb'
tests/mysql_client_test.c:
  Read also groups 'client-server' and 'client-mariadb'
tests/thread_test.c:
  Read also groups 'client-server' and 'client-mariadb'
2011-03-18 17:03:43 +02:00
He Zhenxing
c5aa3313aa BUG#57953 my_load_defaults return junk argument ----args-separator---- to caller
After fix of bug#25192, load_defaults() will add an args separator
to distinguish options loaded from configure files from that provided
in the command line. One problem of this is that the args separator
would be added no matter the application need it or not.

Fixed the problem by adding an option:
  bool my_getopt_use_args_separator;
to control whether the separator will be added or not. And also
added functions:
  bool my_getopt_is_args_separator(const char* arg);
to check if the argument is the separator or not.
2011-01-17 15:44:37 +08:00
Sergei Golubchik
65ca700def merge.
checkpoint.
does not compile.
2010-11-25 18:17:28 +01:00