Details
-
Type:
Task
-
Status: Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Fix Version/s: 10.1
-
Component/s: None
-
Labels:None
Description
MySQL/MariaDB uses the file DATADIR/dbname/db.opt to store
the database default character set and collation.
We could also store more per-database options in this file.
For example, a default storage engine would be convenient:
CREATE DATABASE db1 DEFAULT_STORAGE_ENGINE=InnoDB; CREATE DATABASE db2 DEFAULT_STORAGE_ENGINE=MyISAM;
Almost all system variables that can have both global and session
scope could be set per-database.
Some useful examples:
- AUTOCOMMIT
- DATETIME_FORMAT
- DATE_FORMAT
- DEFAULT_WEEK_FORMAT
- DEFAULT_TMP_STORAGE_ENGINE
- LC_MESSAGES
- LOW_PRIORITY_UPDATES
- SQL_MODE
- TX_ISOLATION
Some global-only variables could also possibly be set per-database:
- FT_STOPWORD_FILE
- FT_QUERY_EXPANSION_LIMIT
- FT_MAX_WORD_LEN
- FT_BOOLEAN_SYNTAX
- FT_MIN_WORD_LEN
Gliffy Diagrams
Attachments
Issue Links
- relates to
-
MDEV-307 Add functionality for database comments
-
- Open
-
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
Let's distinguish between table attributes that can be set per database and session variables. Table attributes, like ENGINE or CHARACTER SET or CHECKSUM. When it's set on a database, it means that all tables, created in this database, get this. For example,
this means that t1 table will use myisam storage engine and will have checksums enabled.
On the other hand, system variables set per database merely set session variable values based on the current database. For example,
These are two different functionalities, I'm not sure that we want both or that we want to mix both in one "per database options" feature.