1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-14 13:41:20 +03:00
Commit Graph

2967 Commits

Author SHA1 Message Date
6bf8483cac Merge branch '10.5' into 10.6 2023-08-01 15:08:52 +02:00
7564be1352 Merge branch '10.4' into 10.5 2023-07-26 16:02:57 +02:00
742f960eeb [MDEV-30178] Explicit errors on required secured transport
The error message for user connections using insecure transport when secured transport is required is very uninformative and doesn't mention the requirement of secure
transport at all.

To make the error message more relevant, introduce a new error
'ER_SECURE_TRANSPORT_REQUIRED', copy of MySQL error message with the
error code 08004 (SQL-server rejected establishment SQL-connection).

Move the code of 'require_secure_transport' to be executed before
authentication verification, as it's not part of authentication but
rather verifying if connection should be allowed in the first place.

All new code of the whole pull request, including one or several files that
are either new files or modified ones, are contributed under the BSD-new license.
I am contributing on behalf of my employer Amazon Web Services, Inc.
2023-07-25 16:35:52 +01:00
8b01c2962b Remove CLIENT_SSL_VERIFY_SERVER_CERT
Since TLS server certificate verification is a client
only option, this flag is removed in both client (C/C)
and MariaDB server capability flags.

This patch reverts commit 89d759b93e
(MySQL Bug #21543) and stores the server certificate validation
option in mysql->options.extensions.
2023-07-23 19:23:51 +02:00
f52954ef42 Merge commit '10.4' into 10.5 2023-07-20 11:54:52 +02:00
7e7e12e747 MDEV-30765 SHOW TABLES not working properly with lower_case_table_names=2
lower_case_table_names=2 means "table names and database names are
stored as declared, but they are compared in lowercase".
But names of objects in grants are stored in lowercase for any value
of lower_case_table_names. This caused an error when checking grants
for objects containing uppercase letters since table_hash_search()
didn't take into account lower_case_table_names value
2023-05-11 12:06:08 +07:00
c7fe8e51de Merge 10.11 into 11.0 2023-04-17 16:50:01 +03:00
656c2e18b1 Merge 10.10 into 10.11 2023-04-14 13:08:28 +03:00
1d1e0ab2cc Merge 10.6 into 10.8 2023-04-12 15:50:08 +03:00
5bada1246d Merge 10.5 into 10.6 2023-04-11 16:15:19 +03:00
ac5a534a4c Merge remote-tracking branch '10.4' into 10.5 2023-03-31 21:32:41 +02:00
8145b308b0 MDEV-30826 Invalid data on mysql.host segfaults the server after an upgrade to 10.4
convert empty host.db to "%", just as it's done for host.hostname
(in update_hostname())
2023-03-10 22:04:09 +01:00
2e6a9886a9 MDEV-30526 Assertion `rights == merged->cols' failed in update_role_columns
another case of the antipattern "iterate the HASH and delete
elements as we go"
2023-02-21 23:22:56 +01:00
2e431ff7e6 Merge 10.11 into 11.0 2023-02-16 13:34:45 +02:00
1fd0099839 Merge 10.10 into 10.11 2023-02-16 11:41:18 +02:00
10a974adc9 Merge 11.0-selectivity into 11.0 2023-02-15 12:03:12 +03:00
dbab3e8d90 Merge 10.6 into 10.8 2023-02-10 13:43:53 +02:00
6aec87544c Merge 10.5 into 10.6 2023-02-10 13:03:01 +02:00
c41c79650a Merge 10.4 into 10.5 2023-02-10 12:02:11 +02:00
08c852026d Apply clang-tidy to remove empty constructors / destructors
This patch is the result of running
run-clang-tidy -fix -header-filter=.* -checks='-*,modernize-use-equals-default' .

Code style changes have been done on top. The result of this change
leads to the following improvements:

1. Binary size reduction.
* For a -DBUILD_CONFIG=mysql_release build, the binary size is reduced by
  ~400kb.
* A raw -DCMAKE_BUILD_TYPE=Release reduces the binary size by ~1.4kb.

2. Compiler can better understand the intent of the code, thus it leads
   to more optimization possibilities. Additionally it enabled detecting
   unused variables that had an empty default constructor but not marked
   so explicitly.

   Particular change required following this patch in sql/opt_range.cc

   result_keys, an unused template class Bitmap now correctly issues
   unused variable warnings.

   Setting Bitmap template class constructor to default allows the compiler
   to identify that there are no side-effects when instantiating the class.
   Previously the compiler could not issue the warning as it assumed Bitmap
   class (being a template) would not be performing a NO-OP for its default
   constructor. This prevented the "unused variable warning".
2023-02-09 16:09:08 +02:00
d6e3d89c80 MDEV-29668 SUPER should not allow actions that have fine-grained dedicated privileges
SUPER privilege used to allow various actions that were alternatively
allowed by one of BINLOG ADMIN, BINLOG MONITOR, BINLOG REPLAY,
CONNECTION ADMIN, FEDERATED ADMIN, REPL MASTER ADMIN, REPL SLAVE ADMIN,
SET USER, SLAVE MONITOR.

Now SUPER no longer does that, one has to grant one of the fine-grained
privileges above to be to perform corresponding actions.

On upgrade from MariaDB versions 10.11 and below all the privileges
above are granted automatically if the user has SUPER.

As a side-effect, such an upgrade will allow SUPER-user to run SHOW
BINLOG EVENTS, SHOW RELAYLOG EVENTS, SHOW SLAVE HOSTS, even if he wasn't
able to do it before the upgrade.
2023-02-06 14:31:48 +01:00
6418c24c94 Set thd->query() for internal (startup) transactions
This helps with debugging as 'Query: ' in DBUG traces will show something
useful, for internal transactions, instead of just "".
2023-02-03 10:34:49 +03:00
6252a281b5 MDEV-28910 remove the 5.5.5- version hack
no longer needed, MySQL replication was fixed meanwhile.

client code still can recognize and strip the prefix though.
2023-01-25 15:40:32 +01:00
3a237f7666 Merge 10.10 into 10.11 2023-01-11 11:13:56 +02:00
8356fb68c3 Merge 10.6 into 10.7 2023-01-04 14:52:25 +02:00
cfaf47a4d4 acl - is_public - avoid embedded warning
Using clang generates the unused-function warning on embedded like:

FAILED: libmysqld/CMakeFiles/sql_embedded.dir/__/sql/sql_acl.cc.o
/usr/lib64/ccache/clang++ .... libmysqld/CMakeFiles/sql_embedded.dir/__/sql/sql_acl.cc.o -MF libmysqld/CMakeFiles/sql_embedded.dir/__/sql/sql_acl.cc.o.d -o libmysqld/CMakeFiles/sql_embedded.dir/__/sql/sql_acl.cc.o -c /home/dan/repos/mariadb-server-10.11/sql/sql_acl.cc

sql_acl.cc:113:20: error: unused function 'is_public' [-Werror,-Wunused-function]
static inline bool is_public(const LEX_USER *l) { return is_public(&l->user); }
2023-01-04 08:24:05 +11:00
e441c32a0b Merge 10.5 into 10.6 2023-01-03 18:13:11 +02:00
8b9b4ab3f5 Merge 10.4 into 10.5 2023-01-03 17:08:42 +02:00
fb0808c450 Merge 10.3 into 10.4 2023-01-03 16:10:02 +02:00
22491e627a MDEV-30154: Assertion `strcasecmp(rolename, public_name.str) || acl_public == role' failed in acl_update_role on GRANT ... TO PUBLIC
Reset of acl_public was made too early (before saving it to restore in case
of error).
2023-01-03 10:17:42 +01:00
ca23558a05 --skip-name-resolve=0 didn't work
custom code in `case OPT_SKIP_RESOLVE`
was overriding the correct value from handle_options().
2023-01-02 00:04:03 +01:00
0aca3012a1 Merge 10.10 into 10.11 2022-12-14 09:18:30 +02:00
25b91c3f13 Merge 10.6 into 10.7 2022-12-13 18:01:49 +02:00
a8a5c8a1b8 Merge 10.5 into 10.6 2022-12-13 16:58:58 +02:00
1dc2f35598 Merge 10.4 into 10.5 2022-12-13 14:39:18 +02:00
fdf43b5c78 Merge 10.3 into 10.4 2022-12-13 11:37:33 +02:00
53e57a8681 MDEV-30056 Impossible to export column grants 2022-12-02 16:19:13 +01:00
b527bfe823 MDEV-30023 Revoking Privilege on the Column Yields the Error
The change from MDEV-29465 exposed a flaw in replace_column_table
where again we were not properly updating the column-level bits.

replace_table_table was changed in MDEV-29465 to properly update
grant_table->init_cols, however replace_column_table still only
modified grant_column->rights when the GRANT_COLUMN already existed.

This lead to a missmatch between GRANT_COLUMN::init_rights and
GRANT_COLUMN::rights, *if* the GRANT_COLUMN already existed.

As an example:

GRANT SELECT (col1) ...
Here:
For col1
GRANT_COLUMN::init_rights and GRANT_COLUMN::rights are set to 1 (SELECT) in
replace_column_table.

GRANT INSERT (col1) ...
Here, without this patch GRANT_COLUMN::init_rights is still 1 and
GRANT_COLUMN::rights is 3 (SELECT_PRIV | INSERT_PRIV)

Finally, if before this patch, one does:

REVOKE SELECT (col1) ...

replace_table_table will see that init_rights loses bit 1 thus it
considers there are no more rights granted on that particular table.

This prompts the whole GRANT_TABLE to be removed via the first revoke,
when the GRANT_COLUMN corresponding to it should still have init_rights == 2.

By also updating replace_column_table to keep init_rights in sync
properly, the issue is resolved.

Reviewed by <serg@mariadb.com>
2022-11-30 22:33:20 +02:00
ad937cf33a Merge branch '10.10' into 10.11 2022-11-02 13:08:01 +01:00
0537ce4e9f remove LEX_USER->is_public
it's now redundant
2022-11-02 00:31:27 +01:00
5dc804c3bb MDEV-29752 SHOW GRANTS for PUBLIC should work for all users 2022-11-02 00:31:20 +01:00
00c56e1c7c compare public_name by pointer
print PUBLIC not quoted in SHOW GRANTS, PUBLIC is not a role
2022-11-02 00:25:55 +01:00
0b519a4075 cleanup 2022-11-01 22:21:51 +01:00
b4e7803a6f MDEV-5215 post-review fixes
* "public" should work in any letter case
* PUBLIC is not a valid definer
* granting to public should auto-create an entry in mysql.global_priv
* SHOW GRANTS should show privileges obtained via PUBLIC
* LEX_USER::is_public was often uninitialized
* comments, whitespaces, typos, etc
2022-11-01 22:20:02 +01:00
b0325bd6d6 MDEV-5215 Granted to PUBLIC 2022-11-01 22:15:14 +01:00
1ebfa2af62 Merge branch '10.6' into 10.7 2022-10-29 19:22:04 +02:00
2bd41fc5bf Revert MDEV-25292 Atomic CREATE OR REPLACE TABLE
Specifically:

Revert "MDEV-29664 Assertion `!n_mysql_tables_in_use' failed in innobase_close_connection"
This reverts commit ba875e9396.

Revert "MDEV-29620 Assertion `next_insert_id == 0' failed in handler::ha_external_lock"
This reverts commit aa08a7442a.

Revert "MDEV-29628 Memory leak after CREATE OR REPLACE with foreign key"
This reverts commit c579d66ba6.

Revert "MDEV-29609 create_not_windows test fails with different result"
This reverts commit cb583b2f1b.

Revert "MDEV-29544 SIGSEGV in HA_CREATE_INFO::finalize_locked_tables"
This reverts commit dcd66c3814.

Revert "MDEV-28933 CREATE OR REPLACE fails to recreate same constraint name"
This reverts commit cf6c517632.

Revert "MDEV-28933 Moved RENAME_CONSTRAINT_IDS to include/sql_funcs.h"
This reverts commit f1e1c1335b.

Revert "MDEV-28956 Locking is broken if CREATE OR REPLACE fails under LOCK TABLES"
This reverts commit a228ec80e3.

Revert "MDEV-25292 gcol.gcol_bugfixes --ps fix"
This reverts commit 24fff8267d.

Revert "MDEV-25292 Disable atomic replace for slave-generated or-replace"
This reverts commit 2af15914cb.

Revert "MDEV-25292 backup_log improved"
This reverts commit 34398a20b5.

Revert "MDEV-25292 Atomic CREATE OR REPLACE TABLE"
This reverts commit 93c8252f02.

Revert "MDEV-25292 Table_name class for (db, table_name, alias)"
This reverts commit d145dda9c7.

Revert "MDEV-25292 ha_table_exists() cleanup and improvement"
This reverts commit 409b8a86de.

Revert "MDEV-25292 Cleanups"
This reverts commit 595dad83ad.

Revert "MDEV-25292 Refactoring: moved select_field_count into Alter_info."
This reverts commit f02af1d229.
2022-10-27 23:13:41 +02:00
aeccbbd926 Merge 10.5 into 10.6
To prevent ASAN heap-use-after-poison in the MDEV-16549 part of
./mtr --repeat=6 main.derived
the initialization of Name_resolution_context was cleaned up.
2022-10-25 14:25:42 +03:00
9a0b9e3360 Merge 10.4 into 10.5 2022-10-25 11:26:37 +03:00
667d3fbbb5 Merge 10.3 into 10.4 2022-10-25 10:04:37 +03:00