Commit graph

135 commits

Author SHA1 Message Date
Oleksandr Byelkin
b6ebadaa66 Merge branch '10.6' into 10.7 2022-10-04 07:41:35 +02:00
Sergei Golubchik
900d7bf360 Merge branch '10.5' into 10.6 2022-10-02 22:14:21 +02:00
Sergei Golubchik
3a2116241b Merge branch '10.4' into 10.5 2022-10-02 14:38:13 +02:00
Sergei Golubchik
d4f6d2f08f Merge branch '10.3' into 10.4 2022-10-01 23:07:26 +02:00
Anel Husakovic
1f51d6c0f6 MDEV-28548: ER_TABLEACCESS_DENIED_ERROR is missing information about DB
- Added missing information about database of corresponding table for various types of commands
- Update some typos

- Reviewed by: <vicentiu@mariadb.org>
2022-09-30 08:48:57 +02:00
Marko Mäkelä
7c7ac6d4a4 Merge 10.6 into 10.7 2022-09-21 09:33:07 +03:00
Marko Mäkelä
44fd2c4b24 Merge 10.5 into 10.6 2022-09-20 16:53:20 +03:00
Alexander Barkov
fe844c16b6 Merge remote-tracking branch 'origin/10.4' into 10.5 2022-09-14 16:24:51 +04:00
Marko Mäkelä
18795f5512 Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
Alexander Barkov
f1544424de MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
Marko Mäkelä
2d8e38bc94 Merge 10.6 into 10.7 2022-04-06 13:00:09 +03:00
Marko Mäkelä
9d94c60f2b Merge 10.5 into 10.6 2022-04-06 12:08:30 +03:00
Marko Mäkelä
fd6a464ae5 MDEV-13005 after-merge fixup 2022-04-06 11:51:36 +03:00
Marko Mäkelä
cacb61b6be Merge 10.4 into 10.5 2022-04-06 10:06:39 +03:00
Rucha Deodhar
2eaaa8874f MDEV-13005: Fixing bugs in SEQUENCE, part 3, 5/5
Task 6:
We can find the .frm type of file. If it is sequence then is_sequence
passed to dd_frm_type() will be true. Since there is already a check
to give error message if we trigger is on temporary table or view, an
additional condition is added to check if .frm is sequence
(is_sequence==true) and error message is changed to show
"Trigger's '%-.192s' is view, temporary table or sequence" instead of
"Trigger's '%-.192s' is view or temporary table".
2022-03-30 15:13:01 +05:30
Rucha Deodhar
a8e7e7c0b4 MDEV-13005: Fixing bugs in SEQUENCE, part 3, 4/5
Task 4 and 5:
Already fixed when I started working on bug. Task 4 correctly gives syntax
error ('(' and ')' are not part of create sequence syntax). Task 5 also
gives correct error because s1 is table not sequence. Fails with
ER_NOT_SEQUENCE2
2022-03-30 15:12:55 +05:30
Rucha Deodhar
c6eeacd10f MDEV-13005: Fixing bugs in SEQUENCE, part 3, 3/5
Task 3:
Added an additional condition for SEQUENCE option to check if cache < 0.
2022-03-30 15:12:49 +05:30
Rucha Deodhar
0b9842a3e7 MDEV-13005: Fixing bugs in SEQUENCE, part 3, 2/5
Task 2:
changed the error message and made it more reusable.
2022-03-30 15:12:43 +05:30
Rucha Deodhar
bb4dd70e7c MDEV-13005: Fixing bugs in SEQUENCE, part 3, 1/5
Task 1:
If table is added to list using option TL_OPTION_SEQUENCE (done when we
have sequence functions) then then we are dealing with sequence instead
of table. So global table list will have sequence set to true. This is
used to check and give correct error message about unknown sequence
instead of table doesn't exist.
2022-03-30 15:12:33 +05:30
Marko Mäkelä
79bc654ac3 Merge 10.6 into 10.7 2022-03-11 10:48:58 +02:00
Marko Mäkelä
81523baac6 Merge 10.4 into 10.5 2022-03-11 09:36:03 +02:00
Marko Mäkelä
22d2df8c6b Merge 10.3 into 10.4 2022-03-11 09:26:42 +02:00
Andrei
e7cf871dda MDEV-24617 OPTIMIZE on a sequence causes unexpected ER_BINLOG_UNSAFE_STATEMENT
The warning out of OPTIMIZE
  Statement is unsafe because it uses a system function
was indeed counterfactual and was resulted by checking an
insufficiently strict property of lex' sql_command_flags.

Fixed with deploying an additional checking of weather
the current sql command that modifes a share->non_determinstic_insert
table is capable of generating ROW format events.
The extra check rules out the unsafety to OPTIMIZE et al, while the
existing check continues to do so to CREATE TABLE (which is
perculiarly tagged as ROW-event generative sql command).

As a side effect sql_sequence.binlog test gets corrected and
binlog_stm_unsafe_warning.test is reinforced to add up
an unsafe CREATE..SELECT test.
2022-03-10 13:38:07 +02:00
Daniel Black
4930209b12 MDEV-25152: Insert linebreaks in mysqldump --extended-insert
Per review by Serg, include start row with new line.

We are hoping we haven't annoyed people that prefered the old
way.

Adding an option for new lines seems like over-engineering in advance.
So if there are complaints, let them be known (JIRA), and we'll add
this under an option.

Test cases updated.
2021-10-01 11:03:47 +10:00
Marko Mäkelä
e62120cec7 Merge 10.4 into 10.5 2021-08-31 10:04:56 +03:00
Marko Mäkelä
0464761126 Merge 10.3 into 10.4 2021-08-31 09:22:21 +03:00
Michael Widenius
b378ddb3d3 MDEV 22785 Crash with prepared statements and NEXTVAL()
The problem was that a PREARE followed by a non prepared statement
using DEFAULT NEXT_VALUE() could change table->next_local to point to
a not persitent memory aria. The next EXECUTE would then try to use
the wrong pointer, which could cause a crash.
Fixed by reseting the pointer to it's old value when doing EXECUTE.
2021-08-26 07:07:46 +03:00
Daniel Black
95e9f3c186 Merge branch 10.3 into 10.4 2021-07-02 17:17:33 +10:00
Daniel Black
7ce5984d6d mtr: fix tests funcs_1.is_tables_is & sql_sequence.rebuild 2021-07-02 16:42:21 +10:00
Marko Mäkelä
559efad44e Merge 10.4 into 10.5 2021-04-27 09:10:47 +03:00
Marko Mäkelä
90a306a7ab Merge 10.3 into 10.4 2021-04-27 08:53:50 +03:00
Marko Mäkelä
29b2f3dbb5 MDEV-24545 Sequence created by one connection remains invisible to another
row_merge_is_index_usable(): Allow access to any SEQUENCE, even if it was
created after the read view. SQL sequences are no-rollback tables with no
history at all.
2021-04-27 08:44:28 +03:00
Sergei Golubchik
25d9d2e37f Merge branch 'bb-10.4-release' into bb-10.5-release 2021-02-15 16:43:15 +01:00
Sergei Golubchik
00a313ecf3 Merge branch 'bb-10.3-release' into bb-10.4-release
Note, the fix for "MDEV-23328 Server hang due to Galera lock conflict resolution"
was null-merged. 10.4 version of the fix is coming up separately
2021-02-12 17:44:22 +01:00
Oleksandr Byelkin
c207f04ecc MDEV-21785: sequences used as default by other table not dumped in right order by mysqldump
Dump sequences first.

This atch made to keep it small and
to keep number of queries to the server the same.

Order of tables in a dump can not be changed
(except sequences first) because mysql_list_tables
uses SHOW TABLES and I used SHOW FULL TABLES.
2021-01-26 10:41:02 +01:00
Oleksandr Byelkin
02e7bff882 Merge commit '10.4' into 10.5 2021-01-06 10:53:00 +01:00
Marko Mäkelä
0aa02567dd Merge 10.3 into 10.4 2020-12-23 14:52:59 +02:00
Oleksandr Byelkin
86fc37b668 MDEV-19273: Server crash in MDL_ticket::has_stronger_or_equal_type or Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db.str, table->table_name.str, MDL_SHARED)' failed in mysql_rm_table_no_locks
Early report error in case of DROP SEQUENCE <non-sequence>

Do not use error variable for other purposes except error.
2020-12-09 12:31:12 +01:00
Marko Mäkelä
898521e2dd Merge 10.4 into 10.5 2020-10-30 11:15:30 +02:00
Marko Mäkelä
7b2bb67113 Merge 10.3 into 10.4 2020-10-29 13:38:38 +02:00
Anel Husakovic
e183aec1d7 MDEV-24018: SIGSEGV in Item_func_nextval::update_table on SELECT SETVAL
Reviewed-by: wlad@mariadb.com
2020-10-27 15:17:54 +01:00
Anel Husakovic
81870e499f MDEV-21786 mysqldump will forget sequence definition details on --no-data dump
- Original patch was contributed by Jani Tolonen <jani.k.tolonen@gmail.com>
https://github.com/an3l/server/commits/bb-10.3-anel-MDEV-21786-dump-sequence
which distinguishes data structure (linked list) of sequences from
tables.
- Added standard sql output to prevent future changes
of sequences and disabled locks for sequences.
- Added test case for `MDEV-20070: mysqldump won't work correct on
sequences` where table column depends on sequence value.
- Restore sequence last value in the following way:
  - Find `next_not_cached_value` and use it to `setval()`
  - We just need for logical restore, so don't execute `setval()`
  - `setval()` should be showed also in case of `--no-data` option.

Reviewed-by: daniel@mariadb.org
2020-10-23 09:06:56 +02:00
Sujatha
25ede13611 Merge branch '10.4' into 10.5 2020-09-29 16:59:36 +05:30
Sujatha
ce845b7a2f Merge branch '10.3' into 10.4 2020-09-28 17:55:39 +05:30
Vladislav Vaintroub
a6987d9fb9 MDEV-23823 Crash in SELECT NEXT VALUE on locked view
Make open_table() fail if sequence should be opened, but it turns out to
be locked view.
2020-09-28 09:49:46 +02:00
Marko Mäkelä
4ec032b492 Merge 10.4 into 10.5 2020-07-21 17:33:16 +03:00
Marko Mäkelä
b1538f4d60 Merge 10.3 into 10.4 2020-07-21 16:36:47 +03:00
Monty
e26c822aa0 MDEV-16929 Assertion ... in close_thread_tables upon killing connection
Problem was that the code didn't handle a transaction created in innodb
as part of a failed mysql_lock_tables()
2020-07-21 15:12:53 +03:00
Monty
dfb41fddf6 Make error messages from DROP TABLE and DROP TABLE IF EXISTS consistent
- IF EXISTS ends with a list of all not existing object, instead of a
  separate note for every not existing object
- Produce a "Note" for all wrongly dropped objects
  (like trying to do DROP SEQUENCE for a normal table)
- Do not write existing tables that could not be dropped to binlog

Other things:
MDEV-22820 Bogus "Unknown table" warnings produced upon attempt to drop
           parent table referenced by FK
This was caused by an older version of this commit patch and later fixed
2020-06-14 19:39:42 +03:00
Marko Mäkelä
d3681335b1 Merge 10.4 into 10.5 2020-06-08 12:58:11 +03:00