Commit graph

179103 commits

Author SHA1 Message Date
Sergei Golubchik
4666f01534 mroonga after-merge test fixes
"sed -r" fails on labrador. Don't use sed, use perl.
2017-11-17 13:55:14 +08:00
Vladislav Vaintroub
0d1e805aeb Fix rocksdb tests on Windows 2017-11-16 22:11:08 +00:00
Vladislav Vaintroub
689168be12 MDEV-13852 - redefine WinWriteableFile such as IsSyncThreadSafe()
is set to true, as it should.

Copy and modify original io_win.h header file to a different location
(as we cannot patch anything in submodule). Make sure modified header is
used.
2017-11-16 18:57:18 +00:00
Alexey Botchkov
842dce378a MDEV-14402 JSON_VALUE doesn't escape quote.
Result unescaping added.
2017-11-16 19:59:27 +04:00
Jan Lindström
d7349e204b MDEV-9663: InnoDB assertion failure: *cursor->index->name == TEMP_INDEX_PREFIX
MariaDB adjustments to test case innodb-replace-debug and
add missing instrumentation to row0ins.cc.

MariaDB 10.1 does not seem to be affected.
2017-11-16 14:05:49 +02:00
Jan Lindström
d8ccc61f76 MDEV-9663: InnoDB assertion failure: *cursor->index->name == TEMP_INDEX_PREFIX
Add missing instrumentation to row0ins.cc.
2017-11-16 14:03:02 +02:00
Jan Lindström
eeec64d75e MDEV-9663: InnoDB assertion failure: *cursor->index->name == TEMP_INDEX_PREFIX
Imported missing test case from MySQL 5.7 for

commit 25781c154396dbbc21023786aa3be070057d6999
Author: Annamalai Gurusami <annamalai.gurusami@oracle.com>
Date:   Mon Feb 24 14:00:03 2014 +0530

    Bug #17604730 ASSERTION: *CURSOR->INDEX->NAME == TEMP_INDEX_PREFIX
2017-11-16 13:58:09 +02:00
Jan Lindström
93326ef051 MDEV-9663: InnoDB assertion failure: *cursor->index->name == TEMP_INDEX_PREFIX
MariaDB adjustments to test case innodb-replace-debug.

MariaDB 10.0 does not seem to be affected.
2017-11-16 13:21:07 +02:00
Jan Lindström
923ea5dbf6 MDEV-9663: InnoDB assertion failure: *cursor->index->name == TEMP_INDEX_PREFIX
Imported missing test case from MySQL 5.7 for

commit 25781c154396dbbc21023786aa3be070057d6999
Author: Annamalai Gurusami <annamalai.gurusami@oracle.com>
Date:   Mon Feb 24 14:00:03 2014 +0530

    Bug #17604730 ASSERTION: *CURSOR->INDEX->NAME == TEMP_INDEX_PREFIX
2017-11-16 13:18:22 +02:00
Jan Lindström
c44ece7342 MDEV-9663: InnoDB assertion failure: *cursor->index->name == TEMP_INDEX_PREFIX
MariaDB adjustments to test case innodb-replace-debug.
2017-11-16 12:56:54 +02:00
Jan Lindström
f7b110bdc1 MDEV-9663: InnoDB assertion failure: *cursor->index->name == TEMP_INDEX_PREFIX
Imported missing test case from MySQL 5.7 for

commit 25781c154396dbbc21023786aa3be070057d6999
Author: Annamalai Gurusami <annamalai.gurusami@oracle.com>
Date:   Mon Feb 24 14:00:03 2014 +0530

    Bug #17604730 ASSERTION: *CURSOR->INDEX->NAME == TEMP_INDEX_PREFIX

MariaDB 5.5 does not seem to be affected.
2017-11-16 12:39:41 +02:00
Jan Lindström
0c4d11e819 MDEV-13206: INSERT ON DUPLICATE KEY UPDATE foreign key fail
This is caused by following change:

commit 95d29c99f01882ffcc2259f62b3163f9b0e80c75
Author: Marko Mäkelä <marko.makela@oracle.com>
Date:   Tue Nov 27 11:12:13 2012 +0200

    Bug#15920445 INNODB REPORTS ER_DUP_KEY BEFORE CREATE UNIQUE INDEX COMPLETED

    There is a phase during online secondary index creation where the index has
    been internally completed inside InnoDB, but does not 'officially' exist yet.
    We used to report ER_DUP_KEY in these situations, like this:

    ERROR 23000: Can't write; duplicate key in table 't1'

    What we should do is to let the 'offending' operation complete, but report an
    error to the
    ALTER TABLE t1 ADD UNIQUE KEY (c2):

    ERROR HY000: Index c2 is corrupted
    (This misleading error message should be fixed separately:
    Bug#15920713 CREATE UNIQUE INDEX REPORTS ER_INDEX_CORRUPT INSTEAD OF DUPLICATE)

    row_ins_sec_index_entry_low(): flag the index corrupted instead of
    reporting a duplicate, in case the index has not been published yet.

    rb:1614 approved by Jimmy Yang

Problem is that after we have found duplicate key on primary key
we continue to get necessary gap locks in secondary indexes to
block concurrent transactions from inserting the searched records.
However, search from unique index used in foreign key constraint
could return DB_NO_REFERENCED_ROW if INSERT .. ON DUPLICATE KEY UPDATE
does not contain value for foreign key column. In this case
we should return the original DB_DUPLICATE_KEY error instead
of DB_NO_REFERENCED_ROW.

Consider as a example following:

create table child(a int not null primary key,
b int not null,
c int,
unique key (b),
foreign key (b) references
parent (id)) engine=innodb;

insert into child values (1,1,2);

insert into child(a) values (1) on duplicate key update c = 3;

Now primary key value 1 naturally causes duplicate key error that will be
stored on node->duplicate. If there was no duplicate key error, we should
return the actual no referenced row error. As value for column b used in
both unique key and foreign key is not provided, server uses 0 as a
search value. This is naturally, not found leading to DB_NO_REFERENCED_ROW.
But, we should update the row with primay key value 1 anyway as
requested by on duplicate key update clause.
2017-11-16 11:05:24 +02:00
Jun Su
2401d14e6b Support CRC32 SSE2 implementation under Windows 2017-11-16 09:59:18 +01:00
Andrei Elkin
c7e38076f3 MDEV-9510 Segmentation fault in binlog thread causes crash
With combination of --log-bin and Galera the server may crash
reporting two characteristic stacks:

  /usr/sbin/mysqld(_ZN13MYSQL_BIN_LOG13mark_xid_doneEmb+0xc7)[0x7f182a8e2cb7]
  /usr/sbin/mysqld(binlog_background_thread+0x2b5)[0x7f182a8e3275]

or

  /usr/sbin/mysqld(_ZN13MYSQL_BIN_LOG21do_checkpoint_requestEm+0x9d)[0x7ff395b2dafd]
  /usr/sbin/mysqld(_ZN13MYSQL_BIN_LOG20checkpoint_and_purgeEm+0x11)[0x7ff395b2db91]
  /usr/sbin/mysqld(_ZN13MYSQL_BIN_LOG16rotate_and_purgeEb+0xc2)[0x7ff395b300b2]

The reason of the failure appears to be non-matching decrements for
  `xid_count_per_binlog::xid_count`
which can occur when a transaction is executed having its connection issued
`SET @@sql_log_bin=0`. In such case the xid count is not incremented but
its decrements still runs to turn `binlog_xid_count_list` into improper state
which the following FLUSH BINARY LOGS exposes through the crash.

*Note_1*: the regression test reuses an existing galera.sql_log_bin
which does not run stably (even in its base form) by mtr with --log-bin.

*Note_2*: 10.0-galera branch is free of this issue having missed MDEV-7205
fixes.
2017-11-15 22:26:32 +02:00
Andrei Elkin
aae4932775 MDEV-12012/MDEV-11969 Can't remove GTIDs for a stale GTID Domain ID
As reported in MDEV-11969 "there's no way to ditch knowledge" about some
domain that is no longer updated on a server. Besides being of annoyance to
clutter output in DBA console stale domains can prevent the slave
to connect the master as MDEV-12012 witnesses.
What domain is obsolete must be evaluated by the user (DBA) according
to whether the domain info is still relevant and will the domain ever
receive any update.

This patch introduces a method to discard obsolete gtid domains from
the server binlog state. The removal requires no event group from such
domain present in existing binlog files though. If there are any the
containing logs must be first PURGEd in order for

  FLUSH BINARY LOGS DELETE_DOMAIN_ID=(list-of-domains)

succeed. Otherwise the command returns an error.

The list of obsolete domains can be computed through
intersecting two sets - the earliest (first) binlog's Gtid_list
and the current value of @@global.gtid_binlog_state - and extracting
the domain id components from the intersection list items.
The new DELETE_DOMAIN_ID featured FLUSH continues to rotate binlog
omitting the deleted domains from the active binlog file's Gtid_list.
Notice though when the command is ineffective - that none of requested to delete
domain exists in the binlog state - rotation does not occur.

Obsolete domain deletion is not harmful for connected slaves as long
as master side binlog files *purge* is synchronized with FLUSH-DELETE_DOMAIN_ID.
The slaves must have the last event from purged files processed as usual,
in order not to bump later into requesting a gtid from a file which
was already gone.
While the command is not replicated (as ordinary FLUSH BINLOG LOGS is)
slaves, even though having extra domains, won't suffer from reconnection errors
thanks to master-slave gtid connection protocol allowing the master
to be ignorant about a gtid domain.
Should at failover such slave to be promoted into master role it may run
the ex-master's

 FLUSH BINARY LOGS DELETE_DOMAIN_ID=(list-of-domains)

to clean its own binlog state.

NOTES.
  suite/perfschema/r/start_server_low_digest.result
is re-recorded as consequence of internal parser codes changes.
2017-11-15 22:26:32 +02:00
Oleksandr Byelkin
88cc6db0a4 MDEV-13453: Executing a query via CTE requires more permissions than the query itself
Fix of nondebuging version issue
2017-11-15 13:25:55 +01:00
Alexander Barkov
02e35ef5f2 MDEV-12681 Wrong VIEW results for CHAR(0xDF USING latin1) 2017-11-15 15:52:03 +04:00
Marko Mäkelä
5e7435c4b0 Correct a merge error (remove a bogus #ifdef) 2017-11-15 08:53:31 +02:00
Eugene Kosov
ea1739f90d removed garbase struct member 2017-11-15 09:28:28 +08:00
Daniel Bartholomew
7e1326cfcf bump the VERSION 2017-11-14 17:23:17 -05:00
Igor Babaev
3afc9629fd Fixed bug mdev-13453 Executing a query via CTE requires more permissions
than the query itself

ACL checks were not properly supported for tables used in CTE
specifications. This patch fixes the problem.
2017-11-14 12:23:31 -08:00
Daniel Bartholomew
d7b2bc98bf bump the VERSION 2017-11-14 13:03:54 -05:00
Oleksandr Byelkin
2913f615f0 MDEV-8949: COLUMN_CREATE unicode name breakage
Use utf-mb4 if it is possible.
2017-11-14 10:49:46 +01:00
Alexey Botchkov
24184938ad MDEV-11881 Empty coordinates must be rejected in GeoJSON objects.
Check for the empty 'coordinates' array.
2017-11-14 13:36:50 +04:00
Oleksandr Byelkin
0f43279cc4 MDEV-13936: Server crashes in Time_and_counter_tracker::incr_loops
Repeat reworked solution of procedures for all posible Sp (functions &
triggers).
2017-11-14 08:54:21 +01:00
Vladislav Vaintroub
05103c84ec MDEV-14205 Windows : fix race condition writing into error log and setvbuf
Do not do reopen_fstreams/setbuf twice during server startup on Windows.
fprintf(stderr,..) might crash, if setbuf is executed at the same time.
2017-11-13 18:41:55 +00:00
Vladislav Vaintroub
5632652804 update C/C 2017-11-13 14:59:43 +00:00
Vladislav Vaintroub
f48d56c459 MDEV-14192 Apply marko's patch 2017-11-13 14:58:18 +00:00
Sergei Golubchik
8b18a44fa7 mroonga after-merge CMakeLists.txt fixes
1. remove erroneously committed *.orig
2. fix LZ4 detection on Mac OS X and FreeBSD. Cannot do

   pkg_check_modules(LIBLZ4 liblz4)
   find_library(LIBLZ4_LIBS ... )

because find_library(X) does not do anything if X is defined (documented),
and pkg_check_modules(Y) sets Y_LIBS to "" (undocumented!)
2017-11-13 13:11:53 +08:00
Marko Mäkelä
b2dd5232d4 InnoDB: Remove ut_vsnprintf() and the use of my_vsnprintf(); use vsnprintf() 2017-11-13 04:32:56 +02:00
Marko Mäkelä
c19ef508b8 InnoDB: Remove ut_snprintf() and the use of my_snprintf(); use snprintf() 2017-11-13 02:11:48 +02:00
Marko Mäkelä
17bd6ed29a Remove STATUS_VERBOSE (there is no visible output) 2017-11-12 17:27:36 +02:00
Igor Babaev
b5cb4ae470 Fixed bug MDEV-14368 Improper error for a grouping query that
uses alias in HAVING when sql_mode = 'ONLY_FULL_GROUP_BY'

This patch corrects the patch for bug#18739: non-standard
HAVING extension was allowed in strict ANSI sql mode
added in 2006 by commit 4b7c4cd27f.
As a result of incompleteness of the fix in the above commit
if a query with GROUP BY contained an aggregate function with an
alias and this alias was used in the HAVING clause of the query
the server reported an error when sql_mode was set to
'ONLY_FULL_GROUP_BY'.
2017-11-11 11:45:59 -08:00
Alexey Botchkov
1e2d4f677e MDEV-13971 crash in skip_num_constant.
Character bigger than 0x60 wasn't handled properly
        inside a numeric constant.
2017-11-11 13:54:56 +04:00
Igor Babaev
dcbf2823c7 Fixed MDEV-13994 Bad join results with orderby_uses_equalities=on.
This patch effectively blocks the optimization that uses multiple
equalities for ORDER BY to remove tmp table in the case when
the first table happens to be the result of materialization of
a semi-join nest. Currently there is no code at the execution level
that would support the optimization in this case.
2017-11-10 14:01:29 -08:00
Elena Stepanova
1fdf11669c Updated list of unstable tests for 10.1.29 release 2017-11-10 21:06:58 +02:00
Marko Mäkelä
589b0b3655 Allow innodb_open_files to be exceeded 2017-11-10 16:06:44 +02:00
Marko Mäkelä
fa00fedaac MDEV-14100 Assertion `!is_user_rec || leaf || ...
rec_get_offsets_func(): Relax a bogus debug assertion.
It would fail when we are operating on a copied prefix
of a node pointer record.
2017-11-10 15:58:52 +02:00
Marko Mäkelä
9618c04e3f Follow-up fix of MDEV-13795/MDEV-14332
row_log_table_apply_op(): Remove references to dict_table_t::n_vcols.
Virtual column information is no longer being written to the log.

row_log_t: Remove the unused fields n_old_col, n_old_vcol.
2017-11-10 15:58:52 +02:00
Sergei Golubchik
36f8474403 MDEV-14337 mysqld_safe may suppress error messages with --log-output=file
don't close stdout/stderr, redirect them to /dev/null instead.
otherwise redirections like >&2 fail with "invalid file descriptor"
2017-11-10 12:48:52 +01:00
Marko Mäkelä
c0e10f375a Fix a -Wimplicit-fallthrough warning 2017-11-10 09:07:45 +02:00
Sergei Golubchik
2a4e4335c4 Merge branch 'github/10.0-galera' into 10.1 2017-11-10 01:38:03 +01:00
Sergei Golubchik
7002291b8a Merge branch '10.0' into 10.1 2017-11-10 01:14:58 +01:00
Sergei Golubchik
d79fd5ba7f Merge branch 'ks-10.1-mroonga' into 10.1 2017-11-10 01:14:55 +01:00
Marko Mäkelä
5d142f9958 MDEV-13795/MDEV-14332 Corruption during online table-rebuilding ALTER when VIRTUAL columns exist
When MySQL 5.7 introduced indexed virtual columns, it introduced
several bugs into the online table-rebuilding ALTER, that is,
the row_log_table_apply() family of functions.

The online_log format that was introduced for online table-rebuilding
ALTER in MySQL 5.6 should be sufficient. Ideally, any indexed virtual
column values would be evaluated based on the log records in the temporary
file. There is no need to log virtual column values.

(For ADD INDEX, that is row_log_apply(), we always must log the values of
the keys, no matter if the columns are virtual.)

Because omitting the virtual column values removes any chance of
row_log_table_apply() working with indexed virtual columns, we
will for now refuse LOCK=NONE in table-rebuilding ALTER operations
when indexes on virtual columns exist. This restriction would be
lifted in MDEV-14341.

innobase_indexed_virtual_exist(): New predicate, to determine if
indexed virtual columns exist in a table definition.

ha_innobase::check_if_supported_inplace_alter(): Refuse online rebuild
if indexed virtual columns exist.

rec_get_converted_size_temp_v(), rec_convert_dtuple_to_temp_v(): Remove.

row_log_table_delete(), row_log_table_update(, row_log_table_insert():
Remove parameters for virtual columns.

trx_undo_read_v_rows(): Remove the col_map parameter.

row_log_table_apply(): Do not deal with virtual columns.
2017-11-09 23:39:12 +02:00
Sergei Golubchik
56394a78e3 MDEV-12372 mysqlbinlog --version output is the same on 10.x as on 5.5.x, and contains not only version
don't print usage() for --version
2017-11-09 21:43:52 +01:00
Sergei Golubchik
c97a7cdbd0 remove redundant tests from mysql-test/include/*.inc files
Some tests are skipped by checks in suite.pm. It is redundant to
have an sql-level run-time check in the .inc file itself.

In some cases it's not only redundant, but dangerous.
After one bug in 10.2 innodb.create_isl_with_direct failed
to start InnoDB, but the server started fine (just without InnoDB)
and instead of failing, the test was skipped by run-time check in
have_innodb.inc.

# Conflicts:
#	mysql-test/include/not_embedded.inc
#	mysql-test/r/change_user_notembedded.result
#	mysql-test/suite.pm
#	mysql-test/t/change_user_notembedded.test
2017-11-09 20:51:11 +01:00
Sergei Golubchik
7ec6c6fa62 typo 2017-11-09 20:47:56 +01:00
Sergei Golubchik
3028357aa5 Merge branch '5.5' into 10.0 2017-11-09 20:33:23 +01:00
Vladislav Vaintroub
53c7aaf332 MDEV-14077 Incremental backup extremly slow
Remove the main bottleneck -  the memset() call mentioned in the bug.
Use os_mem_alloc_large() instead of malloc()/memset().
2017-11-09 19:07:05 +00:00