253
253
/*==============================*/
254
254
const dict_table_t* table); /*!< in: table */
255
255
/*********************************************************************//**
256
Calculates the key number used inside MySQL for an Innobase index. We have
257
to take into account if we generated a default clustered index for the table
258
@return the key number used inside MySQL */
261
row_get_mysql_key_number_for_index(
262
/*===============================*/
263
const dict_index_t* index); /*!< in: index */
264
/*********************************************************************//**
256
265
Does an update or delete of a row for MySQL.
257
266
@return error code or DB_SUCCESS */
264
273
row_prebuilt_t* prebuilt); /*!< in: prebuilt struct in MySQL
266
275
/*********************************************************************//**
267
This can only be used when srv_locks_unsafe_for_binlog is TRUE or this
268
session is using a READ COMMITTED or READ UNCOMMITTED isolation level.
269
Before calling this function row_search_for_mysql() must have
270
initialized prebuilt->new_rec_locks to store the information which new
271
record locks really were set. This function removes a newly set
272
clustered index record lock under prebuilt->pcur or
273
prebuilt->clust_pcur. Thus, this implements a 'mini-rollback' that
274
releases the latest clustered index record lock we set.
275
@return error code or DB_SUCCESS */
276
This can only be used when srv_locks_unsafe_for_binlog is TRUE or
277
session is using a READ COMMITTED isolation level. Before
278
calling this function we must use trx_reset_new_rec_lock_info() and
279
trx_register_new_rec_lock() to store the information which new record locks
280
really were set. This function removes a newly set lock under prebuilt->pcur,
281
and also under prebuilt->clust_pcur. Currently, this is only used and tested
282
in the case of an UPDATE or a DELETE statement, where the row lock is of the
284
Thus, this implements a 'mini-rollback' that releases the latest record
286
@return error code or DB_SUCCESS */
278
289
row_unlock_for_mysql(
279
290
/*=================*/
280
row_prebuilt_t* prebuilt, /*!< in/out: prebuilt struct in MySQL
291
row_prebuilt_t* prebuilt, /*!< in: prebuilt struct in MySQL
282
ibool has_latches_on_recs);/*!< in: TRUE if called
283
so that we have the latches on
284
the records under pcur and
285
clust_pcur, and we do not need
286
to reposition the cursors. */
293
ibool has_latches_on_recs);/*!< TRUE if called so that we have
294
the latches on the records under pcur
295
and clust_pcur, and we do not need to
296
reposition the cursors. */
287
297
/*********************************************************************//**
288
298
Creates an query graph node of 'update' type to be used in the MySQL
393
403
FOREIGN KEY (a, b) REFERENCES table2(c, d),
394
404
table2 can be written also with the
395
405
database name before it: test.table2 */
396
size_t sql_length, /*!< in: length of sql_string */
397
406
const char* name, /*!< in: table full name in the
399
408
database_name/table_name */
615
624
the secondary index, then this is
617
626
unsigned templ_contains_blob:1;/*!< TRUE if the template contains
618
a column with DATA_BLOB ==
619
get_innobase_type_from_mysql_type();
620
not to be confused with InnoDB
621
externally stored columns
622
(VARCHAR can be off-page too) */
623
628
mysql_row_templ_t* mysql_template;/*!< template used to transform
624
629
rows fast between MySQL and Innobase
625
630
formats; memory for this template
698
703
ulint new_rec_locks; /*!< normally 0; if
699
704
srv_locks_unsafe_for_binlog is
700
705
TRUE or session is using READ
701
COMMITTED or READ UNCOMMITTED
702
isolation level, set in
703
row_search_for_mysql() if we set a new
704
record lock on the secondary
705
or clustered index; this is
706
used in row_unlock_for_mysql()
707
when releasing the lock under
708
the cursor if we determine
709
after retrieving the row that
710
it does not need to be locked
706
COMMITTED isolation level, in a
707
cursor search, if we set a new
708
record lock on an index, this is
709
incremented; this is used in
710
releasing the locks under the
711
cursors if we are performing an
712
UPDATE and we determine after
713
retrieving the row that it does
714
not need to be locked; thus,
715
these can be used to implement a
716
'mini-rollback' that releases
717
the latest record locks */
712
718
ulint mysql_prefix_len;/*!< byte offset of the end of
713
719
the last requested column */
714
720
ulint mysql_row_len; /*!< length in bytes of a row in the