1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-14 13:41:20 +03:00
Commit Graph

2886 Commits

Author SHA1 Message Date
8ed646f071 Merge 10.4 into 10.5 2019-12-02 13:35:54 +03:00
0b8b11b0b1 Merge 10.3 into 10.4 2019-12-02 12:51:53 +03:00
498a96a478 MDEV-20441 ER_CRASHED_ON_USAGE upon update on versioned Aria table
Turn read cache off for update and multi-update for versioned
table. no_cache is reinited on each TABLE open because it is
applicable for specific algorithms.

As a side fix vers_insert_history_row() honors vers_write setting.

Aria with row_format=fixed uses IO_CACHE of type READ_CACHE for
sequential read in update loop. When history row is inserted inside
this loop the cache misses it and fails with error.

TODO:

Currently maria_extra() does not support SEQ_READ_APPEND. Probably it
might be possible to use this type of cache.
2019-12-02 11:48:37 +03:00
HF
3fb0fe400c MENT-510 Failing test(s): perfschema.threads_insert_delayed.
orig_test_id should be set properly.
Also fixed sporadic test failure.
2019-11-29 21:25:52 +00:00
e066723a41 MDEV-18973 CLIENT_FOUND_ROWS wrong in spider
Get count from last_used_con->info
Contributed by willhan at Tencent Games
2019-11-29 23:23:57 +09:00
bfa6db38cd MENT-510 Failing test(s): perfschema.threads_insert_delayed.
The thread_id of the INSERT DELAYED thread should not be set to 0.
2019-11-27 09:31:47 +04:00
0e403db2c8 MENT-237 Audit to show INSERT DELAYED for the executing user.
Add notifications about the user and connection that actually
did the DELAYED insert.
2019-11-27 09:23:00 +04:00
3ad37ed0eb Merge 10.4 into 10.5 2019-11-07 08:52:30 +01:00
ec40980ddd Merge 10.3 into 10.4 2019-11-01 15:23:18 +02:00
67687d06bf Simplify TABLE::decide_logging_format()
- Use local variables table and share to simplify code
- Use sql_command_flags to detect what kind of command was used
- Added CF_DELETES_DATA to simplify detecton of delete commands
- Removed duplicate error in create_table_from_items().
2019-10-20 11:52:29 +03:00
b62101f84b Fixes for binary logging --read-only mode
- Any temporary tables created under read-only mode will never be logged
  to binary log.  Any usage of these tables to update normal tables, even
  after read-only has been disabled, will use row base logging (as the
  temporary table will not be on the slave).
- Analyze, check and repair table will not be logged in read-only mode.

Other things:
- Removed not used varaibles in
  MYSQL_BIN_LOG::flush_and_set_pending_rows_event.
- Set table_share->table_creation_was_logged for all normal tables.
- THD::binlog_query() now returns -1 if statement was not logged., This
  is used to update table_share->table_creation_was_logged.
- Don't log admin statements in opt_readonly is set.
- Table's that doesn't have table_creation_was_logged will set binlog format to row
  logging.
- Removed not needed/wrong setting of table->s->table_creation_was_logged
  in create_table_from_items()
2019-10-20 11:52:29 +03:00
b1c2c4ee1b MDEV-10014 Add RETURNING to INSERT
post-review fixes:
* test for dependent subqueries
* test for triggers and routines
* disallow INSERT...RETURNING in triggers and stored functions
* don't return anything if INSERT IGNORE ignored an error
2019-10-14 10:29:31 +02:00
837ad9ab97 MDEV-10014 Add RETURNING to INSERT
Closes #1384
2019-10-14 10:29:31 +02:00
57a09a72a3 cleanup st_select_lex_unit::explainable 2019-10-14 10:29:31 +02:00
721a9df751 cleanup: formatting
comments, whitespaces
2019-10-14 10:29:31 +02:00
c7320830a6 outer references in subqueries in INSERT
remove inconsistent limitation
2019-10-14 10:29:30 +02:00
a6de640804 MDEV-18553: MDEV-16327 pre-requisits part 3: move kill check in one place
Kill check moved from send_data() methids in its wrapper:
send_data_with_check().
2019-10-13 09:40:41 +02:00
1ae02f0e0d MDEV-18553: MDEV-16327 pre-requisits part 2: uniform of LIMIT/OFFSET handling
Now both offset and limit are stored and do not chenged during execution
(offset is decreased during processing in versions before 10.5).

(Big part of this changes made by Monty)
2019-10-13 09:40:41 +02:00
eb0804ef5e MDEV-18553: MDEV-16327 pre-requisits part 1: isolation of LIMIT/OFFSET handling 2019-10-13 09:40:41 +02:00
d04f2de80a Merge 10.4 into 10.5 2019-10-11 08:41:36 +03:00
09afd3da1a Merge 10.3 into 10.4 2019-10-10 21:30:40 +03:00
c9cba59749 MDEV-17333 Assertion in update_auto_increment() upon exotic LOAD
While `handler::next_insert_id` is restored on duplicate key errors
`part_share->next_auto_inc_val` is not restored which causes
discrepancy.
2019-10-10 00:20:34 +03:00
a92f3146d2 MDEV-19406 Assertion on updating view of join with versioned table
TABLE::mark_columns_needed_for_update(): use_all_columns() assigns
pointer of all_set into read_set and write_set, but this is not good
since all_set is changed later by
TABLE::mark_columns_used_by_index_no_reset().

Do column_bitmaps_signal() whenever we change read_set/write_set.
2019-10-10 00:20:34 +03:00
d28686ada6 Merge 10.4 into 10.5 2019-09-12 16:36:46 +03:00
60c04be659 Merge 10.3 into 10.4 2019-09-12 12:16:40 +03:00
f6a7730c45 MDEV-16490: It's possible to make a system versioned table without any versioning field
* do not allow versioned table to be without versioned (non-system) fields
* prohibit changing field versioning, when removing table versioning
* handle CREATE...SELECT as well
2019-09-09 20:14:47 +03:00
4081b7b27a Merge 10.4 into 10.5 2019-09-06 17:16:40 +03:00
780d2bb8a7 Merge 10.4 into 10.5 2019-09-06 14:25:20 +03:00
244f0e6dd8 Merge branch '10.3' into 10.4 2019-09-06 11:53:10 +02:00
537f8594a6 Merge 10.2 into 10.3 2019-09-04 17:52:04 +03:00
7e08ac0b41 Merge 10.2 (up to commit ef00ac4c86) into 10.3 2019-09-04 10:19:58 +04:00
17ab02f4b0 cleanup: on update default now
* remove one level of virtual functions
* remove redundant checks
* remove an if() as the value is always known at compilation time

don't pretend that "DEFAULT expr" and "ON UPDATE DEFAULT NOW"
are "basically the same thing"
2019-09-03 20:34:30 +02:00
ef00ac4c86 Part2: MDEV-18156 Assertion 0' failed or btr_validate_index(index, 0, false)' in row_upd_sec_index_entry or error code 126: Index is corrupted upon DELETE with PAD_CHAR_TO_FULL_LENGTH
This patch allows the server to open old tables that have
"bad" generated columns (i.e. indexed virtual generated columns,
persistent generated columns) that depend on sql_mode,
for general things like SELECT, INSERT, DROP, etc.
Warning are issued in such cases.

Only these commands are now disallowed and return an error:
- CREATE TABLE introducing a "bad" generated column
- ALTER TABLE introducing a "bad" generated column
- CREATE INDEX introdicing a "bad" generated column
  (i.e. adding an index on a virtual generated column
   that depends on sql_mode).

Note, these commands are allowed:
- ALTER TABLE removing a "bad" generate column
- ALTER TABLE removing an index from a "bad" virtual generated column
- DROP INDEX removing an index from a "bad" virtual generated column
but only if the table does not have any "bad" columns as a result.
2019-09-03 09:51:35 +04:00
4f10d0918d Merge branch '10.3' into 10.4 2019-09-02 14:57:05 +02:00
b0ff5a6a73 Merge branch '10.2' into 10.3 2019-09-02 09:01:54 +02:00
14149d6c33 Merge remote-tracking branch 'connect/10.2' into 10.2 2019-08-30 16:52:43 +02:00
67ddb6507d Merge 10.4 into 10.5 2019-08-16 14:35:32 +03:00
afe6eb499d Revert "MDEV-20342 Turn Field::flags from a member to a method"
This reverts commit e86010f909.

Reverting on Monty's request, as this change makes merging
things from 10.5 to 10.2 much harder.
2019-08-14 20:27:00 +04:00
1d15a28e52 Merge 10.3 into 10.4 2019-08-14 18:06:51 +03:00
e86010f909 MDEV-20342 Turn Field::flags from a member to a method 2019-08-14 13:33:01 +04:00
c1599821a5 Merge remote-tracking branch 'origin/10.4' into 10.5 2019-08-13 23:49:10 +04:00
65d48b4a7b Merge 10.2 to 10.3 2019-08-13 19:28:51 +03:00
be33124c9d Merge 10.1 into 10.2 2019-08-12 18:25:35 +03:00
284c72eacf MDEV-17614 INSERT on dup key update is replication unsafe
Problem:-
When mysql executes INSERT ON DUPLICATE KEY INSERT, the storage engine checks
if the inserted row would generate a duplicate key error. If yes, it returns
the existing row to mysql, mysql updates it and sends it back to the storage
engine.When the table has more than one unique or primary key, this statement
is sensitive to the order in which the storage engines checks the keys.
Depending on this order, the storage engine may determine different rows
to mysql, and hence mysql can update different rows.The order that the
storage engine checks keys is not deterministic. For example, InnoDB checks
keys in an order that depends on the order in which indexes were added to
the table. The first added index is checked first. So if master and slave
have added indexes in different orders, then slave may go out of sync.

Solution:-
Make INSERT...ON DUPLICATE KEY UPDATE unsafe while using stmt or mixed format
When there is more then one unique key.
Although there is two exception.
  1. Auto Increment key is not counted because Innodb will get gap lock for
    failed Insert and concurrent insert will get a next increment value. But if
    user supplies auto inc value it can be unsafe.
  2. Count only unique keys for which insertion is performed.

So this patch also addresses the bug id #72921
2019-08-09 19:36:56 +05:30
2792c6e7b0 Merge branch '10.3' into 10.4 2019-07-28 13:43:26 +02:00
d97342b6f2 Merge branch '10.2' into 10.3 2019-07-26 22:42:35 +02:00
cf8c2a3c3b Merge branch '10.1' into 10.2 2019-07-26 07:03:39 +02:00
ae476868a5 Merge branch '5.5' into 10.1 2019-07-25 13:27:11 +02:00
cc86a0bd11 MDEV-15572: view.test, server crash with --big-tables=1
Check that table is really opened before cleanup using handler.
2019-07-18 10:01:53 +02:00
e6ff3f9d1c MDEV-20052 Add a MEM_ROOT pointer argument to Type_handler::make_xxx_field() 2019-07-12 06:58:51 +04:00