Commit graph

66400 commits

Author SHA1 Message Date
Igor Babaev
4c9d19ee65 Fixed the bug mdev-13796.
A reference to a CTE may occur not in the master of the CTE
specification. In this case if the reference to the CTE is
the first one the specification should be detached from its
master and attached to the referencing select.

Also fixed the TYPE column in the lines of the EXPLAIN output
created for CTE tables.
2017-10-11 10:22:46 -07:00
Alexander Barkov
3062445a64 MDEV-14038 ALTER TABLE does not exit on error with InnoDB + bad default function
Changing Field::set_default from void to int.
It now uses the same return value notation with Field::store*()
and Item::save_in_field().
2017-10-11 18:13:44 +04:00
Alexey Botchkov
fe0d2e1a2b MDEV-13923 Assertion `!is_set() || (m_status == DA_OK_BULK &&
is_bulk_op())' failed upon altering table with geometry field.

        Check for the validity of the DEFAULT value for the
        geometry field.
2017-10-11 11:57:26 +04:00
Vladislav Vaintroub
93690b96e2 Fix warnings in Win64 2017-10-11 08:44:24 +02:00
Jan Lindström
f2a0fa8685 Fix test failure on galera.view caused by incorrect location
of WSREP_TO_ISOLATION_BEGIN.
2017-10-10 16:54:09 +03:00
Vladislav Vaintroub
dc93ce8dea Windows : Fix truncation warnings in sql/ 2017-10-10 06:19:50 +00:00
sjaakola
0b5a5258ab MW-416 DDL replication moved after acl checking
galera_events test shows a regression with the original fix for MW-416
Reason was that Events::drop_event() can be called also from inside event
execution, and there we have a speacial treatment for event, which executes
"DROP EVENT" statement, and runs TOI replication inside the event processing body.
This resulted in executing WSREP_TO_ISOLATION two times for such DROP EVENT statement.
Fix is to call WSREP_TO_ISOLATION_BEGIN only in Events::drop_event()
2017-10-10 08:37:44 +03:00
sjaakola
70c23321de MW-416
Changed return code for replicatio error to TRUE.
This is aligned with native mysql convention to return TRUE (defined to 1) or FALSE (defined to 0) from a bool function.
This is wrong, but follows the mysql conventiosn, at least...
2017-10-10 08:37:44 +03:00
sjaakola
1841ef1c54 MW-416
Moved TOI replication to happen after ACL checking for commands:
SQLCOM_CREATE_EVENT
SQLCOM_ALTER_EVENT
SQLCOM_DROP_EVENT
SQLCOM_CREATE_VIEW
SQLCOM_CREATE_TRIGGER
SQLCOM_DROP_TRIGGER
SQLCOM_INSTALL_PLUGIN
SQLCOM_UNINSTALL_PLUGIN
2017-10-10 08:37:44 +03:00
Vladislav Vaintroub
da05d0276a merge 10.1->10.2
Some innobase/xtrabackup changes around  from 10.1 are null merged
, in partucular using os_set_file_size to extend tablespaces in server
or mariabackup.
They require non-trivial amount of additional  work in 10.2, due to
innobase differences between 10.1 and 10.2
2017-10-07 17:43:26 +00:00
Alexey Botchkov
ea4e8bab32 MDEV-12705 10.1.18-MariaDB-1~jessie - mysqld got signal 11.
Space for the next operation wasn't reserved in
        Item_func_spatial_relate::val_str()
2017-10-07 14:24:49 +04:00
Alexander Barkov
a659291e85 MDEV-11586 UNION of FLOAT type results in erroneous precision
Fixing the asymmetry in the array field_types_merge_rules[][]
which caused data loss when mixing FLOAT + BIGINT in UNIONs
or hybrid functions:

1. FLOAT  + INT    = DOUBLE
2. FLOAT  + BIGINT = FLOAT
3. INT    + FLOAT  = DOUBLE
4. BIGINT + FLOAT  = DOUBLE

Now FLOAT + BIGINT (as in #2) also produces DOUBLE, like the cases #1,#3,#4 do.
2017-10-06 13:29:29 +04:00
Alexey Botchkov
a3ba8c3660 MDEV-13703 Illegal mix of collations for operation 'json_object' on
using JSON_UNQUOTE as an argument.

        The coercibility and repertoire should be set properly for the
        JSON_UNQUOTE.
2017-10-06 09:28:33 +04:00
Alexey Botchkov
f1a20ec396 MDEV-12311 Insufficient check for argument validity in JSON functions.
Check validity to the end of the JSON in the json_length
        function.
2017-10-05 23:46:25 +04:00
Alexey Botchkov
1f6ada8da8 MDEV-13306 JSON_CONTAINS returns wrong value.
The 'value' state should be saved to be compared against the
        next array item.
2017-10-05 23:23:39 +04:00
Alexander Barkov
1cfaafafee MDEV-13242 Wrong results for queries with row constructors and information_schema 2017-10-05 13:41:16 +04:00
Sergei Golubchik
a62ebf2590 cppcheck harmless warnings
MDEV-13953 mariadb-10.2.9/storage/innobase/row/row0import.cc:3602: possible cut'n'paste error ?
MDEV-13955 mariadb-10.2.9/sql/log_event.cc:7671: possible wrong operator ?
2017-10-04 18:36:30 +02:00
Vladislav Vaintroub
8d413c32dc Fix several truncation and formatting warnings. 2017-10-03 19:43:43 +00:00
Sergei Petrunia
ebc2f0dad3 Avoid using HA_POS_ERROR constant when passing around values of type double.
This is error-prone and causes warnings on Windows
2017-10-03 16:23:39 +03:00
Marko Mäkelä
3c4cff3357 Merge 10.1 into 10.2 2017-10-02 11:16:53 +03:00
Vladislav Vaintroub
157d130a87 Fix some conversion warnings. 2017-09-30 09:26:58 +00:00
Vladislav Vaintroub
24d9664ad0 In table cache code, fix casts from longlong to long for
'version' variables.

The warnings occur on Windows build, yet they are also are valid
on 32bit Unix.

Fix is to consistently use 64bit integer on all platforms.
2017-09-29 17:27:21 +00:00
Vladislav Vaintroub
8e8a7f85a9 Fix DBUG_PRINT formatting in query cache.
some ulonglong variables were printed as %lu
2017-09-29 17:26:55 +00:00
Vladislav Vaintroub
ccf21c9962 fix some conversion warnings 2017-09-28 17:20:46 +00:00
Vladislav Vaintroub
7354dc6773 MDEV-13384 - misc Windows warnings fixed 2017-09-28 17:20:46 +00:00
Vladislav Vaintroub
509928718d MDEV-13384 Fix Windows warnings. thd_alloc functions now use size_t parameters
Fixes some warnings in popular headers.
2017-09-28 17:20:46 +00:00
Vladislav Vaintroub
eba44874ca MDEV-13844 : Fix Windows warnings. Fix DBUG_PRINT.
- Fix win64 pointer truncation warnings
(usually coming from misusing 0x%lx and long cast in DBUG)

- Also fix printf-format warnings

Make the above mentioned warnings fatal.

- fix pthread_join on Windows to set return value.
2017-09-28 17:20:46 +00:00
Sergei Golubchik
f0e9bebd27 MDEV-13897 SELECT @a := MAX(col) FROM t requires full index scan
fix some old bad merge
2017-09-27 10:22:15 +02:00
Sergei Golubchik
f7628ca3c2 cleanup: remove useless "inline" keywords
avoid a function call for a commonly used one-liner.
followup for 0627929f62
2017-09-27 10:22:14 +02:00
Sachin Setiya
0627929f62 MDEV-13787 Crash in persistent stats wsrep_on (thd=0x0)
Problem:- This crash happens because of thd = NULL , and while checking
for wsrep_on , we no longer check for thd != NULL (MDEV-7955). So this
problem is regression of MDEV-7955. However this patch not only solves
this regression , It solves all regression caused by MDEV-7955 patch.

To get all possible cases when thd can be null , assert(thd)/
assert(trx->mysql_thd) is place just before all wsrep_on and innodb test
suite is run. And the assert which caused failure are removed with a physical
check for thd != NULL. Rest assert are removed. Hopefully this method will
remove all current/potential regression of MDEV-7955.
2017-09-27 10:15:08 +05:30
Monty
a02b81daea Moved autosetting of host_cache_size and back_log to proper place
- Clean up formulas and comments for host_cache_size and back_log
- Added test of autoset (for host_cache_size)
- Marked open_files_limit as auto_set
2017-09-26 00:13:04 +03:00
Marko Mäkelä
7dcb8816a1 Merge 10.1 into 10.2 2017-09-25 13:46:54 +03:00
Marko Mäkelä
84be33abe0 Merge 10.0 into 10.1 2017-09-25 09:50:24 +03:00
Varun Gupta
f91eb71e1c MDEV-8840: ANALYZE FORMAT=JSON produces wrong data with BKA
The issue was that r_loops, r_rows and r_filtered in ANALYZE FORMAT= JSON were not
calculated for the table on which we were performing the MRR scan in the BKA join
Fixed this by adding respective counter in the JOIN_TAB_SCAN_MRR::open and JOIN_TAB_SCAN_MRR::next
2017-09-24 23:37:57 +05:30
Vladislav Vaintroub
7128fefa4c Fix compile with -DWITHOUT_DYNAMIC_PLUGINS on Unix 2017-09-23 23:23:05 +02:00
Sergei Golubchik
68d1a598bc bugfix: copy timestamps correctly in INSERT...SELECT
Implement Field_timestamp::save_in_field(timestamp_field)
that stores timestamp values without converting them to MYSQL_TIME
and back, because this conversion is lossy around DST change time.
This fixes main.old-mode test.

This is 10.2 version of f8a800bec8
2017-09-22 14:01:26 +02:00
Sergei Golubchik
a5e1f60b31 bugfix: ALTER TABLE and TIMESTAMPs around DST change time
Implement a special Copy_func function for timestamps, that copies
timestamps without converting them to MYSQL_TIME (the conversion is
lossy around DST change time).

This fixes ALTER TABLE part of main.old-mode test.

This is 10.2 version of f4f48e0621
2017-09-22 14:01:26 +02:00
Sergei Golubchik
bc4409ab4e MDEV-13868 cannot insert 1288481126 in a timestamp column in Europe/Moscow
make insert NULL into a timestamp mark the field as having an
explicit value. So that the field won't be assigned the value
again in TABLE::update_default_field()

make Item_func_now_local::save_in_field(timestamp_field) not to go
through MYSQL_TIME - this conversion is lossy around DST change times.
This fixes inserting a default value into a timestamp field.
2017-09-22 13:58:00 +02:00
Sergei Golubchik
f1ce69f3a9 Merge branch '10.1' into 10.2
But without f4f48e06215..f8a800bec81 - fixes for MDEV-12672
and related issues. 10.2 specific fix follows...
2017-09-22 02:27:00 +02:00
Sergei Golubchik
f8a800bec8 bugfix: copy timestamps correctly in INSERT...SELECT
don't do it via MYSQL_TIME, that conversion is lossy
around DST change dates.
2017-09-21 22:03:28 +02:00
Sergei Golubchik
f4f48e0621 MDEV-12672 Replicated TIMESTAMP fields given wrong value near DST change
Implement a special Copy_field method for timestamps, that copies
timestamps without converting them to MYSQL_TIME (the conversion
is lossy around DST change dates).
2017-09-21 22:03:21 +02:00
Sergei Golubchik
2e3a16e366 Merge branch '10.0' into 10.1 2017-09-21 22:02:21 +02:00
Sergei Golubchik
8d0448d507 MDEV-13861 Assertion `0' failed in Protocol::end_statement
followup for 378beed0a6 - only count WARN_LEVEL_ERROR,
not warnings or notes.
2017-09-21 21:43:07 +02:00
Sergei Golubchik
1015196e0a cleanup: TABLE_LIST::view_check_option
don't prepare for checking view's CHECK OPTION, if
there is no CHECK OPTION in the first place.
2017-09-21 10:04:29 +02:00
Sachin Setiya
e84f5356c3 MDEV-12290 Wrong timestamps in binary log causes replication issues
Binlog_background_thread does not make a call to set_time(), And when
we call binlog_checkpoint_log_event->write() , we write the wrong timestamp.
In this patch we correct this by calling thd->set_time().
2017-09-21 13:22:49 +05:30
Marko Mäkelä
dc112d2f48 Fix -Wimplicit-fallthrough warnings (no functional change) 2017-09-20 22:46:25 +03:00
Sergei Golubchik
378beed0a6 MDEV-13290: Assertion Assertion !is_set() || (m_status == DA_OK_BULK && is_bulk_op())' or ! is_set()' failed
followup for 97c2a7354b - don't use thd->is_error(),
the error could've been set before TABLE_LIST::cleanup_items.
Use the error handler to count errors.

This fixes rpl.rpl_row_binlog_max_cache_size - it was failing when
ER_STMT_CACHE_FULL happened duing multi-table update. Because
multi_update::abort_result_set() calls do_updates() to update
as much as possible, so one cannot rely on thd->is_error() after that.
2017-09-20 20:02:17 +02:00
Marko Mäkelä
96f06f952d MDEV-13847 Allow ALTER TABLE…ADD SPATIAL INDEX…ALGORITHM=INPLACE
MDEV-13851 Always check table options in ALTER TABLE…ALGORITHM=INPLACE

In the merge of MySQL 5.7.9 to MariaDB 10.2.2, some code was included
that prevents ADD SPATIAL INDEX from being executed with ALGORITHM=INPLACE.

Also, the constant ADD_SPATIAL_INDEX was introduced as an alias
to ADD_INDEX. We will remove that alias now, and properly implement
the same ADD SPATIAL INDEX restrictions as MySQL 5.7 does:

1. table-rebuilding operations are not allowed if SPATIAL INDEX survive it
2. ALTER TABLE…ADD SPATIAL INDEX…LOCK=NONE is not allowed

ha_innobase::prepare_inplace_alter_table(): If the ALTER TABLE
requires actions within InnoDB, enforce the table options (MDEV-13851).
In this way, we will keep denying ADD SPATIAL INDEX for tables
that use encryption (MDEV-11974), even if ALGORITHM=INPLACE is used.
2017-09-20 16:53:34 +03:00
Vicențiu Ciorbaru
2d9f5f69d4 Merge branch '10.1' into 10.2 2017-09-20 10:46:09 +03:00
Vicențiu Ciorbaru
c9e111202e Merge branch '10.0' into 10.1 2017-09-20 10:35:11 +03:00