My Project
Todo List
Member Alter_inplace_info::key_info_buffer
This is mainly due to the fact that we need to keep compatibility with removed handler::add_index() call. We plan to switch to TABLE::key_info numbering later.
Replace all references to "next number" or NEXT_NUMBER to "auto_increment", everywhere (see below: there is table->auto_increment_field_not_null, and there also exists table->next_number_field, it's not consistent).
Class binlog_cache_data
All the access functions for the flags suggest that the encapsuling is not done correctly, so try to move any logic that requires access to the flags into the cache.
Member calc_used_field_length (THD *thd, JOIN_TAB *join_tab)
why don't we count the rowids that we might need to store when using DuplicateElimination?
Rename this class.
Member decimal_operation_results (int result)
Fix error messages
Member dispatch_command (enum enum_server_command command, THD *thd, char *packet, uint packet_length)

set thd->lex->sql_command to SQLCOM_END here.

The following has to be changed to an 8 byte integer

Member Ed_connection::store_result_set ()
Use double-linked list, when this is really used.
Class Ed_result_set
Implement support for result set metadata and automatic type conversion.
Class Field_bit_as_char
The inheritance relationship is backwards since Field_bit is an extended version of Field_bit_as_char and not the other way around. Hence, we should refactor it to fix the hierarchy order.
Member Field_new_decimal::store (double nr)
Fix following when double2my_decimal when double2decimal will return E_DEC_TRUNCATED always correctly
Member Field_num::check_int (const CHARSET_INFO *cs, const char *str, int length, const char *int_end, int error)
Make this multi-byte-character safe
Member Field_str::store_decimal (const my_decimal *)
use decimal2string?
Member Field_temporal_with_date_and_time::init_timestamp_flags ()
Member Field_time_common::convert_number_to_TIME (longlong nr, bool unsigned_val, int nanoseconds, MYSQL_TIME *ltime, int *warning)
: convert_number_to_TIME returns conversion status through two different interfaces: return value and warning. It should be refactored to only use return value.
Member fix_delay_key_write (sys_var *self, THD *thd, enum_var_type type)
When updating myisam_delay_key_write, we should do a 'flush tables' of all MyISAM tables to ensure that they are reopen with the new attribute.

use instead to_upper_lex, special array (substitute chars) without skip codes..

try use reverse order of comparing..

Member get_canonical_filename (handler *file, const char *path, char *tmp_path)
This may be done more efficiently when table path gets built. Convert this function to something like ASSERT_CANONICAL_FILENAME.
Member Gtid_set::intersection (const Gtid_set *other, Gtid_set *result)
: This algorithm is simple, a little bit slower than necessary. It would be more efficient to iterate over intervals of 'this' and 'other' similar to add_gno_interval(). At the moment the performance of this is not super-important. /Sven
Member ha_check_if_supported_system_table (handlerton *hton, const char *db, const char *table_name)
There is another function called is_system_table_name() used by get_table_category(), which is used to set TABLE_SHARE table_category. It checks only a subset of table name like proc, event and time*. We cannot use below function in get_table_category(), as that affects locking mechanism. If we need to unify these functions, we need to fix locking issues generated.
Member ha_commit_trans (THD *thd, bool all, bool ignore_global_read_lock)
Since we don't support nested statement transactions in 5.0, we can't commit or rollback stmt transactions while we are inside stored functions or triggers. So we simply do nothing now. TODO: This should be fixed in later ( >= 5.1) releases.
Member handler::index_only_read_time (uint keynr, double records)
Consider joining this function and handler::read_time() into one handler::read_time(keynr, records, ranges, bool index_only) function.
Member Hybrid_type_traits_decimal::div (Hybrid_type *val, ulonglong u) const
what is '4' for scale?
Member Item::copy_andor_structure (THD *thd, bool real_items=false)
this argument should be always false and removed in WL#7082.
Member Item::val_bool ()
Make this functions class dependent
Member Item_func_case::print (String *str, enum_query_type query_type)
Fix this so that it prints the whole CASE expression
Member Item_func_format::val_str_ascii (String *)
This needs to be fixed for multi-byte character set where numbers are stored in more than one byte
Member Item_func_replace::val_str (String *)
Fix that this works with binary strings when using USE_MB
Member Item_func_xor::val_int ()
(low priority) Change this to be optimized as:
A XOR B -> (A) == 1 AND (B) <> 1) OR (A <> 1 AND (B) == 1)
To be able to do this, we would however first have to extend the MySQL range optimizer to handle OR better.
Member Item_in_subselect::row_value_in_to_exists_transformer (JOIN *join)
The IF-ELSE below can be refactored so that there is no duplication of the statements that create the new conditions. For this we have to invert the IF and the FOR statements as this: for (each left operand) create the equi-join condition if (is_having_used || !abort_on_null) create the "is null" and is_not_null_test items if (is_having_used) add the equi-join and the null tests to HAVING else add the equi-join and the "is null" to WHERE add the is_not_null_test to HAVING
Member Item_param::query_val_str (THD *thd, String *str) const
  • Change interface and implementation to fill log data in place and avoid one more memcpy/alloc between str and log string.
  • In case of error we need to notify replication that binary log contains wrong statement
Member Item_ref::fix_fields (THD *, Item **)
Here we could first find the field anyway, and then test this condition, so that we can give a better error message - ER_WRONG_FIELD_WITH_GROUP, instead of the less informative ER_BAD_FIELD_ERROR which we produce now.
Member Item_row::Item_row (List< Item > &)
think placing 2-3 component items in item (as it done for function
Member Item_singlerow_subselect::select_transformer (JOIN *join)
  • We cant change name of Item_field or Item_ref, because it will prevent it's correct resolving, but we should save name of removed item => we do not make optimization if top item of list is field or reference.
  • switch off this optimization for prepare statement, because we do not rollback this changes. Make rollback for it, or special name resolving mode in 5.0.
Member Item_string::val_int ()
Give error if we wanted a signed integer and we got an unsigned one
  • add function from mysql_select that use JOIN* as parameter to JOIN methods (sql_select.h/
Member Item_sum_hybrid::min_max_update_decimal_field ()
optimize: do not get result_field in case of args[0] is NULL
Member Item_sum_sum::Item_sum_sum (THD *thd, Item_sum_sum *item)
check if the following assignments are really needed
Move month and days to language files
Member JOIN::exec ()
When can we have here thd->net.report_error not zero?
Member JOIN::join_free ()
Unlock tables even if the join isn't top level select in the tree
Member JOIN::optimize ()
Above we passed unique=false. But for this query: (oe1, oe2) IN (SELECT primary_key, non_key_maybe_null_field FROM tbl) we could use "unique=true" for the first index component and let Item_is_not_null_test(non_key_maybe_null_field) handle the second.
Member JOIN::prepare (TABLE_LIST *tables, uint wind_num, Item *conds, uint og_num, ORDER *order, ORDER *group, Item *having, SELECT_LEX *select, SELECT_LEX_UNIT *unit)
Add check of calculation of GROUP functions and fields: SELECT COUNT(*)+table.col1 from table1;
Member key_uses_partial_cols (TABLE *table, uint keyno)
Allow use of DS-MRR in cases where the index has partially-covered components but they are not used for scanning.
Change to use my_malloc() ONLY when using LOCK TABLES command or when we are forced to use mysql_lock_merge.
Abort logging when we get an error in reading or writing log files
Member Log_to_csv_event_handler::log_general (THD *thd, time_t event_time, const char *user_host, uint user_host_len, my_thread_id thread_id, const char *command_type, uint command_type_len, const char *sql_text, uint sql_text_len, const CHARSET_INFO *client_cs)
: how?). If a write to the table has failed, the function attempts to write to a short error message to the file. The failure is also indicated in the return value.
Member MYSQL_BIN_LOG::open_binlog (const char *log_name, const char *new_name, enum cache_type io_cache_type_arg, ulong max_size, bool null_created, bool need_lock_index, bool need_sid_lock, Format_description_log_event *extra_description_event)
: although this was introduced to appease valgrind when injecting emulated faults using fault_injection_registering_index it may be good to consider what actually happens when open_purge_index_file succeeds but register or sync fails.
Member MYSQL_BIN_LOG::open_binlog (const char *opt_name)
keep in-memory list of prepared transactions (add to list in log(), remove on unlog()) and copy it to the new binlog if rotated but let's check the behaviour of tc_log_page_waits first!
Member mysql_execute_command (THD *thd)
  • Invalidate the table in the query cache if something changed after unlocking when changes become visible.

: this is workaround. right way will be move invalidating in the unlock procedure.

  • TODO: use check_change_password()
Member MYSQL_LOG::generate_name (const char *log_name, const char *suffix, bool strip_ext, char *buff)
The following should be using fn_format(); We just need to first change fn_format() to cut the file name if it's too long.
Member mysql_reset_thd_for_next_command (THD *thd)

Remove mysql_reset_thd_for_next_command and only use the member function.

Call it after we use THD for queries, not before.

Member Protocol_text::store (MYSQL_TIME *time, uint precision)
Second_part format ("%06") needs to change when we support 0-6 decimals for time.
Member Query_log_event::Query_log_event (const char *buf, uint event_len, const Format_description_log_event *description_event, Log_event_type event_type)
we should clean up and do only copy_str_and_move; it works for both cases. Then we can remove the catalog_nz flag. /sven
Member reinit_stmt_before_use (THD *thd, LEX *lex)
When the new table structure is ready, then have a status bit to indicate the table is altered, and re-do the setup_* and open the tables back.
Member Relay_log_info::flush_info (bool force=FALSE)
Change the log file information to a binary format to avoid calling longlong2str.
Member Relay_log_info::init_relay_log_pos (const char *log, ulonglong pos, bool need_data_lock, const char **errmsg, bool look_for_description_event)
check proper initialization of group_master_log_name/group_master_log_pos. /alfranio
Member setup_copy_fields (THD *thd, TMP_TABLE_PARAM *param, Ref_ptr_array ref_pointer_array, List< Item > &res_selected_fields, List< Item > &res_all_fields, uint elements, List< Item > &all_fields)
In most cases this result will be sent to the user. This should be changed to use copy_int or copy_real depending on how the value is to be used: In some cases this may be an argument in a group function, like: IF(ISNULL(col),0,COUNT(*))
Member sp_head::execute_function (THD *thd, Item **args, uint argcount, Field *return_fld)

We should create sp_rcontext once per command and reuse it on subsequent executions of a function/trigger.

In future we should associate call arena/mem_root with sp_rcontext and allocate all these objects (and sp_rcontext itself) on it directly rather than juggle with arenas.

Member sp_head::execute_trigger (THD *thd, const LEX_STRING *db_name, const LEX_STRING *table_name, GRANT_INFO *grant_info)
  • TODO: we should create sp_rcontext once per command and reuse it on subsequent executions of a trigger.
Member sp_head::set_security_ctx (THD *thd, Security_context **save_ctx)
Cache if the definer has the rights to use the object on the first usage and reset the cache only if someone does a GRANT statement that 'may' affect this.
Class sp_instr_jump
later we will consider introducing a new class, which will be the base for sp_instr_jump, sp_instr_set_case_expr and sp_instr_jump_case_when. Something like sp_regular_branch_instr (similar to sp_lex_branch_instr).
Member sp_parser_data::new_cont_backpatch ()
These functions should probably be declared in a separate interface class, but currently we try to minimize the sp_instr hierarchy.
Class Sql_cmd_alter_table
move Alter_info and other ALTER specific structures from Lex here.
Class Sql_cmd_common_alter_table
move Alter_info and other ALTER generic structures from Lex here.
Member sql_ex_info::write_data (IO_CACHE *file)
This is sensitive to field padding. We should write a char[7], not an old_sql_ex. /sven
Member st_join_table::st_join_table ()
Add constructor to READ_RECORD. All users do init_read_record(), which does memset(), rather than invoking a constructor.
Member subselect_single_select_engine::prepare ()
Re-check what properties of 'join' are needed during prepare, and see if we can avoid creating a JOIN during JOIN::prepare of the outer join.
Member Sys_var_keycache::global_update (THD *thd, set_var *var)
This should be changed so that we wait until the previous assignment is done and then do the new assign
Member TABLE::mem_root
This member should not be declared in-line. That makes it impossible for any function that does memory allocation to take a const reference to a TABLE object.
Member TABLE_LIST::context_of_embedding
When name resolution contexts are created after parsing, we should be able to store this in the embedding join nest instead.
Member TABLE_SHARE::get_table_ref_type () const
perhaps we need to have a member instead of a function.
Member Table_triggers_list::check_n_load (THD *thd, const char *db, const char *table_name, TABLE *table, bool names_only)

A lot of things to do here e.g. how about other funcs and being more paranoical ?

This could be avoided if there is no triggers for UPDATE and DELETE.

Member Table_triggers_list::drop_trigger (THD *thd, TABLE_LIST *table, String *stmt_query)
Probably instead of removing .TRG file we should move to archive directory but this should be done as part of functionality (because we will need it elsewhere).
Member tdc_open_view (THD *thd, TABLE_LIST *table_list, const char *alias, const char *cache_key, uint cache_key_length, uint flags)
This function is needed for special handling of views under LOCK TABLES. We probably should get rid of it in long term.
Member test_if_skip_sort_order (JOIN_TAB *tab, ORDER *order, ha_rows select_limit, const bool no_changes, const key_map *map, const char *clause_type)
  • sergeyp: Results of all index merge selects actually are ordered by clustered PK values.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines