Commit graph

769 commits

Author SHA1 Message Date
Marko Mäkelä
3ad1af9366 MDEV-22545: One more fix: main.perror-win
In 10.3 and earlier, some lines in the result file were
terminated by CR and LF, but in 10.4, all files are expected
to be terminated by LF only.

Also, my build of 10.4 apparently failed without me noticing
it, and the MDEV-22545 fix was not present. The %T should
not have been replaced with %s at all.
2020-05-26 16:40:41 +03:00
Marko Mäkelä
170487473e After-merge fix: main.perror-win 2020-05-26 15:48:29 +03:00
Marko Mäkelä
ca38b6e427 Merge 10.3 into 10.4 2020-05-26 11:54:55 +03:00
Marko Mäkelä
ecc7f305dd Merge 10.2 into 10.3 2020-05-25 19:41:58 +03:00
Alexander Barkov
ea7830eef4 MDEV-14221 Assertion `0' failed in Item::field_type_for_temporal_comparison
Item_null_result did not override type_handler() because of a wrong merge
of d8a9b524f2 (MDEV-14221) from 10.1.

Overriding type_handler().

Removing the old style field_type() method. It's not relevant any more.
2020-05-22 17:00:14 +04:00
Monty
736ca14323 Don't crash if creating sequence under XA
MDEV-22002 Assertion `!is_set() || (m_status == DA_OK_BULK &&
is_bulk_op())' failed upon CREATE TEMPORARY SEQUENCE under XA
2020-05-22 15:42:11 +03:00
Marko Mäkelä
d8dc3c72b6 Merge 10.3 into 10.4 2020-05-20 12:25:23 +03:00
Alexander Barkov
d4f97e2086 MDEV-22391 Assertion `0' failed in Item_type_holder::val_str on utf16 charset table query
Problem:
When handling a query like this:
  VALUES ('') UNION SELECT _utf16 0x0020 COLLATE utf16_bin;
Type_handler_string_result::Item_hybrid_func_fix_attributes()
tried to apply character set conversion Item_type_holder,
which causes a crash on DBUG_ASSERT(0) inside Item_type_holder::val_str().

Fix:
Overriding Item_type_holder's methods to avoid this, as follows:

  bool const_item() const { return false; }
  bool is_expensive() { return true; }
2020-05-20 11:53:09 +04:00
Marko Mäkelä
2bf93a8fd6 Merge 10.3 into 10.4 2020-05-19 21:18:15 +03:00
Marko Mäkelä
79ed33c184 Merge 10.2 into 10.3 2020-05-19 17:05:05 +03:00
Alexander Barkov
f7079d295b MDEV-22610 Crash in INSERT INTO t1 (VALUES (DEFAULT) UNION VALUES (DEFAULT))
The fix for MDEV-21995 earlier fixed MDEV-22610. Adding tests only.
2020-05-19 12:40:59 +04:00
Alexander Barkov
810b7f8ecb Merge remote-tracking branch 'origin/10.3' into 10.4 2020-05-19 12:03:12 +04:00
Alexander Barkov
06fb78c6ac MDEV-21995 Server crashes in Item_field::real_type_handler with table value constructor
1. Code simplification:

Item_default_value handled all these values:
a. DEFAULT(field)
b. DEFAULT
c. IGNORE
and had various conditions to distinguish (a) from (b) and from (c).

Introducing a new abstract class Item_contextually_typed_value_specification,
to handle (b) and (c), so the hierarchy now looks as follows:

Item
  Item_result_field
    Item_ident
      Item_field
        Item_default_value                      - DEFAULT(field)
  Item_contextually_typed_value_specification
    Item_default_specification                  - DEFAULT
    Item_ignore_specification                   - IGNORE

2. Introducing a new virtual method is_evaluable_expression() to
determine if an Item is:
- a normal expression, so its val_xxx()/get_date() methods can be called
- or a just an expression substitute, whose value methods cannot be called.

3. Disallowing Items that are not evalualble expressions in table value
   constructors.
2020-05-19 10:55:39 +04:00
Marko Mäkelä
faf6d0ef3f Merge 10.3 into 10.4 2020-05-18 15:05:52 +03:00
Marko Mäkelä
03aaa7f7a1 Merge 10.2 into 10.3 2020-05-18 10:47:11 +03:00
Marko Mäkelä
66f1e288a1 Merge 10.3 into 10.4 2020-05-16 07:54:09 +03:00
Marko Mäkelä
38d62189a8 Merge 10.2 into 10.3 2020-05-16 06:37:24 +03:00
Marko Mäkelä
4f29d776c7 Merge 10.3 into 10.4 2020-05-16 06:27:55 +03:00
Marko Mäkelä
85651269b6 MDEV-18100: Clean up test 2020-05-16 06:24:09 +03:00
Aleksey Midenkov
a4996f951d MDEV-22563 Segfault on duplicate free of Item_func_in::array
Same array instance in two Item_func_in instances. First Item_func_in
instance is freed on table close. Second one is freed on
cleanup_after_query().

get_copy() depends on copy ctor for copying an item and hence does
shallow copy for default copy ctor. Use build_clone() for deep copy of
Item_func_in.
2020-05-15 16:17:15 +03:00
Varun Gupta
d49233caf6 MDEV-18100: User defined aggregate functions not working correctly when the schema is changed
The issue here was that when the schema was changed the value for the THD::server_status
is ored with SERVER_SESSION_STATE_CHANGED.
For custom aggregate functions, currently we check if the server_status is equal to
SERVER_STATUS_LAST_ROW_SENT then we should terminate the execution of the custom
aggregate function as there are no more rows to fetch.
So the check should be that if the server status has the bit set for
SERVER_STATUS_LAST_ROW_SENT then we should terminate the execution of the
custom aggregate function.
2020-05-15 15:13:06 +05:30
Alexander Barkov
1408e26d0b MDEV-22560 Crash on a table value constructor with an SP variable
fix_fields_for_tvc() could call fix_fields() for Items that have
already been fixed before. Changing fix_fields() to fix_fields_if_needed().
2020-05-15 06:15:10 +04:00
Alexander Barkov
f7cf60991d Merge remote-tracking branch 'origin/10.2' into 10.3 2020-05-14 12:33:22 +04:00
Alexander Barkov
ef65c39ab3 Merge remote-tracking branch 'origin/10.2' into 10.3 2020-05-14 10:01:54 +04:00
Marko Mäkelä
38f6c47f8a Merge 10.3 into 10.4 2020-05-13 12:52:57 +03:00
Marko Mäkelä
15fa70b840 Merge 10.2 into 10.3 2020-05-13 11:45:05 +03:00
Oleksandr Byelkin
19d4e023c6 Merge branch '10.3-release' into 10.3 2020-05-11 20:27:44 +02:00
Sergei Golubchik
f5844e7c4b Merge branch '10.3' into 10.4 2020-05-09 20:36:58 +02:00
Sergei Golubchik
607467bd63 Merge branch '10.2' into 10.3 2020-05-09 20:20:02 +02:00
Sergei Petrunia
8d85715d50 MDEV-21794: Optimizer flag rowid_filter leads to long query
Rowid Filter check is just like Index Condition Pushdown check: before
we check the filter, we must check if we have walked out of the range
we are scanning. (If we did, we should return, and not continue the scan).

Consequences of this:
- Rowid filtering doesn't work for keys that have partially-covered
  blob columns (just like Index Condition Pushdown)
- The rowid filter function has three return values: CHECK_POS (passed)
  CHECK_NEG (filtered out), CHECK_OUT_OF_RANGE.

All of the above is implemented in this patch
2020-05-07 12:27:17 +02:00
Oleksandr Byelkin
0253ea7f22 MDEV-19650: Privilege bug on MariaDB 10.4
Also fixes:
MDEV-21487: Implement option for mysql_upgrade that allows root@localhost to be replaced
MDEV-21486: Implement option for mysql_install_db that allows root@localhost to be replaced

Add user mariadb.sys to be definer of user view
(and has right on underlying table global_priv for
required operation over global_priv
(SELECT,UPDATE,DELETE))

Also changed definer of gis functions in case of creation,
but they work with any definer so upgrade script do not try
to push this change.
2020-05-07 10:54:56 +02:00
Sergei Petrunia
d01d94d77b MDEV-17568: LATERAL DERIVED is not clearly visible in EXPLAIN FORMAT=JSON
Make LATERAL DERIVED tables visible in EXPLAIN FORMAT=JSON output.
2020-05-06 23:44:34 +03:00
Marko Mäkelä
2c3c851d2c Merge 10.3 into 10.4 2020-05-05 20:33:10 +03:00
Marko Mäkelä
50f3a38e89 Add an end marker to a test 2020-05-04 18:31:30 +03:00
Varun Gupta
644d9f38b9 MDEV-21480: Unique key using ref access though eq_ref access can be used
For a unique key if all the keyparts are NOT NULL or the predicates involving
the keyparts is NULL rejecting, then we can use EQ_REF access instead of ref
access with the unique key
2020-05-01 15:17:10 +05:30
Varun Gupta
7f03a93348 MDEV-22160: SIGSEGV in st_join_table::save_explain_data on SELECT
Adding a test case for rowid filter, the crash was fixed by MDEV-22191
2020-04-29 20:22:18 +05:30
Sergei Petrunia
7bc6735736 MDEV-22401: Optimizer trace: multi-component range is not printed correctly
KEY_MULTI_RANGE::range_flag does not have correct flag bits for
per-endpoint flags (NEAR_MIN, NEAR_MAX, NO_MIN_RANGE, NO_MAX_RANGE).
It only has bits for flags that describe both endpoints.
So
- Document this.
- Switch optimizer trace to using {start|end}_key.flag values, instead.
  This fixes the bug.
- Switch records_in_column_ranges() to doing that too. (This used to
  work, because KEY_MULTI_RANGE::range_flag had correct flag value
  for the last key component, and EITS only uses one-component
  pseudo-indexes)
2020-04-29 16:31:16 +03:00
Sergei Golubchik
503fd2115b fix the test for windows 2020-04-28 15:12:02 +02:00
Sergei Golubchik
6dab094fbd MDEV-20257 Server crashes in Grant_table_base::init_read_record upon crash-upgrade
when opening the `user` table separately, reset `thd->open_tables`
for the duration of open, otherwise auto-repair fallback-and-retry
will close *all* tables (but reopen only `user`)
2020-04-27 09:22:36 +02:00
Sergei Golubchik
2144dc1ff2 more verbose tests 2020-04-27 09:22:36 +02:00
Sergei Golubchik
b976b9bfc3 MDEV-21244 mysql_upgrade creating empty global_priv table
support upgrades from 5.2 privilege tables
2020-04-27 09:22:36 +02:00
Marko Mäkelä
be42004d3d Fixup d1c3342d07 for --embedded 2020-04-24 17:12:11 +03:00
Monty
d1c3342d07 Fixed default_storage_engine.test
The bug was that the script tried to start mysqld while there was already
a running mysqld server. Fixed by killing the running one.
2020-04-23 11:08:52 +03:00
Marko Mäkelä
88cf6f1c7f Merge 10.3 into 10.4 2020-04-22 18:18:51 +03:00
Marko Mäkelä
455cf6196c Merge 10.2 into 10.3 2020-04-22 14:45:55 +03:00
Anel Husakovic
42af2b1d8b MDEV-22263: main.func_debug fails on a valgrind build with wrong result
Patches of interest:374dae3ecc49, 374dae3ecc
2020-04-20 07:51:39 +02:00
Marko Mäkelä
af91266498 Merge 10.3 into 10.4
In main.index_merge_myisam we remove the test that was added in
commit a2d24def8c because
it duplicates the test case that was added in
commit 5af12e4635.
2020-04-16 12:12:26 +03:00
Marko Mäkelä
84db10f27b Merge 10.2 into 10.3 2020-04-15 09:56:03 +03:00
Igor Babaev
21b8743734 MDEV-21673 Calling stored procedure twice in the same session causes MariaDB to crash
This bug could happen only with a stored procedure containing queries with
more than one reference to a CTE that used local variables / parameters.

This bug was the result of an incomplete merge of the fix for the bug
MDEV-17154. The merge covered usage of parameter markers occurred in a CTE
that was referenced more than once, but missed coverage of local variables.
2020-04-04 09:24:22 -07:00
Vladislav Vaintroub
fbef428645 MDEV-22137 correct documentation of tcp_keepalive_time system variable 2020-04-03 12:49:50 +02:00