~posulliv/drizzle/memcached_applier

« back to all changes in this revision

Viewing changes to storage/innobase/drizzle/ha_innodb.cc

  • Committer: Eric Herman
  • Date: 2008-12-06 19:42:46 UTC
  • mto: (656.1.6 devel)
  • mto: This revision was merged to the branch mainline in revision 665.
  • Revision ID: eric@mysql.com-20081206194246-5cdexuu81i366eek
removed trailing whitespace with simple script:

for file in $(find . -name "*.c") $(find . -name "*.cc") $(find . -name "*.h"); do ruby -pe 'gsub(/\s+$/, $/)' < $file > $file.out; mv $file.out $file; done;

Show diffs side-by-side

added added

removed removed

Lines of Context:
198
198
static int innobase_close_connection(handlerton *hton, Session* session);
199
199
static int innobase_commit(handlerton *hton, Session* session, bool all);
200
200
static int innobase_rollback(handlerton *hton, Session* session, bool all);
201
 
static int innobase_rollback_to_savepoint(handlerton *hton, Session* session, 
 
201
static int innobase_rollback_to_savepoint(handlerton *hton, Session* session,
202
202
           void *savepoint);
203
203
static int innobase_savepoint(handlerton *hton, Session* session, void *savepoint);
204
 
static int innobase_release_savepoint(handlerton *hton, Session* session, 
 
204
static int innobase_release_savepoint(handlerton *hton, Session* session,
205
205
           void *savepoint);
206
206
static handler *innobase_create_handler(handlerton *hton,
207
207
                                        TABLE_SHARE *table,
223
223
bool
224
224
innobase_file_format_check_on_off(
225
225
/*==============================*/
226
 
                                                /* out: true if one of 
 
226
                                                /* out: true if one of
227
227
                                                "on" or "off" */
228
228
        const char*     format_check);          /* in: parameter value */
229
229
/****************************************************************
259
259
 
260
260
 
261
261
static handler *innobase_create_handler(handlerton *hton,
262
 
                                        TABLE_SHARE *table, 
 
262
                                        TABLE_SHARE *table,
263
263
                                        MEM_ROOT *mem_root)
264
264
{
265
265
  return new (mem_root) ha_innobase(hton, table);
371
371
innobase_start_trx_and_assign_read_view(
372
372
/*====================================*/
373
373
                        /* out: 0 */
374
 
        handlerton* hton, /* in: Innodb handlerton */ 
 
374
        handlerton* hton, /* in: Innodb handlerton */
375
375
        Session*        session);       /* in: MySQL thread handle of the user for whom
376
376
                        the transaction should be committed */
377
377
/********************************************************************
395
395
        Session*        session,        /* in: the MySQL query thread of the caller */
396
396
        stat_print_fn *stat_print);
397
397
static
398
 
bool innobase_show_status(handlerton *hton, Session* session, 
 
398
bool innobase_show_status(handlerton *hton, Session* session,
399
399
                          stat_print_fn* stat_print,
400
400
                          enum ha_stat_type stat_type);
401
401
 
508
508
differently than other threads. Also used in
509
509
srv_conc_force_exit_innodb().
510
510
 
511
 
DRIZZLE: Note, we didn't change this name to avoid more ifdef forking 
 
511
DRIZZLE: Note, we didn't change this name to avoid more ifdef forking
512
512
         in non-handler code.
513
513
*/
514
514
extern "C" UNIV_INTERN
583
583
which transaction to rollback in case of a deadlock - we try to avoid
584
584
rolling back transactions that have edited non-transactional tables.
585
585
 
586
 
DRIZZLE: Note, we didn't change this name to avoid more ifdef forking 
 
586
DRIZZLE: Note, we didn't change this name to avoid more ifdef forking
587
587
         in non-handler code.
588
588
*/
589
589
extern "C" UNIV_INTERN
818
818
not necessary to call this. Call innobase_mysql_end_print_arbitrary_thd()
819
819
after you release the kernel_mutex.
820
820
 
821
 
DRIZZLE: Note, we didn't change this name to avoid more ifdef forking 
 
821
DRIZZLE: Note, we didn't change this name to avoid more ifdef forking
822
822
         in non-handler code.
823
823
 */
824
824
extern "C" UNIV_INTERN
834
834
Releases the mutex reserved by innobase_mysql_prepare_print_arbitrary_thd().
835
835
In the InnoDB latching order, the mutex sits right above the
836
836
kernel_mutex.  In debug builds, we assert that the kernel_mutex is
837
 
released before this function is invoked. 
 
837
released before this function is invoked.
838
838
 
839
 
DRIZZLE: Note, we didn't change this name to avoid more ifdef forking 
 
839
DRIZZLE: Note, we didn't change this name to avoid more ifdef forking
840
840
         in non-handler code.
841
841
*/
842
842
extern "C" UNIV_INTERN
1278
1278
                  HA_PRIMARY_KEY_IN_READ_INDEX |
1279
1279
                  HA_BINLOG_ROW_CAPABLE |
1280
1280
                  HA_PARTIAL_COLUMN_READ |
1281
 
                  HA_TABLE_SCAN_ON_INDEX | 
 
1281
                  HA_TABLE_SCAN_ON_INDEX |
1282
1282
                  HA_MRR_CANT_SORT),
1283
 
  primary_key(0), /* needs initialization because index_flags() may be called 
1284
 
                     before this is set to the real value. It's ok to have any 
 
1283
  primary_key(0), /* needs initialization because index_flags() may be called
 
1284
                     before this is set to the real value. It's ok to have any
1285
1285
                     value here because it doesn't matter if we return the
1286
1286
                     HA_DO_INDEX_COND_PUSHDOWN bit from those "early" calls */
1287
1287
  start_of_scan(0),
2009
2009
        innobase_file_format_name is used in the MySQL set variable
2010
2010
        interface and so can't be const. */
2011
2011
 
2012
 
        innobase_file_format_name = 
 
2012
        innobase_file_format_name =
2013
2013
                (char*) trx_sys_file_format_id_to_name(format_id);
2014
2014
 
2015
2015
        /* Process innobase_file_format_check variable */
2196
2196
innobase_start_trx_and_assign_read_view(
2197
2197
/*====================================*/
2198
2198
                        /* out: 0 */
2199
 
        handlerton *hton, /* in: Innodb handlerton */ 
 
2199
        handlerton *hton, /* in: Innodb handlerton */
2200
2200
        Session*        session)        /* in: MySQL thread handle of the user for whom
2201
2201
                        the transaction should be committed */
2202
2202
{
2240
2240
innobase_commit(
2241
2241
/*============*/
2242
2242
                        /* out: 0 */
2243
 
        handlerton *hton, /* in: Innodb handlerton */ 
 
2243
        handlerton *hton, /* in: Innodb handlerton */
2244
2244
        Session*        session,        /* in: MySQL thread handle of the user for whom
2245
2245
                        the transaction should be committed */
2246
2246
        bool    all)    /* in:  TRUE - commit transaction
2366
2366
innobase_rollback(
2367
2367
/*==============*/
2368
2368
                        /* out: 0 or error number */
2369
 
        handlerton *hton, /* in: Innodb handlerton */ 
 
2369
        handlerton *hton, /* in: Innodb handlerton */
2370
2370
        Session*        session,        /* in: handle to the MySQL thread of the user
2371
2371
                        whose transaction should be rolled back */
2372
2372
        bool    all)    /* in:  TRUE - commit transaction
2442
2442
/*===========================*/
2443
2443
                                /* out: 0 if success, HA_ERR_NO_SAVEPOINT if
2444
2444
                                no savepoint with the given name */
2445
 
        handlerton *hton,       /* in: Innodb handlerton */ 
 
2445
        handlerton *hton,       /* in: Innodb handlerton */
2446
2446
        Session*        session,                /* in: handle to the MySQL thread of the user
2447
2447
                                whose transaction should be rolled back */
2448
2448
        void*   savepoint)      /* in: savepoint data */
2887
2887
retry:
2888
2888
        /* Get pointer to a table object in InnoDB dictionary cache */
2889
2889
        ib_table = dict_table_get(norm_name, TRUE);
2890
 
        
 
2890
 
2891
2891
        if (NULL == ib_table) {
2892
2892
                if (is_part && retries < 10) {
2893
2893
                        ++retries;
3673
3673
            file->active_index != MAX_KEY)
3674
3674
          do_idx_cond_push= need_second_pass= TRUE;
3675
3675
 
3676
 
        /* 
3677
 
          Ok, now build an array of mysql_row_templ_struct structures. 
 
3676
        /*
 
3677
          Ok, now build an array of mysql_row_templ_struct structures.
3678
3678
          If index condition pushdown is used, the array is split into two
3679
3679
          parts: first go index fields, then go table fields.
3680
 
          
 
3680
 
3681
3681
          Note that in InnoDB, innodb_idx is the column number. MySQL calls columns
3682
3682
          'fields' associated with index sql_idx.
3683
3683
        */
3692
3692
                        and which we can skip. */
3693
3693
                        register const ibool    index_contains_field =
3694
3694
                                dict_index_contains_col_or_prefix(index, innodb_idx);
3695
 
                        register const ibool    index_covers_field = 
 
3695
                        register const ibool    index_covers_field =
3696
3696
                                field->part_of_key.is_set(file->active_index);
3697
3697
 
3698
3698
 
4671
4671
                return(PAGE_CUR_GE);
4672
4672
        case HA_READ_KEY_OR_PREV:
4673
4673
                return(PAGE_CUR_LE);
4674
 
        case HA_READ_AFTER_KEY: 
 
4674
        case HA_READ_AFTER_KEY:
4675
4675
                return(PAGE_CUR_G);
4676
4676
        case HA_READ_BEFORE_KEY:
4677
4677
                return(PAGE_CUR_L);
5626
5626
                        ret = FALSE;
5627
5627
                }
5628
5628
        }
5629
 
        
 
5629
 
5630
5630
        /* If KEY_BLOCK_SIZE was specified, check for its
5631
5631
        dependencies. */
5632
5632
        if (kbs_specified && !srv_file_per_table) {
7250
7250
          }
7251
7251
          f_key_info.delete_method = session_make_lex_string(
7252
7252
                  session, f_key_info.delete_method, tmp_buff, length, 1);
7253
 
 
7254
 
 
 
7253
 
 
7254
 
7255
7255
          if (foreign->type & DICT_FOREIGN_ON_UPDATE_CASCADE)
7256
7256
          {
7257
7257
            length=7;
7978
7978
}
7979
7979
 
7980
7980
static
7981
 
bool innobase_show_status(handlerton *hton, Session* session, 
 
7981
bool innobase_show_status(handlerton *hton, Session* session,
7982
7982
                          stat_print_fn* stat_print,
7983
7983
                          enum ha_stat_type stat_type)
7984
7984
{
8118
8118
 
8119
8119
                /* MySQL calls this function in DROP Table though this table
8120
8120
                handle may belong to another session that is running a query.
8121
 
                Let us in that case skip any changes to the prebuilt struct. */ 
 
8121
                Let us in that case skip any changes to the prebuilt struct. */
8122
8122
 
8123
8123
        } else if ((lock_type == TL_READ && in_lock_tables)
8124
8124
                   || (lock_type == TL_READ_HIGH_PRIORITY && in_lock_tables)
8271
8271
        uint64_t*       value)          /* out: autoinc value */
8272
8272
{
8273
8273
        *value = 0;
8274
 
 
 
8274
 
8275
8275
        prebuilt->autoinc_error = innobase_lock_autoinc();
8276
8276
 
8277
8277
        if (prebuilt->autoinc_error == DB_SUCCESS) {
8287
8287
}
8288
8288
 
8289
8289
/***********************************************************************
8290
 
This function reads the global auto-inc counter. It doesn't use the 
 
8290
This function reads the global auto-inc counter. It doesn't use the
8291
8291
AUTOINC lock even if the lock mode is set to TRADITIONAL. */
8292
8292
UNIV_INTERN
8293
8293
uint64_t
8310
8310
        ut_a(auto_inc > 0);
8311
8311
 
8312
8312
        dict_table_autoinc_unlock(innodb_table);
8313
 
 
 
8313
 
8314
8314
        return(auto_inc);
8315
8315
}
8316
 
  
 
8316
 
8317
8317
/*******************************************************************************
8318
8318
This function initializes the auto-inc counter if it has not been
8319
8319
initialized yet. This function does not change the value of the auto-inc