ok after MDEV-8342 and MDEV-8343. There are two main things here: type of sf and return type of sf. Right now the create function... is giving errors at
in sf_create_routine(), which is right since we have been been using TYPE_ENUM_TABLE for m_type so far and mysql.proc takes enum('FUNCTION','PROCEDURE') for type so far. Now we have decided to store both functions as TYPE_ENUM_FUNCTION for now and functions can be differentiated using return types.
The second thing is about return type of function. Right now sp_returns_type() method is being used to store the return type of functions. But in our case we have a list of create_fields: List<Create_field> m_cols_list keeping list of attribute names and their types for the table. The type of the field storing return type right now is longblob which as i read further on it is a binary large object that can hold a variable amount of data and are treated as binary strings (byte strings). We have decided to store all the attribute information in this field only, in a single string eg. TABLE <table_alias>(<col_definitions>).
Also, another thing is to store the table alias m_table_alias, because queries inside the function will be using it. There is no field present specifically for this in mysql.proc. So we finally decided to store the table alias as part of return type string for now.
diwas joshi
added a comment - ok after MDEV-8342 and MDEV-8343 . There are two main things here: type of sf and return type of sf. Right now the create function... is giving errors at
store_failed= store_failed ||
table->field [MYSQL_PROC_MYSQL_TYPE] ->
store((longlong)type, TRUE);
in sf_create_routine(), which is right since we have been been using TYPE_ENUM_TABLE for m_type so far and mysql.proc takes enum('FUNCTION','PROCEDURE') for type so far. Now we have decided to store both functions as TYPE_ENUM_FUNCTION for now and functions can be differentiated using return types.
The second thing is about return type of function. Right now sp_returns_type() method is being used to store the return type of functions. But in our case we have a list of create_fields: List<Create_field> m_cols_list keeping list of attribute names and their types for the table. The type of the field storing return type right now is longblob which as i read further on it is a binary large object that can hold a variable amount of data and are treated as binary strings (byte strings). We have decided to store all the attribute information in this field only, in a single string eg. TABLE <table_alias>(<col_definitions>).
Also, another thing is to store the table alias m_table_alias, because queries inside the function will be using it. There is no field present specifically for this in mysql.proc. So we finally decided to store the table alias as part of return type string for now.
ok after
MDEV-8342andMDEV-8343. There are two main things here: type of sf and return type of sf. Right now the create function... is giving errors atstore_failed= store_failed ||
table->field[MYSQL_PROC_MYSQL_TYPE]->
store((longlong)type, TRUE);
in sf_create_routine(), which is right since we have been been using TYPE_ENUM_TABLE for m_type so far and mysql.proc takes enum('FUNCTION','PROCEDURE') for type so far. Now we have decided to store both functions as TYPE_ENUM_FUNCTION for now and functions can be differentiated using return types.
The second thing is about return type of function. Right now sp_returns_type() method is being used to store the return type of functions. But in our case we have a list of create_fields: List<Create_field> m_cols_list keeping list of attribute names and their types for the table. The type of the field storing return type right now is longblob which as i read further on it is a binary large object that can hold a variable amount of data and are treated as binary strings (byte strings). We have decided to store all the attribute information in this field only, in a single string eg. TABLE <table_alias>(<col_definitions>).
Also, another thing is to store the table alias m_table_alias, because queries inside the function will be using it. There is no field present specifically for this in mysql.proc. So we finally decided to store the table alias as part of return type string for now.