Commit graph

45 commits

Author SHA1 Message Date
Ahmed Ibrahim
a35f744d78 MDEV-31736: format_bytes implementation 2024-11-26 13:10:01 +04:00
Yuchen Pei
ba7088d462
Merge '11.4' into 11.6 2024-10-03 15:59:20 +10:00
Marko Mäkelä
762ad01c7f Merge 11.2 into 11.4 2024-09-13 13:09:23 +03:00
Marko Mäkelä
f0de610d0c Merge 10.11 into 11.2 2024-09-10 18:35:16 +03:00
Marko Mäkelä
f9f92b480e Merge 10.6 into 10.11 2024-09-06 16:17:42 +03:00
Ian Gilfillan
2ed33f2fb6 MDEV-26114: Update Sys Schema README 2024-09-05 13:24:57 +10:00
Alexander Barkov
a2a5ba14a8 Merge remote-tracking branch 'origin/11.5' into 11.6 2024-07-10 19:18:52 +04:00
Alexander Barkov
4e805aed85 Merge remote-tracking branch 'origin/11.4' into 11.5 2024-07-10 12:17:09 +04:00
Alexander Barkov
5fb07d942b Merge remote-tracking branch 'origin/11.2' into 11.4 2024-07-09 21:45:37 +04:00
Vladislav Vaintroub
186a1afe63 MDEV-32537 due to Linux, restrict thread name to 15 characters, also in PS.
Rename some threads to workaround this restrictions,
e.g "rpl_parallel_thread"->"rpl_parallel",
"slave_background" -> "slave_bg" etc.
2024-07-09 13:20:49 +02:00
Alexander Barkov
8aad19ddfc Merge remote-tracking branch 'origin/11.1' into 11.2 2024-07-09 14:04:11 +04:00
Oleksandr Byelkin
2447dda2c0 Merge branch '10.11' into 11.1 2024-07-08 22:40:16 +02:00
Marko Mäkelä
34813c1aa0 Merge 10.6 into 10.11 2024-06-19 15:04:07 +03:00
Alexander Barkov
83d3ed4908 MDEV-34014 mysql_upgrade failed
Adding a new statement into scripts/sys_schema/before_setup.sql:

  ALTER DATABASE sys CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci;

to fix db.opt in case:
- the database `sys` was altered to unexpected CHARACTER SET or COLLATE values
- or db.opt was erroneously removed

to make sure that sys objects are always recreated using utf8mb3_general_ci.
2024-06-17 16:38:48 +04:00
Alexander Barkov
903b5d6a83 MDEV-25829 Change default Unicode collation to uca1400_ai_ci
Step#3 The main patch
2024-05-24 15:50:05 +04:00
Oleg Smirnov
70de4075a1 MDEV-24486 Rename the view sys.table_privileges to sys.privileges_by_table_by_level
This is a follow-up for the initial MDEV-24486 commit. It renames
the view sys.table_privileges to sys.privileges_by_table_by_level
and adds some more tests displaying privilege levels GLOBAL and SCHEMA
2023-12-08 19:29:02 +03:00
Oleg Smirnov
1a5e69b42b MDEV-24486 Add table_privileges view to the sys schema
The existing INFORMATION_SCHEMA.TABLE_PRIVILEGES displays only those
privileges that were specifically granted on the table level,
whereas it may be useful to see privileges granted at the database
and global level.

This commit adds a new view `table_privileges` to the `sys` schema
for that purpose. The view shows privileges on existing tables
and views, combining all possible levels:
 - user_privileges
 - schema_privileges
 - table_privileges
2023-12-05 11:42:47 +03:00
Sergei Golubchik
62decb5e8b MDEV-12459 post-review fixes
* IS_USER_TEMP_TABLE() was misleading, name didn't match the code
* list of temp tables was rescanned number_of_databases times
* some temporary tables were not shown (from nonexistent databases)
* some temporary tables were shown more than once (e.g. after self-joins)
* sys.table_exists() - avoid querying I_S twice
* fix handling of temporary MERGE tables - it's pointless to fully open
  them, they're not in thd->temporary_tables, so they simply fail to
  open and are skipped. Relax the assertion instead.
2023-08-11 19:36:22 +02:00
Anel Husakovic
1fb4828b28 MDEV-28343: sys.create_synonym_db fails with ER_VIEW_SELECT_TMPTABLE when schema contains temporary tables
- MDEV-28342 raised the error in case temporary table shadows base table
- Now we are allowed to shadow base tables with temporary tables and
`sys.create_synonym_db()` can easily check for existance of temporary table and
ignore view creation, since it is not supported to create view from
temporary table.

Reviewed-by: <monty@mariadb.org>,
             <vicentiu@mariadb.org>
2023-08-11 19:36:21 +02:00
Anel Husakovic
1923ff8e41 MDEV-12459 Patch sysschema
This commit updates sysschema to work with the new behaviour of show
tables and information_schema.tables table showing temporary tables for
current connection.

Co-authored-by: Monty <monty@mariadb.org>
Reviewer: <vicentiu@mariadb.org>
2023-08-11 19:36:21 +02:00
Daniel Black
320a4b52c9 MDEV-30205 Move /usr/share/mysql to /usr/share/mariadb
These are mainly internal files so is a low impact change.

The few scripts/mysql*sql where renames to mariadb_* prefix
on the name.

mysql-test renamed to mariadb-test in the final packages
2023-04-11 07:59:02 +10:00
Sergei Golubchik
c2b6916393 MDEV-19629 post-merge fixes
* it isn't "pfs" function, don't call it Item_func_pfs,
  don't use item_pfsfunc.*
* tests don't depend on performance schema, put in the main suite
* inherit from Item_str_ascii_func
* use connection collation, not utf8mb3_general_ci
* set result length in fix_length_and_dec
* do not set maybe_null
* use my_snprintf() where possible
* don't set m_value.ptr on every invocation
* update sys schema to use the format_pico_time()
* len must be size_t (compilation error on Windows)
* the correct function name for double->double is fabs()
* drop volatile hack
2023-03-27 21:27:27 +02:00
Monty
5de734da6b Added sys.optimizer_switch_on() and sys.optimizer_switch_off()
These are helpful tools to quickly see what optimizer switch options
are on or off.  The different options are displayed alphabetically
2023-02-10 12:58:50 +02:00
Sergei Golubchik
8759967d1c MDEV-29625 Some clients/scripts refer to old slow log variables 2022-10-04 12:28:04 +02:00
Sergei Golubchik
45e0373a78 MDEV-28632 Change default of explicit_defaults_for_timestamp to ON 2022-08-10 15:03:22 +02:00
Sergei Golubchik
99a433ed1c Merge branch '10.6' into 10.7 2022-05-18 10:34:38 +02:00
anel
c1063a1bed MDEV-28342: sys.create_synonym_db fails when a temporary table masks a base table
- This commit rely on MDEV-28391
- When temporary table shadows the base table, error is raised (it can be changed if needed),
  since the procedure is relying on creating the views and view cannot be created from the temporary table.

- Reviewed by: <wlad@mariadb.com>
2022-05-12 10:28:13 -05:00
Sergei Golubchik
fd132be117 Merge branch '10.6' into 10.7 2022-05-11 11:25:33 +02:00
Anel Husakovic
06a4193cc3 MDEV-28391: table_exists procedure fails when arguments contain escaped backticks as an quoted identifiers
- When arguments to the procedure contain quote in the name, procedure fails with parsing error.
  The reason was because additional quoting is done when testing TEMPORARY table with the same name.
- Reviewed by: <wlad@mariadb.com>
2022-05-04 08:31:55 -05:00
anel
56fd0d7b06 MDEV-28344:sys.ps_setup_save and dependent procedures fail with ER_ILLEGAL_HA_CREATE_OPTION
- The problem:
==============
- Commit f7216fa63d created the check function for
  default temporary storage engine and in case the SE doesn't support temporary tables
  the error `ER_ILLEGAL_HA_CREATE_OPTION` is raised.
  Before that commit in such cases temporary tables were created by silently substituting
  default SE (RocksDB, Connect, PerfSchema) with MyISAM.
- The test `pr_diagnostics.test` was modified in that commit with raising the error,
  since I didn't check the root cause of test itself.

- The solution:
===============
- This commit update the root case: procedure `ps_setup_save()` that uses temporary
  tables created from performance schema tables definition using `LIKE`, what is not supported.
  The suggested fix is to use InnoDB table by using `AS SELECT`.
- Note that test `pr_diagnostics` will raise this error for `medium/full` third argument,
  but not for `current` value of third argument.
- Additionally this patch updates the test case of commit f7216fa, by adding missing relation
  between temporary tables and Performance schema in `perfschema.misc` test.

- Reviewed by: <wlad@mariadb.com>
2022-04-27 03:02:37 -07:00
Vladislav Vaintroub
03e703fd74 Fix build dependency.
Recreate mysql_sys_schema.sql, whenever one of its source files changes.
2022-04-27 09:08:01 +02:00
Federico Razzoli
489011dd0f MDEV-28340 Don't try to create temptables in system DBs, support table_type='SYSTEM VIEW' 2022-04-26 15:56:58 +02:00
Federico Razzoli
3fe656e629 MDEV-28340 On table_type='SYSTEM VERSIONED' return 'BASE TABLE' instead of failing 2022-04-26 15:56:58 +02:00
Federico Razzoli
81862dbb08 MDEV-28340 sys.table_exists: support table_type=SEQUENCE 2022-04-26 15:56:58 +02:00
Otto Kekäläinen
1fa872f6ef Fix various spelling errors
Among others:
existance -> existence
reinitialze -> reinitialize
successfuly -> successfully
2022-03-03 13:42:49 +11:00
Vladislav Vaintroub
ea45f0ebfb MDEV-26925 - upgrade fails creating trigger in sysschema, if root user does not exist
Fix by removing the trigger. It does not do anything useful anyway.
2021-10-28 14:28:50 +02:00
Vladislav Vaintroub
059a5f1171 Remove trailing space 2021-10-21 17:20:24 +02:00
Monty
8f33f49ebe Aria: Add transaction id to log of create table
In the case of a crash directly after a creation of an Aria table,
Aria recovery would think that the table was from another system and
require a repair of the table and inform that the table is 'zerofilled".
This would cause no harm, but was confusing to see when testing atomic
alter table.

Fixed by logging the create transaction id to the log.

Other things:
- Added "show table status from sys" to maria_empy_logs. This ensures one
  does not get any zerofill warnings when sys/sys_config is used by other
  tests.
- aria_chk --describe now prints a warning if the table was moved from
  another system.
- Logging of truncate (maria_delete_all_rows) is changed to use the
  current trid for the create table.
  This is to ensure that we do not run into the same problem with truncate.
- Changed back sys_config table to Aria as this patch should fix the
  "zerofill" problem in buildbot.
- Added scripts/mysql_sys_schema.sql to .gitignore
2021-03-20 21:17:32 +02:00
Vladislav Vaintroub
40fd42f7f5 MDEV-25193 - remove attempt to tame Aria. 2021-03-18 22:41:45 +01:00
Vladislav Vaintroub
de91ece1d5 MDEV-25193 - temporarily switch storage engine to MyISAM for sys.sys_config 2021-03-18 22:36:58 +01:00
Vladislav Vaintroub
7887d45352 MDEV-9077 - fix README.md
Fix confusing documentation. There is no installation necessary for sys schema.
it is there after mysql_install_db, or mysql_upgrade.
2021-03-18 14:13:10 +01:00
Vladislav Vaintroub
fce1a53d55 MDEV-9077 sys schema . use 'mariadb.sys'@'localhost' as definer for views 2021-03-18 08:02:49 +01:00
Vladislav Vaintroub
aa2ff62082 MDEV-9077 Use sys schema in bootstrapping, incl. mtr 2021-03-18 08:02:48 +01:00
Vladislav Vaintroub
601c577142 MDEV-9077 - port sys schema to MariaDB
- Innodb is not always available, which means t is not always
possible to use innodb system variables, or innodb information schema
tables.

Thus creation of objects that use Innodb information_schema is enclosed
into BEGIN NOT ATOMIC blocks with dummy SQLEXCEPTION handler.

- sys_config table uses Aria, just like other system tables.

- several tables that exist in MySQL, do not exist in MariaDB
   performance_schema.replication_applier_status, mysql.slave_master_info,
   mysql.slave_relay_log_info
2021-03-18 08:02:48 +01:00
Vladislav Vaintroub
4bac804c90 MDEV-9077 add sys_schema from https://github.com/mysql/mysql-sys 2021-03-18 08:02:29 +01:00