Skip to content
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

Cleanup non-null pointer args, increase const correctness #1311

Conversation

laurynas-biveinis
Copy link
Contributor

@laurynas-biveinis laurynas-biveinis commented May 18, 2023

Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

  • ha_rocksdb::create_key_defs had non-null attribute for the 2nd and 3rd
    argument. It seems that the attribute non-null arg indexes got desynced,
    because the 3rd argument is a reference, and by usage the 1st and the 2nd args
    are pointers that cannot be nullptr. Instead of fixing the attribute indexes,
    convert pointers to references, which cannot be null by design.
  • Do the same for ha_rocksdb::create_cfs. At the same time make tbl_def_arg
    const, which previously was not, and make the function return bool, as it only
    returns two values for success and error. Convert it from
    DBUG_ENTER_FUNC/DBUG_RETURN to a newer (and lighter) DBUG_TRACE.
  • ha_rocksdb::create_table made private, pointer args converted to reference
    args.
  • Added missing error checking for RocksDB WriteBatch::SingleDelete calls
  • ha_rocksdb::has_hidden_pk made static, args changed from pointers to
    references, removed redundant nonnull attribute.
  • ha_rocksdb::pk_index args changed from pointers to references, removed
    redundant nonnull attribute.
  • ha_rocksdb::set_last_rowkey argument was marked unused even though it was used
  • ha_rocksdb::check_and_lock_sk, ha_rocksdb::check_uniqueness_and_lock,
    ha_rocksdb::update_write_row, ha_rocksdb::reset,
    ha_rocksdb::calc_updated_indexes: added asserts for relationships between
    arguments and table->record[0]/table->record[1]
  • ha_rocksdb::adjust_handler_stats_sst_and_memtable: reduce scope of two local
    vars
  • Rdb_key_def: introduce invalid index ID constant based on
    dd::INVALID_OBJECT_ID. Check it on construction and in the index ID getter.
    Replace direct field accesses with the getter call.
  • Rdb_key_def::table_has_hidden_pk arg changed from pointer to reference.
  • Replace warn_unused_result attribute with the standard [[nodiscard]] for all
    the touched signatures.

@facebook-github-bot
Copy link

@luqun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link

@laurynas-biveinis has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link

@luqun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

row_info.tx->get_indexed_write_batch(m_tbl_def->get_table_type())
->SingleDelete(kd.get_cf(), old_key_slice);
if (!s.ok()) {
return rdb_error_to_mysql(s);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: in ha_rocksdb::delete_row(), if SD or delete fail, it will call tx->set_status_error() instead of rdb_error_to_mysql(). Although these two function are similar, maybe we should have same behavior?

storage/rocksdb/ha_rocksdb.cc Outdated Show resolved Hide resolved
All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- ha_rocksdb::create_key_defs had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be nullptr. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for ha_rocksdb::create_cfs. At the same time make tbl_def_arg
  const, which previously was not, and make the function return bool, as it only
  returns two values for success and error. Convert it from
  DBUG_ENTER_FUNC/DBUG_RETURN to a newer (and lighter) DBUG_TRACE.
- ha_rocksdb::create_table made private, pointer args converted to reference
  args.
- Added missing error checking for RocksDB WriteBatch::SingleDelete calls
- ha_rocksdb::has_hidden_pk made static, args changed from pointers to
  references, removed redundant nonnull attribute, GCC-style attribute replaced
  with a standard C++ one.
- ha_rocksdb::pk_index args changed from pointers to references, removed
  redundant nonnull attribute.
- ha_rocksdb::set_last_rowkey argument was marked unused even though it was used
- ha_rocksdb::check_and_lock_sk, ha_rocksdb::check_uniqueness_and_lock,
  ha_rocksdb::update_write_row, ha_rocksdb::reset,
  ha_rocksdb::calc_updated_indexes: added asserts for relationships between
  arguments and table->record[0]/table->record[1]
- ha_rocksdb::adjust_handler_stats_sst_and_memtable: reduce scope of two local
  vars
- Rdb_key_def: introduce invalid index ID constant based on
  dd::INVALID_OBJECT_ID. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- Rdb_key_def::table_has_hidden_pk arg changed from pointer to reference.
- Replace warn_unused_result attribute with the standard `[[nodiscard]]` for all
  the touched signatures.
@laurynas-biveinis laurynas-biveinis force-pushed the myr-create_key_defs-fix branch from a00447b to d275f0f Compare June 1, 2023 09:03
@facebook-github-bot
Copy link

@laurynas-biveinis has updated the pull request. You must reimport the pull request before landing.

@laurynas-biveinis
Copy link
Contributor Author

Updated, ready for review

@facebook-github-bot
Copy link

@laurynas-biveinis has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link

@luqun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

2 similar comments
@facebook-github-bot
Copy link

@luqun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link

@luqun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@luqun
Copy link
Contributor

luqun commented Jun 2, 2023

still waiting for test result and will update when it is done.

@facebook-github-bot
Copy link

@luqun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

1 similar comment
@facebook-github-bot
Copy link

@luqun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link

@bigfootjon has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

row_info.tx->get_indexed_write_batch(m_tbl_def->get_table_type())
->SingleDelete(kd.get_cf(), old_key_slice);
if (!s.ok()) {
return rdb_error_to_mysql(s);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe also change this from rdb_error_to_mysql to row_info.tx->set_status_error().

facebook-github-bot pushed a commit that referenced this pull request Jun 9, 2023
Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: #1311

Differential Revision: D46075453

fbshipit-source-id: 5965df2
@laurynas-biveinis laurynas-biveinis deleted the myr-create_key_defs-fix branch June 12, 2023 08:32
luqun pushed a commit to luqun/mysql-5.6 that referenced this pull request Jun 12, 2023
…ness

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook#1311
GitHub Author: Laurynas Biveinis <[email protected]>

Test Plan: Imported from GitHub, without a `Test Plan:` line.

Reviewers: herman, chni, #mysql_eng

Reviewed By: herman

Subscribers: herman, [email protected]

Differential Revision: https://phabricator.intern.facebook.com/D46075453

Tags: accept2ship
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Jun 14, 2023
)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook#1311

Differential Revision: D46075453

fbshipit-source-id: 5965df2
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Jun 19, 2023
)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook#1311

Differential Revision: D46075453

fbshipit-source-id: 5965df2
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Jun 23, 2023
)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook#1311

Differential Revision: D46075453

fbshipit-source-id: 5965df2
hermanlee pushed a commit to hermanlee/mysql-5.6 that referenced this pull request Oct 3, 2023
)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook#1311

Differential Revision: D46075453
hermanlee pushed a commit to hermanlee/mysql-5.6 that referenced this pull request Oct 18, 2023
)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook#1311

Differential Revision: D46075453
inikep pushed a commit to inikep/percona-server that referenced this pull request Dec 20, 2023
Upstream commit ID: facebook/mysql-5.6@63b8aae
PS-8951: Merge percona-202305 (https://jira.percona.com/browse/PS-8951)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook/mysql-5.6#1311

Differential Revision: D46075453

fbshipit-source-id: 5965df275a5a7371a015ebc0d5ac1ab59dc47a64
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Jul 16, 2024
)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook#1311

Differential Revision: D46075453
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Jul 16, 2024
)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook#1311

Differential Revision: D46075453
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Jul 17, 2024
)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook#1311

Differential Revision: D46075453
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Jul 19, 2024
)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook#1311

Differential Revision: D46075453
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Jul 19, 2024
)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook#1311

Differential Revision: D46075453
dlenev pushed a commit to dlenev/percona-server that referenced this pull request Jul 25, 2024
Upstream commit ID: facebook/mysql-5.6@63b8aae
PS-8951: Merge percona-202305 (https://jira.percona.com/browse/PS-8951)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook/mysql-5.6#1311

Differential Revision: D46075453

fbshipit-source-id: 5965df275a5a7371a015ebc0d5ac1ab59dc47a64
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Jul 30, 2024
)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook#1311

Differential Revision: D46075453
dlenev pushed a commit to dlenev/percona-server that referenced this pull request Jul 30, 2024
Upstream commit ID: facebook/mysql-5.6@63b8aae
PS-8951: Merge percona-202305 (https://jira.percona.com/browse/PS-8951)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook/mysql-5.6#1311

Differential Revision: D46075453

fbshipit-source-id: 5965df275a5a7371a015ebc0d5ac1ab59dc47a64
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Jul 31, 2024
)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook#1311

Differential Revision: D46075453
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Aug 2, 2024
)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook#1311

Differential Revision: D46075453
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Aug 6, 2024
)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook#1311

Differential Revision: D46075453
dlenev pushed a commit to dlenev/percona-server that referenced this pull request Aug 21, 2024
Upstream commit ID: facebook/mysql-5.6@63b8aae
PS-8951: Merge percona-202305 (https://jira.percona.com/browse/PS-8951)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook/mysql-5.6#1311

Differential Revision: D46075453

fbshipit-source-id: 5965df275a5a7371a015ebc0d5ac1ab59dc47a64
dlenev pushed a commit to dlenev/percona-server that referenced this pull request Aug 28, 2024
Upstream commit ID: facebook/mysql-5.6@63b8aae
PS-8951: Merge percona-202305 (https://jira.percona.com/browse/PS-8951)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook/mysql-5.6#1311

Differential Revision: D46075453

fbshipit-source-id: 5965df275a5a7371a015ebc0d5ac1ab59dc47a64
dlenev pushed a commit to dlenev/percona-server that referenced this pull request Aug 30, 2024
Upstream commit ID: facebook/mysql-5.6@63b8aae
PS-8951: Merge percona-202305 (https://jira.percona.com/browse/PS-8951)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook/mysql-5.6#1311

Differential Revision: D46075453

fbshipit-source-id: 5965df275a5a7371a015ebc0d5ac1ab59dc47a64
inikep pushed a commit to percona/percona-server that referenced this pull request Sep 23, 2024
Upstream commit ID: facebook/mysql-5.6@63b8aae
PS-8951: Merge percona-202305 (https://jira.percona.com/browse/PS-8951)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook/mysql-5.6#1311

Differential Revision: D46075453

fbshipit-source-id: 5965df275a5a7371a015ebc0d5ac1ab59dc47a64
inikep pushed a commit to percona/percona-server that referenced this pull request Sep 25, 2024
Upstream commit ID: facebook/mysql-5.6@63b8aae
PS-8951: Merge percona-202305 (https://jira.percona.com/browse/PS-8951)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook/mysql-5.6#1311

Differential Revision: D46075453

fbshipit-source-id: 5965df275a5a7371a015ebc0d5ac1ab59dc47a64
inikep pushed a commit to inikep/percona-server that referenced this pull request Sep 25, 2024
Upstream commit ID: facebook/mysql-5.6@63b8aae
PS-8951: Merge percona-202305 (https://jira.percona.com/browse/PS-8951)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook/mysql-5.6#1311

Differential Revision: D46075453

fbshipit-source-id: 5965df275a5a7371a015ebc0d5ac1ab59dc47a64
dlenev pushed a commit to dlenev/percona-server that referenced this pull request Oct 17, 2024
Upstream commit ID: facebook/mysql-5.6@63b8aae
PS-8951: Merge percona-202305 (https://jira.percona.com/browse/PS-8951)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook/mysql-5.6#1311

Differential Revision: D46075453

fbshipit-source-id: 5965df275a5a7371a015ebc0d5ac1ab59dc47a64
dlenev pushed a commit to dlenev/percona-server that referenced this pull request Oct 17, 2024
Upstream commit ID: facebook/mysql-5.6@63b8aae
PS-8951: Merge percona-202305 (https://jira.percona.com/browse/PS-8951)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook/mysql-5.6#1311

Differential Revision: D46075453

fbshipit-source-id: 5965df275a5a7371a015ebc0d5ac1ab59dc47a64
dlenev pushed a commit to dlenev/percona-server that referenced this pull request Oct 22, 2024
Upstream commit ID: facebook/mysql-5.6@63b8aae
PS-8951: Merge percona-202305 (https://jira.percona.com/browse/PS-8951)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook/mysql-5.6#1311

Differential Revision: D46075453

fbshipit-source-id: 5965df275a5a7371a015ebc0d5ac1ab59dc47a64
inikep pushed a commit to inikep/percona-server that referenced this pull request Oct 28, 2024
Upstream commit ID: facebook/mysql-5.6@63b8aae
PS-8951: Merge percona-202305 (https://jira.percona.com/browse/PS-8951)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook/mysql-5.6#1311

Differential Revision: D46075453

fbshipit-source-id: 5965df275a5a7371a015ebc0d5ac1ab59dc47a64
inikep pushed a commit to percona/percona-server that referenced this pull request Oct 30, 2024
Upstream commit ID: facebook/mysql-5.6@63b8aae
PS-8951: Merge percona-202305 (https://jira.percona.com/browse/PS-8951)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook/mysql-5.6#1311

Differential Revision: D46075453

fbshipit-source-id: 5965df275a5a7371a015ebc0d5ac1ab59dc47a64
inikep pushed a commit to inikep/percona-server that referenced this pull request Nov 11, 2024
Upstream commit ID: facebook/mysql-5.6@63b8aae
PS-8951: Merge percona-202305 (https://jira.percona.com/browse/PS-8951)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook/mysql-5.6#1311

Differential Revision: D46075453

fbshipit-source-id: 5965df275a5a7371a015ebc0d5ac1ab59dc47a64
inikep pushed a commit to inikep/percona-server that referenced this pull request Nov 14, 2024
Upstream commit ID: facebook/mysql-5.6@63b8aae
PS-8951: Merge percona-202305 (https://jira.percona.com/browse/PS-8951)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook/mysql-5.6#1311

Differential Revision: D46075453

fbshipit-source-id: 5965df275a5a7371a015ebc0d5ac1ab59dc47a64
inikep pushed a commit to inikep/percona-server that referenced this pull request Nov 14, 2024
Upstream commit ID: facebook/mysql-5.6@63b8aae
PS-8951: Merge percona-202305 (https://jira.percona.com/browse/PS-8951)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook/mysql-5.6#1311

Differential Revision: D46075453

fbshipit-source-id: 5965df275a5a7371a015ebc0d5ac1ab59dc47a64
inikep pushed a commit to inikep/percona-server that referenced this pull request Jan 23, 2025
Upstream commit ID: facebook/mysql-5.6@63b8aae
PS-8951: Merge percona-202305 (https://jira.percona.com/browse/PS-8951)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook/mysql-5.6#1311

Differential Revision: D46075453

fbshipit-source-id: 5965df275a5a7371a015ebc0d5ac1ab59dc47a64
inikep pushed a commit to inikep/percona-server that referenced this pull request Jan 23, 2025
Upstream commit ID: facebook/mysql-5.6@63b8aae
PS-8951: Merge percona-202305 (https://jira.percona.com/browse/PS-8951)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook/mysql-5.6#1311

Differential Revision: D46075453

fbshipit-source-id: 5965df275a5a7371a015ebc0d5ac1ab59dc47a64
lukin-oleksiy pushed a commit to lukin-oleksiy/percona-server that referenced this pull request Jan 27, 2025
Upstream commit ID: facebook/mysql-5.6@63b8aae
PS-8951: Merge percona-202305 (https://jira.percona.com/browse/PS-8951)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook/mysql-5.6#1311

Differential Revision: D46075453

fbshipit-source-id: 5965df275a5a7371a015ebc0d5ac1ab59dc47a64
inikep pushed a commit to inikep/percona-server that referenced this pull request Jan 27, 2025
Upstream commit ID: facebook/mysql-5.6@63b8aae
PS-8951: Merge percona-202305 (https://jira.percona.com/browse/PS-8951)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook/mysql-5.6#1311

Differential Revision: D46075453

fbshipit-source-id: 5965df275a5a7371a015ebc0d5ac1ab59dc47a64
lukin-oleksiy pushed a commit to lukin-oleksiy/percona-server that referenced this pull request Jan 29, 2025
Upstream commit ID: facebook/mysql-5.6@63b8aae
PS-8951: Merge percona-202305 (https://jira.percona.com/browse/PS-8951)

Summary:
Various minor cleanups

All done or noticed in the native DD prototype work, are independent from it,
and will help to reduce its diff.

- `ha_rocksdb::create_key_defs` had non-null attribute for the 2nd and 3rd
  argument. It seems that the attribute non-null arg indexes got desynced,
  because the 3rd argument is a reference, and by usage the 1st and the 2nd args
  are pointers that cannot be `nullptr`. Instead of fixing the attribute indexes,
  convert pointers to references, which cannot be null by design.
- Do the same for `ha_rocksdb::create_cfs`. At the same time make `tbl_def_arg`
  `const`, which previously was not, and make the function return `bool`, as it only
  returns two values for success and error. Convert it from
  `DBUG_ENTER_FUNC`/`DBUG_RETURN` to a newer (and lighter) `DBUG_TRACE`.
- `ha_rocksdb::create_table` made `private`, pointer args converted to reference
  args.
- Added missing error checking for RocksDB `WriteBatch::SingleDelete` calls
- `ha_rocksdb::has_hidden_pk` made `static`, args changed from pointers to
  references, removed redundant `nonnull` attribute.
- `ha_rocksdb::pk_index` args changed from pointers to references, removed
  redundant `nonnull` attribute.
- `ha_rocksdb::set_last_rowkey` argument was marked unused even though it was used
- `ha_rocksdb::check_and_lock_sk`, `ha_rocksdb::check_uniqueness_and_lock`,
  `ha_rocksdb::update_write_row`, `ha_rocksdb::reset`,
  `ha_rocksdb::calc_updated_indexes`: added asserts for relationships between
  arguments and `table->record[0]`/`table->record[1]`
- `ha_rocksdb::adjust_handler_stats_sst_and_memtable`: reduce scope of two local
  vars
- `Rdb_key_def`: introduce invalid index ID constant based on
  `dd::INVALID_OBJECT_ID`. Check it on construction and in the index ID getter.
  Replace direct field accesses with the getter call.
- `Rdb_key_def::table_has_hidden_pk` arg changed from pointer to reference.
- Replace `warn_unused_result` attribute with the standard `[[nodiscard]]` for all
  the touched signatures.

Pull Request resolved: facebook/mysql-5.6#1311

Differential Revision: D46075453

fbshipit-source-id: 5965df275a5a7371a015ebc0d5ac1ab59dc47a64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants