summaryrefslogtreecommitdiff
path: root/libmysqld
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-22437 make THR_THD* variable thread_localEugene Kosov2020-05-051-9/+2
| | | | | | | Now all access goes through _current_thd() and set_current_thd() functions. Some functions like THD::store_globals() can not fail now.
* MDEV-20377: Make WITH_MSAN more usableMarko Mäkelä2020-03-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MemorySanitizer (clang -fsanitize=memory) requires that all code be compiled with instrumentation enabled. The C runtime library is an exception. Failure to use instrumented libraries will cause bogus messages about memory being uninitialized. In WITH_MSAN builds, we must avoid calling getservbyname(), because even though it is a standard library function, it is not instrumented, not even in clang 10. The following cmake options were tested: -DCMAKE_C_FLAGS='-march=native -O2' -DCMAKE_CXX_FLAGS='-stdlib=libc++ -march=native -O2' -DWITH_EMBEDDED_SERVER=OFF -DWITH_UNIT_TESTS=OFF -DCMAKE_BUILD_TYPE=Debug -DWITH_INNODB_{BZIP2,LZ4,LZMA,LZO,SNAPPY}=OFF -DPLUGIN_{ARCHIVE,TOKUDB,MROONGA,OQGRAPH,ROCKSDB,CONNECT,SPIDER}=NO -DWITH_SAFEMALLOC=OFF -DWITH_{ZLIB,SSL,PCRE}=bundled -DHAVE_LIBAIO_H=0 -DWITH_MSAN=ON MEM_MAKE_DEFINED(): An alias for VALGRIND_MAKE_MEM_DEFINED() and in the future, __msan_unpoison(). For now, neither MEM_MAKE_DEFINED() nor MEM_UNDEFINED() perform any action under MSAN. Enabling them will catch more bugs, but will also require some more fixes or work-arounds. Json_writer::add_double(): Work around a frequently occurring failure in optimizer tests, related to EXPLAIN FORMAT=JSON. dtoa(): Disable MSAN altogether. For some reason, this function is triggering a lot of trouble, especially when invoked for DBUG functions. The MDL default timeout is dd=86400 seconds, and for some reason it is claimed to be uninitialized. InnoDB: Define UNIV_DEBUG_VALGRIND also WITH_MSAN. ut_crc32_8_hw(), ut_crc32_64_low_hw(): Use the compiler built-in functions instead of inline assembler when building WITH_MSAN. This will require at least -msse4.2 when building for IA-32 or AMD64. The inline assembler would not be instrumented, and would thus cause bogus failures.
* Added support for replication for S3Monty2020-03-241-116/+0
| | | | | | | | | | | | | | | | | MDEV-19964 S3 replication support Added new configure options: s3_slave_ignore_updates "If the slave has shares same S3 storage as the master" s3_replicate_alter_as_create_select "When converting S3 table to local table, log all rows in binary log" This allows on to configure slaves to have the S3 storage shared or independent from the master. Other thing: Added new session variable '@@sql_if_exists' to force IF_EXIST to DDL's.
* MDEV-21303 Make executables MariaDB namedRasmus Johansson2020-03-211-17/+17
| | | | | | | | | To change all executables to have a mariadb name I had to: - Do name changes in every CMakeLists.txt that produces executables - CREATE_MARIADB_SYMLINK was removed and GET_SYMLINK added by Wlad to reuse the function in other places also - The scripts/CMakeLists.txt could make use of GET_SYMLINK instead of introducing redundant code, but I thought I'll leave that for next release - A lot of changes to debian/.install and debian/.links files due to swapping of real executable and symlink. I did not however change the name of the manpages, so the real name is still mysql there and mariadb are symlinks. - The Windows part needed a change now when we made the executables mariadb -named. MSI (and ZIP) do not support symlinks and to not break backward compatibility we had to include mysql named binaries also. Done by Wlad
* MDEV-21907: InnoDB: Enable -Wconversion on clang and GCCMarko Mäkelä2020-03-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The -Wconversion in GCC seems to be stricter than in clang. GCC at least since version 4.4.7 issues truncation warnings for assignments to bitfields, while clang 10 appears to only issue warnings when the sizes in bytes rounded to the nearest integer powers of 2 are different. Before GCC 10.0.0, -Wconversion required more casts and would not allow some operations, such as x<<=1 or x+=1 on a data type that is narrower than int. GCC 5 (but not GCC 4, GCC 6, or any later version) is complaining about x|=y even when x and y are compatible types that are narrower than int. Hence, we must rewrite some x|=y as x=static_cast<byte>(x|y) or similar, or we must disable -Wconversion. In GCC 6 and later, the warning for assigning wider to bitfields that are narrower than 8, 16, or 32 bits can be suppressed by applying a bitwise & with the exact bitmask of the bitfield. For older GCC, we must disable -Wconversion for GCC 4 or 5 in such cases. The bitwise negation operator appears to promote short integers to a wider type, and hence we must add explicit truncation casts around them. Microsoft Visual C does not allow a static_cast to truncate a constant, such as static_cast<byte>(1) truncating int. Hence, we will use the constructor-style cast byte(~1) for such cases. This has been tested at least with GCC 4.8.5, 5.4.0, 7.4.0, 9.2.1, 10.0.0, clang 9.0.1, 10.0.0, and MSVC 14.22.27905 (Microsoft Visual Studio 2019) on 64-bit and 32-bit targets (IA-32, AMD64, POWER 8, POWER 9, ARMv8).
* MDEV-21907: Fix some -Wconversion outside InnoDBMarko Mäkelä2020-03-121-14/+27
| | | | | | | | | | | | | | | Some .c and .cc files are compiled as part of Mariabackup. Enabling -Wconversion for InnoDB would also enable it for Mariabackup. The .h files are being included during InnoDB or Mariabackup compilation. Notably, GCC 5 (but not GCC 4 or 6 or later versions) would report -Wconversion for x|=y when the type is unsigned char. So, we will either write x=(uchar)(x|y) or disable the -Wconversion warning for GCC 5. bitmap_set_bit(), bitmap_flip_bit(), bitmap_clear_bit(), bitmap_is_set(): Always implement as inline functions.
* perfschema memory related instrumentation changesSergei Golubchik2020-03-104-26/+24
|
* MDEV-17832 Protocol: extensions for Pluggable types and JSON, GEOMETRYAlexander Barkov2020-03-105-0/+79
|
* MDEV-21702 Add a data type for privilegesAlexander Barkov2020-02-111-1/+1
|
* MDEV-21689 Add Sql_cmd for GRANT/REVOKE statementsAlexander Barkov2020-02-081-1/+2
| | | | | | | | | | | | | | | | | | | | | Rewriting GRANT/REVOKE grammar to use more bison stack and use Sql_cmd_ style 1. Removing a few members from LEX: - uint grant, grant_to_col, which_columns - List<LEX_COLUMN> columns - bool all_privileges 2. Adding classes Grand_object_name, Lex_grant_object_name 3. Adding classes Grand_privilege, Lex_grand_privilege 4. Adding struct Lex_column_list_privilege_st, class Lex_column_list_privilege 5. Rewriting the GRANT/REVOKE grammar to use new classes and pass them through bison stack (rather than directly access LEX members) 6. Adding classes Sql_cmd_grant* and Sql_cmd_revoke*, changing GRANT/REVOKE to use LEX::m_sql_cmd. 7. Adding the "sp_handler" grammar rule and removing some duplicate grammar for GRANT/REVOKE for different kinds of SP objects. 8. Adding a new rule comma_separated_ident_list, reusing it in: - with_column_list - colum_list_privilege
* MDEV-21581 Helper functions and methods for CHARSET_INFOAlexander Barkov2020-01-281-4/+4
|
* mysqltest crashes on DebianSergei Golubchik2020-01-161-0/+1
| | | | | | | | | | | | Debian is apparently offended that pcre2-posix implements POSIX API, thus it renames all posix-compatible symbols in libpcre2-posix to have the PCRE2 prefix. But Debian doesn't do anything to pcre2posix.h header, so any unaware application will get POSIX compatible type names and function prototypes from pcre2, but actual symbols will come from libc. To remedy this enormous incongruity we have to redefine POSIX-compatible function names in pcre2posix to match Debian's hack.
* MDEV-21327 : MDL wait notification for innodb background threadpoolVladislav Vaintroub2020-01-121-1/+2
|
* remove pcre, add support for bundled pcre2Sergei Golubchik2019-12-212-2/+2
|
* MDEV-14024 PCRE2.Alexey Botchkov2019-12-212-2/+2
| | | | Related changes in the server code.
* MDEV-20844 RBR from binary(16) to inet6 fails with error 171: The event was ↵Alexander Barkov2019-10-181-0/+1
| | | | | | | | | | | | | | | | | | corrupt, leading to illegal data being read This patch changes the way how INET6 is packed to the RBR binary log: - from fixed length 16 bytes - to BINARY(16) compatible variable length style with trailing 0x00 byte compression. This is to make INET6 fully compatible with BINARY(16) in RBR binary logs, so RBR replication works in this scenarios: - Old master BINARY(16) -> New slave INET6 - New master INET6 -> Old slave BINARY(16) A new class StringPack was added to share the code between Field_string and Field_inet6.
* MDEV-20768 Turn INET functions into a function collection pluginAlexander Barkov2019-10-071-2/+0
|
* A cleanup for: MDEV-18010 Add classes Inet4 and Inet6Alexander Barkov2019-10-071-0/+1
| | | | | | | | - Moving the implementations of class Inet4 and class Inet6 into separate files sql_type_inet.h and sql_type_inet.cc, in order to reuse them for the INET6 data type and inet function collection. - Adding a warning in the case when IS_IPV4_MAPPED() and IS_IPV4_COMPAT() erroneously gets an IPv4 address instead of the expected IPv6 address.
* Merge 10.4 into 10.5Marko Mäkelä2019-09-062-4/+15
|\
| * Merge branch '10.3' into 10.4Sergei Golubchik2019-09-062-4/+15
| |\
| | * Merge 10.2 (up to commit ef00ac4c86daf3294c46a45358da636763fb0049) into 10.3Alexander Barkov2019-09-041-0/+1
| | |\
| | | * MDEV-18156 Assertion `0' failed or `btr_validate_index(index, 0, false)' in ↵Alexander Barkov2019-09-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | row_upd_sec_index_entry or error code 126: Index is corrupted upon DELETE with PAD_CHAR_TO_FULL_LENGTH This change takes into account a column's GENERATED ALWAYS AS expression dependcy on sql_mode's PAD_CHAR_TO_FULL_LENGTH and NO_UNSIGNED_SUBTRACTION flags. Indexed virtual columns as well as persistent generated columns are now not allowed to have such dependencies to avoid inconsistent data or index files on sql_mode changes. So an error is now returned in cases like this: CREATE OR REPLACE TABLE t1 ( a CHAR(5), v VARCHAR(5) AS (a) PERSISTENT -- CHAR->VARCHAR or CHAR->TEXT = ERROR ); Functions RPAD() and RTRIM() can now remove dependency on PAD_CHAR_TO_FULL_LENGTH. So this can be used instead: CREATE OR REPLACE TABLE t1 ( a CHAR(5), v VARCHAR(5) AS (RTRIM(a)) PERSISTENT ); Note, unlike CHAR->VARCHAR and CHAR->TEXT this still works, not RPAD(a) is needed: CREATE OR REPLACE TABLE t1 ( a CHAR(5), v CHAR(5) AS (a) PERSISTENT -- CHAR->CHAR is OK ); More sql_mode flags may affect values of generated columns. They will be addressed separately. See comments in sql_mode.h for implementation details.
| | * | Merge branch '10.2' into 10.3Monty2019-09-031-4/+14
| | |\ \ | | | |/
| | | * embedded client now writes errors to stderr during init_embedded_serverMonty2019-09-011-3/+14
| | | | | | | | | | | | | | | | | | | | This was done to be able to get any information why the embedded server doesn't start.
* | | | MDEV-19957 Move Type_handler_geometry code from sql_type.h/cc to ↵Alexander Barkov2019-07-051-0/+1
| | | | | | | | | | | | | | | | sql_type_geom.h/cc
* | | | MDEV-19897 Rename source code variable names from utf8 to utf8mb3Alexander Barkov2019-06-282-2/+2
| | | |
* | | | Added s3_debug to be able to debug s3 connectionsMonty2019-06-251-0/+4
| | | |
* | | | MDEV-19710 Split the server side code in rpl_utility.cc into virtual methods ↵Alexander Barkov2019-06-071-1/+3
| | | | | | | | | | | | | | | | in Type_handler
* | | | Add new option NOT_EMBEDDED, for pluginsVladislav Vaintroub2019-05-261-1/+1
| | | | | | | | | | | | | | | | Means, plugin will not be available in embedded, even if compiled-in
* | | | MDEV-19599 Change db_name, table_name to LEX_CSTRING in Item_ident and ↵Alexander Barkov2019-05-261-7/+0
| | | | | | | | | | | | | | | | Send_field
* | | | Merge 10.4 into 10.5Marko Mäkelä2019-05-2313-13/+13
|\ \ \ \ | |/ / /
| * | | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-05-1913-13/+13
| |\ \ \ | | |/ /
| | * | Merge 10.2 into 10.3Marko Mäkelä2019-05-1413-13/+13
| | |\ \ | | | |/
| | | * Merge 10.1 into 10.2Marko Mäkelä2019-05-1313-13/+13
| | | |\
| | | | * Merge branch '5.5' into 10.1Vicențiu Ciorbaru2019-05-1111-11/+11
| | | | |\
| | | | | * Update FSF AddressVicențiu Ciorbaru2019-05-1111-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | * Update wrong zip-code
* | | | | | MDEV-19550 Move specific parts of log_event.cc to log_event_client.cc and ↵Alexander Barkov2019-05-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | log_event_server.cc
* | | | | | MDEV-17841 S3 storage engineMonty2019-05-231-0/+112
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A read-only storage engine that stores it's data in (aws) S3 To store data in S3 one could use ALTER TABLE: ALTER TABLE table_name ENGINE=S3 libmarias3 integration done by Sergei Golubchik libmarias3 created by Andrew Hutchings
* | | | | Merge 10.3 into 10.4Marko Mäkelä2019-05-051-1/+0
|\ \ \ \ \ | |/ / / /
| * | | | Cleanup session tracker redundancySergey Vojtovich2019-05-031-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - m_enabled is initialised by the base class constructor - removed unused schema_track_inited - moved Transaction_state_tracker constructor to declaration - common enable() - removed unused Session_sysvars_tracker::check_str() - classes are "private" by default - don't even try to compile for embedded Part of MDEV-14984 - regression in connect performance
* | | | | Just move, no code changes otherwise.Sergey Vojtovich2019-04-251-0/+1
| | | | | | | | | | | | | | | | | | | | Part of MDEV-7974 - backport fix for mysql bug#12161 (XA and binlog)
* | | | | MDEV-19125 Change Send_field::type from enum_field_types to Type_handler*Alexander Barkov2019-04-021-1/+1
| | | | |
* | | | | MDEV-18408 Assertion `0' failed in Item::val_native_result / ↵Alexander Barkov2019-02-251-93/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Timestamp_or_zero_datetime_native_null::Timestamp_or_zero_datetime_native_null upon mysqld_list_fields after crash recovery The problem happened because Item_ident_for_show did not implement val_native(). Solution: - Removing class Item_ident_for_show - Implementing a new method Protocol::send_list_fields() instead, which accepts a List<Field> instead of List<Item> as input. Now no any Item creation is done during mysqld_list_fields(). Adding helper methods, to reuse the code easier: - Moved a part of Protocol::send_result_set_metadata(), responsible for sending an individual field metadata, into a new method Protocol_text::store_field_metadata(). Reusing it in both send_list_fields() and send_result_set_metadata(). - Adding Protocol_text::store_field_metadata() - Adding Protocol_text::store_field_metadata_for_list_fields() Note, this patch also automatically fixed another bug: MDEV-18685 mysql_list_fields() returns DEFAULT 0 instead of DEFAULT NULL for view columns The reason for this bug was that Item_ident_for_show::val_xxx() and get_date() did not check field->is_null() before calling field->val_xxx()/get_date(). Now the default value is correctly sent by Protocol_text::store(Field*).
* | | | | Merge branch '10.4' into bb-10.4-mdev16188bb-10.4-mdev16188Sergei Golubchik2019-02-151-0/+1
|\ \ \ \ \
| * | | | | A cleanup for MDEV-13916 Enforce check constraint on JSON typeAlexander Barkov2019-02-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Renaming Type_handler_json to Type_handler_json_longtext There will be other JSON handlers soon, e.g. Type_handler_json_varchar. 2. Making the code more symmetric for data types: - Adding a new virtual method Type_handler::Column_definition_validate_check_constraint() - Moving JSON-specific code from sql_yacc.yy to Type_handler_json_longtext::Column_definition_validate_check_constraint() 3. Adding new files sql_type_json.cc and sql_type_json.h and moving Type_handler+JSON related code into these files.
* | | | | | Merge branch '10.4' into bb-10.4-mdev16188Igor Babaev2019-02-141-1/+3
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge branch '10.4' into bb-10.4-mdev17096Igor Babaev2019-02-121-0/+1
| |\ \ \ \ \
| | * | | | | MDEV-6111 Optimizer TraceVarun Gupta2019-02-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This task involves the implementation for the optimizer trace. This feature produces a trace for any SELECT/UPDATE/DELETE/, which contains information about decisions taken by the optimizer during the optimization phase (choice of table access method, various costs, transformations, etc). This feature would help to tell why some decisions were taken by the optimizer and why some were rejected. Trace is session-local, controlled by the @@optimizer_trace variable. To enable optimizer trace we need to write: set @@optimizer_trace variable= 'enabled=on'; To display the trace one can run: SELECT trace FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; This task also involves: MDEV-18489: Limit the memory used by the optimizer trace introduces a switch optimizer_trace_max_mem_size which limits the memory used by the optimizer trace. This was implemented by Sergei Petrunia.
| * | | | | | Merge branch '10.4' into bb-10.4-mdev17096Igor Babaev2019-02-064-13/+9
| |\ \ \ \ \ \ | | |/ / / / /
| * | | | | | MDEV-17096 Pushdown of simple derived tables to storage enginesIgor Babaev2019-02-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-17631 select_handler for a full query pushdown Interfaces + Proof of Concept for federatedx with test cases. The interfaces have been developed for integration of ColumnStore engine.