Programs for handling SQL commands. The "core" of MySQL.
These is 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 the .frm
file from handler
field.cc---"Implement classes defined in field.h
" (long), defines all storage methods MySQL uses to store field Informatio n into records that is 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 on IN
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 mysqld.exe
for; includes main()
the 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 inSELECT * FROM Table_name PROCEDURE ANALYSE()
protocol.cc---Low level functions for PACKING data (sent to client; Actual sending done withnet_serv.cc
protocol_cursor.cc---Low level functions for storing data to being 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 PROCEDURE ANALYSE()
the, 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 a 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 HANDLER
the interface, which gives direct access to rows in and MyISAM
InnoDB
sql_help.cc---The HELP
statement
sql_insert.cc---The INSERT
statement
sql_lex.cc---Does lexical analysis of a query; That's, 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 was 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 on 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 a 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 and FIELD
field-info struct
Catalog List
Directory name Comment
BDB Berkeley DB Table engine
Build the script for building the project
Client clients
Cmd-line-utils command-line tools
Config some of the files needed to build the project
Dbug Fred Fish's debug library
Docs Documents folder
Extra some of the relatively independent secondary tools
Heap Heap Table engine
Include header File
Innobase InnoDB Table Engine
Libmysql Dynamic Library
Libmysql_r to build a thread-safe libmysql Library
Libmysqld server as an embedded library
Man User manual
Myisam Myisam Table Engine
MYISAMMRG MyISAM Merge Table engine
Test Unit for Mysql-test mysqld
Mysys MySQL's system library
NDB MySQL Cluster
Netware MySQL network version related files
NEW-RPM Storage RPM during deployment
Os2 the underlying function for the OS/2 operating system
Pstack the Stack
Regex regular Expression library (including extended regular expression functions)
SCCS Source control system (not part of the source code)
Scripts Bulk SQL scripts, such as initializing library scripts
Server-tools Management Tools
SQL processing SQL command; MySQL core
Sql-bench Standard Check procedure for MySQL
Sql-common some SQL folder-related C files
SSL Secure Sockets Layer
Strings String Function Library
Support-files files used to build MySQL on different systems
Tests contains tests for Perl and C
Tools
Vio virtual I/O Library
Zlib data compression Library for Windows
Here are a few more important directory listings:
List of documents
Directory name File name Comment
Client
GET_PASSWORD.C command Line Input password
mysql.cc MySQL command line tool
mysqladmin.cc Database Weihu
Mysqldump.c the contents of the table as an SQL statement, that is, a logical backup
mysqlimport.c text file data into the table
MYSQLMANAGER-PWGEN.C Password Generation
MYSQLSHOW.C displaying databases, tables, and columns
MYSQLTEST.C test program used by MySQL test unit
--------------------------------------------------------------------------------------------------------------- -
Mysys
ARRAY.C Dynamic Array
charset.c dynamic character Set, default character set
CHARSET-DEF.C contains the character set used by the client
CHECKSUM.C calculates checksums for memory blocks for Pack_isam
Default.c to find the default configuration items from the *.CNF and *.ini files
DEFAULT_MODIFY.C Edit selectable Options
ERRORS.C English error text
HASH.C Hash Lookup, compare, release function
List.c doubly linked list
MAKE-CONF.C Creating a *.conf file
MD5.C MD5 algorithm
Mf_brkhant.c
MF_CACHE.C Open temporary files and use Io_cache for caching
Mf_driname.c Parse, convert path name
Mf_fn_ext.c getting the suffix of a file name
MF_FORMAT.C Format File name
Mf_getdate Date obtained:
YYYY-MM-DD HH:MM:SS Format
MF_IOCACHE.C Cache I/O
MF_IOCACHES.C Multi-key-value cache
MF_LOADPATH.C Get full path name
MF_PACK.C creating the required compressed/uncompressed file name
MF_PATH.C decide whether the program can find files
MF_QSORT.C Quick Sort
MF_QSORT2.C Quick Sort 2
Mf_radix.c Cardinal Sort
MF_SOUNDEX.C detection Algorithm (EDN 14, 1985)
Mf_strip.c go to string end space
MF_TEMPDIR.C Create, find, delete temporary folders
mf_tempfile.c creation of temporary files
MF_UNIXPATH.C conversion file named Unix style
MF_UTIL.C Common functions
MF_WCOMP.C using wildcard characters to compare
MF_WFILE.C wildcard to find a file
MULALLOC.C assigning multiple pointers simultaneously
MY_ACCESS.C checking the file or path is legal
MY_AES.C AES Encryption algorithm
MY_ALARM.C Alarm Related
MY_ALLOC.C simultaneous allocation of temporary result set caches
MY_APPEND.C one file to another
MY_BIT.C division use, bitwise arithmetic
MY_BITMAP.C bitmap
my_chsize.c filling or truncating a file
MY_CLOCK.C clock function
MY_COMPRESS.C compression
MY_COPY.C Copy Files
My_crc32.c
My_create.c Creating a file
my_delete.c Deleting files
MY_DIV.C Get file name
MY_DUP.C to open a copy file
MY_ERROR.C error code
My_file.c
MY_FOPEN.C Open File
MY_FSTREAM.C file stream read/write
MY_GETHOSTBYNAME.C Get host Name
MY_GETHWADDR.C Get the hardware address
My_getopt.c Find options in effect
My_getsystime.c Time of day
MY_GETWD.C Get working Directory
My_handler.c
MY_INIT.C initialization of variables and functions
MY_LARGEPAGE.C get the paging size of the OS
MY_LIB.C Compare/Convert directory names and filenames
MY_LOCK.C Lock File
MY_LOCKMEM.C allocating a locked memory
MY_LREAD.C reading files to memory
MY_LWRITE.C Memory Write file
MY_MALLOC.C Allocating memory
MY_MESSNC.C output message on standard output
My_mkdir.c Creating a Directory
MY_MMAP.C Memory Mapping
my_net.c NET Functions
MY_NETWARE.C MySQL Network edition
MY_ONCE.C one allocation, never free
MY_OPEN.C Open a file
Simple implementation of MY_OS2COND.C operating system cond
MY_OS2DIRSRCH.C Analog Win32 Directory query
My_os2dlfcn.c simulating UNIX dynamic loading
MY_OS2FILE64.C file 64-bit settings
MY_OS2MUTEX.C Mutex Amount
MY_OS2THREAD.C Threads
MY_OS2TLS.C Thread Local Storage
My_port.c
Encapsulation of MY_PTHREAD.C Threads
MY_QUICK.C Read/write
MY_READ.C reading from a file bytes
MY_REALLOC.C re-allocating memory
MY_REDEL.C Renaming and deleting files
MY_SEEK.C Find
MY_SEMAPHORE.C Signal Volume
MY_SLEEP.C Sleep Waiting
MY_STATIC.C Static variables
MY_SYMLINK.C Reading Symbolic Links
MY_SYMLINK2.C 2
MY_SYNC.C synchronizing memory and files
MY_THR_INIT.C Initialize/Assign thread variables
My_wincond.c
MY_WINDAC.C WINDOWS nt/2000 Autonomous access control
MY_WINSEM.C Impersonation Thread
MY_WINTHREAD.C Impersonation Thread
my_write.c Writing Files
PTR_CMP.C byte stream comparison function
Queue,c Priority Queue
RAID2.C Support raid
RIJNDAEL.C AES Encryption algorithm
SAFEMALLOC.C Safe malloc
SHA1.C SHA1 Hash Encryption algorithm
STRING.C String Functions
TESTHASH.C test hash function (standalone program)
Test_charset test Character Set (standalone)
THR_LOCK.C Read/write lock
THR_MUTEX.C Mutex Amount
THR_RWLOCK.C Synchronous Read-write lock
TREE.C Two fork Tree
TYPELIB.C matching strings in a string
Sql
derror.cc Reading language-independent information files
des_key_file.cc loading des keys
Search for discover.cc frm file
field.cc Storing column information
filed_conv.cc Copy field information
filesort.cc result set sorting (memory or temp file)
frm_crypt.cc get_crypt_from_frm
gen_lex_hash.cc finding and arranging SQL keywords
GSTREAM.C GIS
handler.cc function handle
hash_filo.cc Static size hash table,
Store host name, IP table in FIFO mode
ha_berkeley.cc BDB's handle
ha_innodb.cc InnoDB Handle
Hostname.cc get Hostname based on IP
init.cc initialization and Unireg-related functions
ITEM.CC Item function
Item_buff.cc the Save and compare cache of item
Definition of item_cmpfunc.cc comparison function
item_create.cc Create an item
item_func.cc Numeric functions
item_geofunc.cc aggregate functions
item_row.cc Record Item Comparison
item_strfunc.cc String Functions
item_subselect.cc Sub-query
item_sum.cc Set function (Sum,avg ... )
item_timefunc.cc Time-Date function
item_uniq.cc Empty File
key.cc Create key and compare
lock.cc Lock
log.cc Log
log_event.cc Log Events
MATHERR.C Handling Overflow
mf_iocache.cc sequential Read and write cache
mysqld.cc Main, handling signals and connections
mf_decimal.cc Decimal Type
My_lock.c
Parsing of the net_serv.cc socket packet
nt_servc.cc NT Service
opt_range.cc Key Sort
opt_sum.cc Set function optimization
parse_file.cc frm Analysis
PASSWORD.C password Check
procedure.cc
PROTOCOL.CC packet package sent to client
protocol_cursor.cc Store the data returned
records.cc reading a record set
repl_failsafe.cc
set_var.cc setting, reading user variables
slave.cc Slave Node
sp.cc stored procedures and stored functions
sp_cache.cc
sp_head.cc
sp_pcontext.cc
sp_rcontext.cc
spatial.cc aggregate function, point line face
sql_acl.cc ACL
sql_analyse.cc
sql_base.cc Basic Functions
sql_cache.cc Query Cache
sql_client.cc
sql_crypt.cc Plus decryption
sql_db.cc creating, deleting db
sql_delete.cc DELETE statement
sql_derived.cc derived tables
sql_do.cc do
sql_error.cc Errors and warnings
sql_handler.cc
sql_help.cc Help
sql_insert.cc Insert
Lexical analysis of sql_lex.cc
sql_list.cc
sql_load.cc Load DATA Statement
sql_manager.cc Maintenance work
sql_map.cc Memory Mapping
sql_olap.cc
sql_parse.cc parsing statements
sql_prepare.cc
sql_rename.cc Renaming the table name
sql_repl.cc replication
sql_select.cc Select and join optimizations
sql_show.cc Show
SQL_STATE.C error numbers and status mappings
sql_string.cc
sql_table.cc DROP table, ALTER table
Sql_trigger.cc Trigger
sql_udf.cc user-defined functions
Sql_union.cc Union operator
sql_update.cc Update
sql_view.cc View
STACKTRACE.C Display Stack (Linux/intel only)
strfunc.cc
table.cc table Meta Data Acquisition (FRM)
thr_malloc.cc
time.cc
Quick deletion of uniques.cc copies
unireg.cc Create a frm
Reference:
Http://dev.mysql.com/doc/internals/en/sql-directory.html
Http://www.cnblogs.com/nocode/archive/2011/08/12/2135791.html