Commit graph

69118 commits

Author SHA1 Message Date
Daniel Black
9b8d0d9ff9 MDEV-11455: test case for status variable innodb_buffer_pool_load_incomplete
Add innodb debug system variable, innodb_buffer_pool_load_pages_abort, to test
the behaviour of innodb_buffer_pool_load_incomplete.
(innodb_buufer_pool_dump_abort_loads.test)
2018-02-22 15:50:50 +11:00
Marko Mäkelä
cc3b5d1fe7 Merge bb-10.2-ext into 10.3 2018-02-15 11:48:30 +02:00
Marko Mäkelä
b006d2ead4 Merge bb-10.2-ext into 10.3 2018-02-15 10:22:03 +02:00
Monty
7bd81c726b Crash when giving error message for ALTER SEQUENCE
Fixes MDEV-14761 "Assertion `!mysql_parse_status || thd->is_error() ||
thd->get_internal_handler()' failed in parse_sql"
2018-02-15 10:18:55 +02:00
Alexander Barkov
c17a06abf8 MDEV-15310 Range optimizer does not work well for "WHERE temporal_column NOT IN (const_list)"
There were two problems related to the bug report:
1. Item_datetime::get_date() was not implemented.
   So execution went through val_int() followed
   by int-to-datetime or int-to-time conversion.
   This was the reason why the optimizer did not
   work well on data with fractional seconds.
2. Item_datetime::set() did not have a TIME specific code
   to mix months and days to hours after unpack_time().
   This is why the optimizer did not work well with negative
   TIME values, as well as huge time values.

Changes:

1. Overriding Item_datetime::get_date(), to return ltime.
   This fixes the problem N1.
2. Cleanup: Moving pack_time() and unpack_time() from
   sql-common/my_time.c and include/my_time.h to
   sql/sql_time.cc and sql/sql_time.h, as they are not needed
   on the client side.
3. Adding a new "enum_mysql_timestamp_type ts_type" parameter
   to unpack_time() and moving the TIME specific code to mix
   months and days with hours inside unpack_time().
   Adding a new "ts_type" parameter to Item_datetime::set(),
   to pass it from the caller down to unpack_time().
   So now the TIME specific code is automatically called
   from Item_datetime::set(). This fixes the problem N2.
   This change also helped to get rid of duplicate TIME specific code
   from other three places, where mixing month/days to hours
   was done immediately after unpack_time().
   Moving the DATE specific code to zero hhmmssff
   from Item_func_min_max::get_date_native to inside unpack_time(),
   for symmetry.
4. Removing the virtual method in_vector::result_type(),
   adding in_vector::type_handler() instead.
   This helps to get result_type(), field_type(),
   mysql_timestamp_type() of an in_vector easier.
   Passing type_handler()->mysql_timestamp_type() as
   a new parameter to Item_datetime::set() inside
   in_temporal::value_to_item().
5. Cleaup: Removing separate implementations of in_datetime::get_value()
   and in_time::get_value(). Adding a single implementation
   in_temporal::get_value() instead.
   Passing type_handler()->field_type() to get_value_internal().
2018-02-14 22:58:34 +04:00
Monty
1fe9092d06 Fix privilege checking for sequence
MDEV-13732 User with SELECT privilege can ALTER sequence
2018-02-14 16:43:22 +02:00
Marko Mäkelä
dc09f8f29c Merge 10.2 into bb-10.2-ext 2018-02-14 10:12:53 +02:00
Marko Mäkelä
c6e35276f1 Merge 10.1 into 10.2 2018-02-14 10:01:16 +02:00
Alexey Yurchenko
a33c9a07e5 GAL-506 breaks galera_defaults MTR test by upping repl.proto_max again. Fix this once and for all by overwriting it with constant string since it makes little sense to check for it in this test. 2018-02-14 09:58:18 +02:00
Alexander Barkov
95d075a0e5 MDEV-15293 CAST(AS TIME) returns bad results for LAST_VALUE(),NAME_CONST(),SP variable 2018-02-13 20:37:31 +04:00
Marko Mäkelä
0c4aeef976 Merge 10.2 into bb-10.2-ext 2018-02-13 16:51:45 +02:00
Marko Mäkelä
a778a62822 Re-record a result; repl.proto_max is 8, not 7 2018-02-13 16:39:51 +02:00
Marko Mäkelä
d9955b22e9 Merge 10.1 into 10.2 2018-02-13 14:49:47 +02:00
Marko Mäkelä
2202afd541 Merge 10.0 into 10.1 2018-02-13 14:32:17 +02:00
Marko Mäkelä
c051eaba46 MDEV-14988 innodb_read_only tries to modify files if transactions were recovered in COMMITTED state
lock_trx_release_locks(): Relax a debug assertion to allow
recovered TRX_STATE_COMMITTED_IN_MEMORY transactions.

trx_commit_in_memory(): Add DEBUG_SYNC instrumentation.

trx_undo_insert_cleanup(): Skip persistent changes if innodb_read_only
is set. This should only happen when a recovered committed transaction
would be cleaned up at shutdown.
2018-02-13 14:29:32 +02:00
Sergei Golubchik
3c87973235 MDEV-14990 mysql_upgrade fails with ERROR 1408 (HY000) at line 566: Event Scheduler: An error occurred when initializing system tables
Don't check mysql.db and mysql.user from event schedule on startup.

Event schedule should only check its own mysql.event table, it has
no business checking other system tables. In particular, it's ridiculous
for event schedule to fail when privilege tables are not the newest,
because sql_acl.cc supports old privilege tables just fine.
2018-02-13 00:23:57 +01:00
Sergei Golubchik
f7621f17bd rename mysql.user and mysql.db column
Truncate_versioning_priv->Delete_history_priv

because the command and the privilege were renamed
2018-02-12 23:43:48 +01:00
Sergei Golubchik
f51ecfee93 MDEV-15146 SQLError[4122]: View is not system versioned
don't expand AS OF in views, and, in particular, don't auto-add
AS OF NOW().
2018-02-12 23:43:48 +01:00
Sergei Golubchik
39157fbf05 Remove ER_NON_VERSIONED_FIELD_IN_HISTORICAL_QUERY 2018-02-12 23:43:47 +01:00
Sergei Golubchik
d0f5e56a20 MDEV-14785 SYSTEM_INVISIBLE behaviour not consistent
Hide INVISIBLE_SYSTEM columns from writes and from fix_vcol_expr().
2018-02-12 23:43:47 +01:00
Monty
54db0be3be Added Max_index_length and Temporary to SHOW TABLE STATUS
- Max_index_length is supported by MyISAM and Aria tables.
- Temporary is a placeholder to signal that a table is a
  temporary table. For the moment this is always "N", except
  "Y" for generated information_schema tables and NULL for
  views. Full temporary table support will be done in another task.
  (No reason to have to update a lot of result files twice in a row)
2018-02-12 17:17:26 +02:00
Monty
19dd14e648 Updated galera .result files 2018-02-12 17:17:26 +02:00
Marko Mäkelä
00f0c039d2 MDEV-15270 Mariabackup should not try to use doublewrite buffer
When Mariabackup gets a bad read of the first page of the system
tablespace file, it would inappropriately try to apply the doublewrite
buffer and write changes back to the data file (to the source file)!
This is very wrong and must be prevented.

The correct action would be to retry reading the system tablespace
as well as any other files whose first page was read incorrectly.
Fixing this was not attempted.

xb_load_tablespaces(): Shorten a bogus message to be more relevant.
The message can be displayed by --backup or --prepare.

xtrabackup_backup_func(), os_file_write_func(): Add a missing space
to a message.

Datafile::restore_from_doublewrite(): Do not even attempt the
operation in Mariabackup.

recv_init_crash_recovery_spaces(): Do not attempt to restore the
doublewrite buffer in Mariabackup (--prepare or --export), because
all pages should have been copied correctly in --backup already,
and because --backup should ignore the doublewrite buffer.

SysTablespace::read_lsn_and_check_flags(): Do not attempt to initialize
the doublewrite buffer in Mariabackup.

innodb_make_page_dirty(): Correct the bounds check.

Datafile::read_first_page(): Correct the name of the parameter.
2018-02-12 16:56:01 +02:00
Alexander Barkov
4087683e1a MDEV-15287 Bad result for LEAST/GREATEST(datetime_alike_string, time) 2018-02-12 17:55:48 +04:00
Sergei Golubchik
4fd48678ae ALTER TABLE ... DROP COLUMN sys_start
update all unique keys, not just PK
2018-02-12 14:14:35 +01:00
Sergei Golubchik
dfd42ed990 ALTER TABLE ... DROP COLUMN sys_start should rename a "dropped" column 2018-02-12 14:14:35 +01:00
Sergei Golubchik
c847089e6e Cannot DROP VERSIONING without dropping all visible AS ROW fields 2018-02-12 13:46:08 +01:00
Sergei Golubchik
f3a49e7020 Don't allow adding AS ROW START column to a not versioned table 2018-02-12 13:46:08 +01:00
Sergei Golubchik
bc0ac28f69 ALTER TABLE ... DROP VERSIONING
don't add columns to the drop list, INVISIBLE_SYSTEM columns
cannot be recognized as specified by the user
2018-02-12 13:46:07 +01:00
Sergei Golubchik
59ca71d496 INVISIBLE columns in USING and NATURAL JOIN
* don't disclose INVISIBLE_FULL columns in USING and NATURAL JOIN
* other INVISIBLE columns must me mentioned by name in USING,
  they are hidden from NATURAL JOIN
2018-02-12 13:46:07 +01:00
Sergei Golubchik
711f3dd7f5 MDEV-13417 UPDATE produces wrong values if an updated column is later used as an update source
replication tests
2018-02-12 13:14:23 +01:00
Jerome Brauge
d943d7f712 MDEV-13417 UPDATE produces wrong values if an updated column is later used as an update source
Standard compatible behavior for UPDATE: all assignments in SET
are executed "simultaneously", not left-to-right. And `SET a=b,b=a`
will swap the values.
2018-02-12 13:14:23 +01:00
Marko Mäkelä
33f70c4d9c MDEV-13869 MariaDB slow start
When code from MySQL 5.7.9 was merged to MariaDB 10.2.2
in commit 2e814d4702
an assignment validate=true was inadvertently added to the function
dict_check_sys_tables().

This causes InnoDB to open every single .ibd file on startup, even
when no crash recovery was needed.

Simply removing the assignment would make some tests fail. We do the
best to retain almost the same level of inconsistency detection.
In the test innodb.table_flags, access to one of the tables will not
be blocked despite inconsistent flags.

dict_check_sys_tables(): Remove the problematic assignment, and skip
validation in normal startup.

dict_load_table_one(): If the .ibd file cannot be opened, mark the
table as corrupted and unreadable.

fil_node_open_file(): Validate FSP_SPACE_FLAGS with the expected
flags. If reading the tablespace fails, invalidate node->handle
instead of letting it remain stale. This bug was caught by a
fil_validate() assertion failure.

fsp_flags_try_adjust(): If the tablespace file is invalid, do nothing.
2018-02-12 14:06:04 +02:00
Alexander Barkov
da99e086f9 Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext 2018-02-12 10:03:28 +04:00
Elena Stepanova
7a106d1961 Updated list of unstable tests for 10.2.13 2018-02-12 03:20:09 +02:00
Sergei Golubchik
49bcc82686 Merge branch '10.1' into 10.2 2018-02-11 13:47:16 +01:00
Alexey Botchkov
b88542681b MDEV-14611 ALTER TABLE EXCHANGE PARTITION does not work properly when used with DATA DIRECTORY.
When table is renamed, the InnoDB's dictionary cache didn't
        change the ib_table->data_dir_path accordingly.
        Now it's set to NULL.
2018-02-10 22:17:49 +04:00
Alexander Barkov
a2feeb3d6f After-merge fixes for "sys_vars.sysvars_innodb '32bit,xtradb'" test results. 2018-02-10 21:51:24 +04:00
Monty
12d5307e95 MDEV-13508 ALTER TABLE that renames columns and CHECK constraints
Fixed by adding Item::rename_fields_processor

Signed-off-by: Monty <monty@mariadb.org>
2018-02-10 14:32:24 +02:00
Alexander Barkov
e07451f71f Merge remote-tracking branch 'origin/10.0' into 10.1 2018-02-10 00:06:10 +04:00
Alexander Barkov
b0a92333c0 MDEV-15262 Wrong results for SELECT..WHERE non_indexed_datetime_column=indexed_time_column 2018-02-09 19:47:00 +04:00
Marko Mäkelä
5559905d41 Merge 10.2 into bb-10.2-ext 2018-02-09 12:48:23 +02:00
Marko Mäkelä
7c1bd8fa04 Add back (and clean up) the test innodb_zip.prefix_index_liftedlimit
This MySQL 5.5 test innodb_zip.innodb_prefix_index_lifted
was renamed in MySQL 5.7. In
commit 2e814d4702
the test was inadvertently removed, instead of being renamed.

The absence of this test caused a regression in MariaDB 10.2:
MDEV-15257 Invalid CREATE INDEX fails to report error correctly
2018-02-09 10:03:53 +02:00
Sergei Golubchik
b75d8453d4 MDEV-14868 MariaDB server crashes after using ROLLBACK TO when encrypt_tmp_files=ON
add a test that restores the data from a binlog
2018-02-08 22:54:37 +01:00
Sergei Golubchik
60dfe12be3 MDEV-14868 MariaDB server crashes after using ROLLBACK TO when encrypt_tmp_files=ON
Fix reinit_io_cache(WRITE_CACHE) with non-zero seek_offset.
Run encryption.tempfiles with and without binlog checksums.
2018-02-08 22:54:37 +01:00
Sergei Golubchik
47d1679ac6 fix encryption.tempfiles to check that encrypt_tmp_files is ON 2018-02-08 22:54:37 +01:00
Igor Babaev
8411a8ff60 Corrected the patch for mdev-15119 that caused a failure for
cte_nonrecursive.test with --embedded.

This also fixed some problems for embedded CTEs.
Adjusted test results accordingly.
2018-02-08 09:48:36 -08:00
Jan Lindström
06d77eb43a MDEV-14427: encryption.innodb-bad-key-change failed in buildbot
Timing problem as sometimes table is marked as encrypted but
sometimes we are not sure and table is just marked missing.
2018-02-08 18:53:01 +02:00
Marko Mäkelä
c567369ad7 Merge 10.2 into bb-10.2-ext 2018-02-08 17:48:19 +02:00
Alexander Barkov
3cad31f2a7 Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext 2018-02-08 19:06:25 +04:00