Commit graph

27 commits

Author SHA1 Message Date
Oleksandr Byelkin
9e1fb104a3 MariaDB 11.4.4 release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEF39AEP5WyjM2MAMF8WVvJMdM0dgFAmck77AACgkQ8WVvJMdM
 0dgccQ/+Lls8fWt4D+gMPP7x+drJSO/IE/gZFt3ugbWF+/p3B2xXAs5AAE83wxEh
 QSbp4DCkb/9PnuakhLmzg0lFbxMUlh4rsJ1YyiuLB2J+YgKbAc36eQQf+rtYSipd
 DT5uRk36c9wOcOXo/mMv4APEvpPXBIBdIL4VvpKFbIOE7xT24Sp767zWXdXqrB1f
 JgOQdM2ct+bvSPC55oZ5p1kqyxwvd6K6+3RB3CIpwW9zrVSLg7enT3maLjj/761s
 jvlRae+Cv+r+Hit9XpmEH6n2FYVgIJ3o3WhdAHwN0kxKabXYTg7OCB7QxDZiUHI9
 C/5goKmKaPB1PCQyuTQyLSyyK9a8nPfgn6tqw/p/ZKDQhKT9sWJv/5bSWecrVndx
 LLYifSTrFC/eXLzgPvCnNv/U8SjsZaAdMIKS681+qDJ0P5abghUIlGnMYTjYXuX1
 1B6Vrr0bdrQ3V1CLB3tpkRjpUvicrsabtuAUAP65QnEG2G9UJXklOer+DE291Gsl
 f1I0o6C1zVGAOkUUD3QEYaHD8w7hlvyfKme5oXKUm3DOjaAar5UUKLdr6prxRZL4
 ebhmGEy42Mf8fBYoeohIxmxgvv6h2Xd9xCukgPp8hFpqJGw8abg7JNZTTKH4h2IY
 J51RpD10h4eoi6WRn3opEcjexTGvZ+xNR7yYO5WxWw6VIre9IUA=
 =s+WW
 -----END PGP SIGNATURE-----

Merge tag '11.4' into 11.6

MariaDB 11.4.4 release
2024-11-08 07:17:00 +01:00
Oleksandr Byelkin
69d033d165 Merge branch '10.11' into 11.2 2024-10-29 16:42:46 +01:00
Sergei Golubchik
3a1cf2c85b MDEV-34679 ER_BAD_FIELD uses non-localizable substrings 2024-10-17 21:37:37 +02:00
Monty
c4cad8d50c MDEV-33449 improving repair of tables
This task is to ensure we have a clear definition and rules of how to
repair or optimize a table.

The rules are:

- REPAIR should be used with tables that are crashed and are
  unreadable (hardware issues with not readable blocks, blocks with
  'unexpected data' etc)
- OPTIMIZE table should be used to optimize the storage layout for the
  table (recover space for delete rows and optimize the index
  structure.
- ALTER TABLE table_name FORCE should be used to rebuild the .frm file
  (the table definition) and the table (with the original table row
  format). If the table is from and older MariaDB/MySQL release with a
  different storage format, it will convert the data to the new
  format. ALTER TABLE ... FORCE is used as part of mariadb-upgrade

Here follows some more background:

The 3 ways to repair a table are:
1) ALTER TABLE table_name FORCE" (not other options).
   As an alias we allow: "ALTER TABLE table_name ENGINE=original_engine"
2) "REPAIR TABLE" (without FORCE)
3) "OPTIMIZE TABLE"

All of the above commands will optimize row space usage (which means that
space will be needed to hold a temporary copy of the table) and
re-generate all indexes. They will also try to replicate the original
table definition as exact as possible.

For ALTER TABLE and "REPAIR TABLE without FORCE", the following will hold:
If the table is from an older MariaDB version and data conversion is
needed (for example for old type HASH columns, MySQL JSON type or new
TIMESTAMP format) "ALTER TABLE table_name FORCE, algorithm=COPY" will be
used.

The differences between the algorithms are
1) Will use the fastest algorithm the engine supports to do a full repair
   of the table (except if data conversions are is needed).
2) Will use the storage engine internal REPAIR facility (MyISAM, Aria).
   If the engine does not support REPAIR then
   "ALTER TABLE FORCE, ALGORITHM=COPY" will be used.
   If there was data incompatibilities (which means that FORCE was used)
   then there will be a warning after REPAIR that ALTER TABLE FORCE is
   still needed.
   The reason for this is that REPAIR may be able to go around data
   errors (wrong incompatible data, crashed or unreadable sectors) that
   ALTER TABLE cannot do.
3) Will use the storage engine internal OPTIMIZE. If engine does not
   support optimize, then "ALTER TABLE FORCE" is used.

The above will ensure that ALTER TABLE FORCE is able to
correct almost any errors in the row or index data.  In case of
corrupted blocks then REPAIR possible followed by ALTER TABLE is needed.
This is important as mariadb-upgrade executes ALTER TABLE table_name
FORCE for any table that must be re-created.

Bugs fixed with InnoDB tables when using ALTER TABLE FORCE:
- No error for INNODB_DEFAULT_ROW_FORMAT=COMPACT even if row length
  would be too wide. (Independent of innodb_strict_mode).
- Tables using symlinks will be symlinked after any of the above commands
  (Independent of the setting of --symbolic-links)

If one specifies an algorithm together with ALTER TABLE FORCE, things
will work as before (except if data conversion is required as then
the COPY algorithm is enforced).

ALTER TABLE .. OPTIMIZE ALL PARTITIONS will work as before.

Other things:
- FORCE argument added to REPAIR to allow one to first run internal
  repair to fix damaged blocks and then follow it with ALTER TABLE.
- REPAIR will not update frm_version if ha_check_for_upgrade() finds
  that table is still incompatible with current version. In this case the
  REPAIR will end with an error.
- REPAIR for storage engines that does not have native repair, like InnoDB,
  is now using ALTER TABLE FORCE.
- REPAIR csv-table USE_FRM now works.
  - It did not work before as CSV tables had extension list in wrong
    order.
- Default error messages length for %M increased from 128 to 256 to not
  cut information from REPAIR.
- Documented HA_ADMIN_XX variables related to repair.
- Added HA_ADMIN_NEEDS_DATA_CONVERSION to signal that we have to
  do data conversions when converting the table (and thus ALTER TABLE
  copy algorithm is needed).
- Fixed typo in error message (caused test changes).
2024-05-27 12:39:03 +02:00
Monty
1f4a9f086a Removed "<select expression> INTO <destination>" deprication.
This was done after discussions with Igor, Sanja and Bar.

The main reason for removing the deprication was to ensure that MariaDB
is always backward compatible whenever possible.

Other things:
- Added statistics counters, mainly for the feedback plugin.
  - INTO OUTFILE
  - INTO variable
  - If INTO is using the old syntax (end of query)
2023-02-03 11:57:50 +03:00
Monty
4102f1589c Aria will now register it's transactions
MDEV-22531 Remove maria::implicit_commit()
MDEV-22607 Assertion `ha_info->ht() != binlog_hton' failed in
           MYSQL_BIN_LOG::unlog_xa_prepare

From the handler point of view, Aria now looks like a transactional
engine. One effect of this is that we don't need to call
maria::implicit_commit() anymore.

This change also forces the server to call trans_commit_stmt() after doing
any read or writes to system tables.  This work will also make it easier
to later allow users to have system tables in other engines than Aria.

To handle the case that Aria doesn't support rollback, a new
handlerton flag, HTON_NO_ROLLBACK, was added to engines that has
transactions without rollback (for the moment only binlog and Aria).

Other things
- Moved freeing of MARIA_SHARE to a separate function as the MARIA_SHARE
  can be still part of a transaction even if the table has closed.
- Changed Aria checkpoint to use the new MARIA_SHARE free function. This
  fixes a possible memory leak when using S3 tables
- Changed testing of binlog_hton to instead test for HTON_NO_ROLLBACK
- Removed checking of has_transaction_manager() in handler.cc as we can
  assume that as the transaction was started by the engine, it does
  support transactions.
- Added new class 'start_new_trans' that can be used to start indepdendent
  sub transactions, for example while reading mysql.proc, using help or
  status tables etc.
- open_system_tables...() and open_proc_table_for_Read() doesn't anymore
  take a Open_tables_backup list. This is now handled by 'start_new_trans'.
- Split thd::has_transactions() to thd::has_transactions() and
  thd::has_transactions_and_rollback()
- Added handlerton code to free cached transactions objects.
  Needed by InnoDB.

squash! 2ed35999f2a2d84f1c786a21ade5db716b6f1bbc
2020-05-23 12:29:10 +03:00
Vicențiu Ciorbaru
45bc7574fb MDEV-18650: Options deprecated in previous versions - storage_engine
Remove usage of deprecated variable storage_engine. It was deprecated in 5.5 but
it never issued a deprecation warning. Make it issue a warning in 10.5.1.

Replaced with default_storage_engine.
2020-02-13 13:42:01 +02:00
Monty
163b34fe25 Optimize flush tables with read lock (FTWRL) to not wait for select's
Part of MDEV-5336 Implement LOCK FOR BACKUP

The idea is that instead of waiting in close_cached_tables() for all
tables to be closed, we instead call flush_tables() that does:
- Flush not used objects in table cache to free memory
- Collect all tables that are open
- Call HA_EXTRA_FLUSH on the objects, to get them into "closed state"
- Added HA_EXTRA_FLUSH support to archive and CSV
- Added multi-user protection to HA_EXTRA_FLUSH in MyISAM and Aria

The benefit compared to old code is:
- FTWRL doesn't have to wait for long running read operations or
  open HANDLER's
2018-12-09 22:12:25 +02:00
Varun Gupta
93c360e3a5 MDEV-15253: Default optimizer setting changes for MariaDB 10.4
use_stat_tables= PREFERABLY
optimizer_use_condition_selectivity= 4
2018-12-09 09:22:00 +05:30
Oleksandr Byelkin
de745ecf29 MDEV-11953: support of brackets in UNION/EXCEPT/INTERSECT operations 2018-07-04 19:13:55 +02:00
Alexey Botchkov
a639eff594 MDEV-15813 ASAN use-after-poison in hp_hashnr upon HANDLER READ on a versioned HEAP table.
Check index capabilities before executing HANDLER READ command.
2018-05-16 09:44:22 +04:00
Sergey Vojtovich
d665e79c5b MDEV-7660 - MySQL WL#6671 "Improve scalability by not using thr_lock.c locks
for InnoDB tables"

Don't use thr_lock.c locks for InnoDB tables. Below is list of changes that
were needed to implement this:
- HANDLER OPEN acquireis MDL_SHARED_READ instead of MDL_SHARED
- HANDLER READ calls external_lock() even if SE is not going to be locked by
  THR_LOCK
- InnoDB lock wait timeouts are now honored which are much shorter by default
  than server lock wait timeouts (1 year vs 50 seconds)
- with @@autocommit= 1 LOCK TABLES disables autocommit implicitely, though
  user still sees @@autocommt= 1
- the above starts implicit transaction
- transactions started by LOCK TABLES are now rolled back on disconnect
  (previously everything was committed due to autocommit)
- transactions started by LOCK TABLES are now rolled back by ROLLBACK
  (previously everything was committed due to autocommit)
- it is now impossible to change BINLOG_FORMAT under LOCK TABLES (at least
  to statement) due to running transaction
- LOCK TABLES WRITE is additionally handled by MDL
- ...in contrast LOCK TABLES READ protection against DML is pure InnoDB
- combining transactional and non-transactional tables under LOCK TABLES
  may cause rolled back changes in transactional table and "committed"
  changes in non-transactional table
- user may disable innodb_table_locks, which will cause LOCK TABLES to be
  noop basically

Removed tests for BUG#45143 and BUG#55930 which cover InnoDB + THR_LOCK. To
operate properly these tests require code flow to go through THR_LOCK debug
sync points, which is not the case after this patch. These tests are removed
by WL#6671 as well. An alternative is to port them to different storage engine.
2016-11-03 16:35:15 +04:00
Nirbhay Choubey
7305be2f7e MDEV-5535: Cannot reopen temporary table
mysqld maintains a list of TABLE objects for all temporary
tables created within a session in THD. Here each table is
represented by a TABLE object.

A query referencing a particular temporary table for more
than once, however, failed with ER_CANT_REOPEN_TABLE error
because a TABLE_SHARE was allocate together with the TABLE,
so temporary tables always had only one TABLE per TABLE_SHARE.

This patch lift this restriction by separating TABLE and
TABLE_SHARE objects and storing TABLE_SHAREs for temporary
tables in a list in THD, and TABLEs in a list within their
respective TABLE_SHAREs.
2016-06-10 18:39:43 -04:00
Sergey Vojtovich
282497dd6d MDEV-6720 - enable connection log in mysqltest by default 2016-03-31 10:11:16 +04:00
Sergei Golubchik
d28d3ba40d 10.0-base merge 2013-12-16 13:02:21 +01:00
Sergei Golubchik
c6d30805db 5.5 merge 2013-11-23 00:50:54 +01:00
Sergei Golubchik
fa3f8a18b2 mysql-5.5.34 merge
(some patches reverted, test case added)
2013-11-19 13:16:25 +01:00
Sergei Golubchik
8367241d5a update handler.* tests 2013-07-12 21:41:20 +02:00
Sergei Golubchik
3ad01d00f2 error messages: name the storage engine explicitly,
instead of "used storage engine" and similar changes.
2013-04-09 23:27:07 +02:00
Sergei Golubchik
2ccf247e93 after merge changes:
* rename all debugging related command-line options
  and variables to start from "debug-", and made them all
  OFF by default.
* replace "MySQL" with "MariaDB" in error messages
* "Cast ... converted ... integer to it's ... complement"
  is now a note, not a warning
* @@query_cache_strip_comments now has a session scope,
  not global.
2011-12-12 23:58:40 +01:00
Sergei Golubchik
76f0b94bb0 merge with 5.3
sql/sql_insert.cc:
  CREATE ... IF NOT EXISTS may do nothing, but
  it is still not a failure. don't forget to my_ok it.
  ******
  CREATE ... IF NOT EXISTS may do nothing, but
  it is still not a failure. don't forget to my_ok it.
sql/sql_table.cc:
  small cleanup
  ******
  small cleanup
2011-10-19 21:45:18 +02:00
Michael Widenius
52b64be318 Fixed compiler warnings
client/readline.cc:
  Initialize not used variable (to kill wrong compiler warning)
mysql-test/suite/handler/aria.result:
  Updated test result
mysql-test/suite/handler/handler.inc:
  Changed index to ensure rows are in a fixed order
mysql-test/suite/handler/heap.result:
  Updated test result
mysql-test/suite/handler/innodb.result:
  Updated test result
mysql-test/suite/handler/myisam.result:
  Updated test result
plugin/handler_socket/handlersocket/Makefile.am:
  Use CXX flags to compile
sql/filesort.cc:
  Initialize variable that may be used
sql/log.cc:
  Initialize not used variable (to kill wrong compiler warning)
sql/opt_range_mrr.cc:
  Fixed cast to avoid compiler warning
storage/xtradb/fil/fil0fil.c:
  Added cast to avoid compiler warning
2011-02-25 20:15:27 +02:00
Michael Widenius
6c610ed979 Fixed build issues
- Linking now with g++ instead of gcc with 'compile-dist' to solve problems with handlersocket/client
- Fixed bug in heap tables when doing handler read next-prev over last row


BUILD/compile-dist:
  - Linking now with g++ instead of gcc with 'compile-dist' to solve problems with handlersocket/client
cmd-line-utils/libedit/vi.c:
  Fixed compiler warning about not checking return value for write
mysql-test/r/index_intersect.result:
  Updated results (missed this file in my last push)
mysql-test/suite/handler/aria.result:
  Updated test results
mysql-test/suite/handler/handler.inc:
  Changed test to use read next/read prev on key where there are duplicates that can come in different order depending on system
  Added testing of read next-prev over last row and read prev-next around first row
mysql-test/suite/handler/heap.result:
  Updated test results
mysql-test/suite/handler/init.inc:
  More rows to test
mysql-test/suite/handler/innodb.result:
  Updated test results
mysql-test/suite/handler/interface.result:
  Updated test results
mysql-test/suite/handler/myisam.result:
  Updated test results
mysql-test/t/variables-big.test:
  Fixed test to not fail on windows
mysql-test/valgrind.supp:
  Removed not matching fun: to get rid of valgrind warning
storage/heap/hp_rfirst.c:
  Added state so that we know if we have an active position in the index.
storage/heap/hp_rkey.c:
  Added state so that we know if we have an active position in the index.
storage/heap/hp_rnext.c:
  Handle reading several next after finding the last row (this caused a crash before)
storage/heap/hp_rprev.c:
  Handle reading several prev after finding the first row (this caused a crash before)
storage/xtradb/buf/buf0buf.c:
  Fixed compiler warning about uninitialized value
2011-02-23 14:46:16 +02:00
Michael Widenius
39616eb9ef Fixed compiler warnings and some test failures found by buildbot
dbug/dbug.c:
  Fixed compiler warnings on windows
mysql-test/r/index_intersect_innodb.result:
  Don't print number of rows as this varies
mysql-test/suite/funcs_1/r/processlist_val_no_prot.result:
  Update to use new State
mysql-test/suite/handler/heap.result:
  Update results
mysql-test/suite/handler/heap.test:
  Changed key used in test as the key 'b' will not guarantee order of the two last elements (as the key value is the same)
mysql-test/suite/pbxt/r/lock_multi.result:
  Update to use new State
mysql-test/t/index_intersect.test:
  Don't print number of rows as this varies
mysql-test/valgrind.supp:
  Added suppression for linux
mysys/hash.c:
  Fixed compiler warnings on windows
plugin/handler_socket/handlersocket/database.cpp:
  Fixed compiler warnings
sql-common/client_plugin.c:
  Changed variable to define to avoid compiler warnings when variable is not used
sql-common/my_time.c:
  Initialize all my_time elements to avoid compiler warnings
storage/oqgraph/ha_oqgraph.cc:
  Use right function (to avoid compiler warning)
storage/pbxt/src/table_xt.cc:
  Initialize variables (to avoid compiler warnings)
2011-02-23 02:06:58 +02:00
Michael Widenius
26aa83bfc0 Fix for LP#702786 "Two handler read f1 next gives different errors"
mysql-test/suite/handler/heap.result:
  New test case
mysql-test/suite/handler/heap.test:
  New test case
sql/sql_handler.cc:
  If we get a fatal error in handler read, end table/index scan as it's likely it was wrongly used (for example not supported feature for index)
2011-01-14 12:32:23 +02:00
Michael Widenius
bda130e6b3 Updated test results for 5.3
Changed handler.inc to make test row order independent

mysql-test/r/table_elim.result:
  Updated test results for 5.3
mysql-test/suite/handler/aria.result:
  Updated result
mysql-test/suite/handler/handler.inc:
  Changed handler.inc to make test row order independent
mysql-test/suite/handler/heap.result:
  Updated result
mysql-test/suite/handler/innodb.result:
  Updated result
mysql-test/suite/handler/myisam.result:
  Updated result
2011-01-13 02:59:11 +02:00
Michael Widenius
0d01dd200f Added HANDLER support for MEMORY tables
Added key and file version numbers to MEMORY tables so that we can detect if someone has changed them between HANDLER calls.


mysql-test/suite/handler/aria.result:
  Fixed result after test changes
mysql-test/suite/handler/handler.inc:
  Changed test to use combined key to ensure rows are returned in a pre-determinated order.
mysql-test/suite/handler/heap.result:
  New result
mysql-test/suite/handler/heap.test:
  Added test for HANDLER + HEAP
mysql-test/suite/handler/innodb.result:
  Fixed result after test changes
mysql-test/suite/handler/myisam.result:
  Fixed result after test changes
sql/sql_handler.cc:
  Fixed wrong parameter to ha_index_next_same()
storage/heap/ha_heap.cc:
  Abort key scan if table has changed.
  Abort table scan if table has been recreated.
storage/heap/ha_heap.h:
  Added support for HANDLER
storage/heap/hp_clear.c:
  Increase version number so that we can notice changes if using HANDLER
storage/heap/hp_delete.c:
  Increase key data version number on key changes.
storage/heap/hp_rfirst.c:
  Remember version of key data
  Give error if using read-first on hash key.
storage/heap/hp_rkey.c:
  Remember version of key data
storage/heap/hp_rlast.c:
  Remember version of key data
  Give error if using read-last on hash key.
storage/heap/hp_rnext.c:
  Fixed that we get next key from last search.
storage/heap/hp_rprev.c:
  Fixed that we get previous key from last search.
storage/heap/hp_scan.c:
  Remember version of key and file data
storage/heap/hp_update.c:
  Increase key data version number on key changes.
storage/heap/hp_write.c:
  Increase key data version number on key changes.
2011-01-11 18:51:59 +02:00