Commit graph

198879 commits

Author SHA1 Message Date
Oleksandr Byelkin
2f0efad110 Merge branch '11.0' into 11.1 2023-08-10 21:22:37 +02:00
Oleksandr Byelkin
adf84c827b Merge branch '10.11' into 11.0 2023-08-10 21:21:53 +02:00
Oleksandr Byelkin
587d0b944f Merge branch '10.10' into 10.11 2023-08-10 21:21:22 +02:00
Oleksandr Byelkin
cce155cc90 Merge branch '10.9' into 10.10 2023-08-10 21:20:38 +02:00
Oleksandr Byelkin
3e0009dc3a Merge branch '10.6' into 10.9 2023-08-10 21:19:03 +02:00
Oleksandr Byelkin
0d16eb35bc Merge branch '10.5' into 10.6 2023-08-10 21:18:25 +02:00
Oleksandr Byelkin
7e650253dc Merge branch '10.4' into 10.5 2023-08-10 21:17:44 +02:00
Monty
2aea938749 MDEV-31893 Valgrind reports issues in main.join_cache_notasan
This is also related to
MDEV-31348 Assertion `last_key_entry >= end_pos' failed in virtual bool
           JOIN_CACHE_HASHED::put_record()

Valgrind exposed a problem with the join_cache for hash joins:
=25636== Conditional jump or move depends on uninitialised value(s)
==25636== at 0xA8FF4E: JOIN_CACHE_HASHED::init_hash_table()
          (sql_join_cache.cc:2901)

The reason for this was that avg_record_length contained a random value
if one had used SET optimizer_switch='optimize_join_buffer_size=off'.

This causes either 'random size' memory to be allocated (up to
join_buffer_size) which can increase memory usage or, if avg_record_length
is less than the row size, memory overwrites in thd->mem_root, which is
bad.

Fixed by setting avg_record_length in JOIN_CACHE_HASHED::init()
before it's used.

There is no test case for MDEV-31893 as valgrind of join_cache_notasan
checks that.
I added a test case for MDEV-31348.
2023-08-10 20:57:42 +02:00
Oleksandr Byelkin
4bc960831d Make test plan stabil. 2023-08-10 12:54:30 +02:00
Daniel Black
fa2faf41e7 MDEV-31746 Problems with tx_isolation after MDEV-21921
With session tracking on the tx_isolation of importance to
connector frameworks, its important that tracking of tx_isolation
does get informed if a user `set session transaction_isolation=X`
as the alias for tx_isolation.

Rather than just implement this for one variable alias, it
is implemented for all aliases.

To assist with this the key hash of session_tracker is now made up of
the offset, not the sys_var pointer.

The impacts of aliases are:
- If track one variable, its alias changes, you get a tracking
  change on the variable you are monitoring.
- If you track two aliased variables of each other, changing
  a variable will have a tracking events for only one of them.

Aliases of Sys_var_bit are not implemented, because we don't
have them, so would've been no way to verify that the new code works.

Post-Review edits by Sergei Golubchik <serg@mariadb.com>
2023-08-10 08:37:18 +02:00
Oleksandr Byelkin
00d09aae6f Merge branch '11.0' into 11.1 2023-08-10 08:19:46 +02:00
Oleksandr Byelkin
ff010fdd79 Make test plan stabil. 2023-08-10 08:19:34 +02:00
Oleksandr Byelkin
f8af7c6f48 Merge branch '10.11' into 11.0 2023-08-10 08:09:33 +02:00
Oleksandr Byelkin
4821ce8137 fix 32bit results after merge 2023-08-10 08:09:03 +02:00
Oleksandr Byelkin
0edb80f632 Merge branch '10.10' into 10.11 2023-08-09 21:25:47 +02:00
Oleksandr Byelkin
4e2c67a617 Merge branch '10.9' into 10.10 2023-08-09 21:24:57 +02:00
Oleksandr Byelkin
f692b2b6bb Merge branch '10.6' into 10.9
# Conflicts:
#	mysql-test/main/sp.result
#	mysql-test/main/sp.test
2023-08-09 21:22:49 +02:00
Oleksandr Byelkin
653f79a66c New Columnstoge vcolumnstore-23.02.4-1 2023-08-09 16:21:29 +02:00
Sergei Petrunia
8d210fc2aa MDEV-31877: ASAN errors in Exec_time_tracker::get_cycles with innodb slow log verbosity
Remove redundant delete_explain_query() calls in

sp_instr_set::exec_core(), sp_instr_set_row_field::exec_core(),
sp_instr_set_row_field_by_name::exec_core().

These calls are made before the SP instruction's tables are
"closed" by close_thread_tables() call.

When we call close_thread_tables() after that, we no longer
can collect engine's counter variables, as they use the data
structures that are located in the Explain Data Structures.

Also, these delete_explain_query() calls are redundant, as
sp_lex_keeper::reset_lex_and_exec_core() has another
delete_explain_query() call, which is located in the right
location after the close_thread_tables() call.
2023-08-09 15:42:31 +02:00
Oleksandr Byelkin
b8a35e1a62 Fix maturity 2023-08-09 15:04:36 +02:00
Oleksandr Byelkin
f5fae75652 Merge branch '11.0' into 11.1 2023-08-09 08:25:14 +02:00
Oleksandr Byelkin
51f9d62005 Merge branch '10.11' into 11.0 2023-08-09 07:53:48 +02:00
Oleksandr Byelkin
036df5f970 Merge branch '10.10' into 10.11 2023-08-08 14:57:31 +02:00
Oleksandr Byelkin
d2fdba94cf Merge branch '10.9' into 10.10 2023-08-08 14:47:16 +02:00
Oleksandr Byelkin
27dc4cd1fc Merge branch '10.6' into 10.9 2023-08-08 13:28:26 +02:00
Oleksandr Byelkin
d28d636f57 Merge branch '10.5' into 10.6 2023-08-08 13:20:58 +02:00
Oleksandr Byelkin
8852afe317 Merge branch '10.4' into 10.5 2023-08-08 11:24:42 +02:00
Thirunarayanan Balathandayuthapani
0ede90dd31 MDEV-31869 Server aborts when table does drop column
- InnoDB aborts when table is dropping the column. This is
caused by 5f09b53bdb (MDEV-31086).
While iterating the altered table fields, we fail to consider
the dropped columns.
2023-08-08 13:24:23 +05:30
Yuchen Pei
4d6eaf5974
MDEV-31524 spider fixup fixup: re-remove some default param setting 2023-08-08 15:40:30 +10:00
Oleksandr Byelkin
45b7a01002 Merge branch '10.9' into 10.10 2023-08-07 10:34:52 +02:00
Oleksandr Byelkin
214654118a Merge branch '10.6' into 10.9 2023-08-07 10:33:32 +02:00
Oleksandr Byelkin
4bc9d50f2f Merge branch '10.5' into 10.6 2023-08-07 10:32:05 +02:00
Sergei Golubchik
8adb6107ce MDEV-31853 Assertion failure in Column_definition::check_vcol_for_key upon adding FK
when validating vcol's (default, check, etc) in ALTER TABLE
vcol_info->flags are modified in place. This means that if ALTER TABLE
fails for any reason we need to restore them to their original values.

(mroonga was freeing the memory on ::reset() but not on ::close())
2023-08-06 20:08:51 +02:00
Oleksandr Byelkin
ced243a099 Merge branch '10.9' into 10.10 2023-08-05 20:34:09 +02:00
Oleksandr Byelkin
998edc374e Merge branch '10.6' into 10.9 2023-08-04 13:27:20 +02:00
Oleksandr Byelkin
c7b6707fe1 Merge branch '10.5' into 10.6 2023-08-04 12:14:00 +02:00
Yuchen Pei
10eff9c809
MDEV-31524 Post-merge fixup 2023-08-04 18:38:51 +10:00
Oleksandr Byelkin
6eb69434c7 Roksdb test postmerge fix 2023-08-04 10:30:30 +02:00
Oleksandr Byelkin
9aef479ac8 fix postmerge view protocol test 2023-08-04 10:24:40 +02:00
Oleksandr Byelkin
6b8310c27a fix postmerge 32bit tests 2023-08-04 10:11:03 +02:00
Oleksandr Byelkin
34a8e78581 Merge branch '10.6' into 10.9 2023-08-04 08:01:06 +02:00
Oleksandr Byelkin
5ea5291d97 Merge branch '10.5' into 10.6 2023-08-04 07:52:54 +02:00
Sergei Golubchik
1ba5a0205c MDEV-31836 mysqldump against MYSQL server 8 creates invalid dump
`select * from information_schema.columns` can return columns in any
order, but we need them ordered by the ordinal position
2023-08-03 14:24:16 +02:00
Oleg Smirnov
8e8c020fb3 MDEV-31743 Server crash in store_length, assertion failure in Type_handler_string_result::sort_length
After MDEV-21580 the truncation of SORT_FIELD::length
  set_if_smaller(sortorder->length, thd->variables.max_sort_length)

became conditional:
  if (is_variable_sized())
    set_if_smaller(length, thd->variables.max_sort_length)

To provide correct functioning of is_variable_sized() SORT_FIELD::type
must be set properly. This commit adds the necessary initialization
of SORT_FIELD::type to JOIN_TAB::remove_duplicates() as it is done
in filesort's sortlength() function.

DBUG_ASSERT is added to sortlength() just in case to prevent
a possible uint32 overflow
2023-08-03 18:03:31 +07:00
Marko Mäkelä
a89527e127 MDEV-31827 InnoDB multi-batch recovery stops prematurely
recv_scan_log(): On recv_sys_t::PREMATURE_EOF, keep reading more log
if recv_sys.lsn < recv_sys.scanned_lsn.

recv_recovery_from_checkpoint_start(): Add a safety check to abort
crash recovery if recv_sys.lsn is not recv_sys.scanned_lsn.

This fixes a serious database corruption bug that was introduced by
commit 2f9e264781 (MDEV-29911).
2023-08-02 19:28:12 +03:00
Sergei Golubchik
61acb43689 MDEV-31822 ALTER TABLE ENGINE=x started failing instead of producing warning on unsupported TRANSACTIONAL=1
make TRANSACTIONAL table option behave similar to other engine-defined
table options. If the engine doesn't suport it:
* if specified expicitly in CREATE or ALTER - it's ER_UNKNOWN_OPTION
* an error or a warning depending on sql_mode IGNORE_BAD_TABLE_OPTIONS
* in ALTER TABLE from the engine that suppors it to the engine that
  doesn't - silently preserved (no warning)
* it is commented out in SHOW CREATE unless IGNORE_BAD_TABLE_OPTIONS
2023-08-02 14:45:31 +02:00
Sergei Golubchik
da09ae05a9 MDEV-18114 Foreign Key Constraint actions don't affect Virtual Column
* invoke check_expression() for all vcol_info's in
  mysql_prepare_create_table() to check for FK CASCADE
* also check for SET NULL and SET DEFAULT
* to check against existing FKs when a vcol is added in ALTER TABLE,
  old FKs must be added to the new_key_list just like other indexes are
* check columns recursively, if vcol1 references vcol2,
  flags of vcol2 must be taken into account
* remove check_table_name_processor(), put that logic under
  check_vcol_func_processor() to avoid walking the tree twice
2023-08-02 14:45:31 +02:00
Marko Mäkelä
8760fe11b8 MDEV-31791: Recovery on memory-mapped log occasionally fails
recv_ring::copy_if_needed(): If the record wraps around the
memory-mapped ib_logfile0, do copy it also if len==0
(the record consists only of a header, like FREE_PAGE and INIT_PAGE
records do).

recv_sys_t::parse(): Invoke recv_ring::copy_if_needed() for INIT_PAGE
and FREE_PAGE records, so that if these records wrap around the
memory-mapped ib_logfile0, they will be correctly copied to
recv_sys.pages.

Together with commit 0d175968d1 (MDEV-31354)
this fixes occasional failures of the test innodb.recovery_memory.
2023-08-02 11:52:00 +03:00
Sergei Golubchik
ab1191c039 cleanup: key->key_create_info.check_for_duplicate_indexes -> key->old
mark old keys in the ALTER TABLE with the `old` flag, not with
the `key_create_info.check_for_duplicate_indexes`.

This allows to mark old foreign keys too.
2023-08-01 22:43:16 +02:00
Sergei Golubchik
0c9794d022 cleanup: Item_field::check_vcol_func_processor()
to declutter Item_field::check_vcol_func_processor(), move alter_info
specific part of it into Alter_info::check_vcol_field()
2023-08-01 22:43:16 +02:00