Commit graph

187356 commits

Author SHA1 Message Date
Marko Mäkelä
1333da90b5 Merge 10.4 into 10.5 2019-09-24 10:07:56 +03:00
Eugene Kosov
e3da362c03 MDEV-19189 ASAN memcpy-param-overlap in fill_alter_inplace_info upon adding indexes
memmove() should be used instead of memcpy() for overlapping memory regions.

Overlapping memory regions itself here are fine, because code simply removes
one element from arbitrary position of an array.
2019-09-23 19:12:24 +03:00
Marko Mäkelä
5a92ccbaea Merge 10.3 into 10.4
Disable MDEV-20576 assertions until MDEV-20595 has been fixed.
2019-09-23 17:35:29 +03:00
Marko Mäkelä
c997af7d1f Remove reference to dict_sys->mutex 2019-09-23 10:33:10 +03:00
Marko Mäkelä
c016ea660e Merge 10.2 into 10.3 2019-09-23 10:25:34 +03:00
Marko Mäkelä
2931fd2917 After-merge fix: Adjust a result 2019-09-23 09:04:51 +03:00
Marko Mäkelä
60cb5559a9 MDEV-17614 post-fix: Remove dead dup_chk_only=true code.
The parameter dup_chk_only was always passed as a constant false.
Remove the parameter and the dead code related to it.
2019-09-23 08:29:39 +03:00
Marko Mäkelä
44c5144943 Merge 10.1 into 10.2 2019-09-23 08:26:08 +03:00
Michael Widenius
1bbe8c5e0f Proper fix for disabling warnings in read_statistics_for_table().
MDEV-20589: Server still crashes in Field::set_warning_truncated_wrong_value

- Use dbug_tmp_use_all_columns() to mark that all fields can be used
- Remove field->is_stat_field (not needed)
- Remove extra arguments to Field::clone() that should not be there
- Safety fix for Field::set_warning_truncated_wrong_value() to not crash
  if table is zero in production builds (We have got crashes several times
  here so better to be safe than sorry).
- Threat wrong character string warnings identical to other field
  conversion warnings. This removes some warnings we before got from
  internal conversion errors.  There is no good reason why a user would
  get an error in case of 'key_field='wrong-utf8-string' but not for
  'field=wrong-utf8-string'.  The old code could also easily give
  thousands of no-sence warnings for one single statement.
2019-09-22 04:08:48 +03:00
Varun Gupta
896974fc3d MDEV-18094: Query with order by limit picking index scan over filesort
In the function test_if_cheaper_ordering we make a decision if using an index is better than
using filesort for ordering. If we chose to do range access then in test_quick_select we
should make sure that cost for table scan is set to DBL_MAX so that it is not picked.
2019-09-21 12:14:05 +05:30
Christian Hesse
7a4019a1c7 MDEV-19207 systemd service: add instance name in description
The unit files made systemd print:

systemd[1]: Started MariaDB 10.3.13 database server (multi-instance).

Let's add the instance name, so starting mariadb@foo.service
makes it print:

systemd[1]: Started MariaDB 10.3.13 database server (multi-instance foo).
2019-09-21 08:08:52 +03:00
Igor Babaev
ba7725dace MDEV-20229 CTE defined with table value constructor cannot be used in views
A CTE can be defined as a table values constructor. In this case the CTE is
always materialized in a temporary table.
If the definition of the CTE contains a list of the names of the CTE
columns then the query expression that uses this CTE can refer to the CTE
columns by these names. Otherwise the names of the columns are taken from
the names of the columns in the result set of the query that specifies the
CTE.
Thus if the column names of a CTE are provided in the definition the
columns of result set should be renamed. In a general case renaming of
the columns is done in the select lists of the query specifying the CTE.
If a CTE is specified by a table value constructor then there are no such
select lists and renaming is actually done for the columns of the result
of materialization.
Now if a view is specified by a query expression that uses a CTE specified
by a table value constructor saving the column names of the CTE in the
stored view definition becomes critical: without these names the query
expression is not able to refer to the columns of the CTE.

This patch saves the given column names of CTEs in stored view definitions
that use them.
2019-09-20 15:59:54 -07:00
Vicențiu Ciorbaru
6a7d51b1cb MDEV-19211 Fix mysqld_safe --dry-run
mysqld_safe --dry-run needs to either call exit or return, depending if
it is being sourced or not, otherise return can lead to the error:

return: can only `return' from a function or sourced script

The original fix suggestion was proposed by FaramosCZ <mschorm@centrum.cz>
2019-09-21 01:04:07 +03:00
David Carlier
631c5ab45f Removing obsolete register keyword 2019-09-21 00:21:10 +03:00
Anel Husakovic
1ad79c8187 MDEV-19679 - CREATE SERVER needs tweaks for compatibility with CONNECT engine 2019-09-20 01:54:38 -07:00
Anel Husakovic
fd5cd073cc MDEV 19205 Sphinx unable to connect using a host name
- Enable the test `sphinx.sphinx` which was disabled by MDEV 10986,
  comit ee0094d2fd
- Add test case to `sphinx.sphinx` to cover host as localhost instead of `127.0.0.1`
- Add result file for single test
2019-09-20 01:36:06 -07:00
Caribe 1999
9611d7e08a Fix
There's an annoying bug that prevents a Sphinx table to connect to a searchd using a host name.
So the example table in the documentation https://mariadb.com/kb/en/library/about-sphinxse/#basic-usage that point's to "localhost" actually doesn't work.
After some investigation I found two errors. The first one is a wrong check after the getaddrinfo call. The second is a wrong usage of the returned struct.
2019-09-20 01:36:06 -07:00
Sebastian Kemper
d99216356d cmake: support new libedit interface
libedit changed it's interface a while ago. MariaDB's cmake file doesn't
recognize the new interface, the compile test fails:

/mariadb-10.2.19/CMakeFiles/CMakeTmp/src.cxx: In function 'int main(int, char**)':
/mariadb-10.2.19/CMakeFiles/CMakeTmp/src.cxx:6:47: error: invalid conversion from 'char*' to 'int' [-fpermissive]
  int res= (*rl_completion_entry_function)(0,0);
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~

Fix this by adding a detection for the new interface as well.

Run-tested on a MIPS machine.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2019-09-20 10:27:27 +02:00
Alexander Barkov
2f88bd2da2 MDEV-20634 Report disallowed subquery errors as such (instead of parse error) 2019-09-20 10:36:20 +04:00
Daniel Black
75bcf1f9ad MDEV-12646: systemd service file changes from Fedora
Include comment header that describes overrides.

Unit description now includes @VERSION@.

After=syslog.target removed - redunant

Add --basedir=@prefix to prevent /root/.my.cnf lookups. This is
placed after $MYSQLD_OPTIONS in case a user sets a --{no,}default
type options which has to be first in the mysqld arguements.

Additional changes to multi instance (support-files/mariadb@.service.in):
* added @SYSTEMD_EXECSTARTPRE@ / @SYSTEMD_EXECSTARTPOST@
* removed mariadb@bootstrap reference as galera_new_cluster as
  it's a little too proment.
* use_galera_new_cluster.conf updated to override pre/post steps
  to ensure it has no side effects

Signed-off-by: Daniel Black <daniel@linux.vnet.ibm.com>
2019-09-20 08:59:18 +03:00
Marko Mäkelä
4afe9d4b6d MDEV-16222: Move the test to gcol.innodb_virtual_debug_purge 2019-09-20 08:30:31 +03:00
Simon Lipp
c0db3fe6da MDEV-18438 Don't stream xtrabackup_info of extra-lsndir 2019-09-19 17:47:54 +03:00
Marko Mäkelä
8887effe13 MDEV-12353 preparation: page_mem_alloc_heap()
Define the function in the same compilation unit as its only callers
page_cur_insert_rec_low() and page_cur_insert_rec_zip().
2019-09-19 08:35:21 +03:00
Thirunarayanan Balathandayuthapani
f94d9ab9f8 MDEV-20483 Follow-up fix
At commit, trx->lock.table_locks (which is a cache of trx_locks) can
consist of NULL pointers. Add a debug assertion for that, and clear
the vector.
2019-09-18 20:20:04 +05:30
Stepan Patryshev
b3a7c07eae Enable galera.MW-286 test case. 2019-09-18 16:50:46 +03:00
Marko Mäkelä
bb4214272a Merge 10.1 into 10.2 2019-09-18 16:24:48 +03:00
Otto Kekäläinen
b9dea911bf Extend mysql_instal_db to search plugins also from lib/*/mariadb19/plugin
In Debian official the MariaDB plugins (.so files) go to a separate
versioned directory so that upgrades and dependencies will work correctly.

This change extends this script to check the /usr/lib/*/mariadb19/..
directory in addition to what it already does. Without this change
the script fails with:

  $ mysql_install_db ...
  Cannot change ownership of the '/auth_pam_tool_dir' directory
  to the 'mysql' user. Check that you have the necessary permissions and
  try again.
2019-09-18 16:11:49 +03:00
Otto Kekäläinen
97cd583df7 Deb: Sync non-functional changes from official Debian 10.4 packaging
- Update comment strings
- Extend package description to satisfy Lintian complaint
- Remove uscan stanza from rules as it is never used anyway
2019-09-18 16:11:49 +03:00
Otto Kekäläinen
ffd36093f1 Deb: Run 'wrap-and-sort -a' so comparison across releases is easier 2019-09-18 16:11:49 +03:00
Marko Mäkelä
24859049c6 MDEV-20485: Disable galera.galera_var_node_address 2019-09-18 16:10:07 +03:00
Marko Mäkelä
a624b99f91 Remove an unused declaration 2019-09-18 16:10:03 +03:00
Varun Gupta
273d8eb12c MDEV-20589: Server still crashes in Field::set_warning_truncated_wrong_value
The flag is_stat_field is not set for the min_value and max_value of field items
inside table share. This is a must requirement as we don't want to throw
warnings of truncation when we read values from the statistics table to the column
statistics of table share fields.
2019-09-18 15:06:02 +05:30
Otto Kekäläinen
13c2fd36c1 Deb: Implement proper version detection in maintainer scripts
Fixes bug introduced in commit 5415002.

Using script run-time filename does not always work. One cannot assume
that the filename is always the same as there might be temporary file
names used by dpkg in certain situations. See Debian #920415.

The same fix has been successfully in use in Debian official packages
since February 2019:
https://salsa.debian.org/mariadb-team/mariadb-10.3/commit/6440c0d6e75
2019-09-18 10:58:16 +03:00
Marko Mäkelä
71e856e152 MDEV-12353 preparation: Clean up page directory operations
page_mem_free(): Define in the same file with the only caller
page_cur_delete_rec().

page_dir_slot_set_rec(): Add const qualifier to a parameter.

page_dir_delete_slot(): Merge with the only caller page_dir_balance_slot().

page_dir_add_slot(): Merge with the only caller page_dir_split_slot().

page_dir_split_slot(), page_dir_balance_slot(): Define in the
same compilation unit with the callers, and simplify the code.
2019-09-18 10:53:31 +03:00
Thirunarayanan Balathandayuthapani
8a79fa0e4d MDEV-19529 InnoDB hang on DROP FULLTEXT INDEX
Problem:
=======
  During dropping of fts index, InnoDB waits for fts_optimize_remove_table()
and it holds dict_sys->mutex and dict_operaiton_lock even though the
table id is not present in the queue. But fts_optimize_thread does wait
for dict_sys->mutex to process the unrelated table id from the slot.

Solution:
========
  Whenever table is added to fts_optimize_wq, update the fts_status
of in-memory fts subsystem to TABLE_IN_QUEUE. Whenever drop index
wants to remove table from the queue, it can check the fts_status
to decide whether it should send the MSG_DELETE_TABLE to the queue.

Removed the following functions because these are all deadcode.
dict_table_wait_for_bg_threads_to_exit(),
fts_wait_for_background_thread_to_start(),fts_start_shutdown(), fts_shudown().
2019-09-18 13:22:08 +05:30
Sachin
2eeac53715 Fix compile error in macOS caused by MDEV-20477 2019-09-18 11:58:42 +05:30
Sachin
386f9d14bd Disable part of binlog_table_map_optional_metadata.test (because of MDEV-20582) 2019-09-18 11:58:42 +05:30
Alexander Barkov
bf617c3654 MDEV-20423 Assertion 0' failed or btr_validate_index(index, 0, false)' in row_upd_sec_index_entry or error code 126: Index is corrupted upon DELETE with TIME_ROUND_FRACTIONAL 2019-09-18 09:51:13 +04:00
Varun Gupta
c471bfb34e Fixing a test to reset to original state 2019-09-18 01:44:36 +05:30
Thirunarayanan Balathandayuthapani
708f1e3419 MDEV-19647 Server hangs after dropping full text indexes and restart
- There is no need to add the table in fts_optimize_wq if there is
no fts indexes associated with it.
2019-09-17 20:47:58 +05:30
Thirunarayanan Balathandayuthapani
fb3e3a6a3d MDEV-20483 trx_lock_t::table_locks is not a subset of trx_lock_t::trx_locks
Problem:
=======
  Transaction left with nonempty table locks list. This leads to
assumption that table_locks is not subset of trx_locks. Problem is that
lock_wait_timeout_thread() doesn't remove the table lock from
table_locks for transaction.

Solution:
========
  In lock_wait_timeout_thread(), remove the lock from table vector of
transaction.
2019-09-17 19:54:55 +05:30
Leandro Pacheco
efefafd02f fix for thread getting stuck after BF ABORT (#1362)
- Fixes a situation in which a thread gets BF aborted and does not send the reply back to
  the client, even though the connection is still alive. That caused
  both sides to hang waiting for the next message. Now we explicitly
  check that the connection is still alive.
- MTR test for the above
- Replaced thd->killed assignments to thd->reset_kill_query where applicable.
2019-09-17 10:58:20 +03:00
Marko Mäkelä
46a6cea5c5 Merge 10.4 into 10.5 2019-09-17 09:07:52 +03:00
Alexander Barkov
74551b2b6f Cleanup: removing Type_handler members m_name_xxx
Hiding the definitions inside Type_handler_xxx::name().

This is needed to avoid exporting members with MYSQL_PLUGIN_IMPORT,
which would be needed to compile data type plugins on Windows.
2019-09-17 08:00:37 +04:00
Alexander Barkov
9b1866fd84 Cleanup: removing Type_handler members m_version_xxx
Introducing methods instead:
  const Name version_mysql56() const;
  const Name version_mariadb53() const;

This is needed to avoid exporting members with MYSQL_PLUGIN_IMPORT,
which would be needed to compile data type plugins on Windows.
2019-09-17 07:15:02 +04:00
Jan Lindström
c793f07841 Re-record galera_shutdown_nonprim for 10.4. 2019-09-16 14:57:39 +03:00
Jan Lindström
da76ae2162 Disable galera_var_notify_cmd as it causes hang. 2019-09-16 14:57:18 +03:00
Sujatha
90a9c4cae7 MDEV-20217: Semi_sync: Last_IO_Error: Fatal error: Failed to run 'after_queue_event' hook
Fix:
===
Implemented upstream fix.

commit 7d3d0fc303
Author: He Zhenxing <zhenxing.he@sun.com>

Backport Bug#45852 Semisynch: Last_IO_Error: Fatal error: Failed
to run 'after_queue_event' hook

Errors when send reply to master should never cause the IO thread
to stop, because master can fall back to async replication if it
does not get reply from slave.

The problem is fixed by deliberately ignoring the return value of
slave_reply.
2019-09-16 15:45:24 +05:30
Teemu Ollakka
509d103810 MDEV-20561 Galera node shutdown fails in non-Primary (#1386)
Command COM_SHUTDOWN was rejected in non-Primary because
server_command_flags[COM_SHUTDOWN] had value CF_NO_COM_MULTI
instead of CF_SKIP_WSREP_CHECK.

As a fix removed assignment
server_command_flags[CF_NO_COM_MULTI]= CF_NO_COM_MULTI
which overwrote server_command_flags[COM_SHUTDOWN].
2019-09-15 11:24:57 +03:00
Jan Lindström
2a98d0b5ca Fix #2 for galera.MW-336 2019-09-14 12:15:01 +03:00