summaryrefslogtreecommitdiff
path: root/storage/sequence
Commit message (Collapse)AuthorAgeFilesLines
* 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