Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
01587f5f
Commit
01587f5f
authored
Aug 10, 2011
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug#12626794 61240: UNUSED FUNCTIONS ...
parent
f9b39084
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
21 additions
and
504 deletions
+21
-504
storage/innobase/btr/btr0pcur.c
storage/innobase/btr/btr0pcur.c
+0
-27
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+0
-19
storage/innobase/include/btr0pcur.h
storage/innobase/include/btr0pcur.h
+3
-16
storage/innobase/include/btr0pcur.ic
storage/innobase/include/btr0pcur.ic
+3
-4
storage/innobase/include/buf0buf.h
storage/innobase/include/buf0buf.h
+0
-19
storage/innobase/include/buf0buf.ic
storage/innobase/include/buf0buf.ic
+0
-46
storage/innobase/include/mtr0mtr.h
storage/innobase/include/mtr0mtr.h
+0
-10
storage/innobase/include/ut0mem.h
storage/innobase/include/ut0mem.h
+0
-37
storage/innobase/include/ut0mem.ic
storage/innobase/include/ut0mem.ic
+0
-21
storage/innobase/mtr/mtr0mtr.c
storage/innobase/mtr/mtr0mtr.c
+0
-34
storage/innobase/ut/ut0mem.c
storage/innobase/ut/ut0mem.c
+0
-47
storage/innodb_plugin/btr/btr0pcur.c
storage/innodb_plugin/btr/btr0pcur.c
+1
-28
storage/innodb_plugin/handler/ha_innodb.cc
storage/innodb_plugin/handler/ha_innodb.cc
+1
-20
storage/innodb_plugin/include/btr0pcur.h
storage/innodb_plugin/include/btr0pcur.h
+4
-17
storage/innodb_plugin/include/btr0pcur.ic
storage/innodb_plugin/include/btr0pcur.ic
+4
-5
storage/innodb_plugin/include/mtr0mtr.h
storage/innodb_plugin/include/mtr0mtr.h
+1
-11
storage/innodb_plugin/include/ut0mem.h
storage/innodb_plugin/include/ut0mem.h
+1
-38
storage/innodb_plugin/include/ut0mem.ic
storage/innodb_plugin/include/ut0mem.ic
+1
-22
storage/innodb_plugin/mtr/mtr0mtr.c
storage/innodb_plugin/mtr/mtr0mtr.c
+1
-35
storage/innodb_plugin/ut/ut0mem.c
storage/innodb_plugin/ut/ut0mem.c
+1
-48
No files found.
storage/innobase/btr/btr0pcur.c
View file @
01587f5f
...
...
@@ -339,33 +339,6 @@ btr_pcur_restore_position(
return
(
FALSE
);
}
/******************************************************************
If the latch mode of the cursor is BTR_LEAF_SEARCH or BTR_LEAF_MODIFY,
releases the page latch and bufferfix reserved by the cursor.
NOTE! In the case of BTR_LEAF_MODIFY, there should not exist changes
made by the current mini-transaction to the data protected by the
cursor latch, as then the latch must not be released until mtr_commit. */
void
btr_pcur_release_leaf
(
/*==================*/
btr_pcur_t
*
cursor
,
/* in: persistent cursor */
mtr_t
*
mtr
)
/* in: mtr */
{
page_t
*
page
;
ut_a
(
cursor
->
pos_state
==
BTR_PCUR_IS_POSITIONED
);
ut_ad
(
cursor
->
latch_mode
!=
BTR_NO_LATCHES
);
page
=
btr_cur_get_page
(
btr_pcur_get_btr_cur
(
cursor
));
btr_leaf_page_release
(
page
,
cursor
->
latch_mode
,
mtr
);
cursor
->
latch_mode
=
BTR_NO_LATCHES
;
cursor
->
pos_state
=
BTR_PCUR_WAS_POSITIONED
;
}
/*************************************************************
Moves the persistent cursor to the first record on the next page. Releases the
latch on the current page, and bufferunfixes it. Note that there must not be
...
...
storage/innobase/handler/ha_innodb.cc
View file @
01587f5f
...
...
@@ -3082,25 +3082,6 @@ field_in_record_is_null(
return
(
0
);
}
/******************************************************************
Sets a field in a record to SQL NULL. Uses the record format
information in table to track the null bit in record. */
inline
void
set_field_in_record_to_null
(
/*========================*/
TABLE
*
table
,
/* in: MySQL table object */
Field
*
field
,
/* in: MySQL field object */
char
*
record
)
/* in: a row in MySQL format */
{
int
null_offset
;
null_offset
=
(
uint
)
((
char
*
)
field
->
null_ptr
-
(
char
*
)
table
->
record
[
0
]);
record
[
null_offset
]
=
record
[
null_offset
]
|
field
->
null_bit
;
}
extern
"C"
{
/*****************************************************************
InnoDB uses this function to compare two data fields for which the data type
...
...
storage/innobase/include/btr0pcur.h
View file @
01587f5f
...
...
@@ -210,18 +210,6 @@ btr_pcur_restore_position(
ulint
latch_mode
,
/* in: BTR_SEARCH_LEAF, ... */
btr_pcur_t
*
cursor
,
/* in: detached persistent cursor */
mtr_t
*
mtr
);
/* in: mtr */
/******************************************************************
If the latch mode of the cursor is BTR_LEAF_SEARCH or BTR_LEAF_MODIFY,
releases the page latch and bufferfix reserved by the cursor.
NOTE! In the case of BTR_LEAF_MODIFY, there should not exist changes
made by the current mini-transaction to the data protected by the
cursor latch, as then the latch must not be released until mtr_commit. */
void
btr_pcur_release_leaf
(
/*==================*/
btr_pcur_t
*
cursor
,
/* in: persistent cursor */
mtr_t
*
mtr
);
/* in: mtr */
/*************************************************************
Gets the rel_pos field for a cursor whose position has been stored. */
UNIV_INLINE
...
...
@@ -248,10 +236,9 @@ btr_pcur_get_mtr(
btr_pcur_t
*
cursor
);
/* in: persistent cursor */
/******************************************************************
Commits the pcur mtr and sets the pcur latch mode to BTR_NO_LATCHES,
that is, the cursor becomes detached. If there have been modifications
to the page where pcur is positioned, this can be used instead of
btr_pcur_release_leaf. Function btr_pcur_store_position should be used
before calling this, if restoration of cursor is wanted later. */
that is, the cursor becomes detached.
Function btr_pcur_store_position should be used before calling this,
if restoration of cursor is wanted later. */
UNIV_INLINE
void
btr_pcur_commit
(
...
...
storage/innobase/include/btr0pcur.ic
View file @
01587f5f
...
...
@@ -376,10 +376,9 @@ btr_pcur_move_to_next(
/******************************************************************
Commits the pcur mtr and sets the pcur latch mode to BTR_NO_LATCHES,
that is, the cursor becomes detached. If there have been modifications
to the page where pcur is positioned, this can be used instead of
btr_pcur_release_leaf. Function btr_pcur_store_position should be used
before calling this, if restoration of cursor is wanted later. */
that is, the cursor becomes detached.
Function btr_pcur_store_position should be used before calling this,
if restoration of cursor is wanted later. */
UNIV_INLINE
void
btr_pcur_commit(
...
...
storage/innobase/include/buf0buf.h
View file @
01587f5f
...
...
@@ -176,25 +176,6 @@ buf_page_optimistic_get_func(
ulint
line
,
/* in: line where called */
mtr_t
*
mtr
);
/* in: mini-transaction */
/************************************************************************
Tries to get the page, but if file io is required, releases all latches
in mtr down to the given savepoint. If io is required, this function
retrieves the page to buffer buf_pool, but does not bufferfix it or latch
it. */
UNIV_INLINE
buf_frame_t
*
buf_page_get_release_on_io
(
/*=======================*/
/* out: pointer to the frame, or NULL
if not in buffer buf_pool */
ulint
space
,
/* in: space id */
ulint
offset
,
/* in: offset of the page within space
in units of a page */
buf_frame_t
*
guess
,
/* in: guessed frame or NULL */
ulint
rw_latch
,
/* in: RW_X_LATCH, RW_S_LATCH,
or RW_NO_LATCH */
ulint
savepoint
,
/* in: mtr savepoint */
mtr_t
*
mtr
);
/* in: mtr */
/************************************************************************
This is used to get access to a known database page, when no waiting can be
done. */
...
...
storage/innobase/include/buf0buf.ic
View file @
01587f5f
...
...
@@ -560,52 +560,6 @@ buf_page_hash_get(
return(block);
}
/************************************************************************
Tries to get the page, but if file io is required, releases all latches
in mtr down to the given savepoint. If io is required, this function
retrieves the page to buffer buf_pool, but does not bufferfix it or latch
it. */
UNIV_INLINE
buf_frame_t*
buf_page_get_release_on_io(
/*=======================*/
/* out: pointer to the frame, or NULL
if not in buffer buf_pool */
ulint space, /* in: space id */
ulint offset, /* in: offset of the page within space
in units of a page */
buf_frame_t* guess, /* in: guessed frame or NULL */
ulint rw_latch, /* in: RW_X_LATCH, RW_S_LATCH,
or RW_NO_LATCH */
ulint savepoint, /* in: mtr savepoint */
mtr_t* mtr) /* in: mtr */
{
buf_frame_t* frame;
frame = buf_page_get_gen(space, offset, rw_latch, guess,
BUF_GET_IF_IN_POOL,
__FILE__, __LINE__,
mtr);
if (frame != NULL) {
return(frame);
}
/* The page was not in the buffer buf_pool: release the latches
down to the savepoint */
mtr_rollback_to_savepoint(mtr, savepoint);
buf_page_get(space, offset, RW_S_LATCH, mtr);
/* When we get here, the page is in buffer, but we release
the latches again down to the savepoint, before returning */
mtr_rollback_to_savepoint(mtr, savepoint);
return(NULL);
}
/************************************************************************
Decrements the bufferfix count of a buffer control block and releases
a latch, if specified. */
...
...
storage/innobase/include/mtr0mtr.h
View file @
01587f5f
...
...
@@ -176,16 +176,6 @@ mtr_set_savepoint(
/* out: savepoint */
mtr_t
*
mtr
);
/* in: mtr */
/**************************************************************
Releases the latches stored in an mtr memo down to a savepoint.
NOTE! The mtr must not have made changes to buffer pages after the
savepoint, as these can be handled only by mtr_commit. */
void
mtr_rollback_to_savepoint
(
/*======================*/
mtr_t
*
mtr
,
/* in: mtr */
ulint
savepoint
);
/* in: savepoint */
/**************************************************************
Releases the (index tree) s-latch stored in an mtr memo after a
savepoint. */
UNIV_INLINE
...
...
storage/innobase/include/ut0mem.h
View file @
01587f5f
...
...
@@ -144,43 +144,6 @@ ut_strlcpy_rev(
const
char
*
src
,
/* in: source buffer */
ulint
size
);
/* in: size of destination buffer */
/**************************************************************************
Compute strlen(ut_strcpyq(str, q)). */
UNIV_INLINE
ulint
ut_strlenq
(
/*=======*/
/* out: length of the string when quoted */
const
char
*
str
,
/* in: null-terminated string */
char
q
);
/* in: the quote character */
/**************************************************************************
Make a quoted copy of a NUL-terminated string. Leading and trailing
quotes will not be included; only embedded quotes will be escaped.
See also ut_strlenq() and ut_memcpyq(). */
char
*
ut_strcpyq
(
/*=======*/
/* out: pointer to end of dest */
char
*
dest
,
/* in: output buffer */
char
q
,
/* in: the quote character */
const
char
*
src
);
/* in: null-terminated string */
/**************************************************************************
Make a quoted copy of a fixed-length string. Leading and trailing
quotes will not be included; only embedded quotes will be escaped.
See also ut_strlenq() and ut_strcpyq(). */
char
*
ut_memcpyq
(
/*=======*/
/* out: pointer to end of dest */
char
*
dest
,
/* in: output buffer */
char
q
,
/* in: the quote character */
const
char
*
src
,
/* in: string to be quoted */
ulint
len
);
/* in: length of src */
/**************************************************************************
Return the number of times s2 occurs in s1. Overlapping instances of s2
are only counted once. */
...
...
storage/innobase/include/ut0mem.ic
View file @
01587f5f
...
...
@@ -47,24 +47,3 @@ ut_strcmp(const void* str1, const void* str2)
{
return(strcmp((const char*)str1, (const char*)str2));
}
/**************************************************************************
Compute strlen(ut_strcpyq(str, q)). */
UNIV_INLINE
ulint
ut_strlenq(
/*=======*/
/* out: length of the string when quoted */
const char* str, /* in: null-terminated string */
char q) /* in: the quote character */
{
ulint len;
for (len = 0; *str; len++, str++) {
if (*str == q) {
len++;
}
}
return(len);
}
storage/innobase/mtr/mtr0mtr.c
View file @
01587f5f
...
...
@@ -201,40 +201,6 @@ mtr_commit(
dyn_array_free
(
&
(
mtr
->
log
));
}
/**************************************************************
Releases the latches stored in an mtr memo down to a savepoint.
NOTE! The mtr must not have made changes to buffer pages after the
savepoint, as these can be handled only by mtr_commit. */
void
mtr_rollback_to_savepoint
(
/*======================*/
mtr_t
*
mtr
,
/* in: mtr */
ulint
savepoint
)
/* in: savepoint */
{
mtr_memo_slot_t
*
slot
;
dyn_array_t
*
memo
;
ulint
offset
;
ut_ad
(
mtr
);
ut_ad
(
mtr
->
magic_n
==
MTR_MAGIC_N
);
ut_ad
(
mtr
->
state
==
MTR_ACTIVE
);
memo
=
&
(
mtr
->
memo
);
offset
=
dyn_array_get_data_size
(
memo
);
ut_ad
(
offset
>=
savepoint
);
while
(
offset
>
savepoint
)
{
offset
-=
sizeof
(
mtr_memo_slot_t
);
slot
=
dyn_array_get_element
(
memo
,
offset
);
ut_ad
(
slot
->
type
!=
MTR_MEMO_MODIFY
);
mtr_memo_slot_release
(
mtr
,
slot
);
}
}
/*******************************************************
Releases an object in the memo stack. */
...
...
storage/innobase/ut/ut0mem.c
View file @
01587f5f
...
...
@@ -407,53 +407,6 @@ ut_strlcpy_rev(
return
(
src_size
);
}
/**************************************************************************
Make a quoted copy of a NUL-terminated string. Leading and trailing
quotes will not be included; only embedded quotes will be escaped.
See also ut_strlenq() and ut_memcpyq(). */
char
*
ut_strcpyq
(
/*=======*/
/* out: pointer to end of dest */
char
*
dest
,
/* in: output buffer */
char
q
,
/* in: the quote character */
const
char
*
src
)
/* in: null-terminated string */
{
while
(
*
src
)
{
if
((
*
dest
++
=
*
src
++
)
==
q
)
{
*
dest
++
=
q
;
}
}
return
(
dest
);
}
/**************************************************************************
Make a quoted copy of a fixed-length string. Leading and trailing
quotes will not be included; only embedded quotes will be escaped.
See also ut_strlenq() and ut_strcpyq(). */
char
*
ut_memcpyq
(
/*=======*/
/* out: pointer to end of dest */
char
*
dest
,
/* in: output buffer */
char
q
,
/* in: the quote character */
const
char
*
src
,
/* in: string to be quoted */
ulint
len
)
/* in: length of src */
{
const
char
*
srcend
=
src
+
len
;
while
(
src
<
srcend
)
{
if
((
*
dest
++
=
*
src
++
)
==
q
)
{
*
dest
++
=
q
;
}
}
return
(
dest
);
}
/**************************************************************************
Return the number of times s2 occurs in s1. Overlapping instances of s2
are only counted once. */
...
...
storage/innodb_plugin/btr/btr0pcur.c
View file @
01587f5f
/*****************************************************************************
Copyright (c) 1996, 201
0, Innobase Oy
. All Rights Reserved.
Copyright (c) 1996, 201
1, Oracle and/or its affiliates
. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -356,33 +356,6 @@ btr_pcur_restore_position_func(
return
(
FALSE
);
}
/**************************************************************//**
If the latch mode of the cursor is BTR_LEAF_SEARCH or BTR_LEAF_MODIFY,
releases the page latch and bufferfix reserved by the cursor.
NOTE! In the case of BTR_LEAF_MODIFY, there should not exist changes
made by the current mini-transaction to the data protected by the
cursor latch, as then the latch must not be released until mtr_commit. */
UNIV_INTERN
void
btr_pcur_release_leaf
(
/*==================*/
btr_pcur_t
*
cursor
,
/*!< in: persistent cursor */
mtr_t
*
mtr
)
/*!< in: mtr */
{
buf_block_t
*
block
;
ut_a
(
cursor
->
pos_state
==
BTR_PCUR_IS_POSITIONED
);
ut_ad
(
cursor
->
latch_mode
!=
BTR_NO_LATCHES
);
block
=
btr_pcur_get_block
(
cursor
);
btr_leaf_page_release
(
block
,
cursor
->
latch_mode
,
mtr
);
cursor
->
latch_mode
=
BTR_NO_LATCHES
;
cursor
->
pos_state
=
BTR_PCUR_WAS_POSITIONED
;
}
/*********************************************************//**
Moves the persistent cursor to the first record on the next page. Releases the
latch on the current page, and bufferunfixes it. Note that there must not be
...
...
storage/innodb_plugin/handler/ha_innodb.cc
View file @
01587f5f
/*****************************************************************************
Copyright (c) 2000, 201
0, MySQL AB & Innobase Oy
. All Rights Reserved.
Copyright (c) 2000, 201
1, Oracle and/or its affiliates
. All Rights Reserved.
Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc.
...
...
@@ -3792,25 +3792,6 @@ field_in_record_is_null(
return
(
0
);
}
/**************************************************************//**
Sets a field in a record to SQL NULL. Uses the record format
information in table to track the null bit in record. */
static
inline
void
set_field_in_record_to_null
(
/*========================*/
TABLE
*
table
,
/*!< in: MySQL table object */
Field
*
field
,
/*!< in: MySQL field object */
char
*
record
)
/*!< in: a row in MySQL format */
{
int
null_offset
;
null_offset
=
(
uint
)
((
char
*
)
field
->
null_ptr
-
(
char
*
)
table
->
record
[
0
]);
record
[
null_offset
]
=
record
[
null_offset
]
|
field
->
null_bit
;
}
/*************************************************************//**
InnoDB uses this function to compare two data fields for which the data type
is such that we must use MySQL code to compare them. NOTE that the prototype
...
...
storage/innodb_plugin/include/btr0pcur.h
View file @
01587f5f
/*****************************************************************************
Copyright (c) 1996, 201
0, Innobase Oy
. All Rights Reserved.
Copyright (c) 1996, 201
1, Oracle and/or its affiliates
. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -244,18 +244,6 @@ btr_pcur_restore_position_func(
mtr_t
*
mtr
);
/*!< in: mtr */
#define btr_pcur_restore_position(l,cur,mtr) \
btr_pcur_restore_position_func(l,cur,__FILE__,__LINE__,mtr)
/**************************************************************//**
If the latch mode of the cursor is BTR_LEAF_SEARCH or BTR_LEAF_MODIFY,
releases the page latch and bufferfix reserved by the cursor.
NOTE! In the case of BTR_LEAF_MODIFY, there should not exist changes
made by the current mini-transaction to the data protected by the
cursor latch, as then the latch must not be released until mtr_commit. */
UNIV_INTERN
void
btr_pcur_release_leaf
(
/*==================*/
btr_pcur_t
*
cursor
,
/*!< in: persistent cursor */
mtr_t
*
mtr
);
/*!< in: mtr */
/*********************************************************//**
Gets the rel_pos field for a cursor whose position has been stored.
@return BTR_PCUR_ON, ... */
...
...
@@ -282,10 +270,9 @@ btr_pcur_get_mtr(
btr_pcur_t
*
cursor
);
/*!< in: persistent cursor */
/**************************************************************//**
Commits the mtr and sets the pcur latch mode to BTR_NO_LATCHES,
that is, the cursor becomes detached. If there have been modifications
to the page where pcur is positioned, this can be used instead of
btr_pcur_release_leaf. Function btr_pcur_store_position should be used
before calling this, if restoration of cursor is wanted later. */
that is, the cursor becomes detached.
Function btr_pcur_store_position should be used before calling this,
if restoration of cursor is wanted later. */
UNIV_INLINE
void
btr_pcur_commit_specify_mtr
(
...
...
storage/innodb_plugin/include/btr0pcur.ic
View file @
01587f5f
/*****************************************************************************
Copyright (c) 1996, 201
0, Innobase Oy
. All Rights Reserved.
Copyright (c) 1996, 201
1, Oracle and/or its affiliates
. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -396,10 +396,9 @@ btr_pcur_move_to_next(
/**************************************************************//**
Commits the mtr and sets the pcur latch mode to BTR_NO_LATCHES,
that is, the cursor becomes detached. If there have been modifications
to the page where pcur is positioned, this can be used instead of
btr_pcur_release_leaf. Function btr_pcur_store_position should be used
before calling this, if restoration of cursor is wanted later. */
that is, the cursor becomes detached.
Function btr_pcur_store_position should be used before calling this,
if restoration of cursor is wanted later. */
UNIV_INLINE
void
btr_pcur_commit_specify_mtr(
...
...
storage/innodb_plugin/include/mtr0mtr.h
View file @
01587f5f
/*****************************************************************************
Copyright (c) 1995, 20
09, Innobase Oy
. All Rights Reserved.
Copyright (c) 1995, 20
11, Oracle and/or its affiliates
. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -213,16 +213,6 @@ ulint
mtr_set_savepoint
(
/*==============*/
mtr_t
*
mtr
);
/*!< in: mtr */
/**********************************************************//**
Releases the latches stored in an mtr memo down to a savepoint.
NOTE! The mtr must not have made changes to buffer pages after the
savepoint, as these can be handled only by mtr_commit. */
UNIV_INTERN
void
mtr_rollback_to_savepoint
(
/*======================*/
mtr_t
*
mtr
,
/*!< in: mtr */
ulint
savepoint
);
/*!< in: savepoint */
#ifndef UNIV_HOTBACKUP
/**********************************************************//**
Releases the (index tree) s-latch stored in an mtr memo after a
...
...
storage/innodb_plugin/include/ut0mem.h
View file @
01587f5f
/*****************************************************************************
Copyright (c) 1994, 20
09, Innobase Oy
. All Rights Reserved.
Copyright (c) 1994, 20
11, Oracle and/or its affiliates
. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -209,43 +209,6 @@ ut_strlcpy_rev(
const
char
*
src
,
/*!< in: source buffer */
ulint
size
);
/*!< in: size of destination buffer */
/**********************************************************************//**
Compute strlen(ut_strcpyq(str, q)).
@return length of the string when quoted */
UNIV_INLINE
ulint
ut_strlenq
(
/*=======*/
const
char
*
str
,
/*!< in: null-terminated string */
char
q
);
/*!< in: the quote character */
/**********************************************************************//**
Make a quoted copy of a NUL-terminated string. Leading and trailing
quotes will not be included; only embedded quotes will be escaped.
See also ut_strlenq() and ut_memcpyq().
@return pointer to end of dest */
UNIV_INTERN
char
*
ut_strcpyq
(
/*=======*/
char
*
dest
,
/*!< in: output buffer */
char
q
,
/*!< in: the quote character */
const
char
*
src
);
/*!< in: null-terminated string */
/**********************************************************************//**
Make a quoted copy of a fixed-length string. Leading and trailing
quotes will not be included; only embedded quotes will be escaped.
See also ut_strlenq() and ut_strcpyq().
@return pointer to end of dest */
UNIV_INTERN
char
*
ut_memcpyq
(
/*=======*/
char
*
dest
,
/*!< in: output buffer */
char
q
,
/*!< in: the quote character */
const
char
*
src
,
/*!< in: string to be quoted */
ulint
len
);
/*!< in: length of src */
/**********************************************************************//**
Return the number of times s2 occurs in s1. Overlapping instances of s2
are only counted once.
...
...
storage/innodb_plugin/include/ut0mem.ic
View file @
01587f5f
/*****************************************************************************
Copyright (c) 1994, 20
09, Innobase Oy
. All Rights Reserved.
Copyright (c) 1994, 20
11, Oracle and/or its affiliates
. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -98,27 +98,6 @@ ut_strcmp(const char* str1, const char* str2)
return(strcmp(str1, str2));
}
/**********************************************************************//**
Compute strlen(ut_strcpyq(str, q)).
@return length of the string when quoted */
UNIV_INLINE
ulint
ut_strlenq(
/*=======*/
const char* str, /*!< in: null-terminated string */
char q) /*!< in: the quote character */
{
ulint len;
for (len = 0; *str; len++, str++) {
if (*str == q) {
len++;
}
}
return(len);
}
/**********************************************************************//**
Converts a raw binary data to a NUL-terminated hex string. The output is
truncated if there is not enough space in "hex", make sure "hex_size" is at
...
...
storage/innodb_plugin/mtr/mtr0mtr.c
View file @
01587f5f
/*****************************************************************************
Copyright (c) 1995, 20
09, Innobase Oy
. All Rights Reserved.
Copyright (c) 1995, 20
11, Oracle and/or its affiliates
. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -211,40 +211,6 @@ mtr_commit(
}
#ifndef UNIV_HOTBACKUP
/**********************************************************//**
Releases the latches stored in an mtr memo down to a savepoint.
NOTE! The mtr must not have made changes to buffer pages after the
savepoint, as these can be handled only by mtr_commit. */
UNIV_INTERN
void
mtr_rollback_to_savepoint
(
/*======================*/
mtr_t
*
mtr
,
/*!< in: mtr */
ulint
savepoint
)
/*!< in: savepoint */
{
mtr_memo_slot_t
*
slot
;
dyn_array_t
*
memo
;
ulint
offset
;
ut_ad
(
mtr
);
ut_ad
(
mtr
->
magic_n
==
MTR_MAGIC_N
);
ut_ad
(
mtr
->
state
==
MTR_ACTIVE
);
memo
=
&
(
mtr
->
memo
);
offset
=
dyn_array_get_data_size
(
memo
);
ut_ad
(
offset
>=
savepoint
);
while
(
offset
>
savepoint
)
{
offset
-=
sizeof
(
mtr_memo_slot_t
);
slot
=
dyn_array_get_element
(
memo
,
offset
);
ut_ad
(
slot
->
type
!=
MTR_MEMO_MODIFY
);
mtr_memo_slot_release
(
mtr
,
slot
);
}
}
/***************************************************//**
Releases an object in the memo stack. */
UNIV_INTERN
...
...
storage/innodb_plugin/ut/ut0mem.c
View file @
01587f5f
/*****************************************************************************
Copyright (c) 1994, 20
09, Innobase Oy
. All Rights Reserved.
Copyright (c) 1994, 20
11, Oracle and/or its affiliates
. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -489,53 +489,6 @@ ut_strlcpy_rev(
return
(
src_size
);
}
/**********************************************************************//**
Make a quoted copy of a NUL-terminated string. Leading and trailing
quotes will not be included; only embedded quotes will be escaped.
See also ut_strlenq() and ut_memcpyq().
@return pointer to end of dest */
UNIV_INTERN
char
*
ut_strcpyq
(
/*=======*/
char
*
dest
,
/*!< in: output buffer */
char
q
,
/*!< in: the quote character */
const
char
*
src
)
/*!< in: null-terminated string */
{
while
(
*
src
)
{
if
((
*
dest
++
=
*
src
++
)
==
q
)
{
*
dest
++
=
q
;
}
}
return
(
dest
);
}
/**********************************************************************//**
Make a quoted copy of a fixed-length string. Leading and trailing
quotes will not be included; only embedded quotes will be escaped.
See also ut_strlenq() and ut_strcpyq().
@return pointer to end of dest */
UNIV_INTERN
char
*
ut_memcpyq
(
/*=======*/
char
*
dest
,
/*!< in: output buffer */
char
q
,
/*!< in: the quote character */
const
char
*
src
,
/*!< in: string to be quoted */
ulint
len
)
/*!< in: length of src */
{
const
char
*
srcend
=
src
+
len
;
while
(
src
<
srcend
)
{
if
((
*
dest
++
=
*
src
++
)
==
q
)
{
*
dest
++
=
q
;
}
}
return
(
dest
);
}
#ifndef UNIV_HOTBACKUP
/**********************************************************************//**
Return the number of times s2 occurs in s1. Overlapping instances of s2
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment