summaryrefslogtreecommitdiff
path: root/storage/sequence
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.3 into 10.4Marko Mäkelä2022-09-132-4/+4
|\
| * MDEV-29446 Change SHOW CREATE TABLE to display default collationAlexander Barkov2022-09-122-4/+4
| |
* | Merge branch 'bb-10.3-release' into bb-10.4-releaseSergei Golubchik2021-02-121-2/+2
|\ \ | |/ | | | | | | Note, the fix for "MDEV-23328 Server hang due to Galera lock conflict resolution" was null-merged. 10.4 version of the fix is coming up separately
| * MDEV-17556 Assertion `bitmap_is_set_all(&table->s->all_set)' failedNikita Malyavin2021-01-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The assertion failed in handler::ha_reset upon SELECT under READ UNCOMMITTED from table with index on virtual column. This was the debug-only failure, though the problem is mush wider: * MY_BITMAP is a structure containing my_bitmap_map, the latter is a raw bitmap. * read_set, write_set and vcol_set of TABLE are the pointers to MY_BITMAP * The rest of MY_BITMAPs are stored in TABLE and TABLE_SHARE * The pointers to the stored MY_BITMAPs, like orig_read_set etc, and sometimes all_set and tmp_set, are assigned to the pointers. * Sometimes tmp_use_all_columns is used to substitute the raw bitmap directly with all_set.bitmap * Sometimes even bitmaps are directly modified, like in TABLE::update_virtual_field(): bitmap_clear_all(&tmp_set) is called. The last three bullets in the list, when used together (which is mostly always) make the program flow cumbersome and impossible to follow, notwithstanding the errors they cause, like this MDEV-17556, where tmp_set pointer was assigned to read_set, write_set and vcol_set, then its bitmap was substituted with all_set.bitmap by dbug_tmp_use_all_columns() call, and then bitmap_clear_all(&tmp_set) was applied to all this. To untangle this knot, the rule should be applied: * Never substitute bitmaps! This patch is about this. orig_*, all_set bitmaps are never substituted already. This patch changes the following function prototypes: * tmp_use_all_columns, dbug_tmp_use_all_columns to accept MY_BITMAP** and to return MY_BITMAP * instead of my_bitmap_map* * tmp_restore_column_map, dbug_tmp_restore_column_maps to accept MY_BITMAP* instead of my_bitmap_map* These functions now will substitute read_set/write_set/vcol_set directly, and won't touch underlying bitmaps.
* | Merge 10.3 into 10.4Marko Mäkelä2019-10-102-0/+13
|\ \ | |/
| * MDEV-20753: Sequence with limit 0 crashes serverOleksandr Byelkin2019-10-092-0/+13
| | | | | | | | Do not try to push down conditions to engine if query was resolved without tables (and so the engine).
* | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-05-191-1/+1
|\ \ | |/
| * Merge 10.2 into 10.3Marko Mäkelä2019-05-141-1/+1
| |\
| | * 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
| | | |
* | | | Merge 10.3 into 10.4Marko Mäkelä2019-03-201-4/+5
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-4/+5
| |\ \ \ | | |/ /
| | * | Merge branch '10.1' into 10.2Sergei Golubchik2019-03-151-4/+5
| | |\ \ | | | |/
| | | * fix gcc 8 compiler warningsSergei Golubchik2019-03-141-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-16188 Post merge fixes: more for TokuDBIgor Babaev2019-02-082-3/+3
|/ / /
* | | Changing field::field_name and Item::name to LEX_CSTRINGMonty2017-04-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Benefits of this patch: - Removed a lot of calls to strlen(), especially for field_string - Strings generated by parser are now const strings, less chance of accidently changing a string - Removed a lot of calls with LEX_STRING as parameter (changed to pointer) - More uniform code - Item::name_length was not kept up to date. Now fixed - Several bugs found and fixed (Access to null pointers, access of freed memory, wrong arguments to printf like functions) - Removed a lot of casts from (const char*) to (char*) Changes: - This caused some ABI changes - lex_string_set now uses LEX_CSTRING - Some fucntions are now taking const char* instead of char* - Create_field::change and after changed to LEX_CSTRING - handler::connect_string, comment and engine_name() changed to LEX_CSTRING - Checked printf() related calls to find bugs. Found and fixed several errors in old code. - A lot of changes from LEX_STRING to LEX_CSTRING, especially related to parsing and events. - Some changes from LEX_STRING and LEX_STRING & to LEX_CSTRING* - Some changes for char* to const char* - Added printf argument checking for my_snprintf() - Introduced null_clex_str, star_clex_string, temp_lex_str to simplify code - Added item_empty_name and item_used_name to be able to distingush between items that was given an empty name and items that was not given a name This is used in sql_yacc.yy to know when to give an item a name. - select table_name."*' is not anymore same as table_name.* - removed not used function Item::rename() - Added comparision of item->name_length before some calls to my_strcasecmp() to speed up comparison - Moved Item_sp_variable::make_field() from item.h to item.cc - Some minimal code changes to avoid copying to const char * - Fixed wrong error message in wsrep_mysql_parse() - Fixed wrong code in find_field_in_natural_join() where real_item() was set when it shouldn't - ER_ERROR_ON_RENAME was used with extra arguments. - Removed some (wrong) ER_OUTOFMEMORY, as alloc_root will already give the error. TODO: - Check possible unsafe casts in plugin/auth_examples/qa_auth_interface.c - Change code to not modify LEX_CSTRING for database name (as part of lower_case_table_names)
* | | MDEV-10139 Support for SEQUENCE objectsMonty2017-04-071-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Working features: CREATE OR REPLACE [TEMPORARY] SEQUENCE [IF NOT EXISTS] name [ INCREMENT [ BY | = ] increment ] [ MINVALUE [=] minvalue | NO MINVALUE ] [ MAXVALUE [=] maxvalue | NO MAXVALUE ] [ START [ WITH | = ] start ] [ CACHE [=] cache ] [ [ NO ] CYCLE ] ENGINE=xxx COMMENT=".." SELECT NEXT VALUE FOR sequence_name; SELECT NEXTVAL(sequence_name); SELECT PREVIOUS VALUE FOR sequence_name; SELECT LASTVAL(sequence_name); SHOW CREATE SEQUENCE sequence_name; SHOW CREATE TABLE sequence_name; CREATE TABLE sequence-structure ... SEQUENCE=1 ALTER TABLE sequence RENAME TO sequence2; RENAME TABLE sequence TO sequence2; DROP [TEMPORARY] SEQUENCE [IF EXISTS] sequence_names Missing features - SETVAL(value,sequence_name), to be used with replication. - Check replication, including checking that sequence tables are marked not transactional. - Check that a commit happens for NEXT VALUE that changes table data (may already work) - ALTER SEQUENCE. ANSI SQL version of setval. - Share identical sequence entries to not add things twice to table list. - testing insert/delete/update/truncate/load data - Run and fix Alibaba sequence tests (part of mysql-test/suite/sql_sequence) - Write documentation for NEXT VALUE / PREVIOUS_VALUE - NEXTVAL in DEFAULT - Ensure that NEXTVAL in DEFAULT uses database from base table - Two NEXTVAL for same row should give same answer. - Oracle syntax sequence_table.nextval, without any FOR or FROM. - Sequence tables are treated as 'not read constant tables' by SELECT; Would be better if we would have a separate list for sequence tables so that select doesn't know about them, except if refereed to with FROM. Other things done: - Improved output for safemalloc backtrack - frm_type_enum changed to Table_type - Removed lex->is_view and replaced with lex->table_type. This allows use to more easy check if item is view, sequence or table. - Added table flag HA_CAN_TABLES_WITHOUT_ROLLBACK, needed for handlers that want's to support sequences - Added handler calls: - engine_name(), to simplify getting engine name for partition and sequences - update_first_row(), to be able to do efficient sequence implementations. - Made binlog_log_row() global to be able to call it from ha_sequence.cc - Added handler variable: row_already_logged, to be able to flag that the changed row is already logging to replication log. - Added CF_DB_CHANGE and CF_SCHEMA_CHANGE flags to simplify deny_updates_if_read_only_option() - Added sp_add_cfetch() to avoid new conflicts in sql_yacc.yy - Moved code for add_table_options() out from sql_show.cc::show_create_table() - Added String::append_longlong() and used it in sql_show.cc to simplify code. - Added extra option to dd_frm_type() and ha_table_exists to indicate if the table is a sequence. Needed by DROP SQUENCE to not drop a table.
* | Fix several compile warnings on WindowsVladislav Vaintroub2017-03-171-3/+3
|/
* test for group by pushdown with a viewSergei Golubchik2016-05-052-0/+9
|
* MDEV-9550 COUNT(NULL) returns incorrect result with sequence storage engineSergei Golubchik2016-02-233-3/+18
| | | | | when calculating COUNT(basic_const), take into account that this basic_const may be NULL
* MDEV-9039 Can't upgrade MariaDB to to 10.1.8 version from 10.0.21Sergei Golubchik2015-11-162-2/+2
| | | | | | | | Don't mark the SEQUENCE engine as XA-capable. The engine never registers itself for any transaction, so it doesn't matter whether it is XA-capable or not. The only effect of being "XA-capable" is breaking the "number of XA-capable engines" check of TC_LOG_MMAP.
* Don't use flags in the group_by_handler classSergei Golubchik2015-10-051-8/+6
| | | | | instead pass the whole query down and let the engine return unsupported parts back
* cleanups and simplificationsSergei Golubchik2015-10-051-19/+6
|
* move internal API out from group_by_handlerSergei Golubchik2015-10-051-15/+9
| | | | into a Pushdown_query object
* remove unused methodSergei Golubchik2015-10-051-9/+0
|
* typos in comments, minor stylistic editsSergei Golubchik2015-10-051-1/+1
|
* MDEV-6080: Allowing storage engine to shortcut group by queriesMonty2015-10-053-2/+293
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This task is to allow storage engines that can execute GROUP BY or summary queries efficiently to intercept a full query or sub query from MariaDB and deliver the result either to the client or to a temporary table for further processing. - Added code in sql_select.cc to intercept GROUP BY queries. Creation of group_by_handler is done after all optimizations to allow storage engine to benefit of an optimized WHERE clause and suggested indexes to use. - Added group by handler to sequence engine and a group_by test suite as a way to test the new interface. - Intercept EXPLAIN with a message "Storage engine handles GROUP BY" libmysqld/CMakeLists.txt: Added new group_by_handler files sql/CMakeLists.txt: Added new group_by_handler files sql/group_by_handler.cc: Implementation of group_by_handler functions sql/group_by_handler.h: Definition of group_by_handler class sql/handler.h: Added handlerton function to create a group_by_handler, if the storage engine can intercept the query. sql/item_cmpfunc.cc: Allow one to evaluate item_equal any time. sql/sql_select.cc: Added code to intercept GROUP BY queries - If all tables are from the same storage engine and the query is using sum functions, call create_group_by() to check if the storage engine can intercept the query. - If yes: - create a temporary table to hold a GROUP_BY row or result - In do_select() intercept normal query execution by instead calling the group_by_handler to get the result - Intercept EXPLAIN sql/sql_select.h: Added handling of group_by_handler Added caching of the original join tab (needed for cleanup after group_by handler) storage/sequence/mysql-test/sequence/group_by.result: Test group_by_handler interface storage/sequence/mysql-test/sequence/group_by.test: Test group_by_handler interface storage/sequence/sequence.cc: Added simple group_by_engine for handling COUNT(*) and SUM(primary_key). This was done as a test of the group_by_handler interface
* MDEV-6894 Enable SEQUENCE engine by defaultSergei Golubchik2014-12-041-1/+1
|
* 5.5.40+ mergeSergei Golubchik2014-10-091-0/+1
|
* promote server_audit and sequence plugins to stableSergei Golubchik2014-06-131-1/+1
|
* update plugins' maturity levels:Sergei Golubchik2014-03-191-1/+1
| | | | | | old plugins get STABLE newer plugins get GAMMA those that had bugs recently get BETA
* MDEV-5735 Selecting from SEQUENCE table with negative number hangs server Sergei Golubchik2014-03-013-4/+22
|
* 10.0-base mergeSergei Golubchik2014-02-031-1/+0
|\
| * make sequence and sql_discovery suites default tooSergei Golubchik2014-02-011-0/+7
| |
* | mtr: abort when a suite.pm fails to load, don't just ignore the errors.Sergei Golubchik2013-12-223-4/+5
| | | | | | | | Fix all suite.pm files that had errors and test files that were skipped because of that
* | Percona-Server-5.6.14-rel62.0 mergeSergei Golubchik2013-12-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | support ha_innodb.so as a dynamic plugin. * remove obsolete *,innodb_plugin.rdiff files * s/--plugin-load=/--plugin-load-add=/ * MYSQL_PLUGIN_IMPORT glob_hostname[] * use my_error instead of push_warning_printf(ER_DEFAULT) * don't use tdc_size and tc_size in a module update test cases (XtraDB is 5.6.14, InnoDB is 5.6.10) * copy new tests over * disable some tests for (old) InnoDB * delete XtraDB tests that no longer apply small compatibility changes: * s/HTON_EXTENDED_KEYS/HTON_SUPPORTS_EXTENDED_KEYS/ * revert unnecessary InnoDB changes to make it a bit closer to the upstream fix XtraDB to compile on Windows (both as a static and a dynamic plugin) disable XtraDB on Windows (deadlocks) and where no atomic ops are available (e.g. CentOS 5) storage/innobase/handler/ha_innodb.cc: revert few unnecessary changes to make it a bit closer to the original InnoDB storage/innobase/include/univ.i: correct the version to match what it was merged from
* | 10.0-base mergeSergei Golubchik2013-12-161-0/+8
|\ \ | |/
* | MDEV-4786 - merge 10.0-monty - 10.0Sergey Vojtovich2013-07-241-10/+10
| | | | | | | | | | | | | | | | | | | | | | Fixed sql_discovery.simple failure. storage/sequence/sequence.cc: Let sequence share class have unique name to avoid collision with other classes. storage/test_sql_discovery/test_sql_discovery.cc: Let test_sql_discovery share class have unique name to avoid collision with other classes.
* | MDEV-4786 - merge 10.0-monty → 10.0Sergey Vojtovich2013-07-231-43/+58
|/ | | | | | | | Fixed sequence compilation failure. storage/sequence/sequence.cc: Adjusted sequence according to: WL#4305 - storage-engine private data area per physical table.
* MDEV-4451 Attempt to write-lock a SEQUENCE table with log-bin enabled causes ↵Sergei Golubchik2013-06-163-1/+15
| | | | | | ER_BINLOG_ROW_ENGINE mark the SEQUENCE engine as both SBR and RBR capable :)
* MDEV-4449 SEQUENCE depends on TEST_SQL_DISCOVERY for discovering tables upon DDLSergei Golubchik2013-06-163-13/+35
| | | | implement a non-dummy discover_table_existence() method
* MDEV-26: Global transaction ID. First alpha release.unknown2013-04-152-6/+6
| | | | | | | | | | | | | | | | | Merge of 10.0-mdev26 feature tree into 10.0-base. Global transaction ID is prepended to each event group in the binlog. Slave connect can request to start from GTID position instead of specifying file name/offset of master binlog. This facilitates easy switch to a new master. Slave GTID state is stored in a table mysql.rpl_slave_state, which can be InnoDB to get crash-safe slave state. GTID includes a replication domain ID, allowing to keep track of distinct positions for each of multiple masters.
* error messages: name the storage engine explicitly,Sergei Golubchik2013-04-091-1/+1
| | | | instead of "used storage engine" and similar changes.
* mysql-test fixesSergei Golubchik2013-04-091-0/+1
|
* fix internal plugin namesSergei Golubchik2013-04-091-1/+1
|
* sequence engineSergei Golubchik2013-04-096-0/+712