branches/innodb+: Merge c6413 from branches/innodb+_persistent_stats:

------------------------------------------------------------------------
  r6413 | vasil | 2010-01-11 15:18:35 +0200 (Mon, 11 Jan 2010) | 4 lines
  Changed paths:
     M /branches/innodb+_persistent_stats/include/pars0pars.h
     M /branches/innodb+_persistent_stats/pars/pars0pars.c
  
  branches/innodb+: Add a func to store uint64
  
  Add a new function pars_info_add_uint64_literal() that adds a literal of
  type ib_uint64_t.
  ------------------------------------------------------------------------
This commit is contained in:
vdimov 2010-03-26 12:54:03 +00:00
parent 17504e31ce
commit eef4feb313
2 changed files with 40 additions and 0 deletions

View file

@ -519,6 +519,23 @@ pars_info_add_int4_literal(
/****************************************************************//**
Equivalent to:
char buf[8];
mach_write_ull(buf, val);
pars_info_add_literal(info, name, buf, 8, DATA_INT, 0);
except that the buffer is dynamically allocated from the info struct's
heap. */
UNIV_INTERN
void
pars_info_add_uint64_literal(
/*=========================*/
pars_info_t* info, /*!< in: info struct */
const char* name, /*!< in: name */
ib_uint64_t val); /*!< in: value */
/****************************************************************//**
Equivalent to:
char buf[8];
mach_write_to_8(buf, val);
pars_info_add_literal(info, name, buf, 8, DATA_BINARY, 0);

View file

@ -2030,6 +2030,29 @@ pars_info_add_int4_literal(
/****************************************************************//**
Equivalent to:
char buf[8];
mach_write_ull(buf, val);
pars_info_add_literal(info, name, buf, 8, DATA_INT, 0);
except that the buffer is dynamically allocated from the info struct's
heap. */
UNIV_INTERN
void
pars_info_add_uint64_literal(
/*=========================*/
pars_info_t* info, /*!< in: info struct */
const char* name, /*!< in: name */
ib_uint64_t val) /*!< in: value */
{
byte* buf = mem_heap_alloc(info->heap, 8);
mach_write_ull(buf, val);
pars_info_add_literal(info, name, buf, 8, DATA_INT, 0);
}
/****************************************************************//**
Equivalent to:
char buf[8];
mach_write_to_8(buf, val);
pars_info_add_literal(info, name, buf, 8, DATA_FIXBINARY, 0);