summaryrefslogtreecommitdiff
path: root/storage/innobase/include/row0sel.ic
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/include/row0sel.ic')
-rw-r--r--storage/innobase/include/row0sel.ic46
1 files changed, 43 insertions, 3 deletions
diff --git a/storage/innobase/include/row0sel.ic b/storage/innobase/include/row0sel.ic
index d83a3448832..a816e4440e2 100644
--- a/storage/innobase/include/row0sel.ic
+++ b/storage/innobase/include/row0sel.ic
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1997, 2009, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 2014, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -27,7 +27,7 @@ Created 12/19/1997 Heikki Tuuri
/*********************************************************************//**
Gets the plan node for the nth table in a join.
-@return plan node */
+@return plan node */
UNIV_INLINE
plan_t*
sel_node_get_nth_plan(
@@ -55,7 +55,7 @@ sel_node_reset_cursor(
/**********************************************************************//**
Performs an execution step of an open or close cursor statement node.
-@return query thread to run next or NULL */
+@return query thread to run next or NULL */
UNIV_INLINE
que_thr_t*
open_step(
@@ -103,3 +103,43 @@ open_step(
return(thr);
}
+
+
+/** Searches for rows in the database. This is used in the interface to
+MySQL. This function opens a cursor, and also implements fetch next
+and fetch prev. NOTE that if we do a search with a full key value
+from a unique index (ROW_SEL_EXACT), then we will not store the cursor
+position and fetch next or fetch prev must not be tried to the cursor!
+
+@param[out] buf buffer for the fetched row in MySQL format
+@param[in] mode search mode PAGE_CUR_L
+@param[in,out] prebuilt prebuilt struct for the table handler;
+ this contains the info to search_tuple,
+ index; if search tuple contains 0 field then
+ we position the cursor at start or the end of
+ index, depending on 'mode'
+@param[in] match_mode 0 or ROW_SEL_EXACT or ROW_SEL_EXACT_PREFIX
+@param[in] direction 0 or ROW_SEL_NEXT or ROW_SEL_PREV;
+ Note: if this is != 0, then prebuilt must has a
+ pcur with stored position! In opening of a
+ cursor 'direction' should be 0.
+@return DB_SUCCESS, DB_RECORD_NOT_FOUND, DB_END_OF_INDEX, DB_DEADLOCK,
+DB_LOCK_TABLE_FULL, DB_CORRUPTION, or DB_TOO_BIG_RECORD */
+UNIV_INLINE
+dberr_t
+row_search_for_mysql(
+ byte* buf,
+ page_cur_mode_t mode,
+ row_prebuilt_t* prebuilt,
+ ulint match_mode,
+ ulint direction)
+{
+ if (!dict_table_is_intrinsic(prebuilt->table)) {
+ return(row_search_mvcc(
+ buf, mode, prebuilt, match_mode, direction));
+ } else {
+ return(row_search_no_mvcc(
+ buf, mode, prebuilt, match_mode, direction));
+ }
+}
+