-
Notifications
You must be signed in to change notification settings - Fork 713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FB8-120: Added db_metadata options to create database command #972
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly stylistic comments + one potential buffer overflow problem.
Please, also extend commit message with some info that in 8.0 database metadata is stored in Data Dictionary rather than in an .opt
file.
sql/dd/impl/types/schema_impl.cc
Outdated
return true; | ||
} | ||
|
||
String_type const &Schema_impl::get_db_metadata() const { return m_metadata; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String_type const &Schema_impl::get_db_metadata() const { return m_metadata; } | |
String_type const &Schema_impl::get_db_metadata() const noexcept { return m_metadata; } |
sql/dd/impl/types/schema_impl.h
Outdated
@@ -127,6 +128,9 @@ class Schema_impl : public Entity_object_impl, public Schema { | |||
|
|||
virtual bool set_options_raw(const String_type &options_raw); | |||
|
|||
virtual bool set_db_metadata(const String_type &metadata) override; | |||
virtual String_type const &get_db_metadata() const override; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
virtual String_type const &get_db_metadata() const override; | |
virtual String_type const &get_db_metadata() const noexcept override; |
sql/dd/impl/types/schema_impl.h
Outdated
id(), name().c_str(), m_default_collation_id, m_created, | ||
m_last_altered); | ||
m_last_altered, m_metadata.c_str()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential buffer overflow here with very long metadata.
Consider snprintf()
.
sql/dd/types/schema.h
Outdated
@@ -110,6 +110,9 @@ class Schema : virtual public Entity_object { | |||
|
|||
virtual bool set_options_raw(const String_type &options_raw) = 0; | |||
|
|||
virtual bool set_db_metadata(const String_type &metadata) = 0; | |||
virtual String_type const &get_db_metadata() const = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
virtual String_type const &get_db_metadata() const = 0; | |
virtual String_type const &get_db_metadata() const noexcept = 0; |
sql/sql_yacc.yy
Outdated
boost::property_tree::json_parser::read_json(is, | ||
db_metadata_root); | ||
} | ||
catch (std::exception) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
catch (std::exception) | |
catch (const std::exception&) |
sql/dd/impl/types/schema_impl.h
Outdated
@@ -66,7 +66,8 @@ class Schema_impl : public Entity_object_impl, public Schema { | |||
: m_created(0), | |||
m_last_altered(0), | |||
m_default_collation_id(INVALID_OBJECT_ID), | |||
m_options(new Properties_impl()) {} | |||
m_options(new Properties_impl()), | |||
m_metadata("") {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m_metadata("") {} | |
m_metadata() {} |
sql/dd/dd_schema.cc
Outdated
// Create dd::Schema object. | ||
std::unique_ptr<dd::Schema> schema(dd::create_object<dd::Schema>()); | ||
|
||
// Set schema name and collation id. | ||
schema->set_name(schema_name); | ||
DBUG_ASSERT(charset_info); | ||
schema->set_default_collation_id(charset_info->number); | ||
schema->set_db_metadata(db_metadata ? db_metadata : ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no implicit conversions
schema->set_db_metadata(db_metadata ? db_metadata : ""); | |
schema->set_db_metadata(db_metadata != nullptr ? db_metadata : ""); |
mysql-test/t/db_metadata.test
Outdated
@@ -0,0 +1,163 @@ | |||
# Test per-database database-metadata attribute | |||
|
|||
--disable_query_log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there is need to disable query log here, please check
mysql-test/t/db_metadata.test
Outdated
|
||
|
||
# cleanup | ||
--disable_warnings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the warning disable required here? What are the warnings?
@@ -1236,6 +1239,7 @@ void warn_about_deprecated_national(THD *thd) | |||
%token<keyword> GTID_SYM | |||
%token<keyword> GTID_EXECUTED /* MYSQL */ | |||
%token<keyword> SUPER_READ_ONLY_SYM /* MYSQL */ | |||
%token DB_METADATA_SYM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8.0 has some attempts to have parser token ID (and resulting query digest) stability, please check: might be a good idea to skip 100 IDs and start a FB-specific section
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 3 tokens above this are also added by facebook - I simply added this one to the end of the existing list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure? All three look like MySQL ones
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a comment at line 1236: "Tokens from FB MySQL"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, sorry. And there is no provision to skip IDs, thus everything already is as good as it could be
updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
You might want to follow how the DB read only feature was done, because I believe by changing the schema, you need to bump some data dictionary version or something. The FIELD_OPTIONS column is meant to be a generic place to add key/values, and I'm wondering if that's a better place for this. |
Updated: I removed the additional columns from the dd, and used the options field. Tests pass now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hermanlee has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good overall. Just some small minor comments.
share/errmsg-utf8.txt
Outdated
@@ -18728,6 +18728,15 @@ ER_RPL_FAILED_IN_RLI_INIT_INFO | |||
ER_SEMISYNC_FORCE_SHUTDOWN | |||
eng "Force shutdown: Semi-sync master is being switched off while there are active un-acked transactions" | |||
|
|||
ER_DB_METADATA_TOO_LONG |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should replace ER_PLACEHOLDER_50063.
share/errmsg-utf8.txt
Outdated
ER_DB_METADATA_TOO_LONG | ||
eng "Metadata for the database is too long. Max length is %d bytes" | ||
|
||
ER_DB_METADATA_INVALID_JSON |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace ER_PLACEHOLDER_50064
share/errmsg-utf8.txt
Outdated
ER_DB_METADATA_INVALID_JSON | ||
eng "Invalid JSON for DB_METADATA attribute: %s." | ||
|
||
ER_DB_METADATA_READ_ERROR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace ER_PLACEHOLDER_50065
sql/dd/impl/types/schema_impl.h
Outdated
@@ -127,6 +128,9 @@ class Schema_impl : public Entity_object_impl, public Schema { | |||
|
|||
virtual bool set_options_raw(const String_type &options_raw); | |||
|
|||
virtual bool set_db_metadata(const String_type &metadata) override; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also compile with -Winconsistent-missing-override, so adding this override cause the compiler to warn about the rest of the object:
In file included from ../../sql/dd/impl/bootstrapper.cc:58:
../../sql/dd/impl/types/schema_impl.h:75:31: error: 'object_table' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
virtual const Object_table &object_table() const;
../../sql/dd/impl/types/weak_object_impl.h:50:31: note: overridden virtual function is here
virtual const Object_table &object_table() const = 0;
^
In file included from ../../sql/dd/impl/bootstrapper.cc:58:
../../sql/dd/impl/types/schema_impl.h:77:16: error: 'validate' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
virtual bool validate() const;
^
../../sql/dd/impl/types/weak_object_impl.h:52:16: note: overridden virtual function is here
virtual bool validate() const = 0;
^
sql/sql_const.h
Outdated
@@ -286,6 +286,9 @@ static const ulong EVENT_DEF_CACHE_MIN = 256; | |||
*/ | |||
#define MAX_TIME_ZONE_NAME_LENGTH (NAME_LEN + 1) | |||
|
|||
#define DB_METADATA_MAX_LENGTH 1024 /* Max length for the db-metadata option \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like "*/" should also fit onto this line too?
@@ -155,7 +155,7 @@ bool migrate_schema_to_dd(THD *thd, const char *dbname) { | |||
// Disable autocommit option | |||
Disable_autocommit_guard autocommit_guard(thd); | |||
|
|||
if (dd::create_schema(thd, schema_name, schema_charset)) { | |||
if (dd::create_schema(thd, schema_name, schema_charset, nullptr)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In 5.6, we store the db_metadata information in the db_opt file using the keyword db-metadata
. Since there are in-place upgrade paths planned to 8.0, it should be fine to have nullptr here.
sql/dd/impl/types/schema_impl.cc
Outdated
@@ -106,6 +106,25 @@ bool Schema_impl::set_options_raw(const String_type &options_raw) { | |||
return false; | |||
} | |||
|
|||
bool Schema_impl::set_db_metadata(const String_type &metadata) { | |||
if (metadata.empty()) { | |||
if (options().exists("db_metadata")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can "db_metadata" be made into a constant string, similar to read_only_options_key
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requesting changes for the db_metadata key.
JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: 2f08e3a Reference commit: a21e84f Reference commit: 5983ba3181a Reference commit: 414870abeee In 8.0, db_metadata is stored in the data dictionary instead of opt files. -------- 2f08e3a -------- Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+
@dutow has updated the pull request. Re-import the pull request |
Updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hermanlee has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: 2f08e3a Reference commit: a21e84f Reference commit: 5983ba3181a Reference commit: 414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: #972 Reviewed By: yizhang82 Differential Revision: D14883632 Pulled By: yizhang82 fbshipit-source-id: 3af0fc8
Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: 2f08e3a Reference commit: a21e84f Reference commit: 5983ba3181a Reference commit: 414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: #972 Reviewed By: yizhang82 Differential Revision: D14883632 Pulled By: yizhang82 fbshipit-source-id: 84fda3f
…ok#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Reviewed By: yizhang82 Differential Revision: D14883632 Pulled By: yizhang82 fbshipit-source-id: 84fda3f
…ok#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Reviewed By: yizhang82 Differential Revision: D14883632 Pulled By: yizhang82 fbshipit-source-id: 84fda3f
…ok#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Reviewed By: yizhang82 Differential Revision: D14883632 Pulled By: yizhang82 fbshipit-source-id: 84fda3f
…ok#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Reviewed By: yizhang82 Differential Revision: D14883632 Pulled By: yizhang82 fbshipit-source-id: 84fda3f
…ok#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Reviewed By: yizhang82 Differential Revision: D14883632 Pulled By: yizhang82 fbshipit-source-id: 84fda3f
…ok#972) (facebook#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Differential Revision: D14883632 Pulled By: yizhang82
…a#972) (percona#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook/mysql-5.6@2f08e3a Reference commit: facebook/mysql-5.6@a21e84f Reference commit: facebook/mysql-5.6@5983ba3181a Reference commit: facebook/mysql-5.6@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook/mysql-5.6#972 Differential Revision: D14883632 Pulled By: yizhang82
…a#972) (percona#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook/mysql-5.6@2f08e3a Reference commit: facebook/mysql-5.6@a21e84f Reference commit: facebook/mysql-5.6@5983ba3181a Reference commit: facebook/mysql-5.6@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook/mysql-5.6#972 Differential Revision: D14883632 Pulled By: yizhang82
…a#972) (percona#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook/mysql-5.6@2f08e3a Reference commit: facebook/mysql-5.6@a21e84f Reference commit: facebook/mysql-5.6@5983ba3181a Reference commit: facebook/mysql-5.6@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook/mysql-5.6#972 Differential Revision: D14883632 Pulled By: yizhang82
…ok#972) (facebook#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Differential Revision: D14883632 Pulled By: yizhang82
…ok#972) (facebook#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Differential Revision: D14883632 Pulled By: yizhang82
…ok#972) (facebook#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Differential Revision: D14883632 Pulled By: yizhang82
…ok#972) (facebook#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Differential Revision: D14883632 Pulled By: yizhang82
…ok#972) (facebook#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Differential Revision: D14883632 Pulled By: yizhang82
…ok#972) (facebook#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Differential Revision: D14883632 Pulled By: yizhang82
…ok#972) (facebook#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Differential Revision: D14883632 Pulled By: yizhang82
…ok#972) (facebook#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Differential Revision: D14883632 Pulled By: yizhang82
…ok#972) (facebook#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Differential Revision: D14883632 Pulled By: yizhang82
…ok#972) (facebook#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Differential Revision: D14883632 Pulled By: yizhang82
…ok#972) (facebook#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Differential Revision: D14883632 Pulled By: yizhang82
…ok#972) (facebook#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Differential Revision: D14883632 Pulled By: yizhang82
…ok#972) (facebook#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Differential Revision: D14883632 Pulled By: yizhang82
…ok#972) (facebook#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Differential Revision: D14883632 Pulled By: yizhang82
…ok#972) (facebook#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Differential Revision: D14883632 Pulled By: yizhang82
…ok#972) (facebook#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Differential Revision: D14883632 Pulled By: yizhang82
…ok#972) (facebook#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Differential Revision: D14883632 Pulled By: yizhang82
…ok#972) (facebook#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Differential Revision: D14883632 Pulled By: yizhang82
…ok#972) (facebook#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Differential Revision: D14883632 Pulled By: yizhang82
…ok#972) (facebook#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Differential Revision: D14883632 Pulled By: yizhang82
…ok#972) (facebook#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Differential Revision: D14883632 Pulled By: yizhang82
…ok#972) (facebook#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Differential Revision: D14883632 Pulled By: yizhang82
…ok#972) (facebook#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Differential Revision: D14883632 Pulled By: yizhang82
…ok#972) (facebook#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Differential Revision: D14883632 Pulled By: yizhang82
…ok#972) (facebook#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Differential Revision: D14883632 Pulled By: yizhang82
…ok#972) (facebook#972) Summary: JIRA ticket: https://jira.percona.com/browse/FB8-120 Reference commit: facebook@2f08e3a Reference commit: facebook@a21e84f Reference commit: facebook@5983ba3181a Reference commit: facebook@414870abeee Added new option db_metadata to the create database `CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata` The new option is stored in the db.opt file along with other database options like charset and read_only. The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file. To retrieve the option value for a particular database, the show command can be used as follows: `SHOW CREATE DATABASE db_name` Example Usage: create database test2 charset utf8 read_only = true db_metadata '{\'shard_name\':\'myshard_for_test2\'}'; show create database test2; Output: +----------+--------------------------------------------------------------------------------------------------------------------------+ | Database | Create Database | +----------+--------------------------------------------------------------------------------------------------------------------------+ | test2 | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ | +----------+--------------------------------------------------------------------------------------------------------------------------+ Pull Request resolved: facebook#972 Differential Revision: D14883632 Pulled By: yizhang82
JIRA ticket: https://jira.percona.com/browse/FB8-120
Reference commit: 2f08e3a
Reference commit: a21e84f
Reference commit: 5983ba3181a
Reference commit: 414870abeee
-------- 2f08e3a --------
Added new option db_metadata to the create database
CREATE DATABASE [IF NOT EXISTS] db_name DB_METADATA [=] metadata
The new option is stored in the db.opt file along with other database options like charset and read_only.
The options accepts any string value. If not specified, it writes empty string as the default value in the db.opt file.
To retrieve the option value for a particular database, the show command can be used as follows:
SHOW CREATE DATABASE db_name
Example Usage:
create database test2 charset utf8 read_only = true db_metadata '{'shard_name':'myshard_for_test2'}';
show create database test2;
Output:
+----------+--------------------------------------------------------------------------------------------------------------------------+
| Database | Create Database |
+----------+--------------------------------------------------------------------------------------------------------------------------+
| test2 | CREATE DATABASE
test2
/*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {'shard_name':'myshard_for_test2'} */ |+----------+--------------------------------------------------------------------------------------------------------------------------+