summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-14836: Assertion `m_status == DA_ERROR' failed inbb-10.2-MDEV-14836Rucha Deodhar2020-07-271-6/+12
| | | | | | | | | | Diagnostics_area::sql_errno upon query from I_S with LIMIT ROWS EXAMINED open_normal_and_derived_table() fails because the query was already killed as rows examined by the query are more than the limit. However, this isn't a real error. Fix: Check if there is actually an error before calling thd->sql_errno() and later send a warning in handle_select() if no real error.
* Merge 10.1 into 10.2Marko Mäkelä2020-07-021-4/+4
|\
| * MDEV-22941: Fix the DBUG_ENTER nameMarko Mäkelä2020-07-021-4/+4
| |
* | Merge 10.1 into 10.2bb-10.2-mergeMarko Mäkelä2020-07-011-13/+27
|\ \ | |/
| * MDEV-22941 Assertion `idx < array.elements' failed in ↵Alexander Barkov2020-06-191-13/+27
| | | | | | | | | | | | | | | | | | | | | | | | Dynamic_array<st_mysql_const_lex_string*>::at The code in fill_schema_schemata() did not take into account that make_db_list() can leave empty db_names if the requested database name was too long, so the call for db_names.at(0) crashed on assert. - Moving the code testing if the database directory exists into a separate function verify_database_directory_exists() - Modifying the test to check if db_names is not empty
* | MDEV-22019: Sig 11 in next_breadth_first_tab | max_sort_length setting + ↵Varun Gupta2020-03-301-4/+3
| | | | | | | | | | | | double GROUP BY leads to crash No need to create a temp table for aggregation if we have encountered some error.
* | Merge branch '10.1' into 10.2Sergei Petrunia2020-01-171-3/+3
|\ \ | |/ | | | | | | | | | | # Conflicts: # sql/sp_head.cc # sql/sql_select.cc # sql/sql_trigger.cc
| * MDEV-21341: Fix UBSAN failures: Issue SixSergei Petrunia2020-01-141-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (Variant #2 of the patch, which keeps the sp_head object inside the MEM_ROOT that sp_head object owns) (10.3 requires extra work due to sp_package, will commit a separate patch for it) sp_head::operator new() and operator delete() were dereferencing sp_head* pointers to memory that didn't hold a valid sp_head object (it was not created/already destroyed). This caused UBSan to crash when looking up type information. Fixed by providing static sp_head::create() and sp_head::destroy() methods.
* | PR #1127 and PR #1150Anel Husakovic2019-12-131-9/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR#1127: Fix is_check_constraints.result to be compatibile with 10.3 The patch is done according to the original patch for MDEV-14474 1edd09c325525cba33152 and not one which is merged on server d526679efd108478cc2af07578. This patch includes: - Rename from `is_check_constraint` to `is_check_constraints` to tests and results - Per review, change the order of fields in IS check_constraints table by adding the column `table_name` before `constraint_name`. According to the standard 2006 there is no `table_name` column. - Original patch and one in `10.3` supports embedded server this patch doesn't support. After the merge `10.3` will not support also. - Don't use patch c8b8b01b61 to change the length of `CHECK_CLAUSE` field PR#1150: MDEV-18440: Information_schema.check_constraints possible data leak This patch is extension of PR 1127 and includes: - Check for table grants - Additional test according to the MDEV specification Signed-off-by: Vicențiu Ciorbaru <vicentiu@mariadb.org>
* | Merge branch '10.1' into 10.2Oleksandr Byelkin2019-10-301-2/+1
|\ \ | |/
| * avoid accessing TLSEugene Kosov2019-10-301-1/+1
| |
| * MDEV-20926 UBSAN: load of value 165, which is not a valid value for type boolEugene Kosov2019-10-301-2/+1
| | | | | | | | | | | | | | Basicaly it's an uninitialized read. 165 is 0xa5 which comes from TRASH_ALLOC() Fix by calling a class ctor which initializes problematic TMP_TABLE_PARAM::force_copy_fields field
* | MDEV-20549 SQL SECURITY DEFINER does not work for INFORMATION_SCHEMA tablesSergei Golubchik2019-10-281-0/+1
| | | | | | | | switch to definer privileges when populating I_S tables
* | Merge 10.1 into 10.2Marko Mäkelä2019-10-251-2/+6
|\ \ | |/
| * Merge branch 'github/5.5' into 10.1Sergei Golubchik2019-10-231-2/+6
| |\
| | * MDEV-20466: SHOW PROCESSLIST truncates query text on \0 bytesOleksandr Byelkin2019-10-151-2/+6
| | | | | | | | | | | | Data should be sent with length.
* | | Merge 10.1 into 10.2Marko Mäkelä2019-10-091-4/+1
|\ \ \ | |/ /
| * | MDEV-19536 - Server crash or ASAN heap-use-after-free in is_temporary_table /Sergey Vojtovich2019-10-071-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | read_statistics_for_tables_if_needed Regression after 279a907, read_statistics_for_tables_if_needed() was called after open_normal_and_derived_tables() failure. Fixed by moving read_statistics_for_tables() call to a branch of get_schema_stat_record() where result of open_normal_and_derived_tables() is checked. Removed THD::force_read_stats, added read_statistics_for_tables() instead. Simplified away statistics_for_command_is_needed().
* | | Merge 10.1 into 10.2Marko Mäkelä2019-06-121-3/+0
|\ \ \ | |/ /
| * | MDEV-16467 - MariaDB crashes because of "long semaphore wait"after migrating ↵Sergey Vojtovich2019-06-121-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | from 10.1 to 10.3 This patch fixes 10.2 issue reported in MDEV-16467 by partial backport of c2118a0. Specifically "Remove not needed LOCK_thread_count from thd_get_error_context_description()".
* | | 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-6/+4
|\ \ \ | |/ /
| * | Adjusting sql_command to align with higher version, this is an adjustmentVarun Gupta2019-05-021-5/+4
| | | | | | | | | | | | to the patch for MDEV-17605
| * | Merge branch '5.5' into 10.1Sergei Golubchik2019-04-261-2/+0
| |\ \ | | |/
| | * MDEV-15907 ASAN heap-use-after-freeRobert Bindar2019-04-241-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes an invalid read in fill_effective_table_privileges triggered by a grant_version increase between a PREPARE for a statement creating a view from I_S and EXECUTE. A tmp table was created and free'd while preparing the statement, TABLE_LIST::table_name was set to point to the tmp table TABLE_SHARE::table_name which no longer existed after preparing was done. The grant version increase made fill_effective_table_privileges called during EXECUTE to try fetch the updated grant info and this is where the dangling table name was used.
* | | MDEV-17654 Incorrect syntax returned for column with CHECK constraint in the ↵Anel Husakovic2019-05-011-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | "SHOW CREATE TABLE ..." result Prepend COMMENT before CHECK constraint in SHOW CREATE Closes #924
* | | Merge 10.1 into 10.2Marko Mäkelä2019-04-251-0/+5
|\ \ \ | |/ /
| * | MDEV-17605 Statistics for InnoDB table is wrong if persistent statistics is usedIgor Babaev2019-04-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | The command SHOW INDEXES ignored setting of the system variable use_stat_tables to the value of 'preferably' and and showed statistical data received from the engine. Similarly queries over the table STATISTICS from INFORMATION_SCHEMA ignored this setting. It happened because the function fill_schema_table_by_open() did not read any data from statistical tables.
* | | Merge branch '10.1' into 10.2Sergei Golubchik2019-03-151-4/+47
|\ \ \ | |/ /
| * | fix gcc 8 compiler warningsSergei Golubchik2019-03-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were two newly enabled warnings: 1. cast for a function pointers. Affected sql_analyse.h, mi_write.c and ma_write.cc, mf_iocache-t.cc, mysqlbinlog.cc, encryption.cc, etc 2. memcpy/memset of nontrivial structures. Fixed as: * the warning disabled for InnoDB * TABLE, TABLE_SHARE, and TABLE_LIST got a new method reset() which does the bzero(), which is safe for these classes, but any other bzero() will still cause a warning * Table_scope_and_contents_source_st uses `TABLE_LIST *` (trivial) instead of `SQL_I_List<TABLE_LIST>` (not trivial) so it's safe to bzero now. * added casts in debug_sync.cc and sql_select.cc (for JOIN) * move assignment method for MDL_request instead of memcpy() * PARTIAL_INDEX_INTERSECT_INFO::init() instead of bzero() * remove constructor from READ_RECORD() to make it trivial * replace some memcpy() with c++ copy assignments
| * | MDEV-15945 --ps-protocol does not test some queriesSergei Golubchik2019-03-121-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make mysqltest to use --ps-protocol more use prepared statements for everything that server supports with the exception of CALL (for now). Fix discovered test failures and bugs. tests: * PROCESSLIST shows Execute state, not Query * SHOW STATUS increments status variables more than in text protocol * multi-statements should be avoided (see tests with a wrong delimiter) * performance_schema events have different names in --ps-protocol * --enable_prepare_warnings mysqltest.cc: * make sure run_query_stmt() doesn't crash if there's no active connection (in wait_until_connected_again.inc) * prepare all statements that server supports protocol.h * Protocol_discard::send_result_set_metadata() should not send anything to the client. sql_acl.cc: * extract the functionality of getting the user for SHOW GRANTS from check_show_access(), so that mysql_test_show_grants() could generate the correct column names in the prepare step sql_class.cc: * result->prepare() can fail, don't ignore its return value * use correct number of decimals for EXPLAIN columns sql_parse.cc: * discard profiling for SHOW PROFILE. In text protocol it's done in prepare_schema_table(), but in --ps it is called on prepare only, so nothing was discarding profiling during execute. * move the permission checking code for SHOW CREATE VIEW to mysqld_show_create_get_fields(), so that it would be called during prepare step too. * only set sel_result when it was created here and needs to be destroyed in the same block. Avoid destroying lex->result. * use the correct number of tables in check_show_access(). Saying "as many as possible" doesn't work when first_not_own_table isn't set yet. sql_prepare.cc: * use correct user name for SHOW GRANTS columns * don't ignore verbose flag for SHOW SLAVE STATUS * support preparing REVOKE ALL and ROLLBACK TO SAVEPOINT * don't ignore errors from thd->prepare_explain_fields() * use select_send result for sending ANALYZE and EXPLAIN, but don't overwrite lex->result, because it might be needed to issue execute-time errors (select_dumpvar - too many rows) sql_show.cc: * check grants for SHOW CREATE VIEW here, not in mysql_execute_command sql_view.cc: * use the correct function to check privileges. Old code was doing check_access() for thd->security_ctx, which is invoker's sctx, not definer's sctx. Hide various view related errors from the invoker. sql_yacc.yy: * initialize lex->select_lex for LOAD, otherwise it'll contain garbage data that happen to fail tests with views in --ps (but not otherwise).
| * | cleanup: miscSergei Golubchik2019-03-121-3/+4
| | |
| * | Merge branch '11.0' into 10.1Oleksandr Byelkin2018-09-061-4/+5
| |\ \
| | * | cleanup: FOREIGN_KEY_INFOSergei Golubchik2018-09-041-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | instead of returning strings for CASCADE/RESTRICT from every storage engine, use enum values Backport of a3614d33e8a
* | | | compiler warningsSergei Golubchik2019-02-051-2/+2
| | | |
* | | | Backport INFORMATION_SCHEMA.CHECK_CONSTRAINTSAnel Husakovic2019-01-161-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. There were some result files which failed after running mtr. These files are updated with newly create record with mtr --record.
* | | | 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.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
* | | | 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 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 branch 'github/10.1' into 10.2Sergei Golubchik2018-02-061-1/+1
|\ \ \ \ | |/ / /