summaryrefslogtreecommitdiff
path: root/client/mysqldump.c
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-20939: Race condition between mysqldump import and InnoDB persistentRucha Deodhar2021-01-271-0/+14
| | | | | | | | | | | statistics calculation Analysis: When --replace or --insert-ignore is not given, dumping of mysql.innodb_index_stats and mysql.innodb_table_stats will result into race condition. Fix: Check if these options are present with --system=stats (because dumping under --system=stats is safe). Otherwise, dump only structure, ignoring data because innodb will recalculate data anyway.
* MDEV-20939: Race condition between mysqldump import and InnoDB persistentDaniel Black2021-01-251-2/+8
| | | | | | | | | | | | | statistics calculation mysqldump --system=stats and --system=timezones by default used ordinary INSERT statements populate EITS, innodb stats, and timezone tables. As these all have primary keys it could result in conflict. The behavior desired with --system= is to replace the tables. As such we assume --replace for the purposes of stats and timezone tables there if --insert-ignore isn't specified.
* MDEV-23630: mysqldump logically dump system table informationDaniel Black2020-11-011-10/+559
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add --system={all, users, plugins, udfs, servers, stats, timezones} This will dump system information from the server in a logical form like: * CREATE USER * GRANT * SET DEFAULT ROLE * CREATE ROLE * CREATE SERVER * INSTALL PLUGIN * CREATE FUNCTION "stats" is the innodb statistics tables or EITS and these are dumped as INSERT/REPLACE INTO statements without recreating the table. "timezones" is the collection of timezone tables which are important to transfer to generate identical results on restoration. Two other options have an effect on the SQL generated by --system=all. These are mutually exclusive of each other. * --replace * --insert-ignore --replace will include "OR REPLACE" into the logical form like: * CREATE OR REPLACE USER ... * DROP ROLE IF EXISTS (MySQL-8.0+) * CREATE OR REPLACE ROLE ... * UNINSTALL PLUGIN IF EXISTS (10.4+) ... (before INSTALL PLUGIN) * DROP FUNCTION IF EXISTS (MySQL-5.7+) * CREATE OR REPLACE [AGGREGATE] FUNCTION * CREATE OR REPLACE SERVER --insert-ignore uses the construct " IF NOT EXISTS" where supported in the logical syntax. 'CREATE OR REPLACE USER' includes protection against being run as the same user that is importing the mysqldump. Includes experimental support for dumping mysql-5.7/8.0 system tables and exporting logical SQL compatible with MySQL. Updates mysqldump man page, including this information and (removing obsolute bug reference) Reviewed-by: anel@mariadb.org
* Merge branch '10.1' into 10.2Vicențiu Ciorbaru2020-06-111-7/+7
|\
| * Client spelling mistakesIan Gilfillan2020-06-081-8/+8
| |
* | Merge branch '10.1' into 10.2Oleksandr Byelkin2020-05-021-1/+1
|\ \ | |/
| * Merge branch '5.5' into 10.1Oleksandr Byelkin2020-04-301-1/+1
| |\
| | * Correct the name of a contributorMarko Mäkelä2020-04-251-1/+1
| | | | | | | | | | | | | | | The name was correctly encoded in UTF-8 before commit 0ce12f70ed2eee1b92e2af27e7dda30db544f492.
* | | Merge 10.1 into 10.2Marko Mäkelä2020-04-011-6/+36
|\ \ \ | |/ /
| * | MDEV-22037: Add ability to skip content of some tables (work around for ↵Oleksandr Byelkin2020-03-251-6/+36
| | | | | | | | | | | | | | | | | | MDEV-20939) --ignore-table-data parameter added.
* | | Enable the auto parameter of the flag `default-character-set`Anel Husakovic2019-09-131-1/+4
| | | | | | | | | | | | | | | | | | | | | Closes #739 When invoking option `--default-character-set=auto` character set from underlying OS settings should be detected for mysqldump.
* | | Ensure that tests and programs can restore variablesMonty2019-06-031-0/+4
| | | | | | | | | | | | | | | | | | | | | - --default-character-set can now be disabled in mysqldump - --skip-resolve can be be disabled in mysqld - mysql_client_test now resets global variables it changes - mtr couldn't handle [mysqldump] in config files (wrong regexp used)
* | | Merge 10.1 into 10.2Marko Mäkelä2019-05-131-1/+1
|\ \ \ | |/ /
| * | Merge branch '5.5' into 10.1Vicențiu Ciorbaru2019-05-111-1/+1
| |\ \ | | |/
| | * Update FSF AddressVicențiu Ciorbaru2019-05-111-1/+1
| | | | | | | | | | | | * Update wrong zip-code
* | | Merge branch '10.1' into 10.2Oleksandr Byelkin2019-05-041-32/+31
|\ \ \ | |/ /
| * | MDEV-19182 mysqldump not always handling SHOW CREATE TRIGGER failures correctlySergei Golubchik2019-04-241-32/+31
| | | | | | | | | | | | | | | only use SHOW TRIGGERS on old (< 5.1.21) servers, otherwise always use SHOW CREATE TRIGGER and don't fallback.
* | | Merge branch '10.1' into 10.2Sergei Golubchik2018-06-211-7/+8
|\ \ \ | |/ /
| * | Merge branch '10.0' into 10.1Vicențiu Ciorbaru2018-06-121-7/+8
| |\ \
| | * \ Merge branch '5.5' into 10.0Vicențiu Ciorbaru2018-06-101-7/+8
| | |\ \ | | | |/
| | | * MDEV-15021: mysqldump --tables --routines generates non importable dump fileRutuja Surve2018-06-101-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | The order of outputting stored procedures is important. Stored procedures must be available on view creation, for views which make use of them. Make sure to print them before outputting tables.
| | | * MDEV-13459 Warnings, when compiling with gcc-7.xSergei Golubchik2017-10-171-0/+1
| | | | | | | | | | | | | | | | mostly caused by -Wimplicit-fallthrough
| * | | MDEV-14265 - RPMLint warning: shared-lib-calls-exitSergey Vojtovich2018-03-161-2/+1
| | | | | | | | | | | | | | | | Eliminated last exit() call from libmysqld.
* | | | After-merge fix for commit 98eb9518db1da854048b09d94244a982a1d32f9aMarko Mäkelä2018-03-161-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The merge only covered 10.1 up to commit 4d248974e00eb915a2fc433cc6b2fb5146281594. Actually merge the changes up to commit 0a534348c75cf435d2017959855de2efa798fd0b. Also, remove the unused InnoDB field trx_t::abort_type.
* | | | Merge remote-tracking branch 'origin/10.1' into 10.2Vicențiu Ciorbaru2017-12-221-2/+6
|\ \ \ \ | |/ / /
| * | | MDEV-14265 - RPMLint warning: shared-lib-calls-exitSergey Vojtovich2017-12-191-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | find_type_or_exit() client helper did exit(1) on error, exit(1) moved to clients. mysql_read_default_options() did exit(1) on error, error is passed through and handled now. my_str_malloc_default() did exit(1) on error, replaced my_str_ allocator functions with normal my_malloc()/my_realloc()/my_free(). sql_connect.cc did many exit(1) on hash initialisation failure. Removed error check since my_hash_init() never fails. my_malloc() did exit(1) on error. Replaced with abort(). my_load_defaults() did exit(1) on error, replaced with return 2. my_load_defaults() still does exit(0) when invoked with --print-defaults.
* | | | MDEV-13384 - misc Windows warnings fixedVladislav Vaintroub2017-09-281-5/+5
| | | |
* | | | Merge branch '10.1' into 10.2Sergei Golubchik2017-07-081-3/+2
|\ \ \ \ | |/ / /
| * | | Merge branch '10.0' into 10.1Sergei Golubchik2017-07-071-3/+2
| |\ \ \ | | |/ /
| | * | coverity medium warningsSergei Golubchik2017-07-061-3/+2
| | | |
* | | | Merge 10.1 into 10.2Marko Mäkelä2017-05-231-2/+3
|\ \ \ \ | |/ / /
| * | | Merge 10.0 into 10.1Marko Mäkelä2017-05-231-2/+3
| |\ \ \ | | |/ /
| | * | MDEV-6262 analyze the coverity report on mariadbSergei Golubchik2017-05-191-2/+3
| | | | | | | | | | | | | | | | | | | | uploaded 10.0, analyzed everything with the Impact=High (and a couple of Medium)
| | * | Silence bogus GCC 7 warnings -Wimplicit-fallthroughMarko Mäkelä2017-05-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not silence uncertain cases, or fix any bugs. The only functional change should be that ha_federated::extra() is not calling DBUG_PRINT to report an unhandled case for HA_EXTRA_PREPARE_FOR_DROP.
* | | | Merge 10.1 into 10.2Marko Mäkelä2017-05-221-0/+1
|\ \ \ \ | |/ / /
| * | | Silence bogus GCC 7 warnings -Wimplicit-fallthroughMarko Mäkelä2017-05-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not silence uncertain cases, or fix any bugs. The only functional change should be that ha_federated::extra() is not calling DBUG_PRINT to report an unhandled case for HA_EXTRA_PREPARE_FOR_DROP.
* | | | Merge branch '10.1' into 10.2Sergei Golubchik2017-05-091-2/+1
|\ \ \ \ | |/ / / | | | | | | | | | | | | Revert commit db0917f68f, because the fix for MDEV-12696 is coming from 5.5 and 10.1 in this merge.
| * | | Merge branch '10.0' 10.1Sergei Golubchik2017-04-281-3/+2
| |\ \ \ | | |/ /
| | * | Merge branch '5.5' into 10.0Sergei Golubchik2017-04-211-3/+2
| | |\ \ | | | |/
| | | * Merge remote-tracking branch 'mysql/5.5' into 5.5mariadb-5.5.55Sergei Golubchik2017-04-111-3/+2
| | | |\
| | | | * Bug #25717383: MYSQLDUMP MAY EXECUTE ANY ARBITRARY QUERYmysql-5.5.55Bharathy Satish2017-03-181-12/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While writing comments if database object names has a new line character, then next line is considered a command, rather than a comment. This patch fixes the way comments are constructed in mysqldump. (cherry picked from commit 1099f9d17b1c697c2760f86556f5bae7d202b444)
| | | | * BUG#25575605: SETTING --SSL-MODE=REQUIRED SENDS CREDENTIALS BEFORE VERIFYING ↵Ramil Kalimullin2017-03-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SSL CONNECTION MYSQL_OPT_SSL_MODE option introduced. It is set in case of --ssl-mode=REQUIRED and permits only SSL connection. (cherry picked from commit 3b2d28578c526f347f5cfe763681eff365731f99)
| | | | * Bug#21977380 - POSSIBLE BUFFER OVERFLOW ISSUESShishir Jaiswal2016-05-161-22/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DESCRIPTION =========== Buffer overflow is reported in a lot of code sections spanning across server, client programs, Regex libraries etc. If not handled appropriately, they can cause abnormal behaviour. ANALYSIS ======== The reported casea are the ones which are likely to result in SEGFAULT, MEMORY LEAK etc. FIX === - sprintf() has been replaced by my_snprintf() to avoid buffer overflow. - my_free() is done after checking if the pointer isn't NULL already and setting it to NULL thereafter at few places. - Buffer is ensured to be large enough to hold the data. - 'unsigned int' (aka 'uint') is replaced with 'size_t' to avoid wraparound. - Memory is freed (if not done so) after its alloced and used. - Inserted assert() for size check in InnoDb memcached code (from 5.6 onwards) - Other minor changes
* | | | | MDEV-10431: Please implement mysqldump --add-drop-trigger from MySQL 5.6Oleksandr Byelkin2017-05-041-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Port of mysql changeset by Georgi Kodinov <Georgi.Kodinov@Oracle.com>: Bug #34325 : --add-drop-trigger option for mysqldump Implemented the --add-drop-trigger option to prepend each CREATE TRIGGER in the dump file with DROP TRIGGER. The option is off by default. Added a test case.
* | | | | Merge branch '10.1' into 10.2Sergei Golubchik2017-03-301-2/+3
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.0 into 10.1Marko Mäkelä2017-03-091-2/+3
| |\ \ \ \ | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, implement MDEV-11027 a little differently from 5.5 and 10.0: recv_apply_hashed_log_recs(): Change the return type back to void (DB_SUCCESS was always returned). Report progress also via systemd using sd_notifyf().
| | * | | Merge branch '5.5' into 10.0Vicențiu Ciorbaru2017-03-031-2/+3
| | |\ \ \ | | | |/ /
| | | * | MDEV-11505 wrong databasename in mysqldump commentSergei Golubchik2017-02-271-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | fix_for_comment() uses a static buffer. cannot have two fix_for_comment() calls as arguments to one printf().
* | | | | Fix many -Wconversion warnings.Marko Mäkelä2017-03-071-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Define my_thread_id as an unsigned type, to avoid mismatch with ulonglong. Change some parameters to this type. Use size_t in a few more places. Declare many flag constants as unsigned to avoid sign mismatch when shifting bits or applying the unary ~ operator. When applying the unary ~ operator to enum constants, explictly cast the result to an unsigned type, because enum constants can be treated as signed. In InnoDB, change the source code line number parameters from ulint to unsigned type. Also, make some InnoDB functions return a narrower type (unsigned or uint32_t instead of ulint; bool instead of ibool).
* | | | | Merge branch '10.1' into 10.2Sergei Golubchik2016-12-291-17/+43
|\ \ \ \ \ | |/ / / /