Documentation Home
MySQL Internals Manual
Download this Manual
EPUB - 1.2Mb


23.18.6 external_lock

Purpose

Handles table locking for transactions.

Synopsis

virtual int external_lock (

thd,

lock_type);

THD *

thd ;

int

lock_type ;

Description

This is the external_lock method.

The locking methods for mysql section in lock.cc has additional comments on this topic that may be useful to read.

This creates a lock on the table. If you are implementing a storage engine that can handle transactions, look at ha_innodb.cc to see how you will want to go about doing this. Otherwise you should consider calling flock() here.

Called from lock.cc by lock_external() and unlock_external(). Also called from sql_table.cc by copy_data_between_tables().

Parameters

  • thd

  • lock_type

Return Values

There are no return values.

Default Implementation

{ return 0; } 

User Comments
Sign Up Login You must be logged in to post a comment.