Functions specific for native InnoDB partitioning.
More...
Functions specific for native InnoDB partitioning.
- See also
- handler.h
◆ close()
int ha_innopart::close |
( |
void |
| ) |
|
|
overrideprivatevirtual |
Closes a handle to an InnoDB table.
- Returns
- 0
Reimplemented from ha_innobase.
◆ delete_row()
int ha_innopart::delete_row |
( |
const uchar * |
record | ) |
|
|
inlineoverrideprivatevirtual |
Deletes a row given as the parameter.
- Returns
- error number or 0
- Parameters
-
record | in: a row in MySQL format |
Reimplemented from ha_innobase.
◆ external_lock()
int ha_innopart::external_lock |
( |
THD * |
thd, |
|
|
int |
lock_type |
|
) |
| |
|
overrideprivatevirtual |
Lock/prepare to lock table.
As MySQL will execute an external lock for every new table it uses when it starts to process an SQL statement (an exception is when MySQL calls start_stmt for the handle) we can use this function to store the pointer to the THD in the handle. We will also use this function to communicate to InnoDB that a new SQL statement has started and that we must store a savepoint to our transaction handle, so that we are able to roll back the SQL statement in case of an error.
- Parameters
-
[in] | thd | Handle to the user thread. |
[in] | lock_type | Lock type. |
- Returns
- 0 or error number.
Reimplemented from ha_innobase.
◆ index_end()
int ha_innopart::index_end |
( |
void |
| ) |
|
|
overrideprivatevirtual |
End index cursor.
- Returns
- 0 or error code.
Reimplemented from ha_innobase.
◆ index_init()
int ha_innopart::index_init |
( |
uint |
keynr, |
|
|
bool |
sorted |
|
) |
| |
|
overrideprivatevirtual |
Initializes a handle to use an index.
- Parameters
-
[in] | keynr | Key (index) number. |
[in] | sorted | True if result MUST be sorted according to index. |
- Returns
- 0 or error number.
Reimplemented from ha_innobase.
◆ open()
int ha_innopart::open |
( |
const char * |
name, |
|
|
int |
mode, |
|
|
uint |
test_if_locked, |
|
|
const dd::Table * |
table_def |
|
) |
| |
|
overrideprivatevirtual |
Open an InnoDB table.
- Parameters
-
[in] | name | table name |
[in] | mode | access mode |
[in] | test_if_locked | test if the file to be opened is locked |
[in] | table_def | dd::Table describing table to be opened |
- Return values
-
Reimplemented from ha_innobase.
◆ rnd_end()
int ha_innopart::rnd_end |
( |
void |
| ) |
|
|
inlineoverrideprivatevirtual |
Ends a table scan.
- Returns
- 0 or error number
Reimplemented from ha_innobase.
◆ rnd_init()
int ha_innopart::rnd_init |
( |
bool |
scan | ) |
|
|
inlineoverrideprivatevirtual |
Initialize a table scan.
- Parameters
-
[in] | scan | whether this is a second call to rnd_init() without rnd_end() in between |
- Returns
- 0 or error number
Reimplemented from ha_innobase.
◆ scan_time()
double ha_innopart::scan_time |
( |
| ) |
|
|
overrideprivatevirtual |
Time estimate for full table scan.
How many seeks it will take to read through the table. This is to be comparable to the number returned by records_in_range so that we can decide if we should scan the table or use keys.
- Returns
- estimated time measured in disk seeks.
Reimplemented from ha_innobase.
◆ store_lock()
Function to store lock for all partitions in native partitioned table.
Also look at ha_innobase::store_lock for more details.
- Parameters
-
[in] | thd | user thread handle |
[in] | to | pointer to the current element in an array of pointers to lock structs |
[in] | lock_type | lock type to store in 'lock'; this may also be TL_IGNORE |
- Return values
-
to | pointer to the current element in the 'to' array |
Reimplemented from ha_innobase.
◆ try_semi_consistent_read()
void ha_innopart::try_semi_consistent_read |
( |
bool |
yes | ) |
|
|
overrideprivatevirtual |
Try semi consistent read.
Tell the engine whether it should avoid unnecessary lock waits. If yes, in an UPDATE or DELETE, if the row under the cursor was locked by another transaction, the engine may try an optimistic read of the last committed row value under the cursor.
- See also
- handler.h and row0mysql.h
- Parameters
-
[in] | yes | Should semi-consistent read be used. |
Reimplemented from ha_innobase.
◆ unlock_row()
void ha_innopart::unlock_row |
( |
void |
| ) |
|
|
overrideprivatevirtual |
Removes a lock on a row.
Removes a new lock set on a row, if it was not read optimistically. This can be called after a row has been read in the processing of an UPDATE or a DELETE query.
- See also
- ha_innobase::unlock_row().
Reimplemented from ha_innobase.
◆ update_row()
int ha_innopart::update_row |
( |
const uchar * |
old_row, |
|
|
uchar * |
new_row |
|
) |
| |
|
inlineoverrideprivatevirtual |
Updates a row given as a parameter to a new value.
Note that we are given whole rows, not just the fields which are updated: this incurs some overhead for CPU when we check which fields are actually updated. TODO: currently InnoDB does not prevent the 'Halloween problem': in a searched update a single row can get updated several times if its index columns are updated!
- Parameters
-
[in] | old_row | Old row contents in MySQL format |
[out] | new_row | Updated row contents in MySQL format |
- Returns
- error number or 0
Reimplemented from ha_innobase.
◆ was_semi_consistent_read()
bool ha_innopart::was_semi_consistent_read |
( |
void |
| ) |
|
|
overrideprivatevirtual |
Was the last returned row semi consistent read.
In an UPDATE or DELETE, if the row under the cursor was locked by another transaction, and the engine used an optimistic read of the last committed row value under the cursor, then the engine returns 1 from this function. MySQL must NOT try to update this optimistic value. If the optimistic value does not match the WHERE condition, MySQL can decide to skip over this row. This can be used to avoid unnecessary lock waits.
If this method returns true, it will also signal the storage engine that the next read will be a locking re-read of the row.
- See also
- handler.h and row0mysql.h
- Returns
- true if last read was semi consistent else false.
Reimplemented from ha_innobase.
◆ write_row()
int ha_innopart::write_row |
( |
uchar * |
record | ) |
|
|
inlineoverrideprivatevirtual |
Stores a row in an InnoDB database, to the table specified in this handle.
- Returns
- error code
- Parameters
-
record | in: a row in MySQL format |
Reimplemented from ha_innobase.