Commit graph

1151 commits

Author SHA1 Message Date
Vicențiu Ciorbaru
8b2800d076 Fix decimals to 0 for MySQL JSON
This prevents the clash between NOT_FIXED_DEC differing between server
and plugins if MYSQL_SERVER is not defined during plugin compilation.
2020-10-29 15:01:33 +02:00
Vicențiu Ciorbaru
76fabe816f Expose utf8mb4_bin charset for plugins
Cleanup other linker errors
2020-10-29 15:01:33 +02:00
Marko Mäkelä
e33d452b4d Fix bogus -Wmaybe-uninitialized in GCC 10.2.0 -Og
If and only if read_variable_length() returns true, the variable
blob_length will be uninitialized and not used. For some reason,
GCC 10.2.0 -Og debug builds would issue a warning.
2020-10-29 08:16:44 +02:00
Vicențiu Ciorbaru
f6549e9544 MDEV-18323 Convert MySQL JSON type to MariaDB TEXT in mysql_upgrade
This patch solves two key problems.
1. There is a type number clash between MySQL and MariaDB. The number
   245, used for MariaDB Virtual Fields is the same as MySQL's JSON.
   This leads to corrupt FRM errors if unhandled. The code properly
   checks frm table version number and if it matches 5.7+ (until 10.0+)
   it will assume it is dealing with a MySQL table with the JSON
   datatype.
2. MySQL JSON datatype uses a proprietary format to pack JSON data. The
   patch introduces a datatype plugin which parses the format and convers
   it to its string representation.

The intended conversion path is to only use the JSON datatype within
ALTER TABLE <table> FORCE, to force a table recreate. This happens
during mysql_upgrade or via a direct ALTER TABLE <table> FORCE.
2020-10-28 11:38:14 +02:00
Sergei Golubchik
2cec0523eb INET6 type plugin -> Beta 2020-10-27 16:45:35 +01:00
Marko Mäkelä
1657b7a583 Merge 10.4 to 10.5 2020-10-22 17:08:49 +03:00
Dmitry Shulga
77c00799e5 MDEV-23935: Fix warnings generated during compilation of plugin/auth_pam/testing/pam_mariadb_mtr.c on MacOS
During build server 10.4 on MacOS warnings like the following one
are generated on compiling the file plugin/auth_pam/testing/pam_mariadb_mtr.c

server-10.4/plugin/auth_pam/testing/pam_mariadb_mtr.c:25:22: error:
initializing 'char *' with an expression of type 'const char [23]'
discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
{ PAM_TEXT_INFO, "Challenge input first." }

The reason of the warnings is that the data member pam_message::msg is declared
as 'char *' on MacOS but initializer of the data member is 'const char *'.

To eliminate warnings the compiler option
  -Wno-incompatible-pointer-types-discards-qualifiers
has been added to the compiler flags used for compiling the file
pam_mariadb_mtr.c.
2020-10-22 10:14:17 +07:00
Alexey Botchkov
0ccdf8b11b MDEV-19275 Provide SQL service to plugins.
test_sql_service plugin added and employed in test_sql_service.test.
2020-10-02 10:19:00 +04:00
Erol Guven
5f2728d594 Define variable to override endpoint url 2020-09-11 02:45:44 +02:00
Marko Mäkelä
cf87f3e08c Merge 10.4 into 10.5 2020-08-14 11:33:35 +03:00
Marko Mäkelä
2f7b37b021 Merge 10.3 into 10.4, except MDEV-22543
Also, fix GCC -Og -Wmaybe-uninitialized in run_backup_stage()
2020-08-13 18:48:41 +03:00
Marko Mäkelä
4bd56a697f Merge 10.2 into 10.3 2020-08-13 18:18:25 +03:00
Anel Husakovic
863e28ff3e MDEV-22066: out-of-source build fails with WITHOUT_SERVER=ON
Patch 4aaa38d26e is replacing `my_config.h` with
`my_global.h` which is included in in-source build, but not for
out-of-source build tree.

Closes #1466
2020-08-11 15:31:01 +02:00
Marko Mäkelä
31aef3ae99 Fix GCC 10.2.0 -Og -Wmaybe-uninitialized
For some reason, GCC emits more -Wmaybe-uninitialized warnings
when using the flag -Og than when using -O2. Many of the warnings
look genuine.
2020-08-11 15:58:16 +03:00
Alexander Barkov
6a7e646df3 MDEV-23054 Assertion `!item->null_value' failed in Type_handler_inet6::make_sort_key_part (#2)
IFNULL(inet6_not_null_expr, 'foo') erroneously set its nullability to NOT NULL.

Fix:
- Moving the line "maybe_null= args[1]->maybe_null" before the call
  of fix_length_and_dec2(), so the call of Type_handler method
  Item_hybrid_func_fix_attributes() can reset it when desired.

- Fixing Type_handler_inet6::Item_hybrid_func_fix_attributes()
  to ignore args[0] when detecting nullability of IFNULL().
2020-08-11 12:35:19 +04:00
Sergei Golubchik
28e714b5f6 change buitin plugin types from Alpha to Stable as needed
for the functionality that was part of the server for years
and is moved in 10.5 into a [statically linked] plugin
without changing the underlying code.
2020-08-07 13:36:11 +02:00
Marko Mäkelä
50a11f396a Merge 10.4 into 10.5 2020-08-01 14:42:51 +03:00
Sergei Golubchik
a773d93267 MDEV-19603 MariaDB 10.4 does not build on OpenBSD due to the use of libdl 2020-07-31 11:10:41 +02:00
Marko Mäkelä
af27f17ea1 Merge 10.4 into 10.5 2020-07-13 17:05:13 +03:00
Alexey Botchkov
873eb4a397 MDEV-21385 PAM v2 plugin produces lots of zombie processes.
The auth_pam_tool that is executed from pam_auth() can be still
not finished by the time we do the waitpid() there.
As we use WNOHANG option for the waitpid(), it didn't wait and
left the zombie process. So let's do the loop of waitpid() with the
limited number of sleeps.
2020-07-10 22:48:35 +04:00
Sergei Golubchik
4876651e0f remove mysql_declare_plugin declaration from some plugins 2020-07-04 01:44:47 +02:00
Marko Mäkelä
1813d92d0c Merge 10.4 into 10.5 2020-07-02 09:41:44 +03:00
Marko Mäkelä
f347b3e0e6 Merge 10.3 into 10.4 2020-07-02 07:39:33 +03:00
Marko Mäkelä
1df1a63924 Merge 10.2 into 10.3 2020-07-02 06:17:51 +03:00
Marko Mäkelä
ea2bc974dc Merge 10.1 into 10.2 2020-07-01 12:03:55 +03:00
Daniel Black
37c88445e3 mtr: use env for perl
On FreeBSD, perl isn't in /usr/bin, its in /usr/local/bin or
elsewhere in the path.

Like storage/{maria/unittest/,}ma_test_* , we use /usr/bin/env to
find perl and run it.
2020-06-23 03:24:46 +02:00
Vicențiu Ciorbaru
93cee30309 Check for krb5_xfree instead of krb5_free_unparsed_name
Use krb5_xfree if available, otherwise default to
krb5_free_unparsed_name.
2020-06-15 16:01:41 +03:00
Marko Mäkelä
805340936a Merge 10.3 into 10.4 2020-06-13 19:01:28 +03:00
Marko Mäkelä
d83a443250 Merge 10.2 into 10.3 2020-06-13 15:11:43 +03:00
Vicențiu Ciorbaru
8ec21afc8e MDEV-22834: Disks plugin - change datatype to bigint
On large hard disks (> 2TB), the plugin won't function correctly, always
showing 2 TB of available space due to integer overflow. Upgrade table
fields to bigint to resolve this problem.
2020-06-12 11:34:45 +03:00
Vicențiu Ciorbaru
8c67ffffe8 Merge branch '10.1' into 10.2 2020-06-11 22:35:30 +03:00
Vicențiu Ciorbaru
ae3a7d5e43 MDEV-22834: Disks plugin - change datatype to bigint
On large hard disks (> 2TB), the plugin won't function correctly, always
showing 2 TB of available space due to integer overflow. Upgrade table
fields to bigint to resolve this problem.
2020-06-10 19:29:25 +03:00
Alexander Barkov
76cb2f9dd6 MDEV-21765 Possibly inconsistent behavior of BIT_xx functions with INET6 field
Disallow BIT_AND(), BIT_OR(), BIT_XOR() for data types GEOMETRY and INET6,
as they cannot return any useful integer values.
2020-06-09 12:54:04 +04:00
Sergei Golubchik
4adc1269cc FreeBSD compilation fixes
* FreeBSD calls amd64 what Linux calls x86_64
* signal returns void (*)(int)
* struct pam_message has char*, not const char*
* krb5_free_unparsed_name exists, but is deprecated
2020-06-04 23:52:46 +02:00
Alexander Barkov
839ad5e132 MDEV-22758 Assertion `!item->null_value' failed in Type_handler_inet6::make_sort_key_part
When some expression of an INET6 data type involves conversion to INET6 from
other data types, e.g. in:

- CAST:

    SELECT CAST(non_inet6_expr AS INET6)

- CASE and hybrid functions:

    SELECT CASE WHEN expr THEN inet6_expr ELSE non_inet6_expr END

- UNION:

    SELECT inet6_expr UNION SELECT non_inet6_expr

the result column must be fixed as NULL-able even if the non-inet6 expression itself
is not NULL-able, because at the execution time the conversion can fail.

Details:
- Forcing NULL-ability if conversion from some data type to INET6 is involved
  (for non-constant or for expensive expressions).
- Non-expensive constant expressions are tested for NULL-ability at fix_fields() time,
  so things like `CAST('::' AS INET6)` are still detected as NOT NULL.
- Adding "bool warn" parameter into a few methods, to avoid redundant warnings
  at fix_fields() time when calculating NULL-ability of constant values.
2020-06-03 18:30:12 +04:00
Varun Gupta
d5e8b4d7f9 MDEV-22509: Server crashes in Field_inet6::store_inet6_null_with_warn / Field::maybe_null
For field with type INET, during EITS collection the min and max values are store in text
representation in the statistical table.
While retrieving the value from the statistical table, the value is stored back in the original
field using binary form instead of text and this was resulting in the crash.

Introduced 2 functions in the Field structure:
  1) store_to_statistical_minmax_field
  2) store_from_statistical_minmax_field
2020-06-02 17:43:45 +05:30
Alexander Barkov
33b839b2e7 MDEV-20280 PERCENTILE_DISC() rejects temporal and string input 2020-06-01 14:30:21 +04:00
Alexander Barkov
f22093ad39 MDEV-22764 Crash with a stored aggregate function returning INET6
Item_sum_sp did not override val_native(). So the reported script
crashed in the default implementation in Item::val_native() on DBUG_ASSERT().

Implementing a correct Item_sum_sp::val_native().
2020-06-01 14:02:31 +04:00
Alexander Barkov
35cbbd4d70 MDEV-20809 EXTRACT from INET6 value does not produce any warnings
Disallowing EXTRACT(xxx FROM inet6arg) as fix time.
Adding a new method Type_handler::can_return_extract_source().
2020-06-01 10:35:01 +04:00
Marko Mäkelä
4a0b56f604 Merge 10.4 into 10.5 2020-05-31 10:28:59 +03:00
Monty
c4bf4b7aef Fixed access to undefined memory found by valgrind and MSAN
When my_vsnprintf() is patched, the code protected disabled with
'WAITING_FOR_BUGFIX_TO_VSPRINTF' should be enabled again. Also all %b
formats in this patch should be revert to %s again
2020-05-23 12:29:10 +03:00
Monty
4ea171ffab Fixed compiler warnings from gcc and clang 5.0.1 2020-05-23 12:29:10 +03:00
Marko Mäkelä
b30a013142 Merge 10.4 into 10.5 2020-05-13 14:25:06 +03:00
Oleksandr Byelkin
db537a8372 Merge branch '10.4-release' into 10.4 2020-05-11 21:32:33 +02:00
Sergei Golubchik
13038e4705 Merge branch '10.4' into 10.5 2020-05-09 20:43:36 +02:00
Sergei Golubchik
f5844e7c4b Merge branch '10.3' into 10.4 2020-05-09 20:36:58 +02:00
Sergei Golubchik
6adb0d2f7c MDEV-22459 pam v2 should log an error if auth_pam_tool exec fails 2020-05-08 18:20:38 +02:00
Sergei Golubchik
b22a4bf626 MDEV-21886 MariaDB RPM upgrade overwrites PAM user map
%config(noreplace) /etc/security
2020-05-07 01:24:37 +02:00
Marko Mäkelä
7bcaa541aa Merge 10.4 into 10.5 2020-05-05 21:16:22 +03:00
Marko Mäkelä
2c3c851d2c Merge 10.3 into 10.4 2020-05-05 20:33:10 +03:00