~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to plugin/innobase/include/row0mysql.h

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-12-09 06:02:39 UTC
  • mto: This revision was merged to the branch mainline in revision 5.
  • Revision ID: james.westby@ubuntu.com-20101209060239-t0ujftvcvd558yno
Tags: upstream-2010.12.05
ImportĀ upstreamĀ versionĀ 2010.12.05

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
        ulint           col_len);       /*!< in: BLOB reference length
104
104
                                        (not BLOB length) */
105
105
/**************************************************************//**
 
106
Pad a column with spaces. */
 
107
UNIV_INTERN
 
108
void
 
109
row_mysql_pad_col(
 
110
/*==============*/
 
111
        ulint   mbminlen,       /*!< in: minimum size of a character,
 
112
                                in bytes */
 
113
        byte*   pad,            /*!< out: padded buffer */
 
114
        ulint   len);           /*!< in: number of bytes to pad */
 
115
 
 
116
/**************************************************************//**
106
117
Stores a non-SQL-NULL field given in the MySQL format in the InnoDB format.
107
118
The counterpart of this function is row_sel_field_store_in_mysql_format() in
108
119
row0sel.c.
264
275
        row_prebuilt_t* prebuilt);      /*!< in: prebuilt struct in MySQL
265
276
                                        handle */
266
277
/*********************************************************************//**
267
 
This can only be used when srv_locks_unsafe_for_binlog is TRUE or
268
 
session is using a READ COMMITTED isolation level. Before
269
 
calling this function we must use trx_reset_new_rec_lock_info() and
270
 
trx_register_new_rec_lock() to store the information which new record locks
271
 
really were set. This function removes a newly set lock under prebuilt->pcur,
272
 
and also under prebuilt->clust_pcur. Currently, this is only used and tested
273
 
in the case of an UPDATE or a DELETE statement, where the row lock is of the
274
 
LOCK_X type.
275
 
Thus, this implements a 'mini-rollback' that releases the latest record
276
 
locks we set.
277
 
@return error code or DB_SUCCESS */
 
278
This can only be used when srv_locks_unsafe_for_binlog is TRUE or this
 
279
session is using a READ COMMITTED or READ UNCOMMITTED isolation level.
 
280
Before calling this function row_search_for_mysql() must have
 
281
initialized prebuilt->new_rec_locks to store the information which new
 
282
record locks really were set. This function removes a newly set
 
283
clustered index record lock under prebuilt->pcur or
 
284
prebuilt->clust_pcur.  Thus, this implements a 'mini-rollback' that
 
285
releases the latest clustered index record lock we set.
 
286
@return error code or DB_SUCCESS */
278
287
UNIV_INTERN
279
288
int
280
289
row_unlock_for_mysql(
281
290
/*=================*/
282
 
        row_prebuilt_t* prebuilt,       /*!< in: prebuilt struct in MySQL
 
291
        row_prebuilt_t* prebuilt,       /*!< in/out: prebuilt struct in MySQL
283
292
                                        handle */
284
 
        ibool           has_latches_on_recs);/*!< TRUE if called so that we have
285
 
                                        the latches on the records under pcur
286
 
                                        and clust_pcur, and we do not need to
287
 
                                        reposition the cursors. */
 
293
        ibool           has_latches_on_recs);/*!< in: TRUE if called
 
294
                                        so that we have the latches on
 
295
                                        the records under pcur and
 
296
                                        clust_pcur, and we do not need
 
297
                                        to reposition the cursors. */
288
298
/*********************************************************************//**
289
299
Creates an query graph node of 'update' type to be used in the MySQL
290
300
interface.
616
626
                                        the secondary index, then this is
617
627
                                        set to TRUE */
618
628
        unsigned        templ_contains_blob:1;/*!< TRUE if the template contains
619
 
                                        BLOB column(s) */
 
629
                                        a column with DATA_BLOB ==
 
630
                                        get_innobase_type_from_mysql_type();
 
631
                                        not to be confused with InnoDB
 
632
                                        externally stored columns
 
633
                                        (VARCHAR can be off-page too) */
620
634
        mysql_row_templ_t* mysql_template;/*!< template used to transform
621
635
                                        rows fast between MySQL and Innobase
622
636
                                        formats; memory for this template
695
709
        ulint           new_rec_locks;  /*!< normally 0; if
696
710
                                        srv_locks_unsafe_for_binlog is
697
711
                                        TRUE or session is using READ
698
 
                                        COMMITTED isolation level, in a
699
 
                                        cursor search, if we set a new
700
 
                                        record lock on an index, this is
701
 
                                        incremented; this is used in
702
 
                                        releasing the locks under the
703
 
                                        cursors if we are performing an
704
 
                                        UPDATE and we determine after
705
 
                                        retrieving the row that it does
706
 
                                        not need to be locked; thus,
707
 
                                        these can be used to implement a
708
 
                                        'mini-rollback' that releases
709
 
                                        the latest record locks */
 
712
                                        COMMITTED or READ UNCOMMITTED
 
713
                                        isolation level, set in
 
714
                                        row_search_for_mysql() if we set a new
 
715
                                        record lock on the secondary
 
716
                                        or clustered index; this is
 
717
                                        used in row_unlock_for_mysql()
 
718
                                        when releasing the lock under
 
719
                                        the cursor if we determine
 
720
                                        after retrieving the row that
 
721
                                        it does not need to be locked
 
722
                                        ('mini-rollback') */
710
723
        ulint           mysql_prefix_len;/*!< byte offset of the end of
711
724
                                        the last requested column */
712
725
        ulint           mysql_row_len;  /*!< length in bytes of a row in the