summaryrefslogtreecommitdiff
path: root/mysql-test/suite/handler
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-16708: fix in test failures(added ↵Dmitry Shulga2021-06-171-0/+2
| | | | --enable_prepared_warnings/--disable_prepared_warnings)
* Aria will now register it's transactionsMonty2020-05-237-796/+363
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-22531 Remove maria::implicit_commit() MDEV-22607 Assertion `ha_info->ht() != binlog_hton' failed in MYSQL_BIN_LOG::unlog_xa_prepare From the handler point of view, Aria now looks like a transactional engine. One effect of this is that we don't need to call maria::implicit_commit() anymore. This change also forces the server to call trans_commit_stmt() after doing any read or writes to system tables. This work will also make it easier to later allow users to have system tables in other engines than Aria. To handle the case that Aria doesn't support rollback, a new handlerton flag, HTON_NO_ROLLBACK, was added to engines that has transactions without rollback (for the moment only binlog and Aria). Other things - Moved freeing of MARIA_SHARE to a separate function as the MARIA_SHARE can be still part of a transaction even if the table has closed. - Changed Aria checkpoint to use the new MARIA_SHARE free function. This fixes a possible memory leak when using S3 tables - Changed testing of binlog_hton to instead test for HTON_NO_ROLLBACK - Removed checking of has_transaction_manager() in handler.cc as we can assume that as the transaction was started by the engine, it does support transactions. - Added new class 'start_new_trans' that can be used to start indepdendent sub transactions, for example while reading mysql.proc, using help or status tables etc. - open_system_tables...() and open_proc_table_for_Read() doesn't anymore take a Open_tables_backup list. This is now handled by 'start_new_trans'. - Split thd::has_transactions() to thd::has_transactions() and thd::has_transactions_and_rollback() - Added handlerton code to free cached transactions objects. Needed by InnoDB. squash! 2ed35999f2a2d84f1c786a21ade5db716b6f1bbc
* MDEV-18650: Options deprecated in previous versions - storage_engineVicențiu Ciorbaru2020-02-136-6/+6
| | | | | | | Remove usage of deprecated variable storage_engine. It was deprecated in 5.5 but it never issued a deprecation warning. Make it issue a warning in 10.5.1. Replaced with default_storage_engine.
* Merge 10.3 into 10.4Marko Mäkelä2019-03-201-0/+2
|\ | | | | | | | | | | | | | | | | | | The MDEV-17262 commit 26432e49d37a37d09b862bb49a021e44bdf4789c was skipped. In Galera 4, the implementation would seem to require changes to the streaming replication. In the tests archive.rnd_pos main.profiling, disable_ps_protocol for SHOW STATUS and SHOW PROFILE commands until MDEV-18974 has been fixed.
| * Merge branch '10.2' into 10.3Sergei Golubchik2019-03-171-0/+2
| |\
| | * Merge branch '10.1' into 10.2Sergei Golubchik2019-03-151-0/+2
| | |\
| | | * MDEV-15945 --ps-protocol does not test some queriesSergei Golubchik2019-03-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* | | | Changed FLUSH TABLES to not change share versionMonty2018-12-092-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Part of MDEV-5336 Implement LOCK FOR BACKUP Originally both table metadata lock and global read lock protection were acquired before getting TABLE from table cache. This will be reordered in a future commit with MDL_BACKUP_XXX locks so that we first take table metadata lock, then get TABLE from table cache, then acquire analogue of global read lock. This patch both simplifies FLUSH TABLES code, makes FLUSH TABLES to lock less and also enables FLUSH TABLES code to be used with backup locks. The usage of FLUSH TABLES changes slightly: - FLUSH TABLES without any arguments will now only close not used tables and tables locked by the FLUSH TABLES connection. All not used table shares will be closed. Tables locked by the FLUSH TABLES connection will be reopened and re-locked after all others has stoped using the table (as before). If there was no locked tables, then FLUSH TABLES is instant and will not cause any waits. FLUSH TABLES will not wait for any in use table. - FLUSH TABLES with a table list, will ensure that the tables are closed before statement returns. The code is now only using MDL locks and not table share versions, which simplices the code greatly. One visible change is that the server will wait for the end of the transaction that are using the tables. Before FLUSH TABLES only waited for the statements to end. Signed-off-by: Monty <monty@mariadb.org>
* | | | Optimize flush tables with read lock (FTWRL) to not wait for select'sMonty2018-12-094-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Part of MDEV-5336 Implement LOCK FOR BACKUP The idea is that instead of waiting in close_cached_tables() for all tables to be closed, we instead call flush_tables() that does: - Flush not used objects in table cache to free memory - Collect all tables that are open - Call HA_EXTRA_FLUSH on the objects, to get them into "closed state" - Added HA_EXTRA_FLUSH support to archive and CSV - Added multi-user protection to HA_EXTRA_FLUSH in MyISAM and Aria The benefit compared to old code is: - FTWRL doesn't have to wait for long running read operations or open HANDLER's
* | | | MDEV-15253: Default optimizer setting changes for MariaDB 10.4Varun Gupta2018-12-094-1/+8
| | | | | | | | | | | | | | | | | | | | use_stat_tables= PREFERABLY optimizer_use_condition_selectivity= 4
* | | | MDEV-11953: support of brackets in UNION/EXCEPT/INTERSECT operationsOleksandr Byelkin2018-07-044-0/+8
|/ / /
* | | Merge branch '10.2' into 10.3Sergei Golubchik2018-06-303-0/+22
|\ \ \ | |/ /
| * | Merge branch '10.1' into 10.2Sergei Golubchik2018-06-213-0/+22
| |\ \ | | |/
| | * Merge branch '10.0' into 10.1Vicențiu Ciorbaru2018-06-125-2/+24
| | |\
| | | * Merge branch '5.5' into 10.0Vicențiu Ciorbaru2018-06-125-2/+24
| | | |\
| | | | * MDEV-15729 Server crashes in Field::make_field upon HANDLER READ executed ↵Sergei Golubchik2018-06-112-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with PS protocol update table->pos_in_table_list during prepare, just like it's done in normal execution. otherwise it'll be a dangling pointer
| | | | * mysqltest: Allow HANDLER READ in --ps-protocol testsSergei Golubchik2018-06-113-2/+4
| | | | | | | | | | | | | | | | | | | | adjust tests
* | | | | MDEV-16172: Enable skipped testsMarko Mäkelä2018-05-171-5/+0
| | | | |
* | | | | MDEV-15813 ASAN use-after-poison in hp_hashnr upon HANDLER READ on a ↵Alexey Botchkov2018-05-164-2/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | versioned HEAP table. Check index capabilities before executing HANDLER READ command.
* | | | | Tests: revert unneded changesEugene Kosov2017-11-281-11/+0
| | | | |
* | | | | Tests: enable disabled tests [closes #341]Aleksey Midenkov2017-11-271-3/+0
| | | | |
* | | | | Tests: disabled failing (in 10.2) testskevg2017-05-051-0/+3
|/ / / /
* | | | MDEV-7660 - MySQL WL#6671 "Improve scalability by not using thr_lock.c locksSergey Vojtovich2016-11-037-95/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for InnoDB tables" Don't use thr_lock.c locks for InnoDB tables. Below is list of changes that were needed to implement this: - HANDLER OPEN acquireis MDL_SHARED_READ instead of MDL_SHARED - HANDLER READ calls external_lock() even if SE is not going to be locked by THR_LOCK - InnoDB lock wait timeouts are now honored which are much shorter by default than server lock wait timeouts (1 year vs 50 seconds) - with @@autocommit= 1 LOCK TABLES disables autocommit implicitely, though user still sees @@autocommt= 1 - the above starts implicit transaction - transactions started by LOCK TABLES are now rolled back on disconnect (previously everything was committed due to autocommit) - transactions started by LOCK TABLES are now rolled back by ROLLBACK (previously everything was committed due to autocommit) - it is now impossible to change BINLOG_FORMAT under LOCK TABLES (at least to statement) due to running transaction - LOCK TABLES WRITE is additionally handled by MDL - ...in contrast LOCK TABLES READ protection against DML is pure InnoDB - combining transactional and non-transactional tables under LOCK TABLES may cause rolled back changes in transactional table and "committed" changes in non-transactional table - user may disable innodb_table_locks, which will cause LOCK TABLES to be noop basically Removed tests for BUG#45143 and BUG#55930 which cover InnoDB + THR_LOCK. To operate properly these tests require code flow to go through THR_LOCK debug sync points, which is not the case after this patch. These tests are removed by WL#6671 as well. An alternative is to port them to different storage engine.
* | | | misc after-merge changes:Sergei Golubchik2016-09-101-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * remove new InnoDB-specific ER_ and HA_ERR_ codes * renamed few old ER_ and HA_ERR_ error messages to be less MyISAM-specific * remove duplicate enum definitions (durability_properties, icp_result) * move new mysql-test include files to their owner suite * rename xtradb.rdiff files to *-disabled * remove mistakenly committed helper perl module * remove long obsolete handler::ha_statistic_increment() method * restore the standard C xid_t structure to not have setters and getters * remove xid_t::reset that was cleaning too much * move MySQL-5.7 ER_ codes where they belong * fir innodb to include service_wsrep.h not internal wsrep headers * update tests and results
* | | | Merge InnoDB 5.7 from mysql-5.7.14.Jan Lindström2016-09-082-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Contains also: MDEV-10549 mysqld: sql/handler.cc:2692: int handler::ha_index_first(uchar*): Assertion `table_share->tmp_table != NO_TMP_TABLE || m_lock_type != 2' failed. (branch bb-10.2-jan) Unlike MySQL, InnoDB still uses THR_LOCK in MariaDB MDEV-10548 Some of the debug sync waits do not work with InnoDB 5.7 (branch bb-10.2-jan) enable tests that were fixed in MDEV-10549 MDEV-10548 Some of the debug sync waits do not work with InnoDB 5.7 (branch bb-10.2-jan) fix main.innodb_mysql_sync - re-enable online alter for partitioned innodb tables
* | | | Merge InnoDB 5.7 from mysql-5.7.9.Jan Lindström2016-09-021-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Contains also MDEV-10547: Test multi_update_innodb fails with InnoDB 5.7 The failure happened because 5.7 has changed the signature of the bool handler::primary_key_is_clustered() const virtual function ("const" was added). InnoDB was using the old signature which caused the function not to be used. MDEV-10550: Parallel replication lock waits/deadlock handling does not work with InnoDB 5.7 Fixed mutexing problem on lock_trx_handle_wait. Note that rpl_parallel and rpl_optimistic_parallel tests still fail. MDEV-10156 : Group commit tests fail on 10.2 InnoDB (branch bb-10.2-jan) Reason: incorrect merge MDEV-10550: Parallel replication can't sync with master in InnoDB 5.7 (branch bb-10.2-jan) Reason: incorrect merge
* | | | Merge branch '10.1' into 10.2Sergei Golubchik2016-06-301-1/+0
|\ \ \ \ | |/ / /
| * | | MDEV-9155 Enabling Defragmenting in 10.1.8 still causes OPTIMIZE TABLE to ↵Sergei Golubchik2016-05-051-1/+0
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | take metadatalocks take MDL_SHARED_WRITE instead of MDL_SHARED_NO_READ_WRITE for OPTIMIZE TABLE. For engines that need a stronger lock (like MyISAM), reopen the table with MDL_SHARED_NO_READ_WRITE.
* | | MDEV-5535: Cannot reopen temporary tableNirbhay Choubey2016-06-105-18/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysqld maintains a list of TABLE objects for all temporary tables created within a session in THD. Here each table is represented by a TABLE object. A query referencing a particular temporary table for more than once, however, failed with ER_CANT_REOPEN_TABLE error because a TABLE_SHARE was allocate together with the TABLE, so temporary tables always had only one TABLE per TABLE_SHARE. This patch lift this restriction by separating TABLE and TABLE_SHARE objects and storing TABLE_SHAREs for temporary tables in a list in THD, and TABLEs in a list within their respective TABLE_SHAREs.
* | | MDEV-6720 - enable connection log in mysqltest by defaultSergey Vojtovich2016-03-318-458/+444
|/ /
* | 10.0-base mergeSergei Golubchik2014-02-032-2/+7
|\ \
| * \ 5.5 mergeSergei Golubchik2014-02-011-2/+2
| |\ \ | | |/
| | * MySQL-5.5.35 mergeSergei Golubchik2014-01-221-2/+2
| | |
* | | 10.0-base mergeSergei Golubchik2013-12-165-15/+34
|\ \ \ | |/ /
| * | 5.5 mergeSergei Golubchik2013-11-235-15/+34
| |\ \ | | |/
| | * mysql-5.5.34 mergeSergei Golubchik2013-11-195-15/+34
| | | | | | | | | | | | (some patches reverted, test case added)
* | | MDEV-4879 - Merge test cases for new CREATE TEMPORARY TABLE privilege modelSergey Vojtovich2013-09-202-0/+175
| | | | | | | | | | | | | | | | | | | | | | | | - merged test cases for MySQL bug#27480 - fixed that LOCK TABLES was unable to open temporary table (covered by grant2 test, merged appropriate code from 5.6) - commented lines that cause server crash in merge test, reported MDEV-5042 (not relevant to bug#27480)
* | | 10.0-monty mergeSergei Golubchik2013-07-215-9/+9
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | includes: * remove some remnants of "Bug#14521864: MYSQL 5.1 TO 5.5 BUGS PARTITIONING" * introduce LOCK_share, now LOCK_ha_data is strictly for engines * rea_create_table() always creates .par file (even in "frm-only" mode) * fix a 5.6 bug, temp file leak on dummy ALTER TABLE
| * | update handler.* testsSergei Golubchik2013-07-125-18/+18
| | |
| * | 10.0-monty: trivial test result updatesSergey Petrunya2013-07-091-1/+1
| | |
* | | 5.5 mergeSergei Golubchik2013-07-172-0/+15
|\ \ \ | | |/ | |/|
| * | MDEV-4480 Assertion `inited == NONE' fails on closing a connection with open ↵Sergei Golubchik2013-06-072-0/+15
| | | | | | | | | | | | handler on temporary table
* | | 5.5 mergeSergei Golubchik2013-06-062-0/+23
|\ \ \ | |/ /
| * | mysql-5.5.31 mergeSergei Golubchik2013-05-072-0/+23
| |/
* | error messages: name the storage engine explicitly,Sergei Golubchik2013-04-095-10/+10
|/ | | | instead of "used storage engine" and similar changes.
* after merge changes:Sergei Golubchik2011-12-125-22/+22
| | | | | | | | | | | * rename all debugging related command-line options and variables to start from "debug-", and made them all OFF by default. * replace "MySQL" with "MariaDB" in error messages * "Cast ... converted ... integer to it's ... complement" is now a note, not a warning * @@query_cache_strip_comments now has a session scope, not global.
* merge with 5.3Sergei Golubchik2011-10-199-128/+5126
| | | | | | | | | | | | | sql/sql_insert.cc: CREATE ... IF NOT EXISTS may do nothing, but it is still not a failure. don't forget to my_ok it. ****** CREATE ... IF NOT EXISTS may do nothing, but it is still not a failure. don't forget to my_ok it. sql/sql_table.cc: small cleanup ****** small cleanup
* Fixed compiler warningsMichael Widenius2011-02-255-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | client/readline.cc: Initialize not used variable (to kill wrong compiler warning) mysql-test/suite/handler/aria.result: Updated test result mysql-test/suite/handler/handler.inc: Changed index to ensure rows are in a fixed order mysql-test/suite/handler/heap.result: Updated test result mysql-test/suite/handler/innodb.result: Updated test result mysql-test/suite/handler/myisam.result: Updated test result plugin/handler_socket/handlersocket/Makefile.am: Use CXX flags to compile sql/filesort.cc: Initialize variable that may be used sql/log.cc: Initialize not used variable (to kill wrong compiler warning) sql/opt_range_mrr.cc: Fixed cast to avoid compiler warning storage/xtradb/fil/fil0fil.c: Added cast to avoid compiler warning
* Fixed build issuesMichael Widenius2011-02-237-195/+387
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Linking now with g++ instead of gcc with 'compile-dist' to solve problems with handlersocket/client - Fixed bug in heap tables when doing handler read next-prev over last row BUILD/compile-dist: - Linking now with g++ instead of gcc with 'compile-dist' to solve problems with handlersocket/client cmd-line-utils/libedit/vi.c: Fixed compiler warning about not checking return value for write mysql-test/r/index_intersect.result: Updated results (missed this file in my last push) mysql-test/suite/handler/aria.result: Updated test results mysql-test/suite/handler/handler.inc: Changed test to use read next/read prev on key where there are duplicates that can come in different order depending on system Added testing of read next-prev over last row and read prev-next around first row mysql-test/suite/handler/heap.result: Updated test results mysql-test/suite/handler/init.inc: More rows to test mysql-test/suite/handler/innodb.result: Updated test results mysql-test/suite/handler/interface.result: Updated test results mysql-test/suite/handler/myisam.result: Updated test results mysql-test/t/variables-big.test: Fixed test to not fail on windows mysql-test/valgrind.supp: Removed not matching fun: to get rid of valgrind warning storage/heap/hp_rfirst.c: Added state so that we know if we have an active position in the index. storage/heap/hp_rkey.c: Added state so that we know if we have an active position in the index. storage/heap/hp_rnext.c: Handle reading several next after finding the last row (this caused a crash before) storage/heap/hp_rprev.c: Handle reading several prev after finding the first row (this caused a crash before) storage/xtradb/buf/buf0buf.c: Fixed compiler warning about uninitialized value
* Fixed compiler warnings and some test failures found by buildbotMichael Widenius2011-02-232-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dbug/dbug.c: Fixed compiler warnings on windows mysql-test/r/index_intersect_innodb.result: Don't print number of rows as this varies mysql-test/suite/funcs_1/r/processlist_val_no_prot.result: Update to use new State mysql-test/suite/handler/heap.result: Update results mysql-test/suite/handler/heap.test: Changed key used in test as the key 'b' will not guarantee order of the two last elements (as the key value is the same) mysql-test/suite/pbxt/r/lock_multi.result: Update to use new State mysql-test/t/index_intersect.test: Don't print number of rows as this varies mysql-test/valgrind.supp: Added suppression for linux mysys/hash.c: Fixed compiler warnings on windows plugin/handler_socket/handlersocket/database.cpp: Fixed compiler warnings sql-common/client_plugin.c: Changed variable to define to avoid compiler warnings when variable is not used sql-common/my_time.c: Initialize all my_time elements to avoid compiler warnings storage/oqgraph/ha_oqgraph.cc: Use right function (to avoid compiler warning) storage/pbxt/src/table_xt.cc: Initialize variables (to avoid compiler warnings)