summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2002-08-12 00:17:39 +0300
committerunknown <heikki@hundin.mysql.fi>2002-08-12 00:17:39 +0300
commit714f2b0f8b90dc843024aea2f3d9afb5becc24d9 (patch)
treedbf522f81c30ed0ab41884fa35b7cee0a2e72fd3 /sql
parent86dc608c3489adf8b5d453f84dc2f89bb7a13b82 (diff)
downloadmariadb-git-714f2b0f8b90dc843024aea2f3d9afb5becc24d9.tar.gz
trx0trx.h, trx0trx.c, ha_innobase.cc, ha_innobase.h:
Add tentative code which can be used in HANDLER implementation for InnoDB sql/ha_innobase.h: Add tentative code which can be used in HANDLER implementation for InnoDB sql/ha_innobase.cc: Add tentative code which can be used in HANDLER implementation for InnoDB innobase/trx/trx0trx.c: Add tentative code which can be used in HANDLER implementation for InnoDB innobase/include/trx0trx.h: Add tentative code which can be used in HANDLER implementation for InnoDB
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_innobase.cc57
-rw-r--r--sql/ha_innobase.h1
2 files changed, 57 insertions, 1 deletions
diff --git a/sql/ha_innobase.cc b/sql/ha_innobase.cc
index e9becc8debb..3ca6262b13f 100644
--- a/sql/ha_innobase.cc
+++ b/sql/ha_innobase.cc
@@ -19,7 +19,7 @@ InnoDB */
/* TODO list for the InnoDB handler:
- Ask Monty if strings of different languages can exist in the same
- database. Answer: in near future yes, but not yet.
+ database. Answer: in 4.1 yes.
*/
#ifdef __GNUC__
@@ -378,6 +378,61 @@ ha_innobase::update_thd(
return(0);
}
+/*********************************************************************
+Call this when you have opened a new table handle in HANDLER, before you
+call index_read_idx() etc. Actually, we can let the cursor stay open even
+over a transaction commit! Then you should call this before every operation,
+fecth next etc. This function inits the necessary things even after a
+transaction commit. */
+
+/* TODO: THIS CODE HAS NOT BEEN TESTED!!! */
+
+void
+ha_innobase::init_table_handle_for_HANDLER(void)
+/*============================================*/
+{
+ row_prebuilt_t* prebuilt;
+
+ /* If current thd does not yet have a trx struct, create one.
+ If the current handle does not yet have a prebuilt struct, create
+ one. Update the trx pointers in the prebuilt struct. Normally
+ this operation is done in external_lock. */
+
+ update_thd(current_thd);
+
+ /* Initialize the prebuilt struct much like it would be inited in
+ external_lock */
+
+ prebuilt = (row_prebuilt_t*)innobase_prebuilt;
+
+ /* If the transaction is not started yet, start it */
+
+ trx_start_if_not_started_noninline(prebuilt->trx);
+
+ /* Assign a read view if the transaction does not have it yet */
+
+ trx_assign_read_view(prebuilt->trx);
+
+ /* We did the necessary inits in this function, no need to repeat them
+ in row_search_for_mysql */
+
+ prebuilt->sql_stat_start = FALSE;
+
+ /* We let HANDLER always to do the reads as consistent reads, even
+ if the trx isolation level would have been specified as SERIALIZABLE */
+
+ prebuilt->select_lock_type = LOCK_NONE;
+
+ /* Always fetch all columns in the index record */
+
+ prebuilt->hint_no_need_to_fetch_extra_cols = FALSE;
+
+ /* We want always to fetch all columns in the whole row? Or do
+ we???? */
+
+ prebuilt->read_just_key = FALSE;
+}
+
/*************************************************************************
Opens an InnoDB database. */
diff --git a/sql/ha_innobase.h b/sql/ha_innobase.h
index abb6ade79f7..2c69018ed38 100644
--- a/sql/ha_innobase.h
+++ b/sql/ha_innobase.h
@@ -157,6 +157,7 @@ class ha_innobase: public handler
void free_foreign_key_create_info(char* str);
THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
enum thr_lock_type lock_type);
+ void init_table_handle_for_HANDLER(); /* TODO: NOT TESTED!!! */
longlong get_auto_increment();
};