summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
Commit message (Collapse)AuthorAgeFilesLines
* Fixed that SHOW PROCESSLIST and information_schema.processlist uses the ↵Michael Widenius2013-05-111-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | right length for user names. Fixed some failing tests mysql-test/mysql-test-run.pl: Removed warning from mysql-test-run mysql-test/r/create.result: Updated result mysql-test/r/log_slow.result: Fixed failing test mysql-test/suite/funcs_1/r/is_columns_is.result: Updated result mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result: Updated result mysql-test/suite/funcs_1/r/processlist_val_no_prot.result: Updated result mysql-test/t/log_slow.test: Ensure variables are properly reset at end of test sql/sql_show.cc: Fixed max length for user names
* mysql-5.5.31 mergeSergei Golubchik2013-05-071-16/+24
|\
| * Bug#16274455: CAN NOT ACESS PARTITIONED TABLES WHENMattias Jonsson2013-02-141-14/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DOWNGRADED FROM 5.6.11 TO 5.6.10 Problem was new syntax not accepted by previous version. Fixed by adding version comment of /*!50531 around the new syntax. Like this in the .frm file: 'PARTITION BY KEY /*!50611 ALGORITHM = 2 */ () PARTITIONS 3' and also changing the output from SHOW CREATE TABLE to: CREATE TABLE t1 (a INT) /*!50100 PARTITION BY KEY */ /*!50611 ALGORITHM = 1 */ /*!50100 () PARTITIONS 3 */ It will always add the ALGORITHM into the .frm for KEY [sub]partitioned tables, but for SHOW CREATE TABLE it will only add it in case it is the non default ALGORITHM = 1. Also notice that for 5.5, it will say /*!50531 instead of /*!50611, which will make upgrade from 5.5 > 5.5.31 to 5.6 < 5.6.11 fail! If one downgrades an fixed version to the same major version (5.5 or 5.6) the bug 14521864 will be visible again, but unless the .frm is updated, it will work again when upgrading again. Also fixed so that the .frm does not get updated version if a single partition check passes.
| * Bug#14521864: MYSQL 5.1 TO 5.5 BUGS PARTITIONINGMattias Jonsson2013-01-301-4/+6
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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;
* | | MDEV-4332 Increase username length from 16 charactersSergei Golubchik2013-04-181-1/+1
| | |
* | | 5.3 mergeSergei Golubchik2013-04-121-3/+3
|\ \ \
| * | | MDEV-4244 [PATCH] Buffer overruns and use-after-free errorsSergei Golubchik2013-04-061-3/+3
| | | | | | | | | | | | | | | | fixes for gcc 4.8 -fsanitize=address
| * | | Merge 5.2->5.3Igor Babaev2013-01-211-6/+12
| |\ \ \
| | * \ \ Merge 5.1->5.2Igor Babaev2013-01-211-6/+12
| | |\ \ \
| | | * | | MDEV-4029 SELECT on information_schema using a subquery locks up the ↵Sergei Golubchik2013-01-211-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | information_schema table due to incorrect mutexes handling Early evaluation of subqueries in the WHERE conditions on I_S.*_STATUS tables, otherwise the subquery on this same table will try to acquire LOCK_status twice.
* | | | | | extend check_global_access() to avoid my_error when it's not neededSergei Golubchik2013-03-191-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | (in INFORMATION_SCHEMA).
* | | | | | MDEV-4029 SELECT on information_schema using a subquery locks up the ↵Sergei Golubchik2013-01-201-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | information_schema table due to incorrect mutexes handling Early evaluation of subqueries in the WHERE conditions on I_S.*_STATUS tables, otherwise the subquery on this same table will try to acquire LOCK_status twice. sql/item.h: remove unused method
* | | | | | mysql-5.5.29 mergeSergei Golubchik2013-01-151-2/+10
|\ \ \ \ \ \ | | |_|_|/ / | |/| | | |
| * | | | | Bug #14036214 MYSQLD CRASHES WHEN EXECUTING UPDATE IN TRX WITHAnnamalai Gurusami2012-10-081-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CONSISTENT SNAPSHOT OPTION A transaction is started with a consistent snapshot. After the transaction is started new indexes are added to the table. Now when we issue an update statement, the optimizer chooses an index. When the index scan is being initialized via ha_innobase::change_active_index(), InnoDB reports the error code HA_ERR_TABLE_DEF_CHANGED, with message stating that "insufficient history for index". This error message is propagated up to the SQL layer. But the my_error() api is never called. The statement level diagnostics area is not updated with the correct error status (it remains in Diagnostics_area::DA_EMPTY). Hence the following check in the Protocol::end_statement() fails. 516 case Diagnostics_area::DA_EMPTY: 517 default: 518 DBUG_ASSERT(0); 519 error= send_ok(thd->server_status, 0, 0, 0, NULL); 520 break; The fix is to backport the fix of bugs 14365043, 11761652 and 11746399. 14365043 PROTOCOL::END_STATEMENT(): ASSERTION `0' FAILED 11761652 HA_RND_INIT() RESULT CODE NOT CHECKED 11746399 RETURN VALUES OF HA_INDEX_INIT() AND INDEX_INIT() IGNORED rb://1227 approved by guilhem and mattiasj.
| * | | | | upmerge to bug#14548159Rohit Kalhans2012-09-221-1/+2
| |\ \ \ \ \ | | | |_|_|/ | | |/| | |
| | * | | | BUG#14548159: NUMEROUS CASES OF INCORRECT IDENTIFIERRohit Kalhans2012-09-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QUOTING IN REPLICATION Problem: Misquoting or unquoted identifiers may lead to incorrect statements to be logged to the binary log. Fix: we use specialized functions to append quoted identifiers in the statements generated by the server.
| * | | | | merge 5.1 => 5.5Tor Didriksen2012-09-051-2/+3
| |\ \ \ \ \ | | |/ / / /
* | | | | | MDEV-3818: Query against view over IS tables worse than equivalent query ↵unknown2012-12-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | without view Analysis: The reason for the suboptimal plan when querying IS tables through a view was that the view columns that participate in an equality are wrapped by an Item_direct_view_ref and were not recognized as being direct column references. Solution: Use the original Item_field objects via the real_item() method.
* | | | | | 5.3->5.5 mergeSergei Golubchik2012-11-221-2/+3
|\ \ \ \ \ \ | | |_|/ / / | |/| | | |
| * | | | | Merge MariaDB 5.1.66 -> 5.2 -> 5.3unknown2012-11-091-2/+3
| |\ \ \ \ \ | | | |_|/ / | | |/| | |
| | * | | | Merge MariaDB 5.1.66 -> 5.2.12unknown2012-11-081-2/+3
| | |\ \ \ \ | | | | |_|/ | | | |/| |
| | | * | | Merge MySQL 5.1.66 -> MariaDB 5.1.65unknown2012-11-061-2/+3
| | | |\ \ \ | | | | | |/ | | | | |/|
| | | | * | Bug#13734987 MEMORY LEAK WITH I_S/SHOW AND VIEWS WITH SUBQUERYclone-5.1.66-buildTor Didriksen2012-09-051-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In fill_schema_table_by_open(): free item list before restoring active arena. sql/sql_show.cc: Replaced i_s_arena.free_items with DBUG_ASSERT(i_s_arena.free_list == NULL) (there's nothing to free in that list)
| | | * | | Merge with latest 5.1.unknown2012-08-241-10/+14
| | | |\ \ \
| | * | \ \ \ Merge into latest 5.2.unknown2012-08-241-10/+14
| | |\ \ \ \ \
| | * \ \ \ \ \ 5.1 mergeSergei Golubchik2012-08-221-29/+35
| | |\ \ \ \ \ \ | | | | |/ / / / | | | |/| | | | | | | | | | | | increase xtradb verson from 13.0 to 13.01
| | | * | | | | merge with MySQL 5.1.65Sergei Golubchik2012-08-221-29/+35
| | | |\ \ \ \ \ | | | | | |_|/ / | | | | |/| | |
* | | | | | | | 5.3 mergeSergei Golubchik2012-10-181-0/+278
|\ \ \ \ \ \ \ \ | |/ / / / / / /
| * | | | | | | Fix compiler warnings that breaks build (-Werror).unknown2012-09-281-2/+1
| | | | | | | |
| * | | | | | | MDEV-495 backport --ignore-db-dir.Alexey Botchkov2012-09-271-0/+281
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The feature was backported from MySQL 5.6. Some code was added to make commands as SELECT * FROM ignored_db.t1; CALL ignored_db.proc(); USE ignored_db; to take that option into account. per-file comments: mysql-test/r/ignore_db_dirs_basic.result test result added. mysql-test/t/ignore_db_dirs_basic-master.opt options for the test, actually the set of --ignore-db-dir lines. mysql-test/t/ignore_db_dirs_basic.test test for the feature. Same test from 5.6 was taken as a basis, then tests for SELECT, CALL etc were added. per-file comments: sql/mysql_priv.h MDEV-495 backport --ignore-db-dir. interface for db_name_is_in_ignore_list() added. sql/mysqld.cc MDEV-495 backport --ignore-db-dir. --ignore-db-dir handling. sql/set_var.cc MDEV-495 backport --ignore-db-dir. the @@ignore_db_dirs variable added. sql/sql_show.cc MDEV-495 backport --ignore-db-dir. check if the directory is ignored. sql/sql_show.h MDEV-495 backport --ignore-db-dir. interface added for opt_ignored_db_dirs. sql/table.cc MDEV-495 backport --ignore-db-dir. check if the directory is ignored.
* | | | | | | | Split ER_NO_SUCH_TABLE into ER_NO_SUCH_TABLE and ER_NO_SUCH_TABLE_IN_ENGINE ↵Michael Widenius2012-08-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to be able to distingus if a .frm file is missing or if the table is missing in the engine. sql/handler.cc: Added ER_NO_SUCH_TABLE_IN_ENGINE sql/rpl_record.cc: Fixed wrong printf sql/share/errmsg-utf8.txt: Added ER_NO_SUCH_TABLE_IN_ENGINE sql/sp.cc: Added ER_NO_SUCH_TABLE_IN_ENGINE sql/sp_head.cc: Added ER_NO_SUCH_TABLE_IN_ENGINE sql/sql_admin.cc: Added ER_NO_SUCH_TABLE_IN_ENGINE sql/sql_base.cc: Added ER_NO_SUCH_TABLE_IN_ENGINE sql/sql_show.cc: Added ER_NO_SUCH_TABLE_IN_ENGINE sql/table.cc: Fixed typo
* | | | | | | | Merge from 5.3unknown2012-08-241-10/+14
|\ \ \ \ \ \ \ \ | |/ / / / / / /
| * | | | | | | merge from 5.2unknown2012-08-241-10/+14
| |\ \ \ \ \ \ \ | | | |_|_|/ / / | | |/| | | | |
| | * | | | | | Merge from 5.1.unknown2012-08-241-10/+14
| | |\ \ \ \ \ \ | | | |/ / / / / | | |/| | | / / | | | | |_|/ / | | | |/| | |
| | | * | | | MDEV-382: Incorrect quotingunknown2012-08-241-10/+14
| | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | Various places in the server replication code was incorrectly quoting strings, which could lead to incorrect SQL on the slave/mysqlbinlog.
| * | | | | 5.2 mergeSergei Golubchik2012-05-201-2/+3
| |\ \ \ \ \ | | |/ / / /
| | * | | | 5.1 mergeSergei Golubchik2012-05-181-2/+3
| | |\ \ \ \ | | | |/ / /
| | | * | | merge with mysql-5.1.63Sergei Golubchik2012-05-171-2/+3
| | | |\ \ \
| * | | \ \ \ mergeSergei Golubchik2012-04-051-3/+5
| |\ \ \ \ \ \ | | |/ / / / /
| | * | | | | mergemariadb-5.2.12Sergei Golubchik2012-04-051-3/+5
| | |\ \ \ \ \ | | | |/ / / /
| | | * | | | mysql-5.1.62 mergemariadb-5.1.62Sergei Golubchik2012-04-051-3/+5
| | | |\ \ \ \
* | | | \ \ \ \ merge with MySQL 5.5.27Sergei Golubchik2012-08-091-2/+5
|\ \ \ \ \ \ \ \ | | |_|_|_|_|_|/ | |/| | | | | | | | | | | | | | manually checked every change, reverted incorrect or stupid changes.
| * | | | | | | Bug#13889741: HANDLE_FATAL_SIGNAL IN _DB_ENTER_ |HANDLE_FATAL_SIGNAL IN STRNLENMayank Prasad2012-07-101-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow up patch to resolve pb2 failure on windows platform
* | | | | | | | mysql-5.5 mergeSergei Golubchik2012-06-141-1/+1
|\ \ \ \ \ \ \ \ | |/ / / / / / /
| * | | | | | | BUG#12427262 : 60961: SHOW TABLES VERY SLOW WHEN NOT IN SYSTEM DISK CACHEMayank Prasad2012-04-191-29/+35
| |\ \ \ \ \ \ \ | | | |_|_|_|_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Details: - Merge : 5.1 -> 5.5 - Addded a new test case which was not added in 5.1 because PS was not there in 5.1.
| | * | | | | | BUG#12427262 : 60961: SHOW TABLES VERY SLOW WHEN NOT IN SYSTEM DISK CACHEMayank Prasad2012-04-191-29/+35
| | | |_|_|_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reason: This is a regression happened because of changes done in code refactoring in 5.1 from 5.0. Issue: While doing "Show tables" lex->verbose was being checked to avoid opening FRM files to get table type. In case of "Show full table", lex->verbose is true to indicate table type is required. In 5.0, this check was present which got missing in >=5.5. Fix: Added the required check to avoid opening FRM files unnecessarily in case of "Show tables".
* | | | | | | bug fix: I_S plugins were not locked when usedSergei Golubchik2012-04-171-0/+1
| | | | | | |
* | | | | | | mysql 5.5.23 mergeSergei Golubchik2012-04-101-2/+3
|\ \ \ \ \ \ \ | |/ / / / / /
| * | | | | | Merge from 5.1 to 5.5Praveenkumar Hulakund2012-03-271-2/+3
| |\ \ \ \ \ \ | | |/ / / / /
| | * | | | | Bug#11763507 - 56224: FUNCTION NAME IS CASE-SENSITIVEPraveenkumar Hulakund2012-03-271-2/+3
| | | |_|_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Analysis: ------------------------------- According to the Manual (http://dev.mysql.com/doc/refman/5.1/en/identifier-case-sensitivity.html): "Column, index, stored routine, and event names are not case sensitive on any platform, nor are column aliases." In other words, 'lower_case_table_names' does not affect the behaviour of those identifiers. On the other hand, trigger names are case sensitive on some platforms, and case insensitive on others. 'lower_case_table_names' does not affect the behaviour of trigger names either. The bug was that SHOW statements did case sensitive comparison for stored procedure / stored function / event names. Fix: Modified the code so that comparison in case insensitive for routines and events for "SHOW" operation.