~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Stewart Smith
  • Author(s): Marko Mäkelä, Stewart Smith
  • Date: 2010-11-17 05:52:09 UTC
  • mto: (2021.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1971.
  • Revision ID: stewart@flamingspork.com-20101117055209-69m035q6h7e1txrc
Merge Revision revid:marko.makela@oracle.com-20100629113248-fvl48lnzr44z94gg from MySQL InnoDB

Original revid:marko.makela@oracle.com-20100629113248-fvl48lnzr44z94gg

Original Authors: Marko Mkel <marko.makela@oracle.com>
Original commit message:
Bug#52199 utf32: mbminlen=4, mbmaxlen=4, type->mbminlen=0, type->mbmaxlen=4

Merge and adjust a forgotten change to fix this bug.
rb://393 approved by Jimmy Yang
  ------------------------------------------------------------------------
  r3794 | marko | 2009-01-07 14:14:53 +0000 (Wed, 07 Jan 2009) | 18 lines

  branches/6.0: Allow the minimum length of a multi-byte character to be
  up to 4 bytes. (Bug #35391)

  dtype_t, dict_col_t: Replace mbminlen:2, mbmaxlen:3 with mbminmaxlen:5.
  In this way, the 5 bits can hold two values of 0..4, and the storage size
  of the fields will not cross the 64-bit boundary.  Encode the values as
  DATA_MBMAX * mbmaxlen + mbminlen.  Define the auxiliary macros
  DB_MBMINLEN(mbminmaxlen), DB_MBMAXLEN(mbminmaxlen), and
  DB_MINMAXLEN(mbminlen, mbmaxlen).

  Try to trim and pad UTF-16 and UTF-32 with spaces as appropriate.

  Alexander Barkov suggested the use of cs->cset->fill(cs, buff, len, 0x20).
  ha_innobase::store_key_val_for_row() now does that, but the added function
  row_mysql_pad_col() does not, because it doesn't have the MySQL TABLE object.

  rb://49 approved by Heikki Tuuri
  ------------------------------------------------------------------------

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (C) 1996, 2010, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved.
4
4
 
5
5
This program is free software; you can redistribute it and/or modify it under
6
6
the terms of the GNU General Public License as published by the Free Software
41
41
#include "read0types.h"
42
42
#include "page0types.h"
43
43
 
44
 
#include <drizzled/atomics.h>
 
44
/** In a MySQL replication slave, in crash recovery we store the master log
 
45
file name and position here. */
 
46
/* @{ */
 
47
/** Master binlog file name */
 
48
extern char             trx_sys_mysql_master_log_name[];
 
49
/** Master binlog file position.  We have successfully got the updates
 
50
up to this position.  -1 means that no crash recovery was needed, or
 
51
there was no master log position info inside InnoDB.*/
 
52
extern ib_int64_t       trx_sys_mysql_master_log_pos;
 
53
/* @} */
45
54
 
46
 
/** the highest commit identifier assigned in the system */
47
 
extern drizzled::atomic<uint64_t> trx_sys_commit_id; 
 
55
/** If this MySQL server uses binary logging, after InnoDB has been inited
 
56
and if it has done a crash recovery, we store the binlog file name and position
 
57
here. */
 
58
/* @{ */
 
59
/** Binlog file name */
 
60
extern char             trx_sys_mysql_bin_log_name[];
 
61
/** Binlog file position, or -1 if unknown */
 
62
extern ib_int64_t       trx_sys_mysql_bin_log_pos;
 
63
/* @} */
48
64
 
49
65
/** The transaction system */
50
66
extern trx_sys_t*       trx_sys;
269
285
/*============*/
270
286
        trx_t*  in_trx);/*!< in: trx */
271
287
/*****************************************************************//**
272
 
Writes to the sys header file the latest commit_id in the system */ 
 
288
Updates the offset information about the end of the MySQL binlog entry
 
289
which corresponds to the transaction just being committed. In a MySQL
 
290
replication slave updates the latest master binlog position up to which
 
291
replication has proceeded. */
273
292
UNIV_INTERN
274
293
void
275
 
trx_sys_flush_commit_id(uint64_t commit_id, ulint field, mtr_t* mtr);
 
294
trx_sys_update_mysql_binlog_offset(
 
295
/*===============================*/
 
296
        const char*     file_name,/*!< in: MySQL log file name */
 
297
        ib_int64_t      offset, /*!< in: position in that log file */
 
298
        ulint           field,  /*!< in: offset of the MySQL log info field in
 
299
                                the trx sys header */
 
300
        mtr_t*          mtr);   /*!< in: mtr */
276
301
/*****************************************************************//**
277
 
Reads the latest commit_id into trx_sys_commit_id */
 
302
Prints to stderr the MySQL binlog offset info in the trx system header if
 
303
the magic number shows it valid. */
278
304
UNIV_INTERN
279
305
void
280
 
trx_sys_read_commit_id(void);
 
306
trx_sys_print_mysql_binlog_offset(void);
 
307
/*===================================*/
281
308
/*****************************************************************//**
282
309
Prints to stderr the MySQL master log offset info in the trx system header if
283
310
the magic number shows it valid. */
360
387
        ulint           format_id);     /*!< in: file format identifier */
361
388
#else /* !UNIV_HOTBACKUP */
362
389
/*****************************************************************//**
 
390
Prints to stderr the MySQL binlog info in the system header if the
 
391
magic number shows it valid. */
 
392
UNIV_INTERN
 
393
void
 
394
trx_sys_print_mysql_binlog_offset_from_page(
 
395
/*========================================*/
 
396
        const byte*     page);  /*!< in: buffer containing the trx
 
397
                                system header page, i.e., page number
 
398
                                TRX_SYS_PAGE_NO in the tablespace */
 
399
/*****************************************************************//**
363
400
Reads the file format id from the first system table space file.
364
401
Even if the call succeeds and returns TRUE, the returned format id
365
402
may be ULINT_UNDEFINED signalling that the format id was not present
462
499
#define TRX_SYS_MYSQL_MASTER_LOG_INFO   (UNIV_PAGE_SIZE - 2000)
463
500
 
464
501
/** The offset of the MySQL binlog offset info in the trx system header */
465
 
#define TRX_SYS_DRIZZLE_LOG_INFO        (UNIV_PAGE_SIZE - 1000)
466
 
#define TRX_SYS_DRIZZLE_MAX_COMMIT_ID   8       /*!< the maximum commit id
467
 
                                                assigned in the system */
468
 
#define TRX_SYS_DRIZZLE_LOG_NAME        12      /*!< Unused */
 
502
#define TRX_SYS_MYSQL_LOG_INFO          (UNIV_PAGE_SIZE - 1000)
 
503
#define TRX_SYS_MYSQL_LOG_MAGIC_N_FLD   0       /*!< magic number which is
 
504
                                                TRX_SYS_MYSQL_LOG_MAGIC_N
 
505
                                                if we have valid data in the
 
506
                                                MySQL binlog info */
 
507
#define TRX_SYS_MYSQL_LOG_OFFSET_HIGH   4       /*!< high 4 bytes of the offset
 
508
                                                within that file */
 
509
#define TRX_SYS_MYSQL_LOG_OFFSET_LOW    8       /*!< low 4 bytes of the offset
 
510
                                                within that file */
 
511
#define TRX_SYS_MYSQL_LOG_NAME          12      /*!< MySQL log file name */
469
512
 
470
513
/** Doublewrite buffer */
471
514
/* @{ */
563
606
        trx_id_t        max_trx_id;     /*!< The smallest number not yet
564
607
                                        assigned as a transaction id or
565
608
                                        transaction number */
566
 
 
567
609
        UT_LIST_BASE_NODE_T(trx_t) trx_list;
568
610
                                        /*!< List of active and committed in
569
611
                                        memory transactions, sorted on trx id,