Hi,
I propose few additional functions to MySQL storage engine handler
interface:
::add_foreign_keys(THD* thd, TABLE *table_arg, foreign_key* fk_key, uint
n_fkeys);
Assuming that HA_CAN_ADD_FOREIGN_KEYS is set this
function is used for implementing alter table add
foreign key ...
::drop_foreign_keys(THD* thd, TABLE *table_arg, char* fk_names, uint
n_fkeys);
Assuming that HA_CAN_DROP_FOREIGN_KEYS is set
this function is used to implement alter table drop foreign
key...
::set_column_defaults(THD* thd, TABLE *table_arg, char* field_names,
mysql_byte* default_values, uint n_defvalues);
Assuming that HA_CAN_SET_DEFAUL_CASCADE is set this function
is used to modify column default value in alter table modify
column a set default ...
Note that this would require that storage engine can in ::create
determine default value for the column (e.g.
Field->get_default_value())
::add_columns(THD* thd, TABLE *table_arg, Field* fields, uint n_fields);
Assuming that HA_CAN_ADD_COLUMNS is set this function is used
to implement alter table add column ...
::drop_columns(THD* thd, TABLE *table_arg, char* field_names, uint
n_fields);
Assuming that HA_CAN_DROP_COLUMNS is set this function is used
to implement alter table drop column ...
R: Jan Lindström
Solid Information Technology Ltd