Commit graph

1503 commits

Author SHA1 Message Date
Alexander Barkov
da4479ef9d MDEV-26732 Assertion `0' failed in Item::val_native
add a test case
2021-10-29 18:29:02 +02:00
Alexander Barkov
6bf5a3beb3 MDEV-26785 Hyphens inside the value of uuid datatype 2021-10-29 18:29:02 +02:00
Alexander Barkov
4300f50243 MDEV-26742 Assertion `field->type_handler() == this' failed in FixedBinTypeBundle<NATIVE_LEN, MAX_CHAR_LEN>::Type_handler_fbt::stored_field_cmp_to_item
The bug was fixed in 10.5 using INET6 specific tests.

This bugs adds only UUID specific tests (no code changes).
2021-10-29 18:29:02 +02:00
Alexander Barkov
b9f19f7eae MDEV-26664 Store UUIDs in a more efficient manner
UUID values

  llllllll-mmmm-Vhhh-vsss-nnnnnnnnnnnn

are now stored as

  nnnnnnnnnnnn-vsss-Vhhh-mmmm-llllllll

inside the record:

- the groups (segments separated by dash) are reordered right-to-left.
- the bytes inside the groups are not reordered (stored as before,
  in big-endian format).

This provides a better sorting order: the earlier UUID was generated,
the higher it appears in the ORDER BY output.

Also, this change enables a good key prefix compression,
because the constant part is now in the beginning, while
the non-constant part (the timestamp) is in the end.
2021-10-29 18:29:02 +02:00
Alexander Barkov
50bcda010f Changing the FixedBinTypeBundle parameter to a "storage class" instead of sizes
- Adding a new template FixedBinTypeStorage.

- Restoring classes UUID and Inet6
  as primitive "storage classes" for their data types.
  They derive from FixedBinTypeStorage.
  These storage classes have very few server dependencies so they
  can later be easily reused in smart engines, e.g. ColumnStore.

- Changing the FixedBinTypeBundle parameter from
  <size_t NATIVE_LEN, size_t MAX_CHAR_LEN> to <class FbtImpl>
  and fixing UUID and INET6 bundles to get their storage
  classes as a parameter.
2021-10-29 18:29:02 +02:00
Sergei Golubchik
b1fab9bf4e UUID() function should return UUID, not VARCHAR(36) 2021-10-29 18:29:02 +02:00
Alexander Barkov
7ab11f2bda MDEV-4958 Adding datatype UUID 2021-10-29 18:29:01 +02:00
Sergei Golubchik
bdaa7fac89 cleanup: move most of type_inet plugin implementation into the server
factor out the the common code for all plugin types that have a
fixed-length native binary representation and a possibly variable-length
string representation.
2021-10-29 18:29:01 +02:00
Marko Mäkelä
d7af7bfc2b Merge 10.6 into 10.7 2021-10-28 09:14:51 +03:00
Marko Mäkelä
d8c6c53a06 Merge 10.5 into 10.6 2021-10-28 09:08:58 +03:00
Marko Mäkelä
a8ded39557 Merge 10.4 into 10.5 2021-10-28 08:48:36 +03:00
Marko Mäkelä
3a79e5fd31 Merge 10.3 into 10.4 2021-10-28 08:28:39 +03:00
Marko Mäkelä
657bcf928e Merge 10.2 into 10.3 2021-10-28 07:50:05 +03:00
Kartik Soneji
bf8b699f64 MDEV-12933 sort out the compression library chaos
bzip2/lz4/lzma/lzo/snappy compression is now provided via *services*

they're almost like normal services, but in include/providers/
and they're supposed to provide exactly the same interface
as original compression libraries (but not everything,
only enough of if for the code to compile).

the services are implemented via dummy functions that return
corresponding error values (LZMA_PROG_ERROR, LZO_E_INTERNAL_ERROR, etc).

the actual compression libraries are linked into corresponding
provider plugins. Providers are daemon plugins that when loaded
replace service pointers to point to actual compression functions.

That is, run-time dependency on compression libraries is now on plugins,
and the server doesn't need any compression libraries to run, but
will automatically support the compression when a plugin is loaded.

InnoDB and Mroonga use compression plugins now. RocksDB doesn't,
because it comes with standalone utility binaries that cannot
load plugins.
2021-10-27 15:55:14 +02:00
Marko Mäkelä
da46c37bc7 Merge 10.6 into 10.7 2021-10-27 10:24:08 +03:00
Marko Mäkelä
d4a89b9262 Merge 10.5 into 10.6 2021-10-27 10:06:02 +03:00
Aleksey Midenkov
d324c03d0c Vanilla cleanups and refactorings
Dead code cleanup:

part_info->num_parts usage was wrong and working incorrectly in
mysql_drop_partitions() because num_parts is already updated in
prep_alter_part_table(). We don't have to update part_info->partitions
because part_info is destroyed at alter_partition_lock_handling().

Cleanups:

- DBUG_EVALUATE_IF() macro replaced by shorter form DBUG_IF();
- Typo in ER_KEY_COLUMN_DOES_NOT_EXITS.

Refactorings:

- Splitted write_log_replace_delete_frm() into write_log_delete_frm()
  and write_log_replace_frm();
- partition_info via DDL_LOG_STATE;
- set_part_info_exec_log_entry() removed.

DBUG_EVALUATE removed

DBUG_EVALUTATE was only added for consistency together with
DBUG_EVALUATE_IF. It is not used anywhere in the code.

DBUG_SUICIDE() fix on release build

On release DBUG_SUICIDE() was statement. It was wrong as
DBUG_SUICIDE() is used in expression context.
2021-10-26 17:07:46 +02:00
Alexander Barkov
49098bfd49 MDEV-26732 Assertion `0' failed in Item::val_native
Also fixes MDEV-24619 Wrong result or Assertion `0' in Item::val_native / Type_handler_inet6::Item_val_native_with_conversion

Type_handler_inet6::create_item_copy() created a generic Item_copy_string,
which does not implement val_native() - it has a dummy implementation
with DBUG_ASSERT(0), which made the server crash.

Fix:

- Adding a new class Type_handler_inet6
  which implements val_native().
- Fixing Type_handler_inet6::create_item_copy()
  to make Item_copy_inet6 instead of Item_copy_string.
2021-10-26 18:04:17 +04:00
Alexey Botchkov
d627d00b13 MDEV-26556 An improper locking bug(s) due to unreleased lock.
Get rid of the global big_buffer.
2021-10-25 19:53:25 +04:00
Marko Mäkelä
71d4ecf182 Merge 10.6 into 10.7 2021-10-22 14:41:47 +03:00
Oleksandr Byelkin
45a376dd2d MDEV-26647 (reuse info) Include password validation plugin information in the error message if the SQL statement is not satisfied password policy
send information about password reusing
2021-10-20 12:02:52 +02:00
Sergei Golubchik
a1b0997d03 windows 2021-10-19 17:35:06 +02:00
Oleksandr Byelkin
bc82b6c03b MDEV-9245 password "reuse prevention" validation plugin 2021-10-19 17:35:06 +02:00
Oleksandr Byelkin
9d1a8665cb Pre requiste MDEV-9245: add host to validate password interface
Hostname added to the interface.

Cracklib plugin fixed according to the new interface.
2021-10-19 17:35:06 +02:00
Sergei Golubchik
26c1311c39 compilation failures on Windows 2021-10-19 17:35:06 +02:00
Alexey Botchkov
585d88a237 MDEV-19275 SQL service for plugins.
review fixes.
2021-10-19 17:35:06 +02:00
Alexey Botchkov
e1f9a80900 MDEV-19275 SQL service for plugins.
host/user/db arguments of the mysql_real_connect_local() are removed.
2021-10-19 17:35:06 +02:00
Sergei Golubchik
74daa97adf a plugin shouldn't need any other includes besised plugin_xxx.h 2021-10-19 17:35:06 +02:00
Sergei Golubchik
a786c0208e remove MYSQL_SERVER requirement 2021-10-19 17:35:06 +02:00
Alexey Botchkov
0a0dfd63d9 MDEV-19275 Provide SQL service to plugins.
SQL service added.
It provides the limited set of client library functions
to be used by plugin.
2021-10-19 17:35:06 +02:00
Marko Mäkelä
9c5835e067 Merge 10.5 into 10.6 2021-10-18 16:36:24 +03:00
Alexander Barkov
df38304342 MDEV-26742 Assertion `field->type_handler() == this' failed in FixedBinTypeBundle<NATIVE_LEN, MAX_CHAR_LEN>::Type_handler_fbt::stored_field_cmp_to_item 2021-10-14 08:37:23 +04:00
Oleksandr Byelkin
8f7edb784f MDEV-26637: (variables) ASAN: main.metadata and user_variables.basic MTR failures after MDEV-26572
Prohibit user variables without name
2021-10-12 10:16:07 +02:00
Marko Mäkelä
a49e394399 Merge 10.5 into 10.6 2021-09-30 10:38:44 +03:00
Marko Mäkelä
064cb58efe Merge 10.4 into 10.5
FIXME: Part of the MDEV-20699 test is disabled due to
nonderterministic result.
2021-09-30 09:04:43 +03:00
Marko Mäkelä
a10b63bf58 Merge 10.3 into 10.4 2021-09-29 16:03:02 +03:00
Marko Mäkelä
742b37a345 Merge 10.2 into 10.3 2021-09-29 15:04:20 +03:00
Oleksandr Byelkin
3690c549c6 MDEV-24454 Crash at change_item_tree
Use in_sum_func (and so nest_level) only in LEX to which SELECT lex belong to

Reduce usage of current_select (because it does not always point on the correct
 SELECT_LEX, for example with prepare.

Change context for all classes inherited from Item_ident (was only for Item_field) in case of pushing down it to HAVING.

Now name resolution context have to have SELECT_LEX reference if the context is present.

Fixed feedback plugin stack usage.
2021-09-27 11:00:51 +02:00
Marko Mäkelä
03c09837fc Merge 10.5 into 10.6 2021-09-16 20:17:12 +03:00
Monty
b4f24c745a Merge branch '10.4' into 10.5
Fixed also an error in suite/perfschema/t/transaction_nested_events-master.opt
2021-09-15 20:23:07 +03:00
Marko Mäkelä
15139964d5 Merge 10.5 into 10.6 2021-09-11 17:55:27 +03:00
Vladislav Vaintroub
54f79a0f7f Early return from auth_socket system checks on Windows
No need to run through all system checks, we already know
it is not possible to authenticate with AF_UNIX socket.
2021-09-11 01:33:29 +02:00
Vicențiu Ciorbaru
7c33ecb665 Merge remote-tracking branch 'upstream/10.4' into 10.5 2021-09-10 17:16:18 +03:00
Sergei Golubchik
865e5b6405 MDEV-26487 cpack rpm failed to build packages with cmake < 3.7.0
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
2021-08-31 09:21:08 +02:00
Marko Mäkelä
cc4e20e56f Merge 10.5 into 10.6 2021-08-26 10:20:17 +03:00
Marko Mäkelä
87ff4ba7c8 Merge 10.4 into 10.5 2021-08-26 08:46:57 +03:00
Sergei Golubchik
dc6bc85cd2 MDEV-26380 auth_pam_tool has incorrect permissions on CentOS 7
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.
2021-08-25 22:28:55 +02:00
Marko Mäkelä
49f95c4065 Merge 10.5 into 10.6 2021-08-23 11:21:33 +03:00
Alexey Bychko
c9d57c006a MDEV-26380 auth_pam_tool has incorrect permissions on CentOS 7
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.
2021-08-19 19:47:38 +07:00
nia
7308e009c9 auth_socket: Add SO_PEERCRED definitions for NetBSD
A getsockopt level of 0 is requied on NetBSD when using
Unix-domain socket LOCAL_* options, SOL_SOCKET will not
work.
2021-08-05 17:51:51 +10:00