diff options
author | unknown <monty@mashka.mysql.fi> | 2002-09-19 17:49:41 +0300 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2002-09-19 17:49:41 +0300 |
commit | a355b6ac7040d0e9540c7d8396d0b1b315a7aa0d (patch) | |
tree | 897900b716e0af342d6a5a9d3c9f2bc23261dc72 /sql/lock.cc | |
parent | 83fc12f21653f1e6fc12c61791f4e6f2dd87be96 (diff) | |
download | mariadb-git-a355b6ac7040d0e9540c7d8396d0b1b315a7aa0d.tar.gz |
Increased max possible max_allowed_packet to 1G
Small optimization to not do external locking of temporary MyISAM tables.
BitKeeper/deleted/.del-sslopt-usage.h~3ab77eeeaad1ba0a:
Delete: include/sslopt-usage.h
Docs/manual.texi:
Fixed wrong descrtion of IF()
Added information about automatic cast of integer to binary string
ChangeLog
client/mysqlbinlog.cc:
Portability fix
client/mysqldump.c:
Increased max possible max_allowed_packet to 1G
include/Makefile.am:
Removed sslopt-usage.h
Made sslopt-case.h global
include/my_sys.h:
Fixd protypes for my_strdup_with_length()
mysys/safemalloc.c:
Fixd some prototypes
sql/ha_isam.cc:
Don't do external locking on temporary tables
sql/ha_myisam.cc:
Don't do external locking on temporary tables
sql/lock.cc:
Added big description of how LOCK TABLES affects locking
sql/log_event.cc:
cleanup
sql/mysqld.cc:
Increased max possible max_allowed_packet to 1G
sql/sql_table.cc:
Fixed portability problem
Diffstat (limited to 'sql/lock.cc')
-rw-r--r-- | sql/lock.cc | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/sql/lock.cc b/sql/lock.cc index 056ed0fec8f..ea627207e42 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -21,6 +21,46 @@ before getting internal locks. If we do it in the other order, the status information is not up to date when called from the lock handler. + GENERAL DESCRIPTION OF LOCKING + + When not using LOCK TABLES: + + - For each SQL statement mysql_lock_tables() is called for all involved + tables. + - mysql_lock_tables() will call + table_handler->external_lock(thd,locktype) for each table. + This is followed by a call to thr_multi_lock() for all tables. + + - When statement is done, we call mysql_unlock_tables(). + This will call thr_multi_unlock() followed by + table_handler->external_lock(thd, F_UNLCK) for each table. + + - Note that mysql_unlock_tables() may be called several times as + MySQL in some cases can free some tables earlier than others. + + - The above is true both for normal and temporary tables. + + - Temporary non transactional tables are never passed to thr_multi_lock() + and we never call external_lock(thd, F_UNLOCK) on these. + + When using LOCK TABLES: + + - LOCK TABLE will call mysql_lock_tables() for all tables. + mysql_lock_tables() will call + table_handler->external_lock(thd,locktype) for each table. + This is followed by a call to thr_multi_lock() for all tables. + + - For each statement, we will call table_handler->start_stmt(THD) + to inform the table handler that we are using the table. + + The tables used can only be tables used in LOCK TABLES or a + temporary table. + + - When statement is done, we will call ha_commit_stmt(thd); + + - When calling UNLOCK TABLES we call mysql_unlock_tables() for all + tables used in LOCK TABLES + TODO: Change to use my_malloc() ONLY when using LOCK TABLES command or when we are forced to use mysql_lock_merge. @@ -206,7 +246,7 @@ void mysql_unlock_read_tables(THD *thd, MYSQL_LOCK *sql_lock) sql_lock->lock_count= found; } - /* Then to the same for the external locks */ + /* Then do the same for the external locks */ /* Move all write locked tables first */ TABLE **table=sql_lock->table; for (i=found=0 ; i < sql_lock->table_count ; i++) |