summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
Commit message (Collapse)AuthorAgeFilesLines
* Final changesSachin2019-01-081-8/+8
|
* Architecture change finalSachin2018-12-311-3/+11
|
* Hash_index to hashSachin2018-12-311-1/+1
|
* commit aSachin2018-12-311-3/+8
|
* MDEV-17928 Conversion from TIMESTAMP to VARCHAR SP variables does not work ↵Alexander Barkov2018-12-081-1/+2
| | | | well on fractional digits
* MDEV-17792 New class Timestamp and cleanups in Date, Datetime, Field for ↵Alexander Barkov2018-11-221-9/+5
| | | | rounding
* MDEV-17712 Remove C_TIME_FUZZY_DATES, C_TIME_DATETIME_ONLY, C_TIME_TIME_ONLYAlexander Barkov2018-11-141-2/+2
|
* Merge 10.3 into 10.4Marko Mäkelä2018-10-051-3/+1
|\
| * Merge branch '10.2' into 10.3Sergei Golubchik2018-09-281-3/+1
| |\
| | * MDEV-16792 Assertion `m_status == DA_ERROR' failed in ↵Sergei Golubchik2018-09-211-3/+1
| | | | | | | | | | | | | | | | | | | | | Diagnostics_area::sql_errno or wrong result upon SHOW TABLE STATUS after adding partition under ANSI_QUOTES if opening a table fails with a syntax error, the error shouldn't be suppressed completely as if it didn't happen at all.
* | | Merge 10.3 into 10.4Marko Mäkelä2018-09-111-1/+51
|\ \ \ | |/ /
| * | Merge 10.2 into 10.3Marko Mäkelä2018-08-281-1/+1
| |\ \ | | |/
| | * Merge 10.1 into 10.2Marko Mäkelä2018-08-211-1/+1
| | |\
| | | * Merge branch '10.0' into 10.1Oleksandr Byelkin2018-08-211-1/+1
| | | |\
| | | | * Merge branch '5.5' into 10.0Oleksandr Byelkin2018-08-151-1/+1
| | | | |\
| | | | | * MDEV-15475: Assertion `!table || (!table->read_set || ↵Oleksandr Byelkin2018-08-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bitmap_is_set(table->read_set, field_index))' failed on EXPLAIN EXTENDED with constant table and view Print constant ISNULL value independent. Fix of printing of view FRM and CREATE VIEW output
| * | | | | MDEV-14474 information_schema.check_constraintsAnel Husakovic2018-08-251-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement according to standard SQL specification 2008. The check_constraints table is used for fetching metadata about the constraints defined for tables in all databases.
* | | | | | MDEV-16542 Fix ALTER TABLE FORCE to upgrade temporal typesAlexander Barkov2018-07-091-0/+6
| | | | | |
* | | | | | MDEV-11953: support of brackets in UNION/EXCEPT/INTERSECT operationsOleksandr Byelkin2018-07-041-15/+16
| | | | | |
* | | | | | Merge remote-tracking branch 'origin/10.3' into 10.4Alexander Barkov2018-07-031-0/+85
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge branch '10.2' into 10.3Sergei Golubchik2018-06-301-0/+85
| |\ \ \ \ \ | | |/ / / /
| | * | | | Merge branch '10.1' into 10.2Sergei Golubchik2018-06-211-9/+94
| | |\ \ \ \ | | | |/ / /
| | | * | | Merge branch '10.0' into 10.1Sergei Golubchik2018-06-141-9/+94
| | | |\ \ \ | | | | |/ /
| | | | * | fix SHOW PROCESSLIST for --embeddedSergei Golubchik2018-06-131-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | make it return the same Info values as for the standalone server. This fixes plugins.processlist for --embedded
| | | | * | MDEV-15359 Thread stay in "cleaning up" status after finishingSergei Golubchik2018-06-131-0/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | make thd_get_error_context_description() to show not just thd->proc_info, but exactly the same thread state that SHOW PROCESSLIST shows.
* | | | | | Merge remote-tracking branch 'origin/10.3' into 10.4Alexander Barkov2018-06-051-5/+2
|\ \ \ \ \ \ | |/ / / / /
| * | | | | MDEV-16385 ROW SP variable is allowed in unexpected contextAlexander Barkov2018-06-051-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem described in the bug report happened because the code did not test check_cols(1) after fix_fields() in a few places. Additionally, fix_fields() could be called multiple times for SP variables, because they are all fixed at a early stage in append_for_log(). Solution: 1. Adding a few helper methods - fix_fields_if_needed() - fix_fields_if_needed_for_scalar() - fix_fields_if_needed_for_bool() - fix_fields_if_needed_for_order_by() and using it in many cases instead of fix_fields() where the "fixed" status is not definitely known to be "false". 2. Adding DBUG_ASSERT(!fixed) into Item_splocal*::fix_fields() to catch double execution. 3. Adding tests. As a good side effect, the patch removes a lot of duplicate code (~60 lines): if (!item->fixed && item->fix_fields(..) && item->check_cols(1)) return true;
* | | | | | mysys: rename ME_xxx flags to match plugin apiSergei Golubchik2018-06-041-1/+1
| | | | | |
* | | | | | mysys: remove dead ME_xxx flagsSergei Golubchik2018-06-041-2/+2
|/ / / / /
* | | | | Add likely/unlikely to speed up executionMonty2018-05-071-30/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added to: - if (error) - Lex - sql_yacc.yy and sql_yacc_ora.yy - In header files to alloc() calls - Added thd argument to thd_net_is_killed()
* | | | | Removed some old #if MYSQL_VERSIONMonty2018-04-261-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | - Removed never used warning that explicit_defaults_for_timestamp was not set
* | | | | MDEV-15971 Split the code for CHARACTER_OCTET_LENGTH and ↵Alexander Barkov2018-04-221-14/+9
| | | | | | | | | | | | | | | | | | | | CHARACTER_MAXIMUM_LENGTH into methods in Field
* | | | | MDEV-15926 MEDIUMINT returns wrong I_S attributesAlexander Barkov2018-04-201-33/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The logic in store_column_type() with a switch on field type was hard to follow. The part for MEDIUMINT (MYSQL_TYPE_INT24) was not correct. It erroneously calculated the precision of MEDIUMINT UNSIGNED as 7 instead of 8. A similar hard-to-follow switch doing some type specific calculations resided in adjust_max_effective_column_length(). It was also wrong for MEDIUMINT (reported as a separate issue in MDEV-15946). Solution: 1. Introducing a new class Information_schema_numeric_attributes 2. Adding a new virtual method Field::information_schema_numeric_attributes() 3. Splitting the logic in store_column_type() into virtual implementations of information_schema_numeric_attributes(). 4. In order to avoid adding duplicate code for the integer data types, adding a new virtual method Field_int::numeric_precision(), which returns the number of digits. Additional changes: 1. Adding the "const" qualifier to Field::max_display_length() 2. Moving the code from adjust_max_effective_column_length() directly to Field::max_display_length(). There was no any sense to have two implementations: - a set of wrong virtual implementations for Field_xxx::max_display_length() - additional code in adjust_max_effective_column_length() fixing bad results of Field_xxx::max_display_length() This change is safe: - The code using Field::max_display_length() in field.cc, sql_show.cc, sql_type.cc is not affected. - The code in rpl_utility.cc is also not affected. See a new DBUG_ASSSERT and new comments explaining why. In the new reduction, Field_xxx::max_display_length() returns correct results for all integer types (except MEDIUMINT, see below). Putting implementations of numeric_precision() and max_display_length() near each other in field.h made the logic much clearer and thus helped to reveal bad results for Field_medium::max_display_length(), which returns 9 instead of 8 for signed MEDIUMINT fields. This problem will be addressed separately (MDEV-15946). Note, this change is also useful for pluggable data types (see MDEV-4912), as now a user defined Field_xxx has a way to control what's returned in INFORMATION_SCHEMA.COLUMNS.NUMERIC_PRECISION and INFORMATION_SCHEMA.COLUMNS.NUMERIC_SCALE by implementing a desired behavior in Field_xxx::information_schema_numeric_attributes().
* | | | | MDEV-15062 Information Schema COLUMNS Table does not show system versioning ↵Eugene Kosov2018-04-101-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | information get_schema_column_record(): print 'WITHOUT SYSTEM VERSIONING` in 'EXTRA' for such fields
* | | | | dead code - related to vtmdSergei Golubchik2018-04-101-79/+2
| | | | | | | | | | | | | | | | | | | | (will be added back when it'll be used)
* | | | | MDEV-14275 Improving memory utilization for information schemaMonty2018-03-291-8/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SELECT queries on information_schema table will now not store data in the temporary table for columns that are not used in the query. This can drastically reduce memory when there are many rows involved in a query, like using SELECT table_name FROM information_schema.table on a system with many tables. The difference for the above query is about 14K per existing table. The code works this way: - Create a bitmap for all information_schema fields used in the query - For BLOB and VARCHAR fields that are not use, create a Field_null field.
* | | | | Merge branch '10.2' into 10.3Sergei Golubchik2018-03-281-0/+7
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch '10.1' into 10.2Sergei Golubchik2018-03-251-0/+7
| |\ \ \ \ | | |/ / /
| | * | | MDEV-10269 - Killed queries from I_S stay in 'Killed' state for longSergey Vojtovich2018-03-231-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | time and don't let server shut down Queries from I_S in "Filling schema table" state didn't check killed flag. For large tables this phase may take a while to complete. Fixed by adding thd->killed flag check for each processed row.
* | | | | Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3Alexander Barkov2018-03-021-14/+127
|\ \ \ \ \
| * | | | | MDEV-15444 Querying I_S.PARAMETERS can crash with a corrupted mysql.procAlexander Barkov2018-03-021-5/+8
| | | | | |
| * | | | | MDEV-15416 Crash when reading I_S.PARAMETERSAlexander Barkov2018-02-281-9/+119
| | | | | |
| * | | | | MDEV-11952 Oracle-style packages: stage#5Alexander Barkov2018-02-271-10/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backporting from bb-10.2-compatibility to bb-10.2-ext Version: 2018-01-26 - CREATE PACKAGE [BODY] statements are now entirely written to mysql.proc with type='PACKAGE' and type='PACKAGE BODY'. - CREATE PACKAGE BODY now supports IF NOT EXISTS - DROP PACKAGE BODY now supports IF EXISTS - CREATE OR REPLACE PACKAGE [BODY] is now supported - CREATE PACKAGE [BODY] now support the DEFINER clause: CREATE DEFINER user@host PACKAGE pkg ... END; CREATE DEFINER user@host PACKAGE BODY pkg ... END; - CREATE PACKAGE [BODY] now supports SQL SECURITY and COMMENT clauses, e.g.: CREATE PACKAGE p1 SQL SECURITY INVOKER COMMENT "comment" AS ... END; - Package routines are now created from the package CREATE PACKAGE BODY statement and don't produce individual records in mysql.proc. - CREATE PACKAGE BODY now supports package-wide variables. Package variables can be read and set inside package routines. Package variables are stored in a separate sp_rcontext, which is cached in THD on the first packate routine call. - CREATE PACKAGE BODY now supports the initialization section. - All public routines (i.e. declared in CREATE PACKAGE) must have implementations in CREATE PACKAGE BODY - Only public package routines are available outside of the package - {CREATE|DROP} PACKAGE [BODY] now respects CREATE ROUTINE and ALTER ROUTINE privileges - "GRANT EXECUTE ON PACKAGE BODY pkg" is now supported - SHOW CREATE PACKAGE [BODY] is now supported - SHOW PACKAGE [BODY] STATUS is now supported - CREATE and DROP for PACKAGE [BODY] now works for non-current databases - mysqldump now supports packages - "SHOW {PROCEDURE|FUNCTION) CODE pkg.routine" now works for package routines - "SHOW PACKAGE BODY CODE pkg" now works (the package initialization section) - A new package body level MDL was added - Recursive calls for package procedures are now possible - Routine forward declarations in CREATE PACKATE BODY are now supported. - Package body variables now work as SP OUT parameters - Package body variables now work as SELECT INTO targets - Package body variables now support ROW, %ROWTYPE, %TYPE
* | | | | | MDEV-11952 Oracle-style packages: stage#5mariadb-10.3.5bb-10.3-compatibilityAlexander Barkov2018-02-251-10/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - CREATE PACKAGE [BODY] statements are now entirely written to mysql.proc with type='PACKAGE' and type='PACKAGE BODY'. - CREATE PACKAGE BODY now supports IF NOT EXISTS - DROP PACKAGE BODY now supports IF EXISTS - CREATE OR REPLACE PACKAGE [BODY] is now supported - CREATE PACKAGE [BODY] now support the DEFINER clause: CREATE DEFINER user@host PACKAGE pkg ... END; CREATE DEFINER user@host PACKAGE BODY pkg ... END; - CREATE PACKAGE [BODY] now supports SQL SECURITY and COMMENT clauses, e.g.: CREATE PACKAGE p1 SQL SECURITY INVOKER COMMENT "comment" AS ... END; - Package routines are now created from the package CREATE PACKAGE BODY statement and don't produce individual records in mysql.proc. - CREATE PACKAGE BODY now supports package-wide variables. Package variables can be read and set inside package routines. Package variables are stored in a separate sp_rcontext, which is cached in THD on the first packate routine call. - CREATE PACKAGE BODY now supports the initialization section. - All public routines (i.e. declared in CREATE PACKAGE) must have implementations in CREATE PACKAGE BODY - Only public package routines are available outside of the package - {CREATE|DROP} PACKAGE [BODY] now respects CREATE ROUTINE and ALTER ROUTINE privileges - "GRANT EXECUTE ON PACKAGE BODY pkg" is now supported - SHOW CREATE PACKAGE [BODY] is now supported - SHOW PACKAGE [BODY] STATUS is now supported - CREATE and DROP for PACKAGE [BODY] now works for non-current databases - mysqldump now supports packages - "SHOW {PROCEDURE|FUNCTION) CODE pkg.routine" now works for package routines - "SHOW PACKAGE BODY CODE pkg" now works (the package initialization section) - A new package body level MDL was added - Recursive calls for package procedures are now possible - Routine forward declarations in CREATE PACKATE BODY are now supported. - Package body variables now work as SP OUT parameters - Package body variables now work as SELECT INTO targets - Package body variables now support ROW, %ROWTYPE, %TYPE
* | | | | | PARTITION BY SYSTEM_TIME INTERVAL ...Sergei Golubchik2018-02-231-17/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lots of changes: * calculate the current history partition in ::external_lock(), not in ::write_row() or ::update_row() * remove dynamically collected per-partition row_end stats * no full table scan in open_table_from_share to calculate these stats, no manual MDL/thr_locks in open_table_from_share * no shared stats in TABLE_SHARE = no mutexes or condition waits when calculating current history partition * always compare timestamps, don't convert them to MYSQL_TIME (avoid DST ambiguity, and it's faster too) * correct interval handling, 1 month = 1 month, not 30 * 24 * 3600 seconds * save/restore first partition start time, and count intervals from there * only allow to drop first partitions if INTERVAL * when adding new history partitions, split the data in the last history parition, if it was overflowed * show partition boundaries in INFORMATION_SCHEMA.PARTITIONS
* | | | | | Merge bb-10.2-ext into 10.3Marko Mäkelä2018-02-151-2/+17
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Added Max_index_length and Temporary to SHOW TABLE STATUSMonty2018-02-121-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Max_index_length is supported by MyISAM and Aria tables. - Temporary is a placeholder to signal that a table is a temporary table. For the moment this is always "N", except "Y" for generated information_schema tables and NULL for views. Full temporary table support will be done in another task. (No reason to have to update a lot of result files twice in a row)
| * | | | | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2018-02-081-1/+1
| |\ \ \ \ \ | | |/ / / /
| | * | | | Merge branch 'github/10.1' into 10.2Sergei Golubchik2018-02-061-1/+1
| | |\ \ \ \ | | | |/ / /
| | | * | | Merge branch 'github/10.0' into 10.1Sergei Golubchik2018-02-021-1/+1
| | | |\ \ \ | | | | |/ /