Commit graph

192070 commits

Author SHA1 Message Date
Marko Mäkelä
49a0ad695b MDEV-23371: Crash in _db_doprnt_ via que_thr_step()
Something appears to be broken in the DBUG subsystem.
Let us remove frequent calls to it from the InnoDB internal SQL interpreter
that is used in the purge of transaction history.

The DBUG_PRINT in que_eval_sql() can remain for now, because those
operations are much less frequent.
2022-11-08 11:24:49 +02:00
Marko Mäkelä
1e8189fcee MDEV-13564 follow-up: Correct a bogus comment
This fixes up commit e3c39c0be8
2022-11-08 10:55:22 +02:00
Marko Mäkelä
9ac8be4e29 Include some advice in the crash-upgrade message 2022-11-08 10:39:29 +02:00
Marko Mäkelä
95e2595d8d MDEV-22512: Disable frequently failing tests
InnoDB crash recovery can run out of memory before
commit 50324ce624 in
MariaDB Server 10.5.

Let us disable some frequently failing recovery tests
in earlier versions.
2022-11-08 10:30:03 +02:00
Marko Mäkelä
314ed9f5ec Work around MDEV-24813 in some tests
Not creating explicit record locks will speed up the test.

Also, disable the use of InnoDB persistent statistics in the test of
MDEV-27270 to avoid intermittent failures in 10.6 or later
(after commit 9608773f75)
due to the nondeterministic scheduling of STATS_AUTO_PERSISTENT.
2022-11-08 09:00:58 +02:00
Marko Mäkelä
456d4a508c Remove an unused file
The file plugin_exports became unused in
commit fec844aca8
2022-11-08 08:54:07 +02:00
Marko Mäkelä
eabb3b35d5 MDEV-27121 fixup: mariabackup.mdev-14447 fault injection 2022-11-08 08:53:49 +02:00
Oleksandr Byelkin
e9dc39572f Merge branch '10.4' into bb-10.4-release 2022-11-07 15:49:14 +01:00
Oleksandr Byelkin
01ac7455e2 Merge branch '10.3' into bb-10.3-release 2022-11-07 15:32:35 +01:00
Daniel Bartholomew
625fff0d8f
bump the VERSION 2022-11-07 08:35:15 -05:00
Daniel Bartholomew
baa6b052a2
bump the VERSION 2022-11-07 08:08:55 -05:00
Thirunarayanan Balathandayuthapani
f7e6198c02 MDEV-27121 mariabackup incompatible with disabled dedicated undo log tablespaces
- mariabackup fails to assign srv_undo_space_id_start when the
dedicated undo tablespaces are disabled
2022-11-07 17:36:08 +05:30
Sachin
10132ad261 MDEV-23264 Unique blobs allow duplicate values upon UPDATE
Problem:-
  We are able to insert duplicate value in table because cmp_binary_offset
  is not able to differentiate between NULL and empty string. So
  check_duplicate_long_entry_key is never called and we don't check for
  duplicate.
Solution
  Added a if condition with is_null() on field which can differentiate
  between NULL and empty string.
2022-11-07 09:50:59 +01:00
Vladislav Vaintroub
92be8d2048 MDEV-29951 server hang in crash handler
When trying to output stacktrace, and addr2line is not installed, the
child process forked by start_addr2line_fork() will fail to do exec(),
and finish with exit(1).

There is a problem with exit() though - it runs exit handlers,
and for the forked copy of crashing process, it is a bad idea.

In 10.5+ code for example, exit handlers include
tpool::task_group static destructors, and it will hang infinitely
waiting for completion of the outstanding tasks.

The fix is to use _exit() instead, which skips the execution of exit
handlers
2022-11-05 18:36:43 +01:00
Ian Gilfillan
e7be2d3142 Fix duplicate entry in mysqld_safe man page 2022-11-03 12:25:38 +11:00
Oleksandr Byelkin
0946c99e7d Merge branch '10.3' into 10.4 2022-11-02 13:13:45 +01:00
Oleksandr Byelkin
3303748fd1 MDEV-29926: ASAN heap-use-after-free in Explain_query::~Explain_query
Make sure that EXPLAIN object allocated on runtime arena.
2022-11-02 12:49:24 +01:00
Sergei Golubchik
1a3859fff0 MDEV-29924 Assertion `(((nr) % (1LL << 24)) % (int) log_10_int[6 - dec]) == 0' failed in my_time_packed_to_binary on SELECT when using TIME field
when assigning the cached item to the Item_cache for the first time
make sure to use Item_cache::setup(), not Item_cache::store().
Because the former copies the metadata (and allocates memory, in case
of Item_cache_row), and Item_cache::decimal must be set for
comparisons to work correctly.
2022-11-01 13:22:34 +01:00
Oleg Smirnov
0d927a57d2 MDEV-29624 MDEV-29655 Fix ASAN errors on pushdown of derived table
Deallocation of TABLE_LIST::dt_handler and TABLE_LIST::pushdown_derived
was performed in multiple places if code. This not only made the code
more difficult to maintain but also led to memory leaks and
ASAN heap-use-after-free errors.
This commit puts deallocation of TABLE_LIST::dt_handler and
TABLE_LIST::pushdown_derived to the single point - JOIN::cleanup()
2022-10-31 19:20:17 +04:00
Brad Smith
7d96cb4703 Fix warning with signal typedef for *BSD
/usr/ports/pobj/mariadb-10.9.3/mariadb-10.9.3/mysys/my_lock.c:183:7: warning: incompatible function pointer types assigning to 'sig_return' (aka 'void (*)(void)') from 'void (*)(int)' [-Wincompatible-function-pointer-types]
      ALARM_INIT;
      ^~~~~~~~~~
/usr/ports/pobj/mariadb-10.9.3/mariadb-10.9.3/include/my_alarm.h:43:16: note: expanded from macro 'ALARM_INIT'
                        alarm_signal=signal(SIGALRM,my_set_alarm_variable);
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/pobj/mariadb-10.9.3/mariadb-10.9.3/mysys/my_lock.c:189:7: warning: incompatible function pointer types passing 'sig_return' (aka 'void (*)(void)') to parameter of type 'void (*)(int)' [-Wincompatible-function-pointer-types]
      ALARM_END;
      ^~~~~~~~~
/usr/ports/pobj/mariadb-10.9.3/mariadb-10.9.3/include/my_alarm.h:44:41: note: expanded from macro 'ALARM_END'
                                              ^~~~~~~~~~~~
/usr/include/sys/signal.h:199:27: note: passing argument to parameter here
void    (*signal(int, void (*)(int)))(int);
                             ^
2 warnings generated.

The prototype is the same for all of the *BSD's.

void
(*signal(int sigcatch, void (*func)(int sigraised)))(int);
2022-10-31 09:28:17 +11:00
Daniel Black
4ebc8d8c27
MDEV-29847: Wrong warning on rlimit capping of max_open_files (#2315)
Per the code my_set_max_open_files 3 lines earlier, we attempt
to set the nofile (number of open files), rlimit to max_open_files.

We should use this in the warning because wanted_files may not
be the number.
2022-10-28 09:59:35 +01:00
Alexander Barkov
ce443c8554 MDEV-29495 Generalize can_convert_xxx() hook engine API to cover any arbitrary data type 2022-10-27 11:48:46 +04:00
Brad Smith
899cedb33c Fix building my_gethwaddr() on OpenBSD 2022-10-27 11:30:45 +11:00
Oleksandr Byelkin
29633dc0c0 Merge branch '10.3' into 10.4 2022-10-26 14:55:47 +02:00
Oleksandr Byelkin
278fbe61d8 Add skipped changes to oracle mode parser. 2022-10-26 10:14:34 +02:00
Andrew Hutchings
fa5f26b422 MDEV-29578 Fix CONNECT build warnings
Fix a couple of build warnings that fire with CONNECT engine.
2022-10-26 16:50:46 +11:00
Brad Smith
055cb3fcd1 Rocksdb: Add initial OpenBSD support 2022-10-26 15:33:10 +11:00
Oleg Smirnov
5f296f3a18 MDEV-29640 FederatedX does not properly handle pushdown in case of difference in local and remote table names
FederatedX table may refer to a table with a different name on the
remote server:
  test> CREATE TABLE t2 (...) ENGINE="FEDERATEDX"
  CONNECTION="mysql://user:pass@192.168.1.111:9308/federatedx/t1";
  test> select * from t2 where ...;
This could cause an issue with federated_pushdown=1, because FederatedX
pushes the query (or derived table's) text to the remote server. The remote
server will try to read from table t2 (while it should read from t1).

Solution: do not allow pushing down queries with tables that have different
db_name.table name on the local and remote server.

This patch also fixes:
MDEV-29863 Server crashes in federatedx_txn::acquire after select from the
FederatedX table with partitions

Solution: disallow pushdown when partitioned FederatedX tables are used.
2022-10-26 10:52:38 +07:00
Alexey Botchkov
77951dd710 MDEV-26161 crash in Gis_point::calculate_haversine
More checks for bad geometry data added.
2022-10-26 00:20:40 +04:00
Sergei Golubchik
e910dff81e MDEV-26161 crash in Gis_point::calculate_haversine
return an error on invalid gis data
2022-10-25 21:26:51 +02:00
Igor Babaev
58cd0bd59e MDEV-28846 Poor performance when rowid filter contains no elements
When a range rowid filter was used with an index ref access the cost of
accessing the index entries for the records rejected by the filter was not
taken into account. For a ref access by an index with big average number
of records per key this led to poor execution plans if selectivity of the
used filter was high.
The patch resolves this problem. It also introduces a minor optimization
that skips look-ups into a filter that turns out to be empty.
With this patch the output of ANALYZE stmt reports the number of look-ups
into used rowid filters.
The patch also back-ports from 10.5 the code that properly sets the field
TABLE::file::table for opened temporary tables.

The test cases that were supposed to use rowid filters have been adjusted
in order to use similar execution plans after this fix.

Approved by Oleksandr Byelkin <sanja@mariadb.com>
2022-10-25 11:43:32 -07:00
Sergei Golubchik
72e79eaaf3 cleanup: put casts in a separate statement
remove useless if()
2022-10-25 20:24:34 +02:00
Alexander Barkov
f1bbc1cd19 MDEV-28545 MyISAM reorganize partition corrupt older table format
The ALTER related code cannot do at the same time both:
- modify partitions
- change column data types

Explicit changing of a column data type together with a partition change is
prohibited by the parter, so this is not allowed and returns a syntax error:

  ALTER TABLE t MODIFY ts BIGINT, DROP PARTITION p1;

This fix additionally disables implicit data type upgrade
(e.g. from "MariaDB 5.3 TIME" to "MySQL 5.6 TIME", or the other way
around according to the current mysql56_temporal_format) in case of
an ALTER modifying partitions, e.g.:

  ALTER TABLE t DROP PARTITION p1;

In such commands now only the partition change happens, while
the data types stay unchanged.

One can additionally run:

  ALTER TABLE t FORCE;

either before or after the ALTER modifying partitions to
upgrade data types according to mysql56_temporal_format.
2022-10-25 17:34:25 +04:00
Lawrin Novitsky
1ff476b415 MDEV-29490 Renaming internally used client API to avoid name conflicts
with C/C.
The patch introduces mariadb_capi_rename.h which is included into
mysql.h. The hew header contains macro definitions for the names being
renamed. In versions 10.6+(i.e. where sql service exists) the renaming
condition in the mariadb_capi_rename.h should be added with
&& !defined(MYSQL_DYNAMIC_PLUGIN)
and look like
The patch also contains removal of mysql.h from the api check.

Disabling false_duper-6543 test for embedded.

ha_federated.so uses C API. C API functions are being renamed in the server,
but not renamed in embedded, since embedded server library should have proper
C API, as expected by programs using it.
Thus the same ha_federated.so cannot work both for server and embedded
server library.

As all federated tests are already disabled for embedded,
federated isn't supposed to work for embedded anyway, and thus the test
is being disabled.
2022-10-25 14:00:21 +02:00
Vladislav Vaintroub
32158be720 MDEV-29811 server advertises ssl even if it's unusable.
Abort startup, if SSL setup fails.
Also, for the server always check that certificate matches private key
(even if ssl_cert is not set, OpenSSL will try to use default one)
2022-10-25 13:18:34 +02:00
Jan Lindström
8c5d323326 Additional fixes
* galera_many_rows : reduce the time used
* wsrep_thd.cc : remove incorrect assertion
* disabled.def : disable failing test cases
2022-10-25 12:58:10 +03:00
Marko Mäkelä
667d3fbbb5 Merge 10.3 into 10.4 2022-10-25 10:04:37 +03:00
Ian Gilfillan
f19e8559aa MDEV-28701 Update 10.4 HELP tables 2022-10-25 09:40:57 +11:00
Ian Gilfillan
34ff5ca895 MDEV-28701 Update 10.3 HELP tables 2022-10-25 09:40:38 +11:00
Oleksandr Byelkin
4fd6dd2d3b MDEV-29748 ASAN errors or server crash in File_parser::parse upon concurrent view operations
Read the version of the view share when we read definition to prevent
simultaniouse access to a view table SHARE (and so its MEM_ROOT)
from different threads.
2022-10-24 14:09:46 +02:00
Oleksandr Byelkin
e00ea301ef MDEV-16549 Server crashes in Item_field::fix_fields on query with view and subquery, Assertion context' failed, Assertion field' failed
Add one-table-resolve context for items created with an aim of switching
to temporary table because then it can be cloned in push-down-condition.
2022-10-24 12:47:57 +02:00
Alexander Barkov
28d6f6a514 MDEV-14983 Wrong error message with SET sql_mode=sha2(ucs2_value)
The problem was fixed earlier. Adding an MTR test only.
2022-10-24 13:58:14 +04:00
Sergei Golubchik
68fb05c360 MDEV-29851 Cached role privileges are not invalidated when needed
GRANT ROLE can update db-level privileges -> must invalidate acl_cache
2022-10-22 18:27:06 +02:00
Sergei Golubchik
7a2f995649 cleanup: rename test file 2022-10-22 17:11:23 +02:00
Sergei Golubchik
741c14cbdd remove two acl_cache->clear()
* to "clear hostname cache" one needs to use hostname_cache->clear()
* no need to clear acl_cache for SET DEFAULT ROLE
2022-10-22 17:11:23 +02:00
Alexander Barkov
2a57396e59 MDEV-29481 mariadb-upgrade prints confusing statement
This is a new version of the patch instead of the reverted:

  MDEV-28727 ALTER TABLE ALGORITHM=NOCOPY does not work after upgrade

Ignore the difference in key packing flags HA_BINARY_PACK_KEY and HA_PACK_KEY
during ALTER to allow ALGORITHM=INSTANT and ALGORITHM=NOCOPY in more cases.

If for some reasons (e.g. due to a bug fix such as MDEV-20704) these
cumulative (over all segments) flags in KEY::flags are different for
the old and new table inside compare_keys_but_name(), the difference
in HA_BINARY_PACK_KEY and HA_PACK_KEY in KEY::flags is not really important:

MyISAM and Aria can handle such cases well: per-segment flags are stored in
MYI and MAI files anyway and they are read during ha_myisam::open()
ha_maria::open() time. So indexes get opened with correct per-segment
flags that were calculated during the table CREATE time, no matter
what the old (CREATE time) and new (ALTER TIME) per-index compression
flags are, and no matter if they are equal or not.

All other engine ignore key compression flags, so this change
is safe for other engines as well.
2022-10-22 14:22:20 +04:00
Sergei Golubchik
16d4431ab6 CONNECT: compile with libxml2 2.10.x
storage/connect/libdoc.cpp:603:17: error: 'void xmlXPathInit()' is deprecated [-Werror=deprecated-declarations]
2022-10-22 11:48:45 +02:00
Sergei Golubchik
0609b34555 disable LTO in debian builds 2022-10-22 10:24:14 +02:00
Sergei Golubchik
3e377fd35b MDEV-15795 Stack exceeded if pthread_attr_setstacksize(&thr_attr,8196) succeeds
on Linux this pthread_attr_setstacksize() fails with EINVAL
"The stack size is less than PTHREAD_STACK_MIN (16384) bytes".

But on FreeBSD it succeeds and causes a crash later, as 8196 is too little.

Let's keep the stack at its default size in the timer thread.
2022-10-22 10:24:14 +02:00
Sergei Golubchik
68391acef2 fix for x86 and other 32-bit little engian arch
(and for 64-bit big endian)
2022-10-22 10:24:14 +02:00