summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-07-071-1/+11
|\
| * Merge branch '10.1' into 10.2Sergei Golubchik2017-07-051-1/+3
| |\
| | * Merge branch '10.0' into 10.1Sergei Golubchik2017-06-301-0/+2
| | |\
| | | * Merge branch '5.5' into 10.0Sergei Golubchik2017-06-281-0/+2
| | | |\
| | | | * MDEV-13187 incorrect backslash parsing in clientsSergei Golubchik2017-06-271-0/+2
| | | | | | | | | | | | | | | | | | | | cover ANSI_QUOTES and NO_BACKSLASH_ESCAPES in mysqltest
| | * | | MDEV-13012 Assertion `share->error' failed in discover_handlerton upon ↵Sergei Golubchik2017-06-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | executing statement with max_session_mem_used = 8192 and MDEV-13011 Server crashes in THD::handle_condition or Assertion `! is_set() || m_can_overwrite_status' fails upon attempt to connect with max_session_mem_used = 8192 errors when a connection is killed in the * TABLE_SHARE::init_from_sql_statement_string() * THD::init() also, safety-wise, don't check max_mem_used on free() and when some error was already issued.
| * | | | MDEV-11639 Server crashes in update_virtual_field, gcol.innodb_virtual_basic ↵Sergei Golubchik2017-07-051-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fails in buildbot don't use thd->query_id check in background purge threads (it doesn't work, because thd->query_id is never incremented there) instead use thd->open_tables directly, there can be only one table there anyway, and this is the table opened by this purge thread.
* | | | | MDEV-13245 Add struct AUTHIDAlexander Barkov2017-07-051-4/+15
| | | | |
* | | | | Merge 10.2 into bb-10.2-extMarko Mäkelä2017-06-271-8/+29
|\ \ \ \ \ | |/ / / /
| * | | | MDEV-12070 - Introduce thd_query_safe() from MySQL 5.7Sergey Vojtovich2017-06-261-8/+29
| | | | | | | | | | | | | | | | | | | | | | | | | Merged relevant part of MySQL revision: https://github.com/mysql/mysql-server/commit/565d20b44f24fcc855dc616164d87b03cfad10bc
* | | | | Merge 10.2 into bb-10.2-extMarko Mäkelä2017-06-191-14/+0
|\ \ \ \ \ | |/ / / /
| * | | | Remove the unnecessary method handlerton::release_temporary_latches()Marko Mäkelä2017-06-161-14/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sole purpose of handlerton::release_temporary_latches and its wrapper function was to release the InnoDB adaptive hash index latch (btr_search_latch). When the btr_search_latch was split into an array of latches in MySQL 5.7.8 as part of the Oracle Bug#20985298 fix, the "caching" of the latch across storage engine API calls was removed. As part of that, the function trx_search_latch_release_if_reserved() was changed to an assertion and the function trx_reserve_search_latch_if_not_reserved() was removed, and handlerton::release_temporary_latches() practically became a no-op. Note: MDEV-12121 replaced the function trx_search_latch_release_if_reserved() with the more appropriately named macro trx_assert_no_search_latch().
* | | | | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-06-151-0/+1
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.1 into 10.2Marko Mäkelä2017-05-221-0/+1
| |\ \ \ \ | | |/ / /
| | * | | Silence bogus GCC 7 warnings -Wimplicit-fallthroughMarko Mäkelä2017-05-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not silence uncertain cases, or fix any bugs. The only functional change should be that ha_federated::extra() is not calling DBUG_PRINT to report an unhandled case for HA_EXTRA_PREPARE_FOR_DROP.
* | | | | Merge tag 'mariadb-10.2.6' into bb-10.2-extAlexander Barkov2017-05-261-5/+1
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch '10.1' into 10.2Sergei Golubchik2017-05-091-1/+1
| |\ \ \ \ | | |/ / / | | | | | | | | | | | | | | | Revert commit db0917f68f, because the fix for MDEV-12696 is coming from 5.5 and 10.1 in this merge.
| | * | | Remove compile warning - "this" canot be nullDaniel Black2017-04-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | /home/travis/build/MariaDB/server/sql/sql_class.cc:1941:15: warning: 'this' pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true [-Wundefined-bool-conversion] if (this && WSREP(this) && wsrep_thd_is_BF(this, FALSE)) ^~~~ ~~
| | * | | Merge branch '10.0' 10.1Sergei Golubchik2017-04-281-1/+1
| | |\ \ \ | | | |/ /
| | | * | Merge branch '5.5' into 10.0Sergei Golubchik2017-04-211-1/+1
| | | |\ \ | | | | |/
| | | | * Merge remote-tracking branch 'mysql/5.5' into 5.5mariadb-5.5.55Sergei Golubchik2017-04-111-1/+1
| | | | |\
| | | | | * WL#10287 - Backport WL#7195 to MySQL - 5.5Thayumanavar S2017-01-301-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is backport of WL#7195 to MySQL-5.5. In 5.5, we offload connection authentication from the acceptor thread to tp worker threads. Connection authentication happens in the acceptor thread that accepts the connection for thread pool plugin. Connection authentication involves exchanging packets with client and disk I/O which is time consuming. This can cause other client connections to starve and wait in the queue possibly increasing the connect latency and decreasing throughput. In the worst case, some connections could be dropped. n addition, SSL handshakes are quite expensive and can stall connections in the accept queue. This patch offloads connection authentication when thread pool plugin is used for client connection. Each thread group shall have a queue of connection_context objects, which represents new connections that need to be processed by thread group threads. The connection context is composed of THD object & list pointers for intrusive queue implementation. Whenever a new connection arrives, connection context object is created and added to the queue. A new connect handler thread is created or woken up to handle the authentication task. The worker thread loop is modified to process connection events on connect handler threads in addition to checking for query processing events. The initial number of connect handler threads is one per thread group and it is restricted to a maximum of 4 threads per thread group.
| | | | | * Bug#24707666: DEFAULT SETTING FOR SECURE-FILE-PRIV SHOULD BEArun Kuruvila2016-09-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RESTRICTED IN ALL GA RELEASES Back port of WL#6782 to 5.5 and 5.6. This also includes back port of Bug#20771331, Bug#20741572 and Bug#20770671. Bug#24695274 and Bug#24679907 are also handled along with this.
| | | | | * BUG#23509275 :DBUG_PRINT in THD::decide_logging_format prints incorrectly, ↵Neha Kumari2016-07-251-10/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | access out-of-bound Problem: In debug builds, there is a chance that an out-of-bounds read is performed when tables are locked in LTM_PRELOCKED_UNDER_LOCK_TABLES mode. It can happen because the debug code uses enum values as index for an array of mode descriptions, but it only takes into consideration 3 out of 4 of the enum values. Fix: This patch fixes it by implementing a getter for the enum which returns a string representation of the enum, effectively removing the out-of-bounds read. Moreover, it also fixes the lock mode descriptions that would be print out in debug builds.
| * | | | | Merge 10.1 into 10.2Marko Mäkelä2017-05-061-4/+0
| |\ \ \ \ \ | | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | Also, include fixes by Vladislav Vaintroub to the aws_key_management plugin. The AWS C++ SDK specifically depends on OPENSSL_LIBRARIES, not generic SSL_LIBRARIES (such as YaSSL).
| | * | | | bugfix: federated/replication did not increment bytes_received status variableSergei Golubchik2017-04-271-14/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | because mysql->net.thd was reset to NULL in mysql_real_connect() and thd_increment_bytes_received() didn't do anything. Fix: * set mysql->net.thd to current_thd instread. * remove the test for non-null THD from a very often used function thd_increment_bytes_received().
* | | | | | Make SEQUENCE working with replicationMonty2017-05-231-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Old sequence code forced row based replication for any statements that refered to a sequence table. What is new is that row based replication is now sequence aware: - NEXT VALUE is now generating a short row based event with only next_value and round being replicated. - Short row based events are now on the slave updated as trough SET_VALUE(sequence_name) - Full row based events are on the slave updated with a full insert, which is practically same as ALTER SEQUENCE. - INSERT on a SEQUENCE table does now a EXCLUSIVE LOCK to ensure that it is logged in binary log before any following NEXT VALUE calls. - Enable all sequence tests and fixed found bugs - ALTER SEQUENCE doesn't anymore allow changes that makes the next_value outside of allowed range - SEQUENCE changes are done with TL_WRITE_ALLOW_WRITE. Because of this one can generate a statement for MyISAM with both TL_WRITE_CONCURRENT_INSERT and TL_WRITE_ALLOW_WRITE. To fix a warning I had to add an extra test in thr_lock.c for this. - Removed UPDATE of SEQUENCE (no need to support this as we have ALTER SEQUENCE, which takes the EXCLUSIVE lock properly. - Removed DBUG_ASSERT() in MDL_context::upgrade_shared_lock. This was removed upstream in MySQL 5.6 in 72f823de453. - Simplified test in decided_logging_format() by using sql_command_flags() - Fix that we log DROP SEQUENCE correctly. - Fixed that Aria works with SEQUENCE
* | | | | | MDEV-12777 Change Lex_field_type_st::m_type from enum_field_types to ↵Alexander Barkov2017-05-101-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | Type_handler pointer
* | | | | | MDEV-12657 A few tests fail in build-bot on Windows after changing ↵Alexander Barkov2017-05-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Field::field_name and Item::name to LEX_CSTRING
* | | | | | MDEV-12659 Add THD::make_string_literal()Alexander Barkov2017-05-021-0/+20
| | | | | |
* | | | | | Changing field::field_name and Item::name to LEX_CSTRINGMonty2017-04-231-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-2/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | MDEV-12291 Allow ROW variables as SELECT INTO targetsAlexander Barkov2017-04-051-13/+40
| | | | | |
* | | | | | MDEV-10914 ROW data type for stored routine variablesAlexander Barkov2017-04-051-0/+5
| | | | | |
* | | | | | MDEV-10597 Cursors with parametersAlexander Barkov2017-04-051-1/+12
| | | | | |
* | | | | | MDEV-10587 sql_mode=ORACLE: User defined exceptionsAlexander Barkov2017-04-051-5/+6
| | | | | |
* | | | | | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-03-311-1/+41
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge branch '10.1' into 10.2Sergei Golubchik2017-03-301-1/+41
| |\ \ \ \ \ | | |/ / / /
| | * | | | MDEV-12345 Performance : replace calls to clock() inside trx_start_low() by ↵Vladislav Vaintroub2017-03-231-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | THD::start_utime
| | * | | | thd_rnd serviceSergei Golubchik2017-03-101-0/+22
| | | | | |
| | * | | | Merge 10.0 into 10.1Marko Mäkelä2017-03-031-0/+6
| | |\ \ \ \ | | | |/ / /
| | | * | | Add protection for reinitialization of mutex in parallel replactionMonty2017-02-281-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added mutex_lock/mutex_unlock of mutex that is to be destroyed in wait_for_commit::reinit() in a similar fashion that we do in ~wait_for_commit
* | | | | | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-03-241-0/+2
|\ \ \ \ \ \ | |/ / / / /
| * | | | | MDEV-11177 mysqlbinlog exits silently without error when anotherAlexey Botchkov2017-03-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instance connects to server. New thread kill status added KILL_SLAVE_SAME_ID, and the related error message.
* | | | | | MDEV-10141: Add support for INTERSECT (and common parts for EXCEPT)Oleksandr Byelkin2017-03-141-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | MDEV-10140: Add support for EXCEPT
* | | | | | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-02-271-6/+3
|\ \ \ \ \ \ | |/ / / / /
| * | | | | cleanup: TABLE::mark_columns_used_by_index()Sergei Golubchik2017-02-131-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mark_columns_used_by_index used to do reset + mark_columns_used_by_index_no_reset + start keyread + set bitmaps Now prepare_for_keyread does that, while mark_columns_used_by_index does only reset + mark_columns_used_by_index_no_reset, just as its name suggests.
| * | | | | Merge branch '10.1' into 10.2Sergei Golubchik2017-02-101-1/+0
| |\ \ \ \ \ | | |/ / / /
| | * | | | Merge branch '10.0' into 10.1mariadb-10.1.21Sergei Golubchik2017-01-171-1/+0
| | |\ \ \ \ | | | |/ / /
| | | * | | Merge branch '5.5' into 10.0Sergei Golubchik2017-01-171-1/+0
| | | |\ \ \ | | | | |/ /