Commit graph

181813 commits

Author SHA1 Message Date
Alexander Barkov
9e9ea4f64a MDEV-15821 Row format replication from LONGBLOB COMPRESSED to LONGBLOB does not work 2018-04-10 15:34:20 +04:00
Sergei Golubchik
9bd3af97df MDEV-15413 Unexpected errors upon CREATE TABLE .. WITH SYSTEM VERSIONING AS SELECT ...
numerous fixes for CREATE ... SELECT with system versioning:
In CREATE ... SELECT the table is created based on the result set,
field properties do not count. That is
* field invisibility is *not* copied over
* AS ROW START/END is *not* copied over
* the history is *not* copied over
* system row_start/row_end fields can *not* be created from the SELECT part
2018-04-10 13:12:36 +02:00
Aleksey Midenkov
72dd813f7e MDEV-15427 IB: TRX_ID based operations inside transaction generate history
[closes tempesta-tech#472]
2018-04-10 13:12:36 +02:00
Sergei Golubchik
a4251d6f18 MDEV-15391 Server crashes in JOIN::fix_all_splittings_in_plan or Assertion `join->best_read < double(1.79...e+308L)' failed
vers_setup_conds() used to AND all conditions on row_start/row_end
columns and store it either in the WHERE clause or in the ON
clause for some table. In some cases this caused ON clause
to have conditions for tables that aren't part of that ON's join.

Fixed to put a table's condition always in the ON clause of the
corresponding table.

Removed unnecessary ... `OR row_end IS NULL` clause, it's not needed
in the ON clause.

Simplified handling on PS and SP.
2018-04-10 13:12:36 +02:00
Sergei Golubchik
1a86fc5f14 MDEV-15378 Valid query causes invalid view definition due to syntax limitation in FOR SYSTEM_TIME
fix parsing of the AS OF clause
2018-04-10 13:12:36 +02:00
Eugene Kosov
bb56a06d26 MDEV-15062 Information Schema COLUMNS Table does not show system versioning information
get_schema_column_record(): print 'WITHOUT SYSTEM VERSIONING` in 'EXTRA'
for such fields
2018-04-10 13:12:36 +02:00
Sergei Golubchik
339b905579 ./mtr --gdb='b mysql_parse;r'
--gdb now accepts an argument, it will be passed to gdb as a command.
multiple commands can be separated by a (non-standard and not escapable)
delimiter - semicolon (;).

Old usage with a bare --gdb continues to work too, of course.
2018-04-10 13:12:36 +02:00
Sergei Golubchik
041e9de6f8 wording: don't prohibit 2018-04-10 13:12:36 +02:00
Aleksey Midenkov
689f83d0ce MDEV-14790 System versioning for system tables does not work as expected
disallow system versioning for tables in mysql database
2018-04-10 13:12:36 +02:00
Sergei Golubchik
dba43f4bec fix comparison of row_start/row_end 2018-04-10 13:12:36 +02:00
Sergei Golubchik
08a901cc0b cleanup: remove XString::operator== and !=
use named methods instead.
2018-04-10 13:12:36 +02:00
Sergei Golubchik
0dcb47cae9 change lex_string_eq to return what it says
the function xxx_eq(a,b) returns true if two elements
are equal and false if they are not.
2018-04-10 13:12:36 +02:00
Sergei Golubchik
479bd5a6fe improve strmake_buf() to detect wrong usage reliably
strmake_buf() macro should only be used with char[] arrays,
and never with char* pointers. To distinguish between the two
we create a new variable of the same type and initialize it
using array initializer, this causes compilation failure
with pointers. The variable is unused and will be removed by the
compiler. It's enough to do this check only with gcc, so
it doesn't have to be portable.
2018-04-10 13:12:36 +02:00
Sergei Golubchik
7dcf1b5049 dead code in versioning/common.inc 2018-04-10 13:12:36 +02:00
Sergei Golubchik
35678c9572 dead code - related to vtmd
(will be added back when it'll be used)
2018-04-10 13:12:36 +02:00
Sergei Golubchik
09e6280147 remove unused THD::query_start_used 2018-04-10 13:12:35 +02:00
Sergei Golubchik
85194bd6ba fix detection of "-Wa,-nH" compiler flags on SunOS/i386 2018-04-10 13:12:35 +02:00
Marko Mäkelä
e7cbb2afa1
Merge pull request #696 from tempesta-tech/tt-10.3-kevgs
remove dead code
2018-04-10 10:41:20 +03:00
Otto Kekäläinen
7980364804 Deb: Fix commit c0f5addecb - also rename .install file 2018-04-09 23:09:03 +03:00
Eugene Kosov
1513630d30 remove dead code 2018-04-09 17:21:21 +03:00
Marko Mäkelä
0c8d6fd66c MDEV-15364 FOREIGN CASCADE operations in system versioned referenced tables
Merge pull request #667
2018-04-09 11:02:24 +03:00
Marko Mäkelä
5a9e7bc6fe MDEV-13603 innodb_fast_shutdown=0 may fail to purge all history
srv_purge_should_exit(): Remove the parameter n_purged.
If we happened to have n_purged==0 while some transaction was still
active, and then that transaction was added to the history list,
we were prematurely stopping the purge. It is more appropriate to
first check for trx_sys.any_active_transactions() == 0
(this count can only decrease during shutdown) and then for
trx_sys.history_size() == 0 (that count typically decreases, but
can increase when any remaining active transactions are committed
or rolled back).

innodb.dml_purge: Remove a server restart, and explicitly wait for
purge, and use FLUSH TABLE FOR EXPORT to read the file contents.
This will make the test run faster, easier to debug, and also
allow it to run with --embedded. This might also help repeat
MDEV-11802 better. The issue MDEV-13603 remains will remain tested
by innodb.table_flags.
2018-04-09 10:47:46 +03:00
Marko Mäkelä
df44e75b42 Minor clean-up of purge code
purge_sys_t::n_submitted: Document that it is only accessed by
srv_purge_coordinator_thread.

purge_sys_t::n_completed: Exclusively use my_atomic access.

srv_task_execute(): Simplify the code.

srv_purge_coordinator_thread(): Test the cheaper condition first.

trx_purge(): Atomically access purge_sys.n_completed.
Remove some code duplication.

trx_purge_wait_for_workers_to_complete(): Atomically access
purge_sys.n_completed. Remove an unnecessary local variable.

trx_purge_stop(): Remove a redundant assignment.
2018-04-08 18:11:49 +03:00
Marko Mäkelä
0f6186c550 Make my_atomic_*lint type-safe 2018-04-08 18:05:01 +03:00
Marko Mäkelä
8beeeddd83 MDEV-12266 fixup: Fix bug in row_ins_sec_index_entry()
row_ins_sec_index_entry(): Compare a pointer to fil_system.sys_space,
not to a numeric constant. This code was recently changed in MDEV-13637,
and the condition was essentially disabled, potentially causing the
change buffer to grow uncontrollably when something is inserted into
a table that has secondary indexes and resides in the system tablespace.

Thanks to Daniel Black for pointing out that clang 7 flagged a warning
for the comparison of a pointer to an integer.

row_import_for_mysql(): Fix a possible compiler warning.
2018-04-08 18:04:24 +03:00
Otto Kekäläinen
c0f5addecb Deb: Remove versioning of MariaDB Backup and depend on client
There is no need for MariaDB Backup to be versioned. Other packages are
very unlikely to need to depend on a certain generation of this package.

Also for MariaDB Backup to run, it does not need the server, but client,
and from client only core parts.
2018-04-07 15:36:18 +03:00
Marko Mäkelä
1730ac5c4a MDEV-15348 Failure to load CREATE SEQUENCE...ROW_FORMAT=REDUNDANT
dict_sys_tables_type_valid(): Do not reject NO_ROLLBACK (sequence)
in ROW_FORMAT=REDUNDANT.

dict_load_table_low(): When flagging an error, assign *table = NULL.
Failure to do so could cause a crash if an error was flagged when
accessing INFORMATION_SCHEMA.INNODB_SYS_TABLES.
2018-04-07 04:22:44 +03:00
Eugene Kosov
7477b97e91 rename "where" to "row_end_data" 2018-04-06 17:38:14 +03:00
Eugene Kosov
e41ae769c1 use dedicated heap for upd_node_t::historical_row and corresponding stuff to
make its lifetime as short as possible

for historical row ROW_COPY_DATA -> ROW_COPY_POINTER for lower memory
consumption and better performance
2018-04-06 17:20:45 +03:00
Michael Widenius
8692973031 Fixed wrong argument to my_snprintf() 2018-04-06 13:15:40 +03:00
Michael Widenius
e27bfeca6a Added test case for MDEV-15742 to prove that it works
MDEV-15742 Assertion `table_share->tmp_table != NO_TMP_TABLE ||
m_lock_type == 1' failed in handler::ha_write_row
2018-04-06 12:31:13 +03:00
Alexander Barkov
a1a966fc0e Cleanup: renaming methods make_field(Send_field*) to make_send_field(..)
Renaming methods:
- Field::make_field(Send_field*) to make_send_field(..)
- Item::make_field(THD *,Send_field *) to make_send_field(..)
- Item::init_make_field(Send_field *, enum_field_type) to init_make_send_field(..)

These names looked similar to other functions that are used
for a very different purpose (creating Field instances):
- Public function "Field * make_field(..)"
- Method "Field *Column_defitinion::make_field(..)"

The rename makes it's easier to search the code using "grep".
2018-04-05 21:27:33 +04:00
Michael Widenius
d8da97b09a MDEV-14762 Server crashes in MDL_ticket::has_stronger_or_equal_type upon inserting into temporary sequence
Fix is to not upgrade MDL locks for temporary tables
2018-04-05 15:17:41 +03:00
luz.paz
3dd01669b4 Misc. typos
Found via `codespell -i 3 -w --skip="./debian/po" -I ../mariadb-server-word-whitelist.txt  ./cmake/ ./debian/ ./Docs/ ./include/ ./man/ ./plugin/ ./strings/`
2018-04-05 15:26:57 +04:00
Michael Widenius
7c68930031 Fix compiler warnings in connect 2018-04-05 13:55:28 +03:00
Michael Widenius
1d7b4c2689 MDEV-15738 Server crashes in my_strcasecmp_utf8 on query from I_S with UNION executed as PS
Problem was the Item_field::Item_field(THD*, Field*) had old code
that put a null pointer in orig_field_names. Now, when we have
proper re-prepare if table definition changes, this is not needed
anymore.
2018-04-05 13:55:28 +03:00
Otto Kekäläinen
30f692f016 Deb: Make AWS key management plugin a special plugin not in Linux distros
It will only build if there is network access, which is a strict no-go
for Linux distributions. Thus the AWS plugin needs to be a custom built
only special plugin that is not built as part of the normal sources.

This fixes the build error in e.g. Launchpad:

  Performing download step (git clone) for 'aws_sdk_cpp'
  cd "/<<PKGBUILDDIR>>/builddir/plugin/aws_key_management" && /usr/bin/cmake ..
  Cloning into 'aws-sdk-cpp'...
  fatal: unable to access 'https://github.com/awslabs/aws-sdk-cpp.git/':
  Could not resolve host: github.com
2018-04-04 22:43:45 +03:00
Otto Kekäläinen
c720a1f8b8 Deb: Build RocksDB only on 64-bit and small endian architectures
RocksDB configure step checks that platform is 64-bit and little endian,
so limit the .deb packages to be built only on those platforms.

List of official Debian platforms at
https://www.debian.org/ports/index.en.html
2018-04-04 22:43:45 +03:00
Otto Kekäläinen
e88e967a3d Deb: Exclude libnuma-dev as build-dep on armhf where is does not exist 2018-04-04 22:43:45 +03:00
Otto Kekäläinen
ec53e031bb Deb: Bump epoch to supercede 1:10.1.29-6 in Debian
A non-MariaDB.org contributor introduced the epoch 1: in Debian.
There is no way to revert it, so we just need to adapt to it to
ensure no 10.3 installation would downgrade to that version in
Debian/Ubuntu, as 1: is considered higher than any version before.
2018-04-04 22:43:45 +03:00
Jacob Mathew
2b0c6b7aa1 MDEV-7914: spider/bg.ha, spider/bg.ha_part crash server sporadically in buildbot
The crash occurs when a thread that is closing its connection attempts to
access Spider transaction information when another thread has freed that memory
while processing Spider plugin deinit.  This occurs because Spider does not
adjust the plugin's reference count when it sets a transaction information
pointer for the plugin.

The fix I implemented changes the way Spider sets the transaction information
pointer to use thd_set_ha_data() so that Spider's plugin reference counter is
adjusted as well.

Author:
  Jacob Mathew.

Reviewer:
  Kentoku Shiba.

Merged From:
  bb-10.3-MDEV-7914
2018-04-04 11:34:20 -07:00
Varun Gupta
7c8c9a8bfa MDEV-15241: make SIGNAL maximum MESSAGE_TEXT length a larger value
Increasing the length of MESSAGE_TEXT from 128 to MYSQL_ERRMSG_SIZE which is the max length of the
error message
2018-04-04 19:04:14 +05:30
Sergey Vojtovich
e6a9ce2759 MDEV-15773 - Simplified away trx_sys_t::m_views
Use trx_sys_t::trx_list instead.
2018-04-04 14:09:37 +04:00
Sergey Vojtovich
3d5f7ad23a MDEV-15773 - Simplified away trx_free_for_(mysql|background) 2018-04-04 14:09:37 +04:00
Sergey Vojtovich
0993d6b81b MDEV-15773 - trx_sys.mysql_trx_list -> trx_sys.trx_list
Replaced "list of transactions created for MySQL" with "list of all
transactions". This simplifies code and allows further removal of
trx_sys.m_views.
2018-04-04 14:09:37 +04:00
Sergey Vojtovich
061c767cce MDEV-15773 - Simplified away trx_t::in_mysql_trx_list 2018-04-04 14:09:37 +04:00
Sergey Vojtovich
d6d58836bb MDEV-15773 - trx_allocate_for_background() -> trx_create()
trx_free_resurrected(): Remove, unused function
2018-04-04 14:09:37 +04:00
Marko Mäkelä
a5da1c64f8 Merge 10.2 into 10.3 2018-04-04 08:24:57 +03:00
Marko Mäkelä
12ed50cc8d MDEV-15767 innodb.101_compatibility fails
The test innodb.101_compatibility occasionally fails, because the flags
for the tables tdd and tp are not always converted back. Thus, the
second attempt of corrupting the flags will update garbage to garbage,
and cause test failure.

This started failing related to one or two MDEV-12266 commits affecting
the function fsp_flags_try_adjust().

fsp_flags_try_adjust(): If the file has not been opened (space->size==0),
try determining its size by reading the file. Only if the file is not
readable, give up.

Also, avoid dummy writes in the Perl script, and add some instrumentation.
2018-04-04 08:22:33 +03:00
Jacob Mathew
eabfadce5d MDEV-7914: spider/bg.ha, spider/bg.ha_part crash server sporadically in buildbot
The crash occurs when a thread that is closing its connection attempts to
access Spider transaction information when another thread has freed that memory
while processing Spider plugin deinit.  This occurs because Spider does not
adjust the plugin's reference count when it sets a transaction information
pointer for the plugin.

The fix I implemented changes the way Spider sets the transaction information
pointer to use thd_set_ha_data() so that Spider's plugin reference counter is
adjusted as well.

Author:
  Jacob Mathew.

Reviewer:
  Kentoku Shiba.
2018-04-03 18:41:39 -07:00