summaryrefslogtreecommitdiff
path: root/client/mysqlcheck.c
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-15091 : Windows, 64bit: reenable and fix warning C4267 (conversion from ↵Vladislav Vaintroub2018-02-061-4/+4
| | | | | | | | | | | 'size_t' to 'type', possible loss of data) Handle string length as size_t, consistently (almost always:)) Change function prototypes to accept size_t, where in the past ulong or uint were used. change local/member variables to size_t when appropriate. This fix excludes rocksdb, spider,spider, sphinx and connect for now.
* Merge bb-10.2-ext into 10.3Marko Mäkelä2018-01-041-2/+6
|\
| * Merge remote-tracking branch 'origin/10.2' into bb-10.2-extMonty2018-01-011-2/+6
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: cmake/make_dist.cmake.in mysql-test/r/func_json.result mysql-test/r/ps.result mysql-test/t/func_json.test mysql-test/t/ps.test sql/item_cmpfunc.h
| | * 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.
* | | | Fix compilation warnings in pluginsSergei Golubchik2017-08-241-2/+0
|/ / / | | | | | | | | | | | | | | | * update cracklib_password_check to match the new prototype * cannot use __attribute__((format)) for my_snprintf, because we support format extensions that the compiler doesn't know about.
* | | Merge tag 'mariadb-10.2.6' into bb-10.2-extAlexander Barkov2017-05-261-1/+1
|\ \ \ | |/ /
| * | Merge branch '10.1' into 10.2Sergei Golubchik2017-05-091-1/+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-1/+1
| | |\
| | | * Merge branch '5.5' into 10.0Sergei Golubchik2017-04-211-1/+1
| | | |\
| | | | * Merge remote-tracking branch 'mysql/5.5' into 5.5mariadb-5.5.55Sergei Golubchik2017-04-111-1/+1
| | | | |\
| | | | | * 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-16/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | Fixed compiler warnings and warnings from build.tagsMonty2017-05-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Other things - Ensure that ut_d() is set to EXPR if ut_ad() is DEBUG_ASSERT() If not, we will get a crash in purge_sys_t::~purge_sys_t() as this ut_ad() code expect's that the ut_d() codes has been executed
* | | | | | Avoid DBUG_ASSERT in mysqlcheck when working with viewsMonty2017-04-181-2/+17
|/ / / / / | | | | | | | | | | | | | | | | | | | | Remove some DBUG_ASSERT that can happen if mysqlcheck is called with a view as argument
* | | | | Merge branch '10.2' into bb-10.2-connector-c-integ-submSergei Golubchik2016-09-211-40/+27
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch '10.0' into 10.1Sergei Golubchik2016-08-251-40/+27
| |\ \ \ \ | | |/ / /
| | * | | Merge branch '5.5' into 10.0Sergei Golubchik2016-08-101-40/+27
| | |\ \ \ | | | |/ /
| | | * | MDEV-6128:[PATCH] mysqlcheck wrongly escapes '.' in table namesSergei Golubchik2016-08-081-40/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a correct fix: * store properly quoted table names in tables4repair/etc lists * tell handle_request_for_tables whether the name is aalready properly quoted * test cases for all uses of fix_table_name()
* | | | | MDEV-9293 - Use MariaDB's Connector/C in serverVladislav Vaintroub2016-08-251-1/+2
| | | | |
* | | | | Revert "MDEV-9293 Connector/C integration"Vladislav Vaintroub2016-08-191-2/+1
| | | | | | | | | | | | | | | | | | | | This reverts commit 7b89b9f5108c80f4f270da922d7e6c182a663719.
* | | | | MDEV-9293 Connector/C integrationVladislav Vaintroub2016-08-191-1/+2
|/ / / /
* | | | Merge branch '10.0' into 10.1Sergei Golubchik2016-06-281-12/+17
|\ \ \ \ | |/ / /
| * | | Merge branch '5.5' into bb-10.0Sergei Golubchik2016-06-211-12/+17
| |\ \ \ | | |/ /
| | * | fix a mysql-5.5.50 merge: mysqlcheckSergei Golubchik2016-06-201-2/+2
| | | | | | | | | | | | | | | | quote identifiers correctly
| | * | Merge branch 'mysql/5.5' into 5.5Sergei Golubchik2016-06-141-13/+21
| | |\ \
| | | * | Bug#21977380 - POSSIBLE BUFFER OVERFLOW ISSUESShishir Jaiswal2016-05-161-16/+26
| | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 (cherry picked from commit 3487e20959c940cbd24429afa795ebfc8a01e94f)
* | | | Merge branch '10.0' into 10.1Sergei Golubchik2016-05-041-1/+1
|\ \ \ \ | |/ / /
| * | | Merge branch '5.5' into 10.0Sergei Golubchik2016-04-261-1/+1
| |\ \ \ | | |/ /
| | * | Merge branch 'mysql/5.5' into 5.5Sergei Golubchik2016-04-201-1/+1
| | |\ \ | | | |/
| | | * WL#9072: Backport WL#8785 to 5.5Ramil Kalimullin2016-02-191-3/+5
| | | |
* | | | Merge branch '10.0' into 10.1Sergei Golubchik2016-03-211-3/+2
|\ \ \ \ | |/ / /
| * | | Merge branch '5.5' into 10.0Sergei Golubchik2016-03-211-1/+0
| |\ \ \ | | |/ /
| | * | MDEV-9568 mysqlcheck crashes with nonexistent table nameSergei Golubchik2016-03-171-1/+0
| | | | | | | | | | | | | | | | remove erroneous free() call
| | * | Merge branch 'mysql/5.5' into 5.5Sergei Golubchik2015-12-091-1/+1
| | |\ \ | | | |/
| | | * Bug #21235226 : THE --ENABLE-CLEARTEXT-PLUGIN IS NOTArun Kuruvila2015-10-141-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IMPLEMENTED IN ALL CLIENT PROGRAMS Description: Option "enable-cleartext-plugin" is not available for the following client utilities:- mysqldump mysqlimport mysqlshow mysqlcheck Analysis: The unavailability of this option limits the features like PAM authentication from using the above mentioned utilities. Fix: Option "enable-cleartext-plugin" is implemented in the above mentioned client utilities.
| | | * Updated/added copyright headersMurthy Narkedimilli2014-01-061-1/+1
| | | |
| | | * Updated/added copyright headersMurthy Narkedimilli2013-02-261-1/+1
| | | |\
| | | * \ Bug#14521864: MYSQL 5.1 TO 5.5 BUGS PARTITIONINGMattias Jonsson2013-01-301-28/+62
| | | |\ \ | | | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to an internal change in the server code in between 5.1 and 5.5 (wl#2649) the hash function used in KEY partitioning changed for numeric and date/time columns (from binary hash calculation to character based hash calculation). Also enum/set changed from latin1 ci based hash calculation to binary hash between 5.1 and 5.5. (bug#11759782). These changes makes KEY [sub]partitioned tables on any of the affected column types incompatible with 5.5 and above, since the calculation of partition id differs. Also since InnoDB asserts that a deleted row was previously read (positioned), the server asserts on delete of a row that is in the wrong partition. The solution for this situation is: 1) The partitioning engine will check that delete/update will go to the partition the row was read from and give an error otherwise, consisting of the rows partitioning fields. This will avoid asserts in InnoDB and also alert the user that there is a misplaced row. A detailed error message will be given, including an entry to the error log consisting of both table name, partition and row content (PK if exists, otherwise all partitioning columns). 2) A new optional syntax for KEY () partitioning in 5.5 is allowed: [SUB]PARTITION BY KEY [ALGORITHM = N] (list_of_cols) Where N = 1 uses the same hashing as 5.1 (Numeric/date/time fields uses binary hashing, ENUM/SET uses charset hashing) N = 2 uses the same hashing as 5.5 (Numeric/date/time fields uses charset hashing, ENUM/SET uses binary hashing). If not set on CREATE/ALTER it will default to 2. This new syntax should probably be ignored by NDB. 3) Since there is a demand for avoiding scanning through the full table, during upgrade the ALTER TABLE t PARTITION BY ... command is considered a no-op (only .frm change) if everything except ALGORITHM is the same and ALGORITHM was not set before, which allows manually upgrading such table by something like: ALTER TABLE t PARTITION BY KEY ALGORITHM = 1 () or ALTER TABLE t PARTITION BY KEY ALGORITHM = 2 () 4) Enhanced partitioning with CHECK/REPAIR to also check for/repair misplaced rows. (Also works for ALTER TABLE t CHECK/REPAIR PARTITION) CHECK FOR UPGRADE: If the .frm version is < 5.5.3 and uses KEY [sub]partitioning and an affected column type then it will fail with an message: KEY () partitioning changed, please run: ALTER TABLE `test`.`t1` PARTITION BY KEY ALGORITHM = 1 (a) PARTITIONS 12 (i.e. current partitioning clause, with the addition of ALGORITHM = 1) CHECK without FOR UPGRADE: if MEDIUM (default) or EXTENDED options are given: Scan all rows and verify that it is in the correct partition. Fail for the first misplaced row. REPAIR: if default or EXTENDED (i.e. not QUICK/USE_FRM): Scan all rows and every misplaced row is moved into its correct partitions. 5) Updated mysqlcheck (called by mysql_upgrade) to handle the new output from CHECK FOR UPGRADE, to run the ALTER statement instead of running REPAIR. This will allow mysql_upgrade (or CHECK TABLE t FOR UPGRADE) to upgrade a KEY [sub]partitioned table that has any affected field type and a .frm version < 5.5.3 to ALGORITHM = 1 without rebuild. Also notice that if the .frm has a version of >= 5.5.3 and ALGORITHM is not set, it is not possible to know if it consists of rows from 5.1 or 5.5! In these cases I suggest that the user does: (optional) LOCK TABLE t WRITE; SHOW CREATE TABLE t; (verify that it has no ALGORITHM = N, and to be safe, I would suggest backing up the .frm file, to be used if one need to change to another ALGORITHM = N, without needing to rebuild/repair) ALTER TABLE t <old partitioning clause, but with ALGORITHM = N>; which should set the ALGORITHM to N (if the table has rows from 5.1 I would suggest N = 1, otherwise N = 2) CHECK TABLE t; (here one could use the backed up .frm instead and change to a new N and run CHECK again and see if it passes) and if there are misplaced rows: REPAIR TABLE t; (optional) UNLOCK TABLES;
| | | * | Merge of patch for Bug#13928675 from mysql-5.1.Nirbhay Choubey2012-08-071-2/+2
| | | |\ \ | | | | |/
| | | | * Bug#13928675 MYSQL CLIENT COPYRIGHT NOTICE MUSTNirbhay Choubey2012-08-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SHOW 2012 INSTEAD OF 2011 * Added a new macro to hold the current year : COPYRIGHT_NOTICE_CURRENT_YEAR * Modified ORACLE_WELCOME_COPYRIGHT_NOTICE macro to take the initial year as parameter and pick current year from the above mentioned macro.
| | | * | Manual merge from mysql-5.1.Alexander Nozdrin2011-07-221-1/+1
| | | |\ \ | | | | |/
| | | | * Manual merge from mysql-5.0.Alexander Nozdrin2011-07-221-6/+3
| | | | |\
| | | | | * For for Bug#12696072: FIX OUTDATED COPYRIGHT NOTICES IN RUNTIME RELATED CLIENTAlexander Nozdrin2011-07-221-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TOOLS Backport a fix for Bug 57094 from 5.5. The following revision was backported: # revision-id: alexander.nozdrin@oracle.com-20101006150613-ls60rb2tq5dpyb5c # parent: bar@mysql.com-20101006121559-am1e05ykeicwnx48 # committer: Alexander Nozdrin <alexander.nozdrin@oracle.com> # branch nick: mysql-5.5-bugteam-bug57094 # timestamp: Wed 2010-10-06 19:06:13 +0400 # message: # Fix for Bug 57094 (Copyright notice incorrect?). # # The fix is to: # - introduce ORACLE_WELCOME_COPYRIGHT_NOTICE define to have a single place # to specify copyright notice; # - replace custom copyright notices with ORACLE_WELCOME_COPYRIGHT_NOTICE # in programs.
| | | * | | Updated/added copyright headersKent Boortz2011-06-301-2/+4
| | | |\ \ \ | | | | |/ /
| | | | * | Updated/added copyright headersKent Boortz2011-06-301-2/+4
| | | | |\ \ | | | | | |/
| | | | | * Updated/added copyright headersKent Boortz2011-06-301-2/+5
| | | | | |
| | | * | | Fixed cast warnings in introducing the pluggable authentication clientGeorgi Kodinov2011-06-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | options.
| | | * | | Bug #11755431 (former 47205)Jon Olav Hauglid2011-03-081-6/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MAP 'REPAIR TABLE' TO RECREATE +ANALYZE FOR ENGINES NOT SUPPORTING NATIVE REPAIR Executing 'mysqlcheck --check-upgrade --auto-repair ...' will first issue 'CHECK TABLE FOR UPGRADE' for all tables in the database in order to check if the tables are compatible with the current version of MySQL. Any tables that are found incompatible are then upgraded using 'REPAIR TABLE'. The problem was that some engines (e.g. InnoDB) do not support 'REPAIR TABLE'. This caused any such tables to be left incompatible. As a result such tables were not properly fixed by the mysql_upgrade tool. This patch fixes the problem by first changing 'CHECK TABLE FOR UPGRADE' to return a different error message if the engine does not support REPAIR. Instead of "Table upgrade required. Please do "REPAIR TABLE ..." it will report "Table rebuild required. Please do "ALTER TABLE ... FORCE ..." Second, the patch changes mysqlcheck to do 'ALTER TABLE ... FORCE' instead of 'REPAIR TABLE' in these cases. This patch also fixes 'ALTER TABLE ... FORCE' to actually rebuild the table. This change should be reflected in the documentation. Before this patch, 'ALTER TABLE ... FORCE' was unused (See Bug#11746162) Test case added to mysqlcheck.test
| | | * | | Bug#58139 : default-auth option not recognized in MySQL standardNirbhay Choubey2011-01-161-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | command line clients. Postfix covering other mysql standard clients like mysql_upgrade, mysqlbinlog, mysqlcheck, mysqlimport, mysqlshow and mysqlslap.