summaryrefslogtreecommitdiff
path: root/plugin
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.5 into 10.6Marko Mäkelä2021-09-162-0/+5
|\
| * Merge branch '10.4' into 10.5Monty2021-09-152-0/+5
| |\ | | | | | | | | | Fixed also an error in suite/perfschema/t/transaction_nested_events-master.opt
* | \ Merge 10.5 into 10.6Marko Mäkelä2021-09-111-2/+2
|\ \ \ | |/ /
| * | Merge remote-tracking branch 'upstream/10.4' into 10.5Vicențiu Ciorbaru2021-09-101-2/+2
| |\ \ | | |/
| | * MDEV-26487 cpack rpm failed to build packages with cmake < 3.7.0Sergei Golubchik2021-08-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | buggy regexp in old CPackRPM.cmake: string(REGEX REPLACE "%[A-Za-z0-9\(\),-]* " "" F_PATH ${F}) string(REGEX MATCH "%[A-Za-z0-9\(\),-]*" F_PREFIX ${F}) it treats everything after the first space as a path
* | | Early return from auth_socket system checks on WindowsVladislav Vaintroub2021-09-111-0/+4
| | | | | | | | | | | | | | | No need to run through all system checks, we already know it is not possible to authenticate with AF_UNIX socket.
* | | Merge 10.5 into 10.6Marko Mäkelä2021-08-261-9/+5
|\ \ \ | |/ /
| * | Merge 10.4 into 10.5Marko Mäkelä2021-08-261-9/+5
| |\ \ | | |/
| | * MDEV-26380 auth_pam_tool has incorrect permissions on CentOS 7Sergei Golubchik2021-08-251-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | Buggy sepdebugcrcfix in CentOS 7 (rpm-4.11.3) does not restore SUID bit after editing the binary. This is fixed in rpm-4.12. Still let's not set SUID bit when installing auth_pam_tool and use rpm spec %attr directive instead.
* | | Merge 10.5 into 10.6Marko Mäkelä2021-08-231-0/+3
|\ \ \ | |/ /
| * | MDEV-26380 auth_pam_tool has incorrect permissions on CentOS 7Alexey Bychko2021-08-191-0/+3
| | | | | | | | | | | | | | | | | | | | | splitted permission setting to the 2 separate calls. according to execute_process() doc, output from first command will be piped to second which led to race and randomly lost suid bit from auth_pam_tool.
* | | auth_socket: Add SO_PEERCRED definitions for NetBSDnia2021-08-052-0/+23
| | | | | | | | | | | | | | | | | | A getsockopt level of 0 is requied on NetBSD when using Unix-domain socket LOCAL_* options, SOL_SOCKET will not work.
* | | Merge branch '10.5' into 10.6Oleksandr Byelkin2021-08-025-3/+7
|\ \ \ | |/ /
| * | Merge branch '10.4' into 10.5Oleksandr Byelkin2021-07-313-1/+5
| |\ \ | | |/
| | * Merge branch '10.3' into 10.4Oleksandr Byelkin2021-07-313-1/+5
| | |\
| | | * Merge 10.2 into 10.3Marko Mäkelä2021-07-223-2/+9
| | | |\
| | | | * Add feature summary at the end of cmake.Heinz Wiesinger2021-07-213-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This gives a short overview over found/missing dependencies as well as enabled/disabled features. Initial author Heinz Wiesinger <heinz@m2mobi.com> Additions by Vicențiu Ciorbaru <vicentiu@mariadb.org> * Report all plugins enabled via MYSQL_ADD_PLUGIN * Simplify code. Eliminate duplication by making use of WITH_xxx variable values to set feature "ON" / "OFF" state. Reviewed by: wlad@mariadb.com (code details) serg@mariadb.com (the idea)
| * | | | MDEV-26226 Change Maturity of plugins inet6 and s3 to stableSergei Golubchik2021-07-282-2/+2
| | | | | | | | | | | | | | | | | | | | from gamma
* | | | | cleanup: formattingSergei Golubchik2021-06-111-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | also avoid an oxymoron of using `MYSQL_PLUGIN_IMPORT` under `#ifdef MYSQL_SERVER`, and empty_clex_str is so trivial that a plugin can define it if needed.
* | | | | MDEV-25602 get rid of __WIN__ in favor of standard _WIN32Vladislav Vaintroub2021-06-062-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixed the MySQL bug# 20338 about misuse of double underscore prefix __WIN__, which was old MySQL's idea of identifying Windows Replace it by _WIN32 standard symbol for targeting Windows OS (both 32 and 64 bit) Not that connect storage engine is not fixed in this patch (must be fixed in "upstream" branch)
* | | | | Merge 10.5 into 10.6Marko Mäkelä2021-05-261-3/+3
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.4 into 10.5Marko Mäkelä2021-05-261-3/+3
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.3 into 10.4Marko Mäkelä2021-05-251-3/+3
| | |\ \ \ | | | |/ /
| | | * | Merge 10.2 into 10.3Marko Mäkelä2021-05-241-4/+4
| | | |\ \ | | | | |/
| | | | * MDEV-25641 max_password_errors not working with ed25519 auth pluginSergei Golubchik2021-05-221-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | report correct error codes in ed25519. Invalid value stored in the user table or an OpenSSL error is CR_ERROR. When a user provided incorrect password when logging in - it's CR_AUTH_USER_CREDENTIALS.
* | | | | Change CHARSET_INFO character set and collaction names to LEX_CSTRINGMonty2021-05-192-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change removed 68 explict strlen() calls from the code. The following renames was done to ensure we don't use the old names when merging code from earlier releases, as using the new variables for print function could result in crashes: - charset->csname renamed to charset->cs_name - charset->name renamed to charset->coll_name Almost everything where mechanical changes except: - Changed to use the new Protocol::store(LEX_CSTRING..) when possible - Changed to use field->store(LEX_CSTRING*, CHARSET_INFO*) when possible - Changed to use String->append(LEX_CSTRING&) when possible Other things: - There where compiler issues with ensuring that all character set names points to the same string: gcc doesn't allow one to use integer constants when defining global structures (constant char * pointers works fine). To get around this, I declared defines for each character set name length.
* | | | | Added override to all releveant methods in Item (and a few other classes)Monty2021-05-192-25/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Other things: - Remove inline and virtual for methods that are overrides - Added a 'final' to some Item classes
* | | | | Reduce usage of strlen()Monty2021-05-196-37/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes: - To detect automatic strlen() I removed the methods in String that uses 'const char *' without a length: - String::append(const char*) - Binary_string(const char *str) - String(const char *str, CHARSET_INFO *cs) - append_for_single_quote(const char *) All usage of append(const char*) is changed to either use String::append(char), String::append(const char*, size_t length) or String::append(LEX_CSTRING) - Added STRING_WITH_LEN() around constant string arguments to String::append() - Added overflow argument to escape_string_for_mysql() and escape_quotes_for_mysql() instead of returning (size_t) -1 on overflow. This was needed as most usage of the above functions never tested the result for -1 and would have given wrong results or crashes in case of overflows. - Added Item_func_or_sum::func_name_cstring(), which returns LEX_CSTRING. Changed all Item_func::func_name()'s to func_name_cstring()'s. The old Item_func_or_sum::func_name() is now an inline function that returns func_name_cstring().str. - Changed Item::mode_name() and Item::func_name_ext() to return LEX_CSTRING. - Changed for some functions the name argument from const char * to to const LEX_CSTRING &: - Item::Item_func_fix_attributes() - Item::check_type_...() - Type_std_attributes::agg_item_collations() - Type_std_attributes::agg_item_set_converter() - Type_std_attributes::agg_arg_charsets...() - Type_handler_hybrid_field_type::aggregate_for_result() - Type_handler_geometry::check_type_geom_or_binary() - Type_handler::Item_func_or_sum_illegal_param() - Predicant_to_list_comparator::add_value_skip_null() - Predicant_to_list_comparator::add_value() - cmp_item_row::prepare_comparators() - cmp_item_row::aggregate_row_elements_for_comparison() - Cursor_ref::print_func() - Removes String_space() as it was only used in one cases and that could be simplified to not use String_space(), thanks to the fixed my_vsnprintf(). - Added some const LEX_CSTRING's for common strings: - NULL_clex_str, DATA_clex_str, INDEX_clex_str. - Changed primary_key_name to a LEX_CSTRING - Renamed String::set_quick() to String::set_buffer_if_not_allocated() to clarify what the function really does. - Rename of protocol function: bool store(const char *from, CHARSET_INFO *cs) to bool store_string_or_null(const char *from, CHARSET_INFO *cs). This was done to both clarify the difference between this 'store' function and also to make it easier to find unoptimal usage of store() calls. - Added Protocol::store(const LEX_CSTRING*, CHARSET_INFO*) - Changed some 'const char*' arrays to instead be of type LEX_CSTRING. - class Item_func_units now used LEX_CSTRING for name. Other things: - Fixed a bug in mysql.cc:construct_prompt() where a wrong escape character in the prompt would cause some part of the prompt to be duplicated. - Fixed a lot of instances where the length of the argument to append is known or easily obtain but was not used. - Removed some not needed 'virtual' definition for functions that was inherited from the parent. I added override to these. - Fixed Ordered_key::print() to preallocate needed buffer. Old code could case memory overruns. - Simplified some loops when adding char * to a String with delimiters.
* | | | | Split item->flags into base_flags and with_flagsMonty2021-05-193-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was done to simplify copying of with_* flags Other things: - Changed Flags to C++ enums, which enables gdb to print out bit values for the flags. This also enables compiler errors if one tries to manipulate a non existing bit in a variable. - Added set_maybe_null() as a shortcut as setting the MAYBE_NULL flags was used in a LOT of places. - Renamed PARAM flag to SP_VAR to ensure it's not confused with persistent statement parameters.
* | | | | Remove calls to current_thd() in Item functionsMichael Widenius2021-05-192-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added THD argument to functions that calls current_thd() or new without a mem_root argument: make_same(), set_comparator_func(), set_cmp_func(), set_cmp_func*(), set_aggregator() and prepare_sum_aggregators() - Changed "new Class" to "new (thd->mem_root) Class" Almost all changes mechanical, no logic changes.
* | | | | Change bitfields in Item to an uint16Michael Widenius2021-05-194-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The reason for the change is that neither clang or gcc can do efficient code when several bit fields are change at the same time or when copying one or more bits between identical bit fields. Updated bits explicitely with & and | is MUCH more efficient than what current compilers can do.
* | | | | Renamed Type_all_attributes::set_maybe_null() to set_type_maybe_null()Monty2021-05-191-1/+1
| | | | | | | | | | | | | | | | | | | | This was done to have Item::set_maybe_null() as an inline function
* | | | | Added typedef decimal_digits_t (uint16) for number of digits in mostMonty2021-05-191-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | aspects of decimals and integers For fields and Item's uint8 should be good enough. After discussions with Alexander Barkov we choose uint16 (for now) as some format functions may accept +256 digits. The reason for this patch was to make the usage and storage of decimal digits simlar. Before this patch decimals was stored/used as uint8, int and uint. The lengths for numbers where also using a lot of different types. Changed most decimal variables and functions to use the new typedef. squash! af7f09106b6c1dc20ae8c480bff6fd22d266b184 Use decimal_digits_t for all aspects of digits (total, precision and scale), both for decimals and integers.
* | | | | MDEV-8334: Rename utf8 to utf8mb3Rucha Deodhar2021-05-195-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the main name of 3 byte character set from utf8 to utf8mb3. New old_mode UTF8_IS_UTF8MB3 is added and set TRUE by default, so that utf8 would mean utf8mb3. If not set, utf8 would mean utf8mb4.
* | | | | Merge 10.5 into 10.6Marko Mäkelä2021-05-071-0/+1
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch bb-10.4-release into bb-10.5-releasemariadb-10.5.10Nikita Malyavin2021-05-051-0/+1
| |\ \ \ \ | | |/ / /
| | * | | Merge branch bb-10.3-release into bb-10.4-releaseNikita Malyavin2021-05-051-0/+1
| | |\ \ \ | | | |/ /
| | | * | MDEV-20842 Crash using versioning plugin functions after plugin was removed ↵Aleksey Midenkov2021-04-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from server Remove plugin functions via item_create_remove() at deinit time.
* | | | | Merge 10.5 into 10.6Marko Mäkelä2021-04-211-0/+4
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.4 into 10.5Marko Mäkelä2021-04-211-0/+4
| |\ \ \ \ | | |/ / /
| | * | | Fix all warnings given by UBSANMonty2021-04-201-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The easiest way to compile and test the server with UBSAN is to run: ./BUILD/compile-pentium64-ubsan and then run mysql-test-run. After this commit, one should be able to run this without any UBSAN warnings. There is still a few compiler warnings that should be fixed at some point, but these do not expose any real bugs. The 'special' cases where we disable, suppress or circumvent UBSAN are: - ref10 source (as here we intentionally do some shifts that UBSAN complains about. - x86 version of optimized int#korr() methods. UBSAN do not like unaligned memory access of integers. Fixed by using byte_order_generic.h when compiling with UBSAN - We use smaller thread stack with ASAN and UBSAN, which forced me to disable a few tests that prints the thread stack size. - Verifying class types does not work for shared libraries. I added suppression in mysql-test-run.pl for this case. - Added '#ifdef WITH_UBSAN' when using integer arithmetic where it is safe to have overflows (two cases, in item_func.cc). Things fixed: - Don't left shift signed values (byte_order_generic.h, mysqltest.c, item_sum.cc and many more) - Don't assign not non existing values to enum variables. - Ensure that bool and enum values are properly initialized in constructors. This was needed as UBSAN checks that these types has correct values when one copies an object. (gcalc_tools.h, ha_partition.cc, item_sum.cc, partition_element.h ...) - Ensure we do not called handler functions on unallocated objects or deleted objects. (events.cc, sql_acl.cc). - Fixed bugs in Item_sp::Item_sp() where we did not call constructor on Query_arena object. - Fixed several cast of objects to an incompatible class! (Item.cc, Item_buff.cc, item_timefunc.cc, opt_subselect.cc, sql_acl.cc, sql_select.cc ...) - Ensure we do not do integer arithmetic that causes over or underflows. This includes also ++ and -- of integers. (Item_func.cc, Item_strfunc.cc, item_timefunc.cc, sql_base.cc ...) - Added JSON_VALUE_UNITIALIZED to json_value_types and ensure that value_type is initialized to this instead of to -1, which is not a valid enum value for json_value_types. - Ensure we do not call memcpy() when second argument could be null. - Fixed that Item_func_str::make_empty_result() creates an empty string instead of a null string (safer as it ensures we do not do arithmetic on null strings). Other things: - Changed struct st_position to an OBJECT and added an initialization function to it to ensure that we do not copy or use uninitialized members. The change to a class was also motived that we used "struct st_position" and POSITION randomly trough the code which was confusing. - Notably big rewrite in sql_acl.cc to avoid using deleted objects. - Changed in sql_partition to use '^' instead of '-'. This is safe as the operator is either 0 or 0x8000000000000000ULL. - Added check for select_nr < INT_MAX in JOIN::build_explain() to avoid bug when get_select() could return NULL. - Reordered elements in POSITION for better alignment. - Changed sql_test.cc::print_plan() to use pointers instead of objects. - Fixed bug in find_set() where could could execute '1 << -1'. - Added variable have_sanitizer, used by mtr. (This variable was before only in 10.5 and up). It can now have one of two values: ASAN or UBSAN. - Moved ~Archive_share() from ha_archive.cc to ha_archive.h and marked it virtual. This was an effort to get UBSAN to work with loaded storage engines. I kept the change as the new place is better. - Added in CONNECT engine COLBLK::SetName(), to get around a wrong cast in tabutil.cpp. - Added HAVE_REPLICATION around usage of rgi_slave, to get embedded server to compile with UBSAN. (Patch from Marko). - Added #ifdef for powerpc64 to avoid a bug in old gcc versions related to integer arithmetic. Changes that should not be needed but had to be done to suppress warnings from UBSAN: - Added static_cast<<uint16_t>> around shift to get rid of a LOT of compiler warnings when using UBSAN. - Had to change some '/' of 2 base integers to shift to get rid of some compile time warnings. Reviewed by: - Json changes: Alexey Botchkov - Charset changes in ctype-uca.c: Alexander Barkov - InnoDB changes & Embedded server: Marko Mäkelä - sql_acl.cc changes: Vicențiu Ciorbaru - build_explain() changes: Sergey Petrunia
* | | | | MDEV-24312 master_host has 60 character limit, increase to 255 bytesbb-10.6-MDEV-24312Oleksandr Byelkin2021-04-201-16/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also increase user name up to 128. The work was started by Rucha Deodhar <rucha.deodhar@mariadb.com>, contains audit plugin fixes by Alexey Botchkov <holyfoot@askmonty.org>.
* | | | | Merge 10.5 into 10.6Marko Mäkelä2021-04-141-1/+1
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.4 into 10.5Marko Mäkelä2021-04-141-1/+1
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.3 into 10.4Marko Mäkelä2021-04-141-1/+1
| | |\ \ \ | | | |/ /
| | | * | Merge 10.2 into 10.3Marko Mäkelä2021-04-091-1/+1
| | | |\ \ | | | | |/
| | | | * MDEV-25242 Server crashes in check_grant upon invoking function with ↵Sergei Golubchik2021-04-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | userstat enabled also fix index_stats table. followup for 5a798071199
| | | | * MDEV-25457 CREATE / DROP PROCEDURE not logged with audit plugin.Alexey Botchkov2021-03-291-5/+1
| | | | | | | | | | | | | | | | | | | | CREATE/DROP PROCEDIRE/FUNCTION is now treated as DDL.
* | | | | Merge 10.5 into 10.6Marko Mäkelä2021-04-081-5/+7
|\ \ \ \ \ | |/ / / /
| * | | | MDEV-22775: Merge 10.4 into 10.5Marko Mäkelä2021-04-081-5/+7
| |\ \ \ \ | | |/ / /