Commit graph

176472 commits

Author SHA1 Message Date
Alexey Botchkov
da5c3e03f6 MDEV-9255 Add generation_expression to information_schema.columns.
Added IS_GENERATED and GENERATION_EXPRESSION columns required by
        the SQL standard
2017-03-28 23:36:33 +04:00
Igor Babaev
93dd70ced8 Fixed bug mdev-12375.
The function st_select_lex_unit::exec_recursive() incorrectly determined
that a CTE mutually recursive with some others was stabilized in the case
when the non-recursive part of the CTE returned an empty set. As a result
the server fell into an infinite loop when executing a query using
this CTE.
2017-03-27 14:41:17 -07:00
Vladislav Vaintroub
046d442d4c Merge branch '10.2' of https://github.com/mariadb/server into 10.2 2017-03-27 16:47:01 +00:00
Vladislav Vaintroub
d3f82e3a67 Fix connect engine crashes in buildbot tests on Win64.
Do not truncate pointers returned by _findfirst to int.
2017-03-27 16:46:38 +00:00
Igor Babaev
ad7da60ded Fixed bug mdev-12368.
Mutually recursive CTE could cause a crash of the server in the case
when they were not Standard compliant. The crash happened in
mysql_derived_prepare(), because the destructor the derived_result
object created for a CTE that was mutually recursive with some others
was called twice. Yet this destructor should not be called for resursive
references.
2017-03-26 23:00:28 -07:00
Igor Babaev
5a4537f092 Fixed bug mdev-12360.
The method With_element::check_unrestricted_recursive() icorrectly performed
the check that no recursive reference is not encountered in inner parts of
outer joins. As a result the server reported errors for valid specifications
with outer joins.
2017-03-26 23:00:28 -07:00
Vladislav Vaintroub
b56262f696 MDEV-12328, attempt to fix windows packaging 2017-03-26 23:03:25 +00:00
Marko Mäkelä
23d72bf3aa Close a file handle in a Perl snippet.
This could fix a race condition between mysqld and perl on Windows.
2017-03-24 19:17:23 +02:00
Marko Mäkelä
cd2fe26116 MDEV-11802 innodb.innodb_bug14676111 fails on buildbot
The test was unnecessarily depending on InnoDB purge, which can
sometimes fail to proceed.

Let us rewrite the test to use BEGIN;INSERT;ROLLBACK to cause the
immediate removal of the desired records.
2017-03-24 18:24:46 +02:00
Vladislav Vaintroub
ec307de388 Merge pull request #342 from rasmushoj/10.2
MDEV-12328, added building of AWS for release builds
2017-03-24 16:04:39 +01:00
Rasmus Johansson
3c3bbbb704 MDEV-12328, added building of AWS for release builds 2017-03-24 16:54:59 +02:00
Alexey Botchkov
92f18bdede MDEV-11177 mysqlbinlog exits silently without error when another
instance connects to server.

        New thread kill status added KILL_SLAVE_SAME_ID, and the related
        error message.
2017-03-22 01:48:22 +04:00
Vladislav Vaintroub
1ca8637ae3 Windows : Fix several thousand of warnings with Visual C++ compiler
On some weird reason, Visual C++ does not like newly introduced
#define ut_ad(EXPR)	DBUG_ASSERT(EXPR)

and writes bogus "not enough parameters for DBUG_ASSERT" warning.

Workaround it with
#define ut_ad DBUG_ASSERT
2017-03-20 14:14:52 +00:00
Alexey Botchkov
76f6c1e1ed MDEV-12262 Assertion `!null_value' failed in virtual bool Item::send on
JSON_REMOVE.

        null_value wasn't properly set in Item_json_func_remove::val_str.
2017-03-20 15:18:06 +04:00
Marko Mäkelä
a06da5c848 MDEV-12258 InnoDB: Fix the bogus debug assertion introduced in MDEV-12219
After a partial rollback, an undo log segment that is empty
may carry a duplicate-looking top_undo_no.

Adjust the debug assertions and add a test.
2017-03-18 21:37:36 +02:00
Vladislav Vaintroub
6c5cfbbf33 Fix crash (race condition) in DBUG in connect2 test case.
When "simulate_failed_connection_1"  DBUG keyword is set, current thread's
DBUG stack points to global variable in dbug (init_settings).
This global variable could be overriden while current THD is still active,
producing crash in worst scenario.

Added DBUG_SET()so that the current thread own dbug
context that cannot concurrently modified by anyone else.
2017-03-17 19:20:08 +00:00
Jon Olav Hauglid
a77ac6513e Bug#21153166: REMOVE UNUSED VARIABLES AND CONVERT GLOBAL SYMBOLS TO STATIC
Follow-up to
Bug#21141390: REMOVE UNUSED FUNCTIONS AND CONVERT GLOBAL SYMBOLS TO STATIC
but for variables instead of functions.

Was identified with the -Wmissing-variable-declarations
compiler warning option supported by Clang 3.6.

Reviewed-by: Marko Mäkelä <marko.makela@oracle.com>

RB: 9070
2017-03-17 12:49:20 +02:00
Marko Mäkelä
97acc4a1c3 MDEV-12270 Port MySQL 8.0 Bug#21141390 REMOVE UNUSED FUNCTIONS AND CONVERT GLOBAL SYMBOLS TO STATIC
InnoDB defines some functions that are not called at all.
Other functions are called, but only from the same compilation unit.

Remove some function declarations and definitions, and add 'static'
keywords. Some symbols must be kept for separately compiled tools,
such as innochecksum.
2017-03-17 12:48:50 +02:00
Marko Mäkelä
4e1116b2c6 MDEV-12271 Port MySQL 8.0 Bug#23150562 REMOVE UNIV_MUST_NOT_INLINE AND UNIV_NONINL
Also, remove empty .ic files that were not removed by my MySQL commit.

Problem:
InnoDB used to support a compilation mode that allowed to choose
whether the function definitions in .ic files are to be inlined or not.
This stopped making sense when InnoDB moved to C++ in MySQL 5.6
(and ha_innodb.cc started to #include .ic files), and more so in
MySQL 5.7 when inline methods and functions were introduced
in .h files.

Solution:
Remove all references to UNIV_NONINL and UNIV_MUST_NOT_INLINE from
all files, assuming that the symbols are never defined.
Remove the files fut0fut.cc and ut0byte.cc which only mattered when
UNIV_NONINL was defined.
2017-03-17 12:42:07 +02:00
Vladislav Vaintroub
c63ca3d7f0 Do not send MARIADB_CLIENT_STMT_BULK_OPERATIONS server capability,
until the protocol changes for bulk are finalized.
2017-03-17 09:00:31 +00:00
Vladislav Vaintroub
66905f6dcb Fix several compile warnings on Windows 2017-03-17 08:56:57 +00:00
Marko Mäkelä
7668a79a88 MDEV-12269 Port Bug#22996442 INNODB: MAKE UNIV_DEBUG DEPEND ON DBUG_OFF
This is a partial port of my patch in MySQL 8.0.
In MySQL 8.0, all InnoDB references to DBUG_OFF were replaced
with UNIV_DEBUG. We will not do that in MariaDB.

InnoDB used two independent compile-time flags that distinguish
debug and non-debug builds, which is confusing.

Also, make ut_ad() and alias of DBUG_ASSERT().
2017-03-16 10:24:53 +02:00
Marko Mäkelä
105f46ffb8 MDEV-12273 Remove dict_table_t::does_not_fit_in_memory
In the InnoDB internal SQL parser, there is the keyword
DOES_NOT_FIT_IN_MEMORY that is never specified in any CREATE TABLE
statement that is passed to the InnoDB SQL parser
(que_eval_sql() or pars_sql() or yyparse()). If this keyword were
ever present, it would set the flag dict_table_t::does_not_fit_in_memory
which is only present in debug builds.

Let us remove all traces of this.

Also, fix storage/innobase/pars/make_flex.sh so that no the generated
file storage/innobase/pars/lexyy.cc works as is.

FIXME: Always generate the InnoDB Bison files at build time, similar
to how sql/sql_yacc.yy is handled. (This would still leave the
generated scanner files, unless we want to add a build-time dependency
for Flex.)
2017-03-16 10:24:53 +02:00
Varun Gupta
aad15eae89 Test result for MDEV-10766 fixed 2017-03-16 10:18:02 +05:30
Varun Gupta
cd7e6d8b53 MDEV-11645: archive.archive fails in buildbot with valgrind (Use of uninitialised value)
The fix is about filling the space beyond the end of VARCHAR values with zeroes.
VARCHAR NULLs already has its buffer filled with zeros. So when the VARCHAR fields
are not NULL, then we explicitly fill the buffer with zeros.
2017-03-15 21:26:39 +05:30
Varun Gupta
6ac754163c MDEV-10766: Queries which start with WITH clause do not get inserted into query cache
Added conditions so that the WITH queries are also added to the query cache
2017-03-15 20:15:31 +05:30
Oleksandr Byelkin
122d0701f7 MDEV-11761: CLIENT_DEPRECATE_EOF : Client must identify a "stored procedure output resultset"
fix proposed by Diego
2017-03-15 13:45:14 +01:00
Alexey Botchkov
5dd4d663fa Test result fixed. 2017-03-15 15:51:44 +04:00
Marko Mäkelä
b5285bd7e2 MDEV-11873 Unnecessary InnoDB warnings upon bootstrap
dict_create_or_check_foreign_constraint_tables(): Change the warning
about the foreign key metadata table creation to a note.

Remove messages after metadata table creation. If the creation fails,
startup will abort with a message. Normally the creation succeeds on
bootstrap, and the messages would only be noise.

Remove the related suppressions from the tests.
2017-03-14 17:11:46 +02:00
Alexey Botchkov
af6eee1fc5 MDEV-11833 JSON functions don't seem to respect max_allowed_packet.
Now let's check JSON length to fit the max_allowed packet.
2017-03-14 17:31:14 +04:00
Alexey Botchkov
d0e8b427a1 MDEV-12078 Using spatial index changes type from point to geometry
In get_mm_tree we have to change Field_geom::geom_type to
        GEOMETRY as we have to let storing all types of the spatial features
        in the field. So now we restore the original geom_type as it's
        done.
2017-03-14 16:35:39 +04:00
Alexey Botchkov
7c7c0696e7 MDEV-11856 json_search doesn't search for values with double quotes
character (").

        The my_wildcmp function doesn't expect the string parameter to
        have escapements, only the template. So the string
        should be unescaped if necessary.
2017-03-14 15:25:02 +04:00
Marko Mäkelä
a77c2ea78f Post-fix MDEV-12219 Discard temporary undo logs at transaction commit
row_purge_remove_sec_if_poss_leaf(): Add a debug assertion.

row_purge_parse_undo_rec(): Add a debug assertion that the table cannot
be a temporary table. Remove a dead condition.
2017-03-14 12:15:49 +02:00
Vladislav Vaintroub
f0a2f4bbb9 Windows : Remove the option for creating anonymous account from the MSI in 10.2 2017-03-13 20:14:28 +00:00
Vladislav Vaintroub
b7ffe9b81e MDEV-11903 : correction - min innodb pagesize is 4K 2017-03-13 19:58:04 +00:00
Vladislav Vaintroub
a8715884a4 MDEV-11903 Windows : Support innodb page sizes in the installer/mysql_install_db.exe
- add PAGESIZE property to the MSI installer
- add combobox  to the MSI UI to select innodb page size
- add new parameter --innodb_page_size for mysql_install_db.exe.
this is passed down to bootstrap and also stored in my.ini.

MSI will call mysql_install_db.exe with --innodb_page_size set to the
PAGESIZE property
2017-03-13 18:39:11 +00:00
Oleksandr Byelkin
bfef611a22 MDEV-12244: C API header file contains C++ comment for COM_BINLOG_DUMP_GTID
fixed C++ comment in C code
2017-03-13 18:03:05 +01:00
Marko Mäkelä
13e5c9de80 MDEV-12219 Discard temporary undo logs at transaction commit
Starting with MySQL 5.7, temporary tables in InnoDB are handled
differently from persistent tables. Because temporary tables are
private to a connection, concurrency control and multi-versioning
(MVCC) are not applicable. For performance reasons, purge is
disabled as well. Rollback is supported for temporary tables;
that is why we have the temporary undo logs in the first place.

Because MVCC and purge are disabled for temporary tables, we should
discard all temporary undo logs already at transaction commit,
just like we discard the persistent insert_undo logs. Before this
change, update_undo logs were being preserved.

trx_temp_undo_t: A wrapper for temporary undo logs, comprising
a rollback segment and a single temporary undo log.

trx_rsegs_t::m_noredo: Use trx_temp_undo_t.
(Instead of insert_undo, update_undo, there will be a single undo.)

trx_is_noredo_rseg_updated(), trx_is_rseg_assigned(): Remove.

trx_undo_add_page(): Remove the parameter undo_ptr.
Acquire and release the rollback segment mutex inside the function.

trx_undo_free_last_page(): Remove the parameter trx.

trx_undo_truncate_end(): Remove the parameter trx, and add the
parameter is_temp. Clean up the code a bit.

trx_undo_assign_undo(): Split the parameter undo_ptr into rseg, undo.

trx_undo_commit_cleanup(): Renamed from trx_undo_insert_cleanup().
Replace the parameter undo_ptr with undo.
This will discard the temporary undo or insert_undo log at
commit/rollback.

trx_purge_add_update_undo_to_history(), trx_undo_update_cleanup():
Remove 3 parameters. Always operate on the persistent update_undo.

trx_serialise(): Renamed from trx_serialisation_number_get().

trx_write_serialisation_history(): Simplify the code flow.
If there are no persistent changes, do not update MONITOR_TRX_COMMIT_UNDO.

trx_commit_in_memory(): Simplify the logic, and add assertions.

trx_undo_page_report_modify(): Keep a direct reference to the
persistent update_undo log.

trx_undo_report_row_operation(): Simplify some code.
Always assign TRX_UNDO_INSERT for temporary undo logs.

trx_prepare_low(): Keep only one parameter. Prepare all 3 undo logs.

trx_roll_try_truncate(): Remove the parameter undo_ptr.
Try to truncate all 3 undo logs of the transaction.

trx_roll_pop_top_rec_of_trx_low(): Remove.

trx_roll_pop_top_rec_of_trx(): Remove the redundant parameter
trx->roll_limit. Clear roll_limit when exhausting the undo logs.
Consider all 3 undo logs at once, prioritizing the persistent
undo logs.

row_undo(): Minor cleanup. Let trx_roll_pop_top_rec_of_trx()
reset the trx->roll_limit.
2017-03-13 18:57:17 +02:00
Marko Mäkelä
056ec4ab24 Fix some compilation warnings. 2017-03-13 18:11:36 +02:00
Marko Mäkelä
e5b155a4e5 MDEV-12091 Shutdown fails to wait for rollback of recovered transactions to finish
In the 10.1 InnoDB Plugin, a call os_event_free(buf_flush_event) was
misplaced. The event could be triggered by rollback of resurrected
transactions while shutdown was in progress. This bug was caught
by cmake -DWITH_ASAN testing. This call was only present in the
10.1 InnoDB Plugin, not in other versions, or in XtraDB.

That said, the bug affects all InnoDB versions. Shutdown assumes the
cessation of any page-dirtying activity, including the activity of
the background rollback thread. InnoDB only waited for the background
rollback to finish as part of a slow shutdown (innodb_fast_shutdown=0).
The default is a clean shutdown (innodb_fast_shutdown=1). In a scenario
where InnoDB is killed, restarted, and shut down soon enough, the data
files could become corrupted.

logs_empty_and_mark_files_at_shutdown(): Wait for the
rollback to finish, except if innodb_fast_shutdown=2
(crash-like shutdown) was requested.

trx_rollback_or_clean_recovered(): Before choosing the next
recovered transaction to roll back, terminate early if non-slow
shutdown was initiated. Roll back everything on slow shutdown
(innodb_fast_shutdown=0).

srv_innodb_monitor_mutex: Declare as static, because the mutex
is only used within one module.

In 10.2, os_event_destroy() sets the event to a NULL pointer,
while os_event_free() in earlier versions did not do that.
2017-03-13 18:11:36 +02:00
Marko Mäkelä
ff8bf6e933 Define a mtr_t::start() wrapper inline. 2017-03-13 18:11:01 +02:00
Marko Mäkelä
c32dcae65a Adjust an outdated comment.
os_sync_free(), which hid resource leaks, was removed in MySQL 5.7.
2017-03-13 18:11:01 +02:00
Oleksandr Byelkin
c0fb7b458b MDEV-10555: Server crashes in mysql_admin_table upon killing ANALYZE
Take into acount result of open table operation in mysql_admin_table.
2017-03-13 15:31:12 +01:00
Otto Kekäläinen
eded6243bc MDEV-12096: Fix ln syntax in debian/rules for libmariadb3 symlink creation
Compatibility links ended up looking like this:
libmysqlclient.so.18 -> /tmp/buildd/mariadb-10.2-10.2.0/debian/tmp/usr/lib/i386-linux-gnu/libmariadb.so.3

This change fixes ln syntax to create links with correct target paths.
2017-03-11 10:54:51 +02:00
Oleksandr Byelkin
eb574697c0 fix test for windows 64 2017-03-10 22:44:52 +01:00
Vladislav Vaintroub
f2fe5cb282 Fix several compile warnings on Windows 2017-03-10 19:07:07 +00:00
Vladislav Vaintroub
7c512138a1 Revert MySQL commit that disables writing on Windows while flush is in progress
Reason : after running sysbench tests (rw,update_no_index), in all cases
the throughout was considerably (approx 15%) better with the patch removed.

Reverted commit info
commit 8dc03bee3ade2edcc53a3a257346f4a0a9f0b44c
Author: Yasufumi Kinoshita <yasufumi.kinoshita@oracle.com>
Date:   Wed Nov 20 17:02:24 2013 +0900

Bug #17824101 : WL#7050 CAUSES RW PERFORMANCE REGRESSION AT SOME WINDOWS ENVIRONMENT
2017-03-10 19:07:07 +00:00
Marko Mäkelä
a20340cf85 Hard-code innodb_page_size as the undo log page size.
InnoDB undo logs currently always use the innodb_page_size,
whether they are stored in the system tablespace, in a
dedicated undo tablespace, or in the temporary tablespace.
Remove redundant page_size parameters.

TrxUndoRsegsIterator::set_next(): return bool instead of page_size.
2017-03-10 08:15:25 +02:00
Marko Mäkelä
0ef91c8958 Simplify InnoDB transaction system initialization.
trx_rseg_mem_create(): Remove the parameter rseg_array.
Update trx_sys->rseg_array directly.
2017-03-10 08:15:25 +02:00
Marko Mäkelä
1417839810 InnoDB purge_sys cleanup.
TrxUndoRsegsIterator::m_purge_sys: Remove. There is only one purge_sys.

purge_sys_t: Renamed from trx_purge_t. Define a constructor and
destructor. Allocate rseg_iter, purge_queue inline.

purge_sys->trx: Remove. Use purge_sys->sess->trx instead.

purge_sys->view_active: Remove. Access to purge_sys->view is always
protected by purge_sys->latch.

trx_purge_sys_create(): Replaced by purge_sys_t::purge_sys_t().

trx_purge_sys_close(): Replaced by purge_sys_t::~purge_sys_t().
2017-03-10 08:15:25 +02:00