Commit graph

193024 commits

Author SHA1 Message Date
Sergei Krivonos
052dda61bb Made optional Json_writer_object / Json_writer_array consistency check 2021-10-17 13:20:49 +03:00
Sergei Krivonos
cf8e78a401 Implemented Json_writer_array & Json_writer_object subitems name presence control 2021-10-16 02:35:16 +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
Sergei Krivonos
bd1573b0f3 Xcode compatibility update: pcre, mysql-test-run.pl 2021-10-13 18:43:47 +03:00
Jan Lindström
d2b4d3ada0 MDEV-26707: SR transaction rolls back locally, but not in cluster
Record correct result file.
2021-10-13 18:11:07 +03:00
Marko Mäkelä
f1acd9f14b MDEV-26819 SET GLOBAL innodb_max_dirty_pages_pct=0 occasionally fails to trigger writes
innodb_max_dirty_pages_pct_update(),
innodb_max_dirty_pages_pct_lwm_update():
Invoke buf_pool.page_cleaner_wakeup() in order to wake up
buf_flush_page_cleaner. This allows the test innodb.page_cleaner
to run without any occasional timeouts.

The occasional hangs were introduced by
commit 7b1252c03d (MDEV-24278).
2021-10-13 15:16:23 +03:00
Jan Lindström
ddf95e834d MDEV-26707: SR transaction rolls back locally, but not in cluster
Add wait_condition
2021-10-13 14:44:47 +03:00
Jan Lindström
ae098b49dd MDEV-24062: : Galera test failure on galera_var_replicate_myisam_on
10.5 version
2021-10-13 13:35:49 +03:00
Marko Mäkelä
aae72f821a MDEV-24062: Re-disable the test after merge
The test galera.galera_var_replicate_myisam_on
would trigger an assertion failure "mode() == m_local"
in wsrep-lib/src/client_state.cpp after the merge
of commit 3067ffc58e enabled it.
2021-10-13 12:49:52 +03:00
Marko Mäkelä
99bb3fb656 Merge 10.4 into 10.5 2021-10-13 12:33:56 +03:00
Marko Mäkelä
a736a3174a Merge 10.3 into 10.4 2021-10-13 12:03:32 +03:00
Marko Mäkelä
4a7dfda373 Merge 10.2 into 10.3 2021-10-13 11:38:21 +03:00
Marko Mäkelä
2bb8d7c2f3 MDEV-26811: Assertion "log_sys->n_pending_flushes == 1" fails
In commit 1cb218c37c (MDEV-26450)
we introduced the function log_write_and_flush(), which may
compete with log_checkpoint() invoking log_write_flush_to_disk_low()
from another thread.

The assertion n_pending_flushes==1 is too strict.
There is no possibility of a race condition here, because
fil_flush() is protected by fil_system->mutex and the
rest will be protected by log_sys->mutex.

log_write_flush_to_disk_low(), log_write_and_flush():
Relax the assertions to test for a nonzero count.
2021-10-13 10:38:41 +03:00
Sergei Krivonos
6f32b28be5 Xcode compatibility update 2021-10-12 18:10:56 -04:00
Daniele Sciascia
b44e12fef1 MDEV-26707 SR transaction rolls back locally, but not in cluster
Update wsrep-lib, and add MTR test case for MDEV-26707

Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
2021-10-12 07:25:13 +03:00
Alexander Barkov
8f04ec2885 MDEV-25925 Warning: Memory not freed: 32 on INSERT DELAYED
Also fixes MDEV-24467 Memory not freed after failed INSERT DELAYED

Description:

In case of an error (e.g. data truncation) during mysql_insert()
handling an INSERT DELAYED, the data type specific data in
fields (e.g. Field_blob::value) is not taken over by the delayed
writer thread.

All fields in table_list->table are freed by free_root()
immediately after mysql_insert(). To avoid a memory leak,
we need to free the specific data before exiting mysql_insert()
on error.
2021-10-11 18:03:42 +04:00
Alexander Barkov
eadd878808 MDEV-23269 SIGSEGV in ft_boolean_check_syntax_string on setting ft_boolean_syntax
The crash happened because my_isalnum() does not support character
sets with mbminlen>1.

The value of "ft_boolean_syntax" is converted to utf8 in do_string_check().
So calling my_isalnum() is combination with "default_charset_info" was wrong.

Adding new parameters (size_t length, CHARSET_INFO *cs) to
ft_boolean_check_syntax_string() and passing self->charset(thd)
as the character set.
2021-10-11 17:43:23 +04:00
Alexander Barkov
9300b66577 MDEV-24742 Server crashes in Charset::numchars / String::numchars
The crash happened because Item_aes_crypt::val_str() did not
set the character set of the result.
2021-10-11 17:01:47 +04:00
SergMariaDB
5e3e5ccbea
Apple Silicon is a 64-bit platform (#1922)
Co-authored-by: FX Coudert <fxcoudert@gmail.com>
2021-10-11 15:26:33 +03:00
Aleksey Midenkov
ff77a09bda MDEV-22464 Server crash on UPDATE with nested subquery
Uninitialized ref_pointer_array[] because setup_fields() got empty
fields list.  mysql_multi_update() for some reason does that by
substituting the fields list with empty total_list for the
mysql_select() call (looks like wrong merge since total_list is not
used anywhere else and is always empty). The fix would be to return
back the original fields list. But this fails update_use_source.test
case:

  --error ER_BAD_FIELD_ERROR
  update v1 set t1c1=2 order by 1;

Actually not failing the above seems to be ok.

The other fix would be to keep resolve_in_select_list false (and that
keeps outer context from being resolved in
Item_ref::fix_fields()). This fix is more consistent with how SELECT
behaves:

  --error ER_SUBQUERY_NO_1_ROW
  select a from t1 where a= (select 2 from t1 having (a = 3));

So this patch implements this fix.
2021-10-11 13:36:07 +03:00
Aleksey Midenkov
1e70b287e7 MDEV-25891 Computed default for INVISIBLE column is ignored in INSERT
There are two fill_record() functions (lines 8343 and 8618). First one
is used when there are some explicit values, the second one is used
for all implicit values. First one does update_default_fields(), the
second one did not. Added update_default_fields() call to the implicit
version of fill_record().
2021-10-11 13:36:07 +03:00
Aleksey Midenkov
d31f953789 MDEV-22660 SIGSEGV on adding system versioning and modifying system column
Second alter subcommand correctly removed VERS_ROW_END flag. We throw
ER_VERS_PERIOD_COLUMNS in such case.
2021-10-11 13:36:07 +03:00
Aleksey Midenkov
911c803db1 MDEV-22660 System versioning cleanups
- Cleaned up Vers_parse_info::check_sys_fields();
- Renamed VERS_SYS_START_FLAG, VERS_SYS_END_FLAG to VERS_ROW_START,
  VERS_ROW_END.
2021-10-11 13:36:06 +03:00
Aleksey Midenkov
89936f11e9 MDEV-18278 Misleading error message in error log upon failed table creation
If error_reported is not set upper caller open_table_from_share()
throws error ER_NOT_FORM_FILE itself via open_table_error().
2021-10-11 12:26:43 +03:00
Aleksey Midenkov
275e7d23f7 MDEV-14846 InnoDB: assertion on trx->state because of deadlock error ignored
On deadlock transaction is rolled back (and trx->state is cleared) but
SELECT continued the loop because evaluate_join_record() ignored the
error status returned from lower join evaluation. val_int() does not
return error status so it is checked by thd->is_error().

Test case was created by Thirunarayanan Balathandayuthapani
<thiru@mariadb.com>
2021-10-11 12:26:43 +03:00
Daniele Sciascia
53c8d559a5 Make test galera_sr_kill_slave_before_apply deterministic
* Handle the (rare) case where the ongoing transaction is aborted, if
  the ongoing transaction is considered orphaned. This happens if the
  node delivers two consecutive primary views with the
* Add ignorable warning to suite.pm

Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
2021-10-11 11:07:34 +03:00
Marko Mäkelä
1d71dacd51 MDEV-24454 fixup: Fix plugins.feedback_plugin_send
In commit 3690c549c6
this test was not adjusted.
2021-10-11 10:15:52 +03:00
Otto Kekäläinen
cda072bb4b Deb: Sync build and runtime dependencies from downstream to upstream
- Go back to using $MAJOR_VER instead of hard-coded version strings where
  possible.

- Default to 'auto' in NUMJOBS instead of just 1. Will make mysql-test-run
  faster.

- Unify autopkgtest with latest version in Debian, use eatmydata to make
  mysql-test-run faster.

- Salsa-CI: Remove obsolete 'artifacts: true' as that is the default value.

- Salsa-CI: Clean away obsolete temporary fixes.

- Salsa-CI: Unify with salsa-ci.yml in Debian, including test upgrades
  from Bullseye to Debian unstable.
2021-10-09 17:44:11 -07:00
Otto Kekäläinen
9bb6520622 Deb: Correctly install test_sql_service.so
Completes the change that was attempted in 5ca14daf (MDEV-19275).
2021-10-09 17:44:11 -07:00
Sergei Petrunia
26eb666463 Make Explain_node::children protected 2021-10-08 19:17:06 +03:00
Jan Lindström
009a8d67b0 MDEV-21518 : galera.galera_toi_ddl_nonconflicting MTR failed: 1213: Deadlock found when trying to get lock
Add wait condition.
2021-10-08 13:01:22 +03:00
Brandon Nesterenko
478020171d MDEV-25444: mysql --binary-mode is not able to replay some mysqlbinlog outputs
This is a documentation-only patch to refine the description of
binary mode for the mariadb client.

Reviewed By:
============
Andrei Elkin <andrei.elkin@mariadb.com>
2021-10-07 11:30:22 -06:00
Jan Lindström
3067ffc58e Update galera disabled.def 2021-10-07 11:05:58 +03:00
Jan Lindström
a1b6f776da MDEV-22996 : Hang on galera_toi_truncate test case
Actual problem was earlier fixed. This contains only test
case change. We use debug_sync to force concurrent
DML and TRUNCATE.
2021-10-07 11:05:58 +03:00
Jan Lindström
d9b933bec6 MDEV-24062 : Galera test failure on galera_var_replicate_myisam_on
We should do after_statement only for local transactions.
2021-10-07 11:05:58 +03:00
Jan Lindström
96b4a5a648 Fix galera_var_reject_queries test case 2021-10-07 11:05:58 +03:00
Brandon Nesterenko
00affc324c Merge branch '10.2' into 10.3 2021-10-06 09:31:01 -06:00
Brandon Nesterenko
1ce35c327e MDEV-25444: mysql --binary-mode is not able to replay some mysqlbinlog outputs
Note: This patch backports commits 10cd281 and 1755ea4 from 10.3.

10cd281:
Problem:- Some binary data is inserted into the table using
Jconnector. When binlog dump of the data is applied using mysql
client it gives syntax error.

Reason:-
After investigating it turns out to be a issue of mysql client not
able to properly handle  \\0 <0 in binary>. In all binary files
where mysql client fails to insert
these 2 bytes are common (0x5c00)

Solution:-
I have changed mysql.cc to include for the possibility that binary
string can have \\0 in it

1755ea4:
Changes on top of Sachin’s patch. Specifically:
 1) Refined the parsing break condition to only change the parser’s
behavior for parsing strings in binary mode (behavior of \0 outside
of strings is unchanged).
 2) Prefixed binary_zero_insert.test with ‘mysql_’ to more clearly
associate the  purpose of the test.
 3) As the input of the test contains binary zeros (0x5c00),
different text editors can visualize this sequence differently, and
Github would not display it at all. Therefore, the input itself was
consolidated into the test and created out of hex sequences to make
it easier to understand what is happening.
 4) Extended test to validate that the rows which correspond to the
INSERTS with 0x5c00 have the correct binary zero data.

Reviewed By:
============
Andrei Elkin <andrei.elkin@mariadb.com>
2021-10-06 07:50:37 -06:00
Marko Mäkelä
4eb7217ec3 Merge 10.4 into 10.5 2021-10-06 09:45:12 +03:00
mkaruza
a75813d467 MDEV-22708 Assertion `!mysql_bin_log.is_open() || thd.is_current_stmt_binlog_format_row()' failed in Delayed_insert::handle_inserts and in Diagnostics_area::set_eof_status
Function `upgrade_lock_type` should check global binlog_format variable
instead of thread one.

Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
2021-10-06 07:20:02 +03:00
Marko Mäkelä
48f1b6946e Update libmariadb 2021-10-06 07:09:24 +03:00
Brandon Nesterenko
1755ea4b49 MDEV-25444: mysql --binary-mode is not able to replay some mysqlbinlog outputs
Changes on top of Sachin’s patch. Specifically:
 1) Refined the parsing break condition to only change the parser’s
behavior for parsing strings in binary mode (behavior of \0 outside
of strings is unchanged).
 2) Prefixed binary_zero_insert.test with ‘mysql_’ to more clearly
associate the  purpose of the test.
 3) As the input of the test contains binary zeros (0x5c00),
different text editors can visualize this sequence differently, and
Github would not display it at all. Therefore, the input itself was
consolidated into the test and created out of hex sequences to make
it easier to understand what is happening.
 4) Extended test to validate that the rows which correspond to the
INSERTS with 0x5c00 have the correct binary zero data.

Reviewed By:
===========
Andrei Elkin <andrei.elkin@mariadb.com>
2021-10-05 10:54:57 -06:00
Sachin Kumar
10cd281820 MDEV-25444 mysql --binary-mode is not able to replay some mysqlbinlog outputs
Problem:- Some binary data is inserted into the table using Jconnector. When
binlog dump of the data is applied using mysql cleint it gives syntax error.

Reason:-
After investigating it turns out to be a issue of mysql client not able to properly
handle  \\\0 <0 in binary>. In all binary files where mysql client fails to insert
these 2 bytes are commom (0x5c00)

Solution:-
I have changed mysql.cc to include for the possibility that binary string can
have \\\0 in it
2021-10-05 08:17:08 -06:00
Marko Mäkelä
1146b5cb58 MDEV-26761: main.mysql_client_test fails with MemorySanitizer
Updated libmariadb and enable the test.
2021-10-05 16:49:30 +03:00
Marko Mäkelä
df94aa344b MDEV-26445 followup: Try to work around GCC 4.8.5 ICE on ARMv8
GCC 4.8.5 would crash when compiling trx_purge_truncate_history().
Let us try to avoid that by disabling optimizations for the function.
2021-10-05 07:13:14 +03:00
Marko Mäkelä
ead38354e6 Merge 10.4 into 10.5 2021-10-04 19:32:13 +03:00
Marko Mäkelä
f3bd278063 MDEV-22083/MDEV-26758: Fix uninitialized memory in mysql_client_test
The test was passing some uninitialized data to libmariadb.
Mostly, the MemorySanitizer wrapper of send() detected that
some bytes were uninitialized.

The test_mdev19838() is for now disabled under MemorySanitizer,
to be fixed in MDEV-26761.
2021-10-04 19:28:43 +03:00
Daniel Black
32839c4df2 MDEV-19867: postfix - syntax spelling ALTER TABLE
Fixes: 5c5ea59bf8
2021-10-04 22:31:18 +11:00
Marko Mäkelä
097b7b8c9e Merge 10.3 into 10.4 2021-10-04 12:36:47 +03:00
Marko Mäkelä
1d57892949 Merge 10.2 into 10.3 2021-10-04 11:34:26 +03:00