Drizzled Public API Documentation

Todo List
Member drizzle_ping (drizzle_con_st *con, drizzle_result_st *result, drizzle_return_t *ret_ptr)
Remove this with next major API change.
Member drizzle_quit (drizzle_con_st *con, drizzle_result_st *result, drizzle_return_t *ret_ptr)
Remove this with next major API change.
Member DRIZZLE_RETURN_SERVER_GONE
Remove these with next major API change.
Member drizzle_select_db (drizzle_con_st *con, drizzle_result_st *result, const char *db, drizzle_return_t *ret_ptr)
Remove this with next major API change.
Member DRIZZLE_SHUTDOWN_DEFAULT
Remove this with next major API change.
Member drizzled::change_group_ref (Session *session, Item_func *expr, Order *group_list, bool *changed)

Some functions are not null-preserving. For those functions updating of the maybe_null attribute is an overkill.

Member drizzled::create_tmp_field (Session *session, Table *table, Item *item, Item::Type type, Item ***copy_func, Field **from_field, Field **default_field, bool group, bool modify_item, bool make_copy_field, uint32_t convert_blob_length)
:
Member drizzled::Cursor::ha_delete_all_rows ()
Make TransactionServices generic to AfterTriggerServices or similar...
Member drizzled::Cursor::index_only_read_time (uint32_t keynr, double records)
Consider joining this function and Cursor::read_time() into one Cursor::read_time(keynr, records, ranges, bool index_only) function.
Member drizzled::decimal_operation_results (int result)
Fix error messages
Member drizzled::decimal_round (const decimal_t *from, decimal_t *to, int scale, decimal_round_mode mode)
fix this code as it won't work for CEILING mode
Member drizzled::determine_search_depth (Join *join)

this value should be determined dynamically, based on statistics: uint32_t max_tables_for_exhaustive_opt= 7;

this value could be determined by some mapping of the form: depth : table_count -> [max_tables_for_exhaustive_opt..MAX_EXHAUSTIVE]

Member drizzled::dispatch_command (enum_server_command command, Session *session, char *packet, uint32_t packet_length)

set session->lex().sql_command to SQLCOM_END here.

The following has to be changed to an 8 byte integer

Member drizzled::do_div_mod (const decimal_t *from1, const decimal_t *from2, decimal_t *to, decimal_t *mod, int scale_incr)
If this library is to be used with huge numbers of thousands of digits, fast division must be implemented and alloca should be changed to malloc (or at least fallback to malloc if alloca() fails) but then, decimal_mul() should be rewritten too :(
Member drizzled::do_mini_left_shift (decimal_t *dec, int shift, int beg, int last)
Above note is unclear - is 'garanted' a typo for 'guaranteed' or 'granted'?
Member drizzled::execute_command (Session *session)
  • Invalidate the table in the query cache if something changed after unlocking when changes become visible. TODO: this is workaround. right way will be move invalidating in the unlock procedure.
  • TODO: use check_change_password()
  • JOIN is not supported yet. TODO
  • SUSPEND and FOR MIGRATE are not supported yet. TODO
Member drizzled::Field_decimal::store (double nr)
Fix following when double2_class_decimal when double2decimal will return E_DEC_TRUNCATED always correctly
Member drizzled::Field_num::check_int (const CHARSET_INFO *const cs, const char *str, int length, const char *int_end, int error)
Make this multi-byte-character safe
Member drizzled::Field_str::store_decimal (const type::Decimal *)
use decimal2string?
Member drizzled::FileSort::run (Table *table, SortField *sortorder, uint32_t s_length, optimizer::SqlSelect *select, ha_rows max_rows, bool sort_positions, ha_rows &examined_rows)
check why we do this (param.keys--)
Member drizzled::get_options ()
  • FIXME add EXIT_TOO_MANY_ARGUMENTS to "drizzled/error.h" and return that code?
Member drizzled::Hybrid_type_traits_decimal::div (Hybrid_type *val, uint64_t u) const
what is '4' for scale?
Member drizzled::internal_alter_table (Session *session, Table *table, identifier::Table &original_table_identifier, identifier::Table &new_table_identifier, HA_CREATE_INFO *create_info, const message::Table &original_proto, message::Table &create_proto, TableList *table_list, AlterInfo *alter_info, uint32_t order_num, Order *order, bool ignore)
Have a check on the table definition for FK in the future to remove the need for the cursor. (aka can_switch_engines())
Member drizzled::Item::is_expensive ()
Member drizzled::Item::val_bool ()
Make this functions class dependent
Member drizzled::Item_cond_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 drizzled::Item_func_case::print (String *str)
Fix this so that it prints the whole CASE expression
Member drizzled::Item_func_format::val_str (String *)
This needs to be fixed for multi-byte character set where numbers are stored in more than one byte
Member drizzled::Item_func_replace::val_str (String *)
Fix that this works with binary strings
Member drizzled::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 drizzled::Item_ref::fix_fields (Session *, 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 drizzled::Item_row::Item_row (List< Item > &)
think placing 2-3 component items in item (as it done for function
Member drizzled::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 drizzled::Item_string::val_int ()
Give error if we wanted a signed integer and we got an unsigned one
Member drizzled::Item_sum_distinct::setup (Session *session)
check that the case of CHAR(0) works OK
Member drizzled::Item_sum_hybrid::min_max_update_decimal_field ()
optimize: do not get result_field in case of args[0] is NULL
Member drizzled::Item_sum_sum::Item_sum_sum (Session *session, Item_sum_sum *item)
check if the following assignments are really needed
Member drizzled::Join::exec ()

Note, that create_sort_index calls test_if_skip_sort_order and may finally replace sorting with index scan if there is a LIMIT clause in the query. It's never shown in EXPLAIN!

When can we have here session->net.report_error not zero?

Member drizzled::Join::join_free ()
Unlock tables even if the join isn't top level select in the tree
Member drizzled::Join::prepare (Item ***rref_pointer_array, TableList *tables, uint32_t wind_num, COND *conds, uint32_t 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 drizzled::make_join_readinfo (Join *join)
Is abort() the correct thing to call here? I call this here because it was what was called in the default case for the switch statement that used to be here.
Member drizzled::memory::Root::alloc_root (size_t Size)

Would this be more suitable as a member function on the Root class?

next part may be unneeded due to this->first_block_usage counter

Class drizzled::Name_resolution_context
Member drizzled::optimizer::QuickRangeSelect::cmp_next (QuickRange *range)
: Figure out why can't this function be as simple as cmp_prev().
Member drizzled::optimizer::QuickRangeSelect::get_next_prefix (uint32_t prefix_length, key_part_map keypart_map, unsigned char *cur_prefix)
This method is a modified copy of QuickRangeSelect::get_next(), so both methods should be unified into a more general one to reduce code duplication.
Member drizzled::optimizer::QuickRorIntersectSelect::get_next ()
: fix this madness!!!!
Member drizzled::plugin::MonitoredInTransaction::id
Class drizzled::plugin::TransactionalStorageEngine
Member drizzled::plugin::TransactionalStorageEngine::releaseTemporaryLatches (Session *session)
Kill this one entirely. It's implementation, not interface...
Member drizzled::prepare_create_table (Session *session, HA_CREATE_INFO *create_info, message::Table &create_proto, AlterInfo *alter_info, bool tmp_table, uint32_t *db_options, KeyInfo **key_info_buffer, uint32_t *key_count, int select_field_count)
Get rid of this MyISAM-specific crap.
Member drizzled::ReplicationServices::evaluateRegisteredPlugins ()
Class drizzled::Session

Member drizzled::Session::clear_error (bool full=false)
: To silence an error, one should use Internal_error_handler mechanism. In future this function will be removed.
Member drizzled::Session::cuted_fields
Kill this friggin thing.
Member drizzled::Session::end_statement ()
Member drizzled::Session::reset_for_next_command ()

Make it a method of Session and align its name with the rest of reset/end/start/init methods.

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

Member drizzled::Session::used_tables
Member drizzled::Session::warn_list
Member drizzled::setup_copy_fields (Session *session, Tmp_Table_Param *param, Item **ref_pointer_array, List< Item > &res_selected_fields, List< Item > &res_all_fields, uint32_t 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 drizzled::setup_group (Session *session, Item **ref_pointer_array, TableList *tables, List< Item > &fields, List< Item > &all_fields, Order *order, bool *hidden_group_fields)
change ER_WRONG_FIELD_WITH_GROUP to more detailed ER_NON_GROUPING_FIELD_USED
Member drizzled::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.
Class drizzled::TableList

how to distinguish from a JOIN?

  • general JOIN

how to distinguish from a table sequence?

  • NATURAL JOIN (TableList::natural_join != NULL)
  • JOIN ... USING (TableList::join_using_fields != NULL)
  • semi-join
Member drizzled::TableShare::fieldInPrimaryKey (Field *field) const
Member drizzled::test_if_skip_sort_order (JoinTable *tab, Order *order, ha_rows select_limit, bool no_changes, const key_map *map)
  • sergeyp: Results of all index merge selects actually are ordered by clustered PK values.
Member drizzled::TransactionServices::commitTransaction (Session::reference session, bool all)
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. This should be fixed in later ( >= 5.1) releases.
Member drizzled::TransactionServices::insertRecord (Session::reference session, Table &in_table)
Member drizzled::TransactionServices::registerResourceForStatement (Session::reference session, plugin::MonitoredInTransaction *monitored, plugin::TransactionalStorageEngine *engine)
Member drizzled::TransactionServices::registerResourceForStatement (Session::reference session, plugin::MonitoredInTransaction *monitored, plugin::TransactionalStorageEngine *engine, plugin::XaResourceManager *resource_manager)
Member drizzled::TransactionServices::updateRecord (Session::reference session, Table &table, const unsigned char *old_record, const unsigned char *new_record)
Move this crap into a real Record API.
File global.cc
Change to use malloc() ONLY when using LOCK TABLES command or when we are forced to use mysql_lock_merge.
Member ha_innobase::getTransactionalEngine ()
Member HexdumpTransactionMessageFunction::val_str (drizzled::String *)

Of course, this is not efficient to create a new input stream every time we call the UDF. Create a pool of TransactionLogReader objects that can be re-used.

Error message for this...

Error message for this...

Member PrintTransactionMessageFunction::val_str (drizzled::String *)

Of course, this is not efficient to create a new input stream every time we call the UDF. Create a pool of TransactionLogReader objects that can be re-used.

Error message for this...

Error message for this...

File subselect.cc
  • add function from select_query that use JOIN* as parameter to JOIN methods (sql_select.h/sql_select.cc)
File temporal.cc
File transaction_log.cc
File transaction_log_reader.cc