facebook / mysql-5.6

Facebook's branch of the Oracle MySQL database. This includes MyRocks.
http://myrocks.io
Other
2.47k stars 711 forks source link

Add extra asserts to prevent incorrect moved-from Rdb_tbl_def uses #1416

Closed laurynas-biveinis closed 5 months ago

laurynas-biveinis commented 6 months ago

Rdb_tbl_def class has a move constructor-like two-arg constructor that takes the ownership of passed object's m_key_descr_arr field. Signify this moved-from state in the object by resetting m_pk_index-which is a related-field to MAX_INDEXES + 1, and add extra asserts that these and other related fields are not accessed in moved-from objects.

At the same time remove redundant "explicit" specifiers from two-argument constructors and clean them up to use initializer lists consistently.

laurynas-biveinis commented 6 months ago

Those incorrect moved-from uses I had seen in passing during MyRocks DDSE debugging

facebook-github-bot commented 6 months ago

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

facebook-github-bot commented 6 months ago

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

facebook-github-bot commented 5 months ago

This pull request has been merged in facebook/mysql-5.6@e5b18aae04c81f0143ad42924eeed9637c05cb71.