Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
a7405ca4
Commit
a7405ca4
authored
Dec 18, 2007
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consistently use doxygen comments in class handler.
parent
7213ca20
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
92 additions
and
114 deletions
+92
-114
sql/handler.h
sql/handler.h
+92
-114
No files found.
sql/handler.h
View file @
a7405ca4
...
@@ -959,11 +959,11 @@ uint calculate_key_len(TABLE *, uint, const uchar *, key_part_map);
...
@@ -959,11 +959,11 @@ uint calculate_key_len(TABLE *, uint, const uchar *, key_part_map);
*/
*/
#define make_prev_keypart_map(N) (((key_part_map)1 << (N)) - 1)
#define make_prev_keypart_map(N) (((key_part_map)1 << (N)) - 1)
/*
/*
*
The handler class is the interface for dynamically loadable
The handler class is the interface for dynamically loadable
storage engines. Do not add ifdefs and take care when adding or
storage engines. Do not add ifdefs and take care when adding or
changing virtual functions to avoid vtable confusion
changing virtual functions to avoid vtable confusion
*/
*/
class
handler
:
public
Sql_alloc
class
handler
:
public
Sql_alloc
{
{
...
@@ -981,7 +981,7 @@ public:
...
@@ -981,7 +981,7 @@ public:
virtual
int
index_init
(
uint
idx
,
bool
sorted
)
{
active_index
=
idx
;
return
0
;
}
virtual
int
index_init
(
uint
idx
,
bool
sorted
)
{
active_index
=
idx
;
return
0
;
}
virtual
int
index_end
()
{
active_index
=
MAX_KEY
;
return
0
;
}
virtual
int
index_end
()
{
active_index
=
MAX_KEY
;
return
0
;
}
/*
/*
*
rnd_init() can be called two times without rnd_end() in between
rnd_init() can be called two times without rnd_end() in between
(it only makes sense if scan=1).
(it only makes sense if scan=1).
then the second call should prepare for the new table scan (e.g
then the second call should prepare for the new table scan (e.g
...
@@ -1006,13 +1006,13 @@ public:
...
@@ -1006,13 +1006,13 @@ public:
ha_statistics
stats
;
ha_statistics
stats
;
/* The following are for read_multi_range */
/*
*
The following are for read_multi_range */
bool
multi_range_sorted
;
bool
multi_range_sorted
;
KEY_MULTI_RANGE
*
multi_range_curr
;
KEY_MULTI_RANGE
*
multi_range_curr
;
KEY_MULTI_RANGE
*
multi_range_end
;
KEY_MULTI_RANGE
*
multi_range_end
;
HANDLER_BUFFER
*
multi_range_buffer
;
HANDLER_BUFFER
*
multi_range_buffer
;
/* The following are for read_range() */
/*
*
The following are for read_range() */
key_range
save_end_range
,
*
end_range
;
key_range
save_end_range
,
*
end_range
;
KEY_PART_INFO
*
range_key_part
;
KEY_PART_INFO
*
range_key_part
;
int
key_compare_result_on_equal
;
int
key_compare_result_on_equal
;
...
@@ -1021,14 +1021,14 @@ public:
...
@@ -1021,14 +1021,14 @@ public:
uint
errkey
;
/* Last dup key */
uint
errkey
;
/* Last dup key */
uint
key_used_on_scan
;
uint
key_used_on_scan
;
uint
active_index
;
uint
active_index
;
/* Length of ref (1-8 or the clustered key length) */
/*
*
Length of ref (1-8 or the clustered key length) */
uint
ref_length
;
uint
ref_length
;
FT_INFO
*
ft_handler
;
FT_INFO
*
ft_handler
;
enum
{
NONE
=
0
,
INDEX
,
RND
}
inited
;
enum
{
NONE
=
0
,
INDEX
,
RND
}
inited
;
bool
locked
;
bool
locked
;
bool
implicit_emptied
;
/* Can be !=0 only if HEAP */
bool
implicit_emptied
;
/* Can be !=0 only if HEAP */
const
COND
*
pushed_cond
;
const
COND
*
pushed_cond
;
/*
/*
*
next_insert_id is the next value which should be inserted into the
next_insert_id is the next value which should be inserted into the
auto_increment column: in a inserting-multi-row statement (like INSERT
auto_increment column: in a inserting-multi-row statement (like INSERT
SELECT), for the first row where the autoinc value is not specified by the
SELECT), for the first row where the autoinc value is not specified by the
...
@@ -1038,14 +1038,14 @@ public:
...
@@ -1038,14 +1038,14 @@ public:
get_auto_increment().
get_auto_increment().
*/
*/
ulonglong
next_insert_id
;
ulonglong
next_insert_id
;
/*
/*
*
insert id for the current row (*autogenerated*; if not
insert id for the current row (*autogenerated*; if not
autogenerated, it's 0).
autogenerated, it's 0).
At first successful insertion, this variable is stored into
At first successful insertion, this variable is stored into
THD::first_successful_insert_id_in_cur_stmt.
THD::first_successful_insert_id_in_cur_stmt.
*/
*/
ulonglong
insert_id_for_cur_row
;
ulonglong
insert_id_for_cur_row
;
/*
/*
*
Interval returned by get_auto_increment() and being consumed by the
Interval returned by get_auto_increment() and being consumed by the
inserter.
inserter.
*/
*/
...
@@ -1066,7 +1066,7 @@ public:
...
@@ -1066,7 +1066,7 @@ public:
/* TODO: DBUG_ASSERT(inited == NONE); */
/* TODO: DBUG_ASSERT(inited == NONE); */
}
}
virtual
handler
*
clone
(
MEM_ROOT
*
mem_root
);
virtual
handler
*
clone
(
MEM_ROOT
*
mem_root
);
/* This is called after create to allow us to set up cached variables */
/*
*
This is called after create to allow us to set up cached variables */
void
init
()
void
init
()
{
{
cached_table_flags
=
table_flags
();
cached_table_flags
=
table_flags
();
...
@@ -1092,7 +1092,7 @@ public:
...
@@ -1092,7 +1092,7 @@ public:
{
return
(
ha_table_flags
()
&
HA_NO_TRANSACTIONS
)
==
0
;
}
{
return
(
ha_table_flags
()
&
HA_NO_TRANSACTIONS
)
==
0
;
}
virtual
uint
extra_rec_buf_length
()
const
{
return
0
;
}
virtual
uint
extra_rec_buf_length
()
const
{
return
0
;
}
/*
/*
*
This method is used to analyse the error to see whether the error
This method is used to analyse the error to see whether the error
is ignorable or not, certain handlers can have more error that are
is ignorable or not, certain handlers can have more error that are
ignorable than others. E.g. the partition handler can get inserts
ignorable than others. E.g. the partition handler can get inserts
...
@@ -1112,12 +1112,12 @@ public:
...
@@ -1112,12 +1112,12 @@ public:
return
TRUE
;
return
TRUE
;
}
}
/*
/*
*
Number of rows in table. It will only be called if
Number of rows in table. It will only be called if
(table_flags() & (HA_HAS_RECORDS | HA_STATS_RECORDS_IS_EXACT)) != 0
(table_flags() & (HA_HAS_RECORDS | HA_STATS_RECORDS_IS_EXACT)) != 0
*/
*/
virtual
ha_rows
records
()
{
return
stats
.
records
;
}
virtual
ha_rows
records
()
{
return
stats
.
records
;
}
/*
/*
*
Return upper bound of current number of records in the table
Return upper bound of current number of records in the table
(max. of how many records one will retrieve when doing a full table scan)
(max. of how many records one will retrieve when doing a full table scan)
If upper bound is not known, HA_POS_ERROR should be returned as a max
If upper bound is not known, HA_POS_ERROR should be returned as a max
...
@@ -1126,7 +1126,7 @@ public:
...
@@ -1126,7 +1126,7 @@ public:
virtual
ha_rows
estimate_rows_upper_bound
()
virtual
ha_rows
estimate_rows_upper_bound
()
{
return
stats
.
records
+
EXTRA_RECORDS
;
}
{
return
stats
.
records
+
EXTRA_RECORDS
;
}
/*
/*
*
Get the row type from the storage engine. If this method returns
Get the row type from the storage engine. If this method returns
ROW_TYPE_NOT_USED, the information in HA_CREATE_INFO should be used.
ROW_TYPE_NOT_USED, the information in HA_CREATE_INFO should be used.
*/
*/
...
@@ -1174,7 +1174,7 @@ public:
...
@@ -1174,7 +1174,7 @@ public:
}
}
Table_flags
ha_table_flags
()
const
{
return
cached_table_flags
;
}
Table_flags
ha_table_flags
()
const
{
return
cached_table_flags
;
}
/*
/*
*
Signal that the table->read_set and table->write_set table maps changed
Signal that the table->read_set and table->write_set table maps changed
The handler is allowed to set additional bits in the above map in this
The handler is allowed to set additional bits in the above map in this
call. Normally the handler should ignore all calls until we have done
call. Normally the handler should ignore all calls until we have done
...
@@ -1186,7 +1186,7 @@ public:
...
@@ -1186,7 +1186,7 @@ public:
virtual
int
open
(
const
char
*
name
,
int
mode
,
uint
test_if_locked
)
=
0
;
virtual
int
open
(
const
char
*
name
,
int
mode
,
uint
test_if_locked
)
=
0
;
virtual
int
close
(
void
)
=
0
;
virtual
int
close
(
void
)
=
0
;
/*
/*
*
These functions represent the public interface to *users* of the
These functions represent the public interface to *users* of the
handler class, hence they are *not* virtual. For the inheritance
handler class, hence they are *not* virtual. For the inheritance
interface, see the (private) functions write_row(), update_row(),
interface, see the (private) functions write_row(), update_row(),
...
@@ -1197,36 +1197,28 @@ public:
...
@@ -1197,36 +1197,28 @@ public:
int
ha_update_row
(
const
uchar
*
old_data
,
uchar
*
new_data
);
int
ha_update_row
(
const
uchar
*
old_data
,
uchar
*
new_data
);
int
ha_delete_row
(
const
uchar
*
buf
);
int
ha_delete_row
(
const
uchar
*
buf
);
/*
/**
SYNOPSIS
@retval 0 Bulk update used by handler
start_bulk_update()
@retval 1 Bulk update not used, normal operation used
RETURN
0 Bulk update used by handler
1 Bulk update not used, normal operation used
*/
*/
virtual
bool
start_bulk_update
()
{
return
1
;
}
virtual
bool
start_bulk_update
()
{
return
1
;
}
/*
/**
SYNOPSIS
@retval 0 Bulk delete used by handler
start_bulk_delete()
@retval 1 Bulk delete not used, normal operation used
RETURN
0 Bulk delete used by handler
1 Bulk delete not used, normal operation used
*/
*/
virtual
bool
start_bulk_delete
()
{
return
1
;
}
virtual
bool
start_bulk_delete
()
{
return
1
;
}
/*
/**
SYNOPSIS
This method is similar to update_row, however the handler doesn't need
This method is similar to update_row, however the handler doesn't need
to execute the updates at this point in time. The handler can be certain
to execute the updates at this point in time. The handler can be certain
that another call to bulk_update_row will occur OR a call to
that another call to bulk_update_row will occur OR a call to
exec_bulk_update before the set of updates in this query is concluded.
exec_bulk_update before the set of updates in this query is concluded.
bulk_update_row()
@param old_data Old record
old_data Old record
@param new_data New record
new_data New record
@param dup_key_found Number of duplicate keys found
dup_key_found Number of duplicate keys found
RETURN
@retval 0 Bulk delete used by handler
0 Bulk delete used by handler
@retval 1 Bulk delete not used, normal operation used
1 Bulk delete not used, normal operation used
*/
*/
virtual
int
bulk_update_row
(
const
uchar
*
old_data
,
uchar
*
new_data
,
virtual
int
bulk_update_row
(
const
uchar
*
old_data
,
uchar
*
new_data
,
uint
*
dup_key_found
)
uint
*
dup_key_found
)
...
@@ -1234,53 +1226,43 @@ public:
...
@@ -1234,53 +1226,43 @@ public:
DBUG_ASSERT
(
FALSE
);
DBUG_ASSERT
(
FALSE
);
return
HA_ERR_WRONG_COMMAND
;
return
HA_ERR_WRONG_COMMAND
;
}
}
/*
/**
SYNOPSIS
After this call all outstanding updates must be performed. The number
After this call all outstanding updates must be performed. The number
of duplicate key errors are reported in the duplicate key parameter.
of duplicate key errors are reported in the duplicate key parameter.
It is allowed to continue to the batched update after this call, the
It is allowed to continue to the batched update after this call, the
handler has to wait until end_bulk_update with changing state.
handler has to wait until end_bulk_update with changing state.
exec_bulk_update()
@param dup_key_found Number of duplicate keys found
dup_key_found Number of duplicate keys found
RETURN
@retval 0 Success
0 Success
@retval >0 Error code
>0 Error code
*/
*/
virtual
int
exec_bulk_update
(
uint
*
dup_key_found
)
virtual
int
exec_bulk_update
(
uint
*
dup_key_found
)
{
{
DBUG_ASSERT
(
FALSE
);
DBUG_ASSERT
(
FALSE
);
return
HA_ERR_WRONG_COMMAND
;
return
HA_ERR_WRONG_COMMAND
;
}
}
/*
/**
SYNOPSIS
Perform any needed clean-up, no outstanding updates are there at the
Perform any needed clean-up, no outstanding updates are there at the
moment.
moment.
end_bulk_update()
RETURN
Nothing
*/
*/
virtual
void
end_bulk_update
()
{
return
;
}
virtual
void
end_bulk_update
()
{
return
;
}
/*
/**
SYNOPSIS
Execute all outstanding deletes and close down the bulk delete.
Execute all outstanding deletes and close down the bulk delete.
end_bulk_delete()
@retval 0 Success
RETURN
@retval >0 Error code
0 Success
>0 Error code
*/
*/
virtual
int
end_bulk_delete
()
virtual
int
end_bulk_delete
()
{
{
DBUG_ASSERT
(
FALSE
);
DBUG_ASSERT
(
FALSE
);
return
HA_ERR_WRONG_COMMAND
;
return
HA_ERR_WRONG_COMMAND
;
}
}
private:
private:
virtual
int
index_read
(
uchar
*
buf
,
const
uchar
*
key
,
uint
key_len
,
virtual
int
index_read
(
uchar
*
buf
,
const
uchar
*
key
,
uint
key_len
,
enum
ha_rkey_function
find_flag
)
enum
ha_rkey_function
find_flag
)
{
return
HA_ERR_WRONG_COMMAND
;
}
{
return
HA_ERR_WRONG_COMMAND
;
}
public:
public:
/**
/**
@brief
@brief
Positions an index cursor to the index specified in the handle. Fetches the
Positions an index cursor to the index specified in the handle. Fetches the
...
@@ -1315,7 +1297,7 @@ public:
...
@@ -1315,7 +1297,7 @@ public:
private:
private:
virtual
int
index_read_last
(
uchar
*
buf
,
const
uchar
*
key
,
uint
key_len
)
virtual
int
index_read_last
(
uchar
*
buf
,
const
uchar
*
key
,
uint
key_len
)
{
return
(
my_errno
=
HA_ERR_WRONG_COMMAND
);
}
{
return
(
my_errno
=
HA_ERR_WRONG_COMMAND
);
}
public:
public:
/**
/**
@brief
@brief
The following functions works like index_read, but it find the last
The following functions works like index_read, but it find the last
...
@@ -1343,11 +1325,11 @@ public:
...
@@ -1343,11 +1325,11 @@ public:
virtual
int
ft_read
(
uchar
*
buf
)
{
return
HA_ERR_WRONG_COMMAND
;
}
virtual
int
ft_read
(
uchar
*
buf
)
{
return
HA_ERR_WRONG_COMMAND
;
}
virtual
int
rnd_next
(
uchar
*
buf
)
=
0
;
virtual
int
rnd_next
(
uchar
*
buf
)
=
0
;
virtual
int
rnd_pos
(
uchar
*
buf
,
uchar
*
pos
)
=
0
;
virtual
int
rnd_pos
(
uchar
*
buf
,
uchar
*
pos
)
=
0
;
/*
/*
*
o
ne has to use this method when to find
O
ne has to use this method when to find
random position by record as the plain
random position by record as the plain
position() call doesn't work for some
position() call doesn't work for some
handlers for random position
handlers for random position
.
*/
*/
virtual
int
rnd_pos_by_record
(
uchar
*
record
)
virtual
int
rnd_pos_by_record
(
uchar
*
record
)
{
{
...
@@ -1355,9 +1337,9 @@ public:
...
@@ -1355,9 +1337,9 @@ public:
return
rnd_pos
(
record
,
ref
);
return
rnd_pos
(
record
,
ref
);
}
}
virtual
int
read_first_row
(
uchar
*
buf
,
uint
primary_key
);
virtual
int
read_first_row
(
uchar
*
buf
,
uint
primary_key
);
/*
/*
*
The following function is only needed for tables that may be temporary
The following function is only needed for tables that may be temporary
tables during joins
tables during joins
.
*/
*/
virtual
int
restart_rnd_next
(
uchar
*
buf
,
uchar
*
pos
)
virtual
int
restart_rnd_next
(
uchar
*
buf
,
uchar
*
pos
)
{
return
HA_ERR_WRONG_COMMAND
;
}
{
return
HA_ERR_WRONG_COMMAND
;
}
...
@@ -1374,13 +1356,13 @@ public:
...
@@ -1374,13 +1356,13 @@ public:
virtual
int
extra_opt
(
enum
ha_extra_function
operation
,
ulong
cache_size
)
virtual
int
extra_opt
(
enum
ha_extra_function
operation
,
ulong
cache_size
)
{
return
extra
(
operation
);
}
{
return
extra
(
operation
);
}
/*
/*
*
Reset state of file to after 'open'
Reset state of file to after 'open'
.
This function is called after every statement for all tables used
This function is called after every statement for all tables used
by that statement.
by that statement.
*/
*/
virtual
int
reset
()
{
return
0
;
}
virtual
int
reset
()
{
return
0
;
}
/*
/*
*
In an UPDATE or DELETE, if the row under the cursor was locked by another
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
transaction, and the engine used an optimistic read of the last
committed row value under the cursor, then the engine returns 1 from this
committed row value under the cursor, then the engine returns 1 from this
...
@@ -1393,7 +1375,7 @@ public:
...
@@ -1393,7 +1375,7 @@ public:
engine that the next read will be a locking re-read of the row.
engine that the next read will be a locking re-read of the row.
*/
*/
virtual
bool
was_semi_consistent_read
()
{
return
0
;
}
virtual
bool
was_semi_consistent_read
()
{
return
0
;
}
/*
/*
*
Tell the engine whether it should avoid unnecessary lock waits.
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
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
by another transaction, the engine may try an optimistic read of
...
@@ -1402,7 +1384,7 @@ public:
...
@@ -1402,7 +1384,7 @@ public:
virtual
void
try_semi_consistent_read
(
bool
)
{}
virtual
void
try_semi_consistent_read
(
bool
)
{}
virtual
void
unlock_row
()
{}
virtual
void
unlock_row
()
{}
virtual
int
start_stmt
(
THD
*
thd
,
thr_lock_type
lock_type
)
{
return
0
;}
virtual
int
start_stmt
(
THD
*
thd
,
thr_lock_type
lock_type
)
{
return
0
;}
/*
/*
*
This is called to delete all rows in a table
This is called to delete all rows in a table
If the handler don't support this, then this function will
If the handler don't support this, then this function will
return HA_ERR_WRONG_COMMAND and MySQL will delete the rows one
return HA_ERR_WRONG_COMMAND and MySQL will delete the rows one
...
@@ -1438,7 +1420,7 @@ public:
...
@@ -1438,7 +1420,7 @@ public:
next_insert_id
=
(
prev_insert_id
>
0
)
?
prev_insert_id
:
next_insert_id
=
(
prev_insert_id
>
0
)
?
prev_insert_id
:
insert_id_for_cur_row
;
insert_id_for_cur_row
;
}
}
/*
/*
*
Reset the auto-increment counter to the given value, i.e. the next row
Reset the auto-increment counter to the given value, i.e. the next row
inserted will get the given value. This is called e.g. after TRUNCATE
inserted will get the given value. This is called e.g. after TRUNCATE
is emulated by doing a 'DELETE FROM t'. HA_ERR_WRONG_COMMAND is
is emulated by doing a 'DELETE FROM t'. HA_ERR_WRONG_COMMAND is
...
@@ -1451,27 +1433,27 @@ public:
...
@@ -1451,27 +1433,27 @@ public:
protected:
protected:
/* to be implemented in handlers */
/* to be implemented in handlers */
/* admin commands - called from mysql_admin_table */
/*
*
admin commands - called from mysql_admin_table */
virtual
int
check
(
THD
*
thd
,
HA_CHECK_OPT
*
check_opt
)
virtual
int
check
(
THD
*
thd
,
HA_CHECK_OPT
*
check_opt
)
{
return
HA_ADMIN_NOT_IMPLEMENTED
;
}
{
return
HA_ADMIN_NOT_IMPLEMENTED
;
}
/*
/*
*
i
n these two methods check_opt can be modified
I
n these two methods check_opt can be modified
to specify CHECK option to use to call check()
to specify CHECK option to use to call check()
upon the table
upon the table
.
*/
*/
virtual
int
check_for_upgrade
(
HA_CHECK_OPT
*
check_opt
)
virtual
int
check_for_upgrade
(
HA_CHECK_OPT
*
check_opt
)
{
return
0
;
}
{
return
0
;
}
public:
public:
int
ha_check_for_upgrade
(
HA_CHECK_OPT
*
check_opt
);
int
ha_check_for_upgrade
(
HA_CHECK_OPT
*
check_opt
);
int
check_old_types
();
int
check_old_types
();
/* to be actually called to get 'check()' functionality*/
/*
*
to be actually called to get 'check()' functionality*/
int
ha_check
(
THD
*
thd
,
HA_CHECK_OPT
*
check_opt
);
int
ha_check
(
THD
*
thd
,
HA_CHECK_OPT
*
check_opt
);
virtual
int
backup
(
THD
*
thd
,
HA_CHECK_OPT
*
check_opt
)
virtual
int
backup
(
THD
*
thd
,
HA_CHECK_OPT
*
check_opt
)
{
return
HA_ADMIN_NOT_IMPLEMENTED
;
}
{
return
HA_ADMIN_NOT_IMPLEMENTED
;
}
/*
/*
*
r
estore assumes .frm file must exist, and that generate_table() has been
R
estore assumes .frm file must exist, and that generate_table() has been
called; It will just copy the data file and run repair.
called; It will just copy the data file and run repair.
*/
*/
virtual
int
restore
(
THD
*
thd
,
HA_CHECK_OPT
*
check_opt
)
virtual
int
restore
(
THD
*
thd
,
HA_CHECK_OPT
*
check_opt
)
...
@@ -1512,17 +1494,15 @@ public:
...
@@ -1512,17 +1494,15 @@ public:
virtual
char
*
update_table_comment
(
const
char
*
comment
)
virtual
char
*
update_table_comment
(
const
char
*
comment
)
{
return
(
char
*
)
comment
;}
{
return
(
char
*
)
comment
;}
virtual
void
append_create_info
(
String
*
packet
)
{}
virtual
void
append_create_info
(
String
*
packet
)
{}
/*
/**
SYNOPSIS
If index == MAX_KEY then a check for table is made and if index <
is_fk_defined_on_table_or_index()
MAX_KEY then a check is made if the table has foreign keys and if
index Index to check if foreign key uses it
a foreign key uses this index (and thus the index cannot be dropped).
RETURN VALUE
TRUE Foreign key defined on table or index
@param index Index to check if foreign key uses it
FALSE No foreign key defined
DESCRIPTION
@retval TRUE Foreign key defined on table or index
If index == MAX_KEY then a check for table is made and if index <
@retval FALSE No foreign key defined
MAX_KEY then a check is made if the table has foreign keys and if
a foreign key uses this index (and thus the index cannot be dropped).
*/
*/
virtual
bool
is_fk_defined_on_table_or_index
(
uint
index
)
virtual
bool
is_fk_defined_on_table_or_index
(
uint
index
)
{
return
FALSE
;
}
{
return
FALSE
;
}
...
@@ -1530,18 +1510,18 @@ public:
...
@@ -1530,18 +1510,18 @@ public:
{
return
(
NULL
);}
/* gets foreign key create string from InnoDB */
{
return
(
NULL
);}
/* gets foreign key create string from InnoDB */
virtual
char
*
get_tablespace_name
(
THD
*
thd
,
char
*
name
,
uint
name_len
)
virtual
char
*
get_tablespace_name
(
THD
*
thd
,
char
*
name
,
uint
name_len
)
{
return
(
NULL
);}
/* gets tablespace name from handler */
{
return
(
NULL
);}
/* gets tablespace name from handler */
/* used in ALTER TABLE; 1 if changing storage engine is allowed */
/*
*
used in ALTER TABLE; 1 if changing storage engine is allowed */
virtual
bool
can_switch_engines
()
{
return
1
;
}
virtual
bool
can_switch_engines
()
{
return
1
;
}
/* used in REPLACE; is > 0 if table is referred by a FOREIGN KEY */
/*
*
used in REPLACE; is > 0 if table is referred by a FOREIGN KEY */
virtual
int
get_foreign_key_list
(
THD
*
thd
,
List
<
FOREIGN_KEY_INFO
>
*
f_key_list
)
virtual
int
get_foreign_key_list
(
THD
*
thd
,
List
<
FOREIGN_KEY_INFO
>
*
f_key_list
)
{
return
0
;
}
{
return
0
;
}
virtual
uint
referenced_by_foreign_key
()
{
return
0
;}
virtual
uint
referenced_by_foreign_key
()
{
return
0
;}
virtual
void
init_table_handle_for_HANDLER
()
virtual
void
init_table_handle_for_HANDLER
()
{
return
;
}
/* prepare InnoDB for HANDLER */
{
return
;
}
/* prepare InnoDB for HANDLER */
virtual
void
free_foreign_key_create_info
(
char
*
str
)
{}
virtual
void
free_foreign_key_create_info
(
char
*
str
)
{}
/* The following can be called without an open handler */
/*
*
The following can be called without an open handler */
virtual
const
char
*
table_type
()
const
=
0
;
virtual
const
char
*
table_type
()
const
=
0
;
/*
/*
*
If frm_error() is called then we will use this to find out what file
If frm_error() is called then we will use this to find out what file
extentions exist for the storage engine. This is also used by the default
extentions exist for the storage engine. This is also used by the default
rename_table and delete_table method in handler.cc.
rename_table and delete_table method in handler.cc.
...
@@ -1598,14 +1578,14 @@ public:
...
@@ -1598,14 +1578,14 @@ public:
virtual
bool
is_crashed
()
const
{
return
0
;
}
virtual
bool
is_crashed
()
const
{
return
0
;
}
virtual
bool
auto_repair
()
const
{
return
0
;
}
virtual
bool
auto_repair
()
const
{
return
0
;
}
/*
/*
*
default rename_table() and delete_table() rename/delete files with a
default rename_table() and delete_table() rename/delete files with a
given name and extensions from bas_ext()
given name and extensions from bas_ext()
*/
*/
virtual
int
rename_table
(
const
char
*
from
,
const
char
*
to
);
virtual
int
rename_table
(
const
char
*
from
,
const
char
*
to
);
virtual
int
delete_table
(
const
char
*
name
);
virtual
int
delete_table
(
const
char
*
name
);
virtual
void
drop_table
(
const
char
*
name
);
virtual
void
drop_table
(
const
char
*
name
);
virtual
int
create
(
const
char
*
name
,
TABLE
*
form
,
HA_CREATE_INFO
*
info
)
=
0
;
virtual
int
create
(
const
char
*
name
,
TABLE
*
form
,
HA_CREATE_INFO
*
info
)
=
0
;
#define CHF_CREATE_FLAG 0
#define CHF_CREATE_FLAG 0
...
@@ -1658,7 +1638,7 @@ public:
...
@@ -1658,7 +1638,7 @@ public:
THR_LOCK_DATA
**
to
,
THR_LOCK_DATA
**
to
,
enum
thr_lock_type
lock_type
)
=
0
;
enum
thr_lock_type
lock_type
)
=
0
;
/* Type of table for caching query */
/*
*
Type of table for caching query */
virtual
uint8
table_cache_type
()
{
return
HA_CACHE_TBL_NONTRANSACT
;
}
virtual
uint8
table_cache_type
()
{
return
HA_CACHE_TBL_NONTRANSACT
;
}
...
@@ -1704,56 +1684,54 @@ public:
...
@@ -1704,56 +1684,54 @@ public:
/*
/*
RETURN
@retval TRUE Primary key (if there is one) is clustered
true Primary key (if there is one) is clustered
key covering all fields
key covering all fields
false
otherwise
@retval FALSE
otherwise
*/
*/
virtual
bool
primary_key_is_clustered
()
{
return
FALSE
;
}
virtual
bool
primary_key_is_clustered
()
{
return
FALSE
;
}
virtual
int
cmp_ref
(
const
uchar
*
ref1
,
const
uchar
*
ref2
)
virtual
int
cmp_ref
(
const
uchar
*
ref1
,
const
uchar
*
ref2
)
{
{
return
memcmp
(
ref1
,
ref2
,
ref_length
);
return
memcmp
(
ref1
,
ref2
,
ref_length
);
}
}
/*
/*
Condition pushdown to storage engines
Condition pushdown to storage engines
*/
*/
/*
/*
*
Push condition down to the table handler.
Push condition down to the table handler.
SYNOPSIS
cond_push()
cond Condition to be pushed. The condition tree must not be
modified by the by the caller.
RETURN
@param cond Condition to be pushed. The condition tree must not be
modified by the by the caller.
@return
The 'remainder' condition that caller must use to filter out records.
The 'remainder' condition that caller must use to filter out records.
NULL means the handler will not return rows that do not match the
NULL means the handler will not return rows that do not match the
passed condition.
passed condition.
NOTES
@note
The pushed conditions form a stack (from which one can remove the
The pushed conditions form a stack (from which one can remove the
last pushed condition using cond_pop).
last pushed condition using cond_pop).
The table handler filters out rows using (pushed_cond1 AND pushed_cond2
The table handler filters out rows using (pushed_cond1 AND pushed_cond2
AND ... AND pushed_condN)
AND ... AND pushed_condN)
or less restrictive condition, depending on handler's capabilities.
or less restrictive condition, depending on handler's capabilities.
handler->ha_reset() call empties the condition stack.
handler->ha_reset() call empties the condition stack.
Calls to rnd_init/rnd_end, index_init/index_end etc do not affect the
Calls to rnd_init/rnd_end, index_init/index_end etc do not affect the
condition stack.
condition stack.
*/
*/
virtual
const
COND
*
cond_push
(
const
COND
*
cond
)
{
return
cond
;
};
virtual
const
COND
*
cond_push
(
const
COND
*
cond
)
{
return
cond
;
};
/*
/*
*
Pop the top condition from the condition stack of the handler instance.
Pop the top condition from the condition stack of the handler instance.
SYNOPSIS
cond_pop()
Pops the top if condition stack, if stack is not empty.
Pops the top if condition stack, if stack is not empty
*/
*/
virtual
void
cond_pop
()
{
return
;
};
virtual
void
cond_pop
()
{
return
;
};
virtual
bool
check_if_incompatible_data
(
HA_CREATE_INFO
*
create_info
,
virtual
bool
check_if_incompatible_data
(
HA_CREATE_INFO
*
create_info
,
uint
table_changes
)
uint
table_changes
)
{
return
COMPATIBLE_DATA_NO
;
}
{
return
COMPATIBLE_DATA_NO
;
}
/* These are only called from sql_select for internal temporary tables */
/*
*
These are only called from sql_select for internal temporary tables */
virtual
int
write_row
(
uchar
*
buf
__attribute__
((
unused
)))
virtual
int
write_row
(
uchar
*
buf
__attribute__
((
unused
)))
{
{
return
HA_ERR_WRONG_COMMAND
;
return
HA_ERR_WRONG_COMMAND
;
...
@@ -1769,7 +1747,7 @@ public:
...
@@ -1769,7 +1747,7 @@ public:
{
{
return
HA_ERR_WRONG_COMMAND
;
return
HA_ERR_WRONG_COMMAND
;
}
}
/*
/*
*
use_hidden_primary_key() is called in case of an update/delete when
use_hidden_primary_key() is called in case of an update/delete when
(table_flags() and HA_PRIMARY_KEY_REQUIRED_FOR_DELETE) is defined
(table_flags() and HA_PRIMARY_KEY_REQUIRED_FOR_DELETE) is defined
but we don't have a primary key
but we don't have a primary key
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment