The long term goal of this MCOL is to have columnstore not need to change Server code to work, but rather do everything through APIs. Some APIs already exist that we're not taking advantage of. Our code should be changed to use these where ever possible.
Instead of adding Session variables directly to sql_class.h and sys_vars.h, use st_mysql_sys_var in st_maria_plugin. Use the new information schema plugin to report all user variables, which creates the Information Schema USER_VARIABLES Table -
Remove INFINIDB_VTABLE from the THD definition and use the ha_data THD member. There are functions to set and access this on a per-session basis. There are some reasons why the original team chose the method they did. There may be an issue getting the ha_data slot number from within the Server itself.
Our virtual table processing is partially implemented in sql_parse.cc. Until we can get a hook put in by the Server guys, this will remain. It uses class Prepared_statement, which is normally declared only in sql_prepare.cc. Prepared_statement uses Select_fetch_protocol_binary also only declared in sql_prepare.cc. We move these declarations to sql_class.h so they can be accessed by sql_parse.cc. We tried moving them to sql_prepare.h – the logical place – but the compiler errors were irreconcilable. We need to
talk to the Server team about making these two classes available to Other parts of the server.
Columnstore needs read access to the following data members. It would be best if the Server team created accessors for these:
Item::thd (currently not stored in Item, but is available in constructor)
We need write access to the following
Field_num::dec is const. We need to be able to change it, at least until we fix decimal type.