Bug #43039 | mysql_truncate() uses ha_resolve_by_legacy_type() | ||
---|---|---|---|
Submitted: | 20 Feb 2009 1:14 | Modified: | 26 Feb 2009 7:23 |
Reporter: | Marc ALFF | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: General | Severity: | S1 (Critical) |
Version: | mysql-6.0.11, 5.1 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[20 Feb 2009 1:14]
Marc ALFF
[21 Feb 2009 8:43]
Sveta Smirnova
Thank you for the report. I can not repeat described behavior with example, csv and daemon_example plugins. Are there special requirements for plugins to repeat this? Ho mysqld should be restarted?
[25 Feb 2009 15:46]
Marc ALFF
To clarify, not all plugin types are affected, only storage engines plugins are. This is because the issue is with handlerton::db_type. The CSV engine can not be used to reproduce the bug, since the CSV engine code contains the following line: storage/csv/ha_tina.cc: tina_hton->db_type= DB_TYPE_CSV_DB; which is what the bug report refers to in this paragraph: " The only way to implement a 'dynamic' storage engine is to actually *not* rely on the db_type allocation in ha_initialize_handlerton(), and add explicitly a new enum entry in enum legacy_db_type in handler.h " The problem is that line should not be there. To reproduce the bug, either not set db_type at all in a storage engine initialization function, or set it to DB_TYPE_UNKNOWN, like in: storage/maria/ha_maria.cc: maria_hton->db_type= DB_TYPE_UNKNOWN; This corresponds to what a truly dynamic storage engine is supposed to implement, since a dynamic engine implementor is *not* supposed to change the server code what so ever, which imply not adding a new enum in the server code in sql/handler.h (db_type).
[26 Feb 2009 7:20]
Sergei Golubchik
db_type is a legacy field and it shouldn't be used - exactly for the reason you described. If any of the sql/ code relies on db_type for anything besides old hard-coded values (like DB_TYPE_MYISAM or DB_TYPE_HEAP) feel free to report it as a bug.
[26 Feb 2009 7:23]
Sergei Golubchik
let's just keep it open with a more appropriate synopsis.