Documentation Home
MySQL Internals Manual


A.1.28 The sql Directory

Programs for handling SQL commands. The "core" of MySQL.

These are the .c and .cc files in the sql directory:

  • derror.cc --- read language-dependent message file

  • des_key_file.cc --- load DES keys from plaintext file

  • discover.cc --- Functions for discovery of .frm file from handler

  • field.cc --- "implement classes defined in field.h" (long); defines all storage methods MySQL uses to store field information into records that are then passed to handlers

  • field_conv.cc --- functions to copy data between fields

  • filesort.cc --- sort a result set, using memory or temporary files

  • frm_crypt.cc --- contains only one short function: get_crypt_for_frm

  • gen_lex_hash.cc --- Knuth's algorithm from Vol 3 Sorting and Searching, Chapter 6.3; used to search for SQL keywords in a query

  • gstream.cc --- GTextReadStream, used to read GIS objects

  • handler.cc --- handler-calling functions

  • hash_filo.cc --- static-sized hash tables, used to store info like hostname -> ip tables in a FIFO manner

  • ha_berkeley.cc --- Handler: BDB

  • ha_blackhole.cc --- Handler: Black Hole

  • ha_federated.cc --- Handler: Federated

  • ha_heap.cc --- Handler: Heap

  • ha_innodb.cc --- Handler: InnoDB

  • ha_myisam.cc --- Handler: MyISAM

  • ha_myisammrg.cc --- Handler: (MyISAM MERGE)

  • ha_ndbcluster.cc --- Handler: NDB

  • hostname.cc --- Given IP, return hostname

  • init.cc --- Init and dummy functions for interface with unireg

  • item.cc --- Item functions

  • item_buff.cc --- Buffers to save and compare item values

  • item_cmpfunc.cc --- Definition of all compare functions

  • item_create.cc --- Create an item. Used by lex.h.

  • item_func.cc --- Numerical functions

  • item_geofunc.cc --- Geometry functions

  • item_row.cc --- Row items for comparing rows and for IN on rows

  • item_strfunc.cc --- String functions

  • item_subselect.cc --- Subqueries

  • item_sum.cc --- Set functions (SUM(), AVG(), etc.)

  • item_strfunc.cc --- String functions

  • item_subselect.cc --- Item subquery

  • item_timefunc.cc --- Date/time functions, for example, week of year

  • item_uniq.cc --- Empty file, here for compatibility reasons

  • key.cc --- Functions to create keys from records and compare a key to a key in a record

  • lock.cc --- Locks

  • log.cc --- Logs

  • log_event.cc --- Log event (a binary log consists of a stream of log events)

  • matherr.c --- Handling overflow, underflow, etc.

  • mf_iocache.cc --- Caching of (sequential) reads and writes

  • mysqld.cc --- Source for mysqld.exe; includes the main() program that starts mysqld, handling of signals and connections

  • mf_decimal.cc --- New decimal and numeric code

  • my_lock.c --- Lock part of a file (like /mysys/my_lock.c, but with timeout handling for threads)

  • net_serv.cc --- Read/write of packets on a network socket

  • nt_servc.cc --- Initialize/register/remove an NT service

  • opt_range.cc --- Range of keys

  • opt_sum.cc --- Optimize functions in presence of (implied) GROUP BY

  • parse_file.cc --- Text .frm files management routines

  • password.c --- Password checking

  • procedure.cc --- Procedure interface, as used in SELECT * FROM Table_name PROCEDURE ANALYSE()

  • protocol.cc --- Low level functions for PACKING data that is sent to client; actual sending done with net_serv.cc

  • protocol_cursor.cc --- Low level functions for storing data to be sent to the MySQL client

  • records.cc --- Functions for easy reading of records, possible through a cache

  • repl_failsafe.cc --- Replication fail-save (not yet implemented)

  • set_var.cc --- Set and retrieve MySQL user variables

  • slave.cc --- Procedures for a slave in a master/slave (replication) relation

  • sp.cc --- DB storage of stored procedures and functions

  • sp_cache.cc --- For stored procedures

  • sp_head.cc --- For stored procedures

  • sp_pcontext.cc --- For stored procedures

  • sp_rcontext.cc --- For stored procedures

  • spatial.cc --- Geometry stuff (lines, points, etc.)

  • sql_acl.cc --- Functions related to ACL security; checks, stores, retrieves, and deletes MySQL user level privileges

  • sql_analyse.cc --- Implements the PROCEDURE ANALYSE(), which analyzes a query result and returns the 'optimal' data type for each result column

  • sql_base.cc --- Basic functions needed by many modules, like opening and closing tables with table cache management

  • sql_cache.cc --- SQL query cache, with long comments about how caching works

  • sql_class.cc --- SQL class; implements the SQL base classes, of which THD (THREAD object) is the most important

  • sql_client.cc --- A function called by my_net_init() to set some check variables

  • sql_crypt.cc --- Encode / decode, very short

  • sql_db.cc --- Create / drop database

  • sql_delete.cc --- The DELETE statement

  • sql_derived.cc --- Derived tables, with long comments

  • sql_do.cc --- The DO statement

  • sql_error.cc --- Errors and warnings

  • sql_handler.cc --- Implements the HANDLER interface, which gives direct access to rows in MyISAM and InnoDB

  • sql_help.cc --- The HELP statement

  • sql_insert.cc --- The INSERT statement

  • sql_lex.cc --- Does lexical analysis of a query; that is, breaks a query string into pieces and determines the basic type (number, string, keyword, etc.) of each piece

  • sql_list.cc --- Only list_node_end_of_list, short (the rest of the list class is implemented in sql_list.h)

  • sql_load.cc --- The LOAD DATA statement

  • sql_manager.cc --- Maintenance tasks, for example, flushing the buffers periodically; used with BDB table logs

  • sql_map.cc --- Memory-mapped files (not yet in use)

  • sql_olap.cc --- ROLLUP

  • sql_parse.cc --- Parse an SQL statement; do initial checks and then jump to the function that should execute the statement

  • sql_prepare.cc --- Prepare an SQL statement, or use a prepared statement

  • sql_rename.cc --- Rename table

  • sql_repl.cc --- Replication

  • sql_select.cc --- Select and join optimization

  • sql_show.cc --- The SHOW statement

  • sql_state.c --- Functions to map mysqld errno to sqlstate

  • sql_string.cc --- String functions: alloc, realloc, copy, convert, etc.

  • sql_table.cc --- The DROP TABLE and ALTER TABLE statements

  • sql_test.cc --- Some debugging information

  • sql_trigger.cc --- Triggers

  • sql_udf.cc --- User-defined functions

  • sql_union.cc --- The UNION operator

  • sql_update.cc --- The UPDATE statement

  • sql_view.cc --- Views

  • stacktrace.c --- Display stack trace (Linux/Intel only)

  • strfunc.cc --- String functions

  • table.cc --- Table metadata retrieval; read the table definition from a .frm file and store it in a TABLE object

  • thr_malloc.cc --- Thread-safe interface to /mysys/my_alloc.c

  • time.cc --- Date and time functions

  • udf_example.cc --- Example file of user-defined functions

  • uniques.cc --- Function to handle quick removal of duplicates

  • unireg.cc --- Create a unireg format file (.frm) from a FIELD and field-info struct


User Comments
User comments in this section are, as the name implies, provided by MySQL users. The MySQL documentation team is not responsible for, nor do they endorse, any of the information provided here.
Sign Up Login You must be logged in to post a comment.