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

Pass actual format string instead of nullptr in Parser_oom_handler::h… #1410

Closed laurynas-biveinis closed 5 months ago

laurynas-biveinis commented 6 months ago

…andle_condition

Should the code path be actually exercised, memory errors were likely to have occurred instead of diagnostics.

This fixes a GCC build error:

sql/sql_parse.cc:7909:17: error: too many arguments for format [-Werror=format-extra-args] 7909 | static_cast(thd->variables.parser_max_mem_size),

Squash with 67fcc60a43687c3e116c7f57e13b52732ad25231

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.

luqun commented 6 months ago

From code(https://github.com/facebook/mysql-5.6/blob/fb-mysql-8.0.32/sql/sql_error.cc#L731), passing nullptr should be same as passing ER_THD(thd, ER_CAPACITY_EXCEEDED).

laurynas-biveinis commented 6 months ago

From code(https://github.com/facebook/mysql-5.6/blob/fb-mysql-8.0.32/sql/sql_error.cc#L731), passing nullptr should be same as passing ER_THD(thd, ER_CAPACITY_EXCEEDED).

I see, then format(printf(...)) attribute annotation is not entirely correct. I still propose my patch as a GCC warning silencer

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@067546c4e52af805086300c6c6bef357bd1b2b37.