mirror of
https://github.com/MariaDB/server.git
synced 2026-05-07 07:35:32 +02:00
Merge from bk-internal.mysql.com/bzrroot/server/mysql-5.5-innodb/
to local repo.
This commit is contained in:
commit
8cf10ed177
608 changed files with 23836 additions and 10246 deletions
|
|
@ -40,12 +40,10 @@ IF(UNIX)
|
|||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# Enable InnoDB's UNIV_DEBUG if MySQL's WITH_DEBUG[_FULL] is defined
|
||||
# enable when this bug is resolved:
|
||||
# Bug#54861 Additional connections not handled properly in mtr --embedded
|
||||
#IF(WITH_DEBUG)
|
||||
# ADD_DEFINITIONS("-DUNIV_DEBUG")
|
||||
#ENDIF()
|
||||
# Enable InnoDB's UNIV_DEBUG if MySQL's WITH_DEBUG is defined
|
||||
IF(WITH_DEBUG)
|
||||
ADD_DEFINITIONS("-DUNIV_DEBUG")
|
||||
ENDIF()
|
||||
|
||||
IF(NOT MSVC)
|
||||
# either define HAVE_IB_GCC_ATOMIC_BUILTINS or not
|
||||
|
|
|
|||
|
|
@ -1,351 +0,0 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
========
|
||||
|
||||
The licenses for most software are designed to take away your freedom
|
||||
to share and change it. By contrast, the GNU General Public License is
|
||||
intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price.
|
||||
Our General Public Licenses are designed to make sure that you have
|
||||
the freedom to distribute copies of free software (and charge for this
|
||||
service if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid anyone
|
||||
to deny you these rights or to ask you to surrender the rights. These
|
||||
restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that you
|
||||
have. You must make sure that they, too, receive or can get the source
|
||||
code. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software patents.
|
||||
We wish to avoid the danger that redistributors of a free program will
|
||||
individually obtain patent licenses, in effect making the program
|
||||
proprietary. To prevent this, we have made it clear that any patent
|
||||
must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
0. This License applies to any program or other work which contains a
|
||||
notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program",
|
||||
below, refers to any such program or work, and a "work based on
|
||||
the Program" means either the Program or any derivative work under
|
||||
copyright law: that is to say, a work containing the Program or a
|
||||
portion of it, either verbatim or with modifications and/or
|
||||
translated into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".) Each
|
||||
licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are
|
||||
not covered by this License; they are outside its scope. The act
|
||||
of running the Program is not restricted, and the output from the
|
||||
Program is covered only if its contents constitute a work based on
|
||||
the Program (independent of having been made by running the
|
||||
Program). Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any
|
||||
warranty; and give any other recipients of the Program a copy of
|
||||
this License along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange
|
||||
for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a. You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b. You must cause any work that you distribute or publish, that
|
||||
in whole or in part contains or is derived from the Program
|
||||
or any part thereof, to be licensed as a whole at no charge
|
||||
to all third parties under the terms of this License.
|
||||
|
||||
c. If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display
|
||||
an announcement including an appropriate copyright notice and
|
||||
a notice that there is no warranty (or else, saying that you
|
||||
provide a warranty) and that users may redistribute the
|
||||
program under these conditions, and telling the user how to
|
||||
view a copy of this License. (Exception: if the Program
|
||||
itself is interactive but does not normally print such an
|
||||
announcement, your work based on the Program is not required
|
||||
to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the
|
||||
Program, and can be reasonably considered independent and separate
|
||||
works in themselves, then this License, and its terms, do not
|
||||
apply to those sections when you distribute them as separate
|
||||
works. But when you distribute the same sections as part of a
|
||||
whole which is a work based on the Program, the distribution of
|
||||
the whole must be on the terms of this License, whose permissions
|
||||
for other licensees extend to the entire whole, and thus to each
|
||||
and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or
|
||||
contest your rights to work written entirely by you; rather, the
|
||||
intent is to exercise the right to control the distribution of
|
||||
derivative or collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the
|
||||
Program with the Program (or with a work based on the Program) on
|
||||
a volume of a storage or distribution medium does not bring the
|
||||
other work under the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms
|
||||
of Sections 1 and 2 above provided that you also do one of the
|
||||
following:
|
||||
|
||||
a. Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of
|
||||
Sections 1 and 2 above on a medium customarily used for
|
||||
software interchange; or,
|
||||
|
||||
b. Accompany it with a written offer, valid for at least three
|
||||
years, to give any third-party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange; or,
|
||||
|
||||
c. Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with
|
||||
such an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete
|
||||
source code means all the source code for all modules it contains,
|
||||
plus any associated interface definition files, plus the scripts
|
||||
used to control compilation and installation of the executable.
|
||||
However, as a special exception, the source code distributed need
|
||||
not include anything that is normally distributed (in either
|
||||
source or binary form) with the major components (compiler,
|
||||
kernel, and so on) of the operating system on which the executable
|
||||
runs, unless that component itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this
|
||||
License. However, parties who have received copies, or rights,
|
||||
from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify
|
||||
or distribute the Program or its derivative works. These actions
|
||||
are prohibited by law if you do not accept this License.
|
||||
Therefore, by modifying or distributing the Program (or any work
|
||||
based on the Program), you indicate your acceptance of this
|
||||
License to do so, and all its terms and conditions for copying,
|
||||
distributing or modifying the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program
|
||||
subject to these terms and conditions. You may not impose any
|
||||
further restrictions on the recipients' exercise of the rights
|
||||
granted herein. You are not responsible for enforcing compliance
|
||||
by third parties to this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent
|
||||
issues), conditions are imposed on you (whether by court order,
|
||||
agreement or otherwise) that contradict the conditions of this
|
||||
License, they do not excuse you from the conditions of this
|
||||
License. If you cannot distribute so as to satisfy simultaneously
|
||||
your obligations under this License and any other pertinent
|
||||
obligations, then as a consequence you may not distribute the
|
||||
Program at all. For example, if a patent license would not permit
|
||||
royalty-free redistribution of the Program by all those who
|
||||
receive copies directly or indirectly through you, then the only
|
||||
way you could satisfy both it and this License would be to refrain
|
||||
entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable
|
||||
under any particular circumstance, the balance of the section is
|
||||
intended to apply and the section as a whole is intended to apply
|
||||
in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of
|
||||
any such claims; this section has the sole purpose of protecting
|
||||
the integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is
|
||||
willing to distribute software through any other system and a
|
||||
licensee cannot impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed
|
||||
to be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces,
|
||||
the original copyright holder who places the Program under this
|
||||
License may add an explicit geographical distribution limitation
|
||||
excluding those countries, so that distribution is permitted only
|
||||
in or among countries not thus excluded. In such case, this
|
||||
License incorporates the limitation as if written in the body of
|
||||
this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new
|
||||
versions of the General Public License from time to time. Such
|
||||
new versions will be similar in spirit to the present version, but
|
||||
may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies a version number of this License which applies
|
||||
to it and "any later version", you have the option of following
|
||||
the terms and conditions either of that version or of any later
|
||||
version published by the Free Software Foundation. If the Program
|
||||
does not specify a version number of this License, you may choose
|
||||
any version ever published by the Free Software Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the
|
||||
author to ask for permission. For software which is copyrighted
|
||||
by the Free Software Foundation, write to the Free Software
|
||||
Foundation; we sometimes make exceptions for this. Our decision
|
||||
will be guided by the two goals of preserving the free status of
|
||||
all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
|
||||
LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
|
||||
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT
|
||||
NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE
|
||||
QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
|
||||
SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
|
||||
MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
|
||||
LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
|
||||
INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
|
||||
INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU
|
||||
OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY
|
||||
OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
|
||||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
How to Apply These Terms to Your New Programs
|
||||
=============================================
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these
|
||||
terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest to
|
||||
attach them to the start of each source file to most effectively convey
|
||||
the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES.
|
||||
Copyright (C) YYYY NAME OF AUTHOR
|
||||
|
||||
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 Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) 19YY NAME OF AUTHOR
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the
|
||||
appropriate parts of the General Public License. Of course, the
|
||||
commands you use may be called something other than `show w' and `show
|
||||
c'; they could even be mouse-clicks or menu items--whatever suits your
|
||||
program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
SIGNATURE OF TY COON, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library,
|
||||
you may consider it more useful to permit linking proprietary
|
||||
applications with the library. If this is what you want to do, use the
|
||||
GNU Library General Public License instead of this License.
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
Portions of this software contain modifications contributed by
|
||||
Sun Microsystems, Inc. These contributions are used with the following
|
||||
license:
|
||||
|
||||
Copyright (c) 2009, Sun Microsystems, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials
|
||||
provided with the distribution.
|
||||
* Neither the name of Sun Microsystems, Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
|
@ -565,7 +565,7 @@ RECURSIVE = YES
|
|||
# excluded from the INPUT source files. This way you can easily exclude a
|
||||
# subdirectory from a directory tree whose root is specified with the INPUT tag.
|
||||
|
||||
EXCLUDE = ut0auxconf_*
|
||||
EXCLUDE =
|
||||
|
||||
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
|
||||
# directories that are symbolic links (a Unix filesystem feature) are excluded
|
||||
|
|
|
|||
|
|
@ -207,7 +207,6 @@ noinst_HEADERS= \
|
|||
include/usr0sess.h \
|
||||
include/usr0sess.ic \
|
||||
include/usr0types.h \
|
||||
include/ut0auxconf.h \
|
||||
include/ut0byte.h \
|
||||
include/ut0byte.ic \
|
||||
include/ut0dbg.h \
|
||||
|
|
|
|||
|
|
@ -603,7 +603,6 @@ btr_page_get_father_node_ptr_func(
|
|||
ulint line, /*!< in: line where called */
|
||||
mtr_t* mtr) /*!< in: mtr */
|
||||
{
|
||||
page_t* page;
|
||||
dtuple_t* tuple;
|
||||
rec_t* user_rec;
|
||||
rec_t* node_ptr;
|
||||
|
|
@ -621,7 +620,6 @@ btr_page_get_father_node_ptr_func(
|
|||
|
||||
level = btr_page_get_level(btr_cur_get_page(cursor), mtr);
|
||||
|
||||
page = btr_cur_get_page(cursor);
|
||||
user_rec = btr_cur_get_rec(cursor);
|
||||
ut_a(page_rec_is_user_rec(user_rec));
|
||||
tuple = dict_index_build_node_ptr(index, user_rec, 0, heap, level);
|
||||
|
|
@ -1899,7 +1897,6 @@ btr_page_split_and_insert(
|
|||
buf_block_t* left_block;
|
||||
buf_block_t* right_block;
|
||||
buf_block_t* insert_block;
|
||||
page_t* insert_page;
|
||||
page_cur_t* page_cursor;
|
||||
rec_t* first_rec;
|
||||
byte* buf = 0; /* remove warning */
|
||||
|
|
@ -2157,8 +2154,6 @@ insert_empty:
|
|||
insert_block = right_block;
|
||||
}
|
||||
|
||||
insert_page = buf_block_get_frame(insert_block);
|
||||
|
||||
/* 7. Reposition the cursor for insert and try insertion */
|
||||
page_cursor = btr_cur_get_page_cur(cursor);
|
||||
|
||||
|
|
@ -2170,8 +2165,12 @@ insert_empty:
|
|||
|
||||
#ifdef UNIV_ZIP_DEBUG
|
||||
{
|
||||
page_t* insert_page
|
||||
= buf_block_get_frame(insert_block);
|
||||
|
||||
page_zip_des_t* insert_page_zip
|
||||
= buf_block_get_page_zip(insert_block);
|
||||
|
||||
ut_a(!insert_page_zip
|
||||
|| page_zip_validate(insert_page_zip, insert_page));
|
||||
}
|
||||
|
|
@ -2564,7 +2563,6 @@ btr_compress(
|
|||
ulint n_recs;
|
||||
ulint max_ins_size;
|
||||
ulint max_ins_size_reorg;
|
||||
ulint level;
|
||||
|
||||
block = btr_cur_get_block(cursor);
|
||||
page = btr_cur_get_page(cursor);
|
||||
|
|
@ -2574,7 +2572,6 @@ btr_compress(
|
|||
ut_ad(mtr_memo_contains(mtr, dict_index_get_lock(index),
|
||||
MTR_MEMO_X_LOCK));
|
||||
ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
|
||||
level = btr_page_get_level(page, mtr);
|
||||
space = dict_index_get_space(index);
|
||||
zip_size = dict_table_zip_size(index->table);
|
||||
|
||||
|
|
|
|||
|
|
@ -1954,7 +1954,6 @@ btr_cur_optimistic_update(
|
|||
page_t* page;
|
||||
page_zip_des_t* page_zip;
|
||||
rec_t* rec;
|
||||
rec_t* orig_rec;
|
||||
ulint max_size;
|
||||
ulint new_rec_size;
|
||||
ulint old_rec_size;
|
||||
|
|
@ -1968,7 +1967,7 @@ btr_cur_optimistic_update(
|
|||
|
||||
block = btr_cur_get_block(cursor);
|
||||
page = buf_block_get_frame(block);
|
||||
orig_rec = rec = btr_cur_get_rec(cursor);
|
||||
rec = btr_cur_get_rec(cursor);
|
||||
index = cursor->index;
|
||||
ut_ad(!!page_rec_is_comp(rec) == dict_table_is_comp(index->table));
|
||||
ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
|
||||
|
|
@ -3761,9 +3760,10 @@ btr_cur_set_ownership_of_extern_field(
|
|||
Marks not updated extern fields as not-owned by this record. The ownership
|
||||
is transferred to the updated record which is inserted elsewhere in the
|
||||
index tree. In purge only the owner of externally stored field is allowed
|
||||
to free the field. */
|
||||
to free the field.
|
||||
@return TRUE if BLOB ownership was transferred */
|
||||
UNIV_INTERN
|
||||
void
|
||||
ibool
|
||||
btr_cur_mark_extern_inherited_fields(
|
||||
/*=================================*/
|
||||
page_zip_des_t* page_zip,/*!< in/out: compressed page whose uncompressed
|
||||
|
|
@ -3777,13 +3777,14 @@ btr_cur_mark_extern_inherited_fields(
|
|||
ulint n;
|
||||
ulint j;
|
||||
ulint i;
|
||||
ibool change_ownership = FALSE;
|
||||
|
||||
ut_ad(rec_offs_validate(rec, NULL, offsets));
|
||||
ut_ad(!rec_offs_comp(offsets) || !rec_get_node_ptr_flag(rec));
|
||||
|
||||
if (!rec_offs_any_extern(offsets)) {
|
||||
|
||||
return;
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
n = rec_offs_n_fields(offsets);
|
||||
|
|
@ -3806,10 +3807,14 @@ btr_cur_mark_extern_inherited_fields(
|
|||
|
||||
btr_cur_set_ownership_of_extern_field(
|
||||
page_zip, rec, index, offsets, i, FALSE, mtr);
|
||||
|
||||
change_ownership = TRUE;
|
||||
updated:
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
return(change_ownership);
|
||||
}
|
||||
|
||||
/*******************************************************************//**
|
||||
|
|
@ -4557,17 +4562,20 @@ btr_free_externally_stored_field(
|
|||
}
|
||||
|
||||
for (;;) {
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_block_t* rec_block;
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
buf_block_t* ext_block;
|
||||
|
||||
mtr_start(&mtr);
|
||||
|
||||
rec_block = buf_page_get(page_get_space_id(
|
||||
page_align(field_ref)),
|
||||
rec_zip_size,
|
||||
page_get_page_no(
|
||||
page_align(field_ref)),
|
||||
RW_X_LATCH, &mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
rec_block =
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
buf_page_get(page_get_space_id(page_align(field_ref)),
|
||||
rec_zip_size,
|
||||
page_get_page_no(page_align(field_ref)),
|
||||
RW_X_LATCH, &mtr);
|
||||
buf_block_dbg_add_level(rec_block, SYNC_NO_ORDER_CHECK);
|
||||
page_no = mach_read_from_4(field_ref + BTR_EXTERN_PAGE_NO);
|
||||
|
||||
|
|
|
|||
|
|
@ -452,7 +452,6 @@ btr_pcur_move_backward_from_page(
|
|||
mtr_t* mtr) /*!< in: mtr */
|
||||
{
|
||||
ulint prev_page_no;
|
||||
ulint space;
|
||||
page_t* page;
|
||||
buf_block_t* prev_block;
|
||||
ulint latch_mode;
|
||||
|
|
@ -488,7 +487,6 @@ btr_pcur_move_backward_from_page(
|
|||
page = btr_pcur_get_page(cursor);
|
||||
|
||||
prev_page_no = btr_page_get_prev(page, mtr);
|
||||
space = buf_block_get_space(btr_pcur_get_block(cursor));
|
||||
|
||||
if (prev_page_no == FIL_NULL) {
|
||||
} else if (btr_pcur_is_before_first_on_page(cursor)) {
|
||||
|
|
|
|||
|
|
@ -1507,7 +1507,6 @@ btr_search_update_hash_on_delete(
|
|||
rec_t* rec;
|
||||
ulint fold;
|
||||
index_id_t index_id;
|
||||
ibool found;
|
||||
ulint offsets_[REC_OFFS_NORMAL_SIZE];
|
||||
mem_heap_t* heap = NULL;
|
||||
rec_offs_init(offsets_);
|
||||
|
|
@ -1540,7 +1539,7 @@ btr_search_update_hash_on_delete(
|
|||
}
|
||||
rw_lock_x_lock(&btr_search_latch);
|
||||
|
||||
found = ha_search_and_delete_if_found(table, fold, rec);
|
||||
ha_search_and_delete_if_found(table, fold, rec);
|
||||
|
||||
rw_lock_x_unlock(&btr_search_latch);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@ Created 11/11/1995 Heikki Tuuri
|
|||
#include "log0log.h"
|
||||
#include "os0file.h"
|
||||
#include "trx0sys.h"
|
||||
#include "mysql/plugin.h"
|
||||
#include "mysql/service_thd_wait.h"
|
||||
|
||||
/**********************************************************************
|
||||
These statistics are generated for heuristics used in estimating the
|
||||
|
|
@ -131,12 +133,18 @@ buf_flush_delete_from_flush_rbt(
|
|||
/*============================*/
|
||||
buf_page_t* bpage) /*!< in: bpage to be removed. */
|
||||
{
|
||||
#ifdef UNIV_DEBUG
|
||||
ibool ret = FALSE;
|
||||
#endif /* UNIV_DEBUG */
|
||||
buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
|
||||
|
||||
ut_ad(buf_flush_list_mutex_own(buf_pool));
|
||||
|
||||
ret = rbt_delete(buf_pool->flush_rbt, &bpage);
|
||||
#ifdef UNIV_DEBUG
|
||||
ret =
|
||||
#endif /* UNIV_DEBUG */
|
||||
rbt_delete(buf_pool->flush_rbt, &bpage);
|
||||
|
||||
ut_ad(ret);
|
||||
}
|
||||
|
||||
|
|
@ -1744,10 +1752,14 @@ buf_flush_wait_batch_end(
|
|||
|
||||
buf_pool = buf_pool_from_array(i);
|
||||
|
||||
thd_wait_begin(NULL, THD_WAIT_DISKIO);
|
||||
os_event_wait(buf_pool->no_flush[type]);
|
||||
thd_wait_end(NULL);
|
||||
}
|
||||
} else {
|
||||
thd_wait_begin(NULL, THD_WAIT_DISKIO);
|
||||
os_event_wait(buf_pool->no_flush[type]);
|
||||
thd_wait_end(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@ Created 11/5/1995 Heikki Tuuri
|
|||
#include "os0file.h"
|
||||
#include "srv0start.h"
|
||||
#include "srv0srv.h"
|
||||
#include "mysql/plugin.h"
|
||||
#include "mysql/service_thd_wait.h"
|
||||
|
||||
/** The linear read-ahead area size */
|
||||
#define BUF_READ_AHEAD_LINEAR_AREA BUF_READ_AHEAD_AREA
|
||||
|
|
@ -135,6 +137,7 @@ buf_read_page_low(
|
|||
|
||||
ut_ad(buf_page_in_file(bpage));
|
||||
|
||||
thd_wait_begin(NULL, THD_WAIT_DISKIO);
|
||||
if (zip_size) {
|
||||
*err = fil_io(OS_FILE_READ | wake_later,
|
||||
sync, space, zip_size, offset, 0, zip_size,
|
||||
|
|
@ -146,6 +149,7 @@ buf_read_page_low(
|
|||
sync, space, 0, offset, 0, UNIV_PAGE_SIZE,
|
||||
((buf_block_t*) bpage)->frame, bpage);
|
||||
}
|
||||
thd_wait_end(NULL);
|
||||
ut_a(*err == DB_SUCCESS);
|
||||
|
||||
if (sync) {
|
||||
|
|
|
|||
|
|
@ -22,4 +22,4 @@ MYSQL_ROOT="$(dirname ${0})/../.."
|
|||
cd ${MYSQL_ROOT}
|
||||
|
||||
cmake -DWITH_INNOBASE_STORAGE_ENGINE:BOOL=ON
|
||||
make -j4
|
||||
make -j$(nproc)
|
||||
|
|
|
|||
|
|
@ -627,7 +627,6 @@ dict_create_index_tree_step(
|
|||
{
|
||||
dict_index_t* index;
|
||||
dict_table_t* sys_indexes;
|
||||
dict_table_t* table;
|
||||
dtuple_t* search_tuple;
|
||||
ulint zip_size;
|
||||
btr_pcur_t pcur;
|
||||
|
|
@ -636,7 +635,6 @@ dict_create_index_tree_step(
|
|||
ut_ad(mutex_own(&(dict_sys->mutex)));
|
||||
|
||||
index = node->index;
|
||||
table = node->table;
|
||||
|
||||
sys_indexes = dict_sys->sys_indexes;
|
||||
|
||||
|
|
|
|||
|
|
@ -4455,7 +4455,6 @@ dict_index_print_low(
|
|||
{
|
||||
ib_int64_t n_vals;
|
||||
ulint i;
|
||||
const char* type_string;
|
||||
|
||||
ut_ad(mutex_own(&(dict_sys->mutex)));
|
||||
|
||||
|
|
@ -4470,14 +4469,6 @@ dict_index_print_low(
|
|||
|
||||
dict_index_stat_mutex_exit(index);
|
||||
|
||||
if (dict_index_is_clust(index)) {
|
||||
type_string = "clustered index";
|
||||
} else if (dict_index_is_unique(index)) {
|
||||
type_string = "unique index";
|
||||
} else {
|
||||
type_string = "secondary index";
|
||||
}
|
||||
|
||||
fprintf(stderr,
|
||||
" INDEX: name %s, id %llu, fields %lu/%lu,"
|
||||
" uniq %lu, type %lu\n"
|
||||
|
|
|
|||
|
|
@ -384,18 +384,13 @@ eval_notfound(
|
|||
/*==========*/
|
||||
func_node_t* func_node) /*!< in: function node */
|
||||
{
|
||||
que_node_t* arg1;
|
||||
que_node_t* arg2;
|
||||
sym_node_t* cursor;
|
||||
sel_node_t* sel_node;
|
||||
ibool ibool_val;
|
||||
|
||||
arg1 = func_node->args;
|
||||
arg2 = que_node_get_next(arg1);
|
||||
|
||||
ut_ad(func_node->func == PARS_NOTFOUND_TOKEN);
|
||||
|
||||
cursor = arg1;
|
||||
cursor = func_node->args;
|
||||
|
||||
ut_ad(que_node_get_type(cursor) == QUE_NODE_SYMBOL);
|
||||
|
||||
|
|
|
|||
|
|
@ -674,6 +674,8 @@ static SHOW_VAR innodb_status_variables[]= {
|
|||
(char*) &export_vars.innodb_rows_read, SHOW_LONG},
|
||||
{"rows_updated",
|
||||
(char*) &export_vars.innodb_rows_updated, SHOW_LONG},
|
||||
{"truncated_status_writes",
|
||||
(char*) &export_vars.innodb_truncated_status_writes, SHOW_LONG},
|
||||
{NullS, NullS, SHOW_LONG}
|
||||
};
|
||||
|
||||
|
|
@ -1271,7 +1273,7 @@ innobase_mysql_tmpfile(void)
|
|||
|
||||
#ifdef _WIN32
|
||||
/* Note that on Windows, the integer returned by mysql_tmpfile
|
||||
has no relation to C runtime file descriptor. Here, we need
|
||||
has no relation to C runtime file descriptor. Here, we need
|
||||
to call my_get_osfhandle to get the HANDLE and then convert it
|
||||
to C runtime filedescriptor. */
|
||||
{
|
||||
|
|
@ -2564,7 +2566,7 @@ static
|
|||
int
|
||||
innobase_start_trx_and_assign_read_view(
|
||||
/*====================================*/
|
||||
handlerton *hton, /*!< in: Innodb handlerton */
|
||||
handlerton *hton, /*!< in: Innodb handlerton */
|
||||
THD* thd) /*!< in: MySQL thread handle of the user for whom
|
||||
the transaction should be committed */
|
||||
{
|
||||
|
|
@ -2609,7 +2611,7 @@ static
|
|||
int
|
||||
innobase_commit(
|
||||
/*============*/
|
||||
handlerton *hton, /*!< in: Innodb handlerton */
|
||||
handlerton *hton, /*!< in: Innodb handlerton */
|
||||
THD* thd, /*!< in: MySQL thread handle of the user for whom
|
||||
the transaction should be committed */
|
||||
bool all) /*!< in: TRUE - commit transaction
|
||||
|
|
@ -3542,12 +3544,19 @@ ha_innobase::innobase_initialize_autoinc()
|
|||
err = row_search_max_autoinc(index, col_name, &read_auto_inc);
|
||||
|
||||
switch (err) {
|
||||
case DB_SUCCESS:
|
||||
/* At the this stage we do not know the increment
|
||||
or the offset, so use a default increment of 1. */
|
||||
auto_inc = read_auto_inc + 1;
|
||||
break;
|
||||
case DB_SUCCESS: {
|
||||
ulonglong col_max_value;
|
||||
|
||||
col_max_value = innobase_get_int_col_max_value(field);
|
||||
|
||||
/* At the this stage we do not know the increment
|
||||
nor the offset, so use a default increment of 1. */
|
||||
|
||||
auto_inc = innobase_next_autoinc(
|
||||
read_auto_inc, 1, 1, col_max_value);
|
||||
|
||||
break;
|
||||
}
|
||||
case DB_RECORD_NOT_FOUND:
|
||||
ut_print_timestamp(stderr);
|
||||
fprintf(stderr, " InnoDB: MySQL and InnoDB data "
|
||||
|
|
@ -3842,8 +3851,6 @@ retry:
|
|||
dict_table_get_format(prebuilt->table));
|
||||
}
|
||||
|
||||
info(HA_STATUS_NO_LOCK | HA_STATUS_VARIABLE | HA_STATUS_CONST);
|
||||
|
||||
/* Only if the table has an AUTOINC column. */
|
||||
if (prebuilt->table != NULL && table->found_next_number_field != NULL) {
|
||||
dict_table_autoinc_lock(prebuilt->table);
|
||||
|
|
@ -3860,6 +3867,8 @@ retry:
|
|||
dict_table_autoinc_unlock(prebuilt->table);
|
||||
}
|
||||
|
||||
info(HA_STATUS_NO_LOCK | HA_STATUS_VARIABLE | HA_STATUS_CONST);
|
||||
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
|
@ -7199,7 +7208,6 @@ innobase_drop_database(
|
|||
ulint len = 0;
|
||||
trx_t* trx;
|
||||
char* ptr;
|
||||
int error;
|
||||
char* namebuf;
|
||||
THD* thd = current_thd;
|
||||
|
||||
|
|
@ -7242,7 +7250,7 @@ innobase_drop_database(
|
|||
#else
|
||||
trx = innobase_trx_allocate(thd);
|
||||
#endif
|
||||
error = row_drop_database_for_mysql(namebuf, trx);
|
||||
row_drop_database_for_mysql(namebuf, trx);
|
||||
my_free(namebuf);
|
||||
|
||||
/* Flush the log to reduce probability that the .frm files and
|
||||
|
|
@ -8970,7 +8978,7 @@ innodb_show_status(
|
|||
{
|
||||
trx_t* trx;
|
||||
static const char truncated_msg[] = "... truncated...\n";
|
||||
const long MAX_STATUS_SIZE = 64000;
|
||||
const long MAX_STATUS_SIZE = 1048576;
|
||||
ulint trx_list_start = ULINT_UNDEFINED;
|
||||
ulint trx_list_end = ULINT_UNDEFINED;
|
||||
|
||||
|
|
@ -9000,6 +9008,7 @@ innodb_show_status(
|
|||
|
||||
if (flen > MAX_STATUS_SIZE) {
|
||||
usable_len = MAX_STATUS_SIZE;
|
||||
srv_truncated_status_writes++;
|
||||
} else {
|
||||
usable_len = flen;
|
||||
}
|
||||
|
|
@ -9035,12 +9044,9 @@ innodb_show_status(
|
|||
|
||||
mutex_exit(&srv_monitor_file_mutex);
|
||||
|
||||
bool result = FALSE;
|
||||
stat_print(thd, innobase_hton_name, (uint) strlen(innobase_hton_name),
|
||||
STRING_WITH_LEN(""), str, flen);
|
||||
|
||||
if (stat_print(thd, innobase_hton_name, (uint) strlen(innobase_hton_name),
|
||||
STRING_WITH_LEN(""), str, flen)) {
|
||||
result= TRUE;
|
||||
}
|
||||
my_free(str);
|
||||
|
||||
DBUG_RETURN(FALSE);
|
||||
|
|
@ -9558,7 +9564,7 @@ ha_innobase::innobase_get_autoinc(
|
|||
}
|
||||
|
||||
/*******************************************************************//**
|
||||
This function reads the global auto-inc counter. It doesn't use the
|
||||
This function reads the global auto-inc counter. It doesn't use the
|
||||
AUTOINC lock even if the lock mode is set to TRADITIONAL.
|
||||
@return the autoinc value */
|
||||
UNIV_INTERN
|
||||
|
|
@ -11177,15 +11183,7 @@ i_s_innodb_lock_waits,
|
|||
i_s_innodb_cmp,
|
||||
i_s_innodb_cmp_reset,
|
||||
i_s_innodb_cmpmem,
|
||||
i_s_innodb_cmpmem_reset,
|
||||
i_s_innodb_sys_tables,
|
||||
i_s_innodb_sys_tablestats,
|
||||
i_s_innodb_sys_indexes,
|
||||
i_s_innodb_sys_columns,
|
||||
i_s_innodb_sys_fields,
|
||||
i_s_innodb_sys_foreign,
|
||||
i_s_innodb_sys_foreign_cols
|
||||
|
||||
i_s_innodb_cmpmem_reset
|
||||
mysql_declare_plugin_end;
|
||||
|
||||
/** @brief Initialize the default value of innodb_commit_concurrency.
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -33,12 +33,5 @@ extern struct st_mysql_plugin i_s_innodb_cmp;
|
|||
extern struct st_mysql_plugin i_s_innodb_cmp_reset;
|
||||
extern struct st_mysql_plugin i_s_innodb_cmpmem;
|
||||
extern struct st_mysql_plugin i_s_innodb_cmpmem_reset;
|
||||
extern struct st_mysql_plugin i_s_innodb_sys_tables;
|
||||
extern struct st_mysql_plugin i_s_innodb_sys_tablestats;
|
||||
extern struct st_mysql_plugin i_s_innodb_sys_indexes;
|
||||
extern struct st_mysql_plugin i_s_innodb_sys_columns;
|
||||
extern struct st_mysql_plugin i_s_innodb_sys_fields;
|
||||
extern struct st_mysql_plugin i_s_innodb_sys_foreign;
|
||||
extern struct st_mysql_plugin i_s_innodb_sys_foreign_cols;
|
||||
|
||||
#endif /* i_s_h */
|
||||
|
|
|
|||
|
|
@ -1297,12 +1297,11 @@ ibuf_rec_get_op_type(
|
|||
const rec_t* rec) /*!< in: ibuf record */
|
||||
{
|
||||
ulint len;
|
||||
const byte* field;
|
||||
|
||||
ut_ad(ibuf_inside());
|
||||
ut_ad(rec_get_n_fields_old(rec) > 2);
|
||||
|
||||
field = rec_get_nth_field_old(rec, 1, &len);
|
||||
(void) rec_get_nth_field_old(rec, 1, &len);
|
||||
|
||||
if (len > 1) {
|
||||
/* This is a < 4.1.x format record */
|
||||
|
|
@ -3779,17 +3778,11 @@ ibuf_insert_to_index_page(
|
|||
rec = page_rec_get_next(page_get_infimum_rec(page));
|
||||
|
||||
if (page_rec_is_supremum(rec)) {
|
||||
/* Empty pages can result from buffered delete operations.
|
||||
The first record from the free list can be used to find the
|
||||
father node. */
|
||||
rec = page_header_get_ptr(page, PAGE_FREE);
|
||||
if (UNIV_UNLIKELY(rec == NULL)) {
|
||||
fputs("InnoDB: Trying to insert a record from"
|
||||
" the insert buffer to an index page\n"
|
||||
"InnoDB: but the index page is empty!\n",
|
||||
stderr);
|
||||
goto dump;
|
||||
}
|
||||
fputs("InnoDB: Trying to insert a record from"
|
||||
" the insert buffer to an index page\n"
|
||||
"InnoDB: but the index page is empty!\n",
|
||||
stderr);
|
||||
goto dump;
|
||||
}
|
||||
|
||||
if (UNIV_UNLIKELY(rec_get_n_fields(rec, index)
|
||||
|
|
|
|||
|
|
@ -456,9 +456,10 @@ btr_estimate_number_of_different_key_vals(
|
|||
Marks not updated extern fields as not-owned by this record. The ownership
|
||||
is transferred to the updated record which is inserted elsewhere in the
|
||||
index tree. In purge only the owner of externally stored field is allowed
|
||||
to free the field. */
|
||||
to free the field.
|
||||
@return TRUE if BLOB ownership was transferred */
|
||||
UNIV_INTERN
|
||||
void
|
||||
ibool
|
||||
btr_cur_mark_extern_inherited_fields(
|
||||
/*=================================*/
|
||||
page_zip_des_t* page_zip,/*!< in/out: compressed page whose uncompressed
|
||||
|
|
|
|||
|
|
@ -707,6 +707,22 @@ ulint
|
|||
dict_table_zip_size(
|
||||
/*================*/
|
||||
const dict_table_t* table); /*!< in: table */
|
||||
/*********************************************************************//**
|
||||
Obtain exclusive locks on all index trees of the table. This is to prevent
|
||||
accessing index trees while InnoDB is updating internal metadata for
|
||||
operations such as truncate tables. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dict_table_x_lock_indexes(
|
||||
/*======================*/
|
||||
dict_table_t* table); /*!< in: table */
|
||||
/*********************************************************************//**
|
||||
Release the exclusive locks on all index tree. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dict_table_x_unlock_indexes(
|
||||
/*========================*/
|
||||
dict_table_t* table); /*!< in: table */
|
||||
/********************************************************************//**
|
||||
Checks if a column is in the ordering columns of the clustered index of a
|
||||
table. Column prefixes are treated like whole columns.
|
||||
|
|
|
|||
|
|
@ -490,6 +490,48 @@ dict_table_zip_size(
|
|||
return(dict_table_flags_to_zip_size(table->flags));
|
||||
}
|
||||
|
||||
/*********************************************************************//**
|
||||
Obtain exclusive locks on all index trees of the table. This is to prevent
|
||||
accessing index trees while InnoDB is updating internal metadata for
|
||||
operations such as truncate tables. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dict_table_x_lock_indexes(
|
||||
/*======================*/
|
||||
dict_table_t* table) /*!< in: table */
|
||||
{
|
||||
dict_index_t* index;
|
||||
|
||||
ut_a(table);
|
||||
ut_ad(mutex_own(&(dict_sys->mutex)));
|
||||
|
||||
/* Loop through each index of the table and lock them */
|
||||
for (index = dict_table_get_first_index(table);
|
||||
index != NULL;
|
||||
index = dict_table_get_next_index(index)) {
|
||||
rw_lock_x_lock(dict_index_get_lock(index));
|
||||
}
|
||||
}
|
||||
|
||||
/*********************************************************************//**
|
||||
Release the exclusive locks on all index tree. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
dict_table_x_unlock_indexes(
|
||||
/*========================*/
|
||||
dict_table_t* table) /*!< in: table */
|
||||
{
|
||||
dict_index_t* index;
|
||||
|
||||
ut_a(table);
|
||||
ut_ad(mutex_own(&(dict_sys->mutex)));
|
||||
|
||||
for (index = dict_table_get_first_index(table);
|
||||
index != NULL;
|
||||
index = dict_table_get_next_index(index)) {
|
||||
rw_lock_x_unlock(dict_index_get_lock(index));
|
||||
}
|
||||
}
|
||||
/********************************************************************//**
|
||||
Gets the number of fields in the internal representation of an index,
|
||||
including fields added by the dictionary system.
|
||||
|
|
|
|||
|
|
@ -289,7 +289,7 @@ amount of increment. */
|
|||
Returns the old value of *ptr, atomically sets *ptr to new_val */
|
||||
|
||||
# define os_atomic_test_and_set_byte(ptr, new_val) \
|
||||
__sync_lock_test_and_set(ptr, new_val)
|
||||
__sync_lock_test_and_set(ptr, (byte) new_val)
|
||||
|
||||
#elif defined(HAVE_IB_SOLARIS_ATOMICS)
|
||||
|
||||
|
|
|
|||
|
|
@ -806,8 +806,6 @@ rec_print(
|
|||
dict_index_t* index); /*!< in: record descriptor */
|
||||
#endif /* UNIV_HOTBACKUP */
|
||||
|
||||
#define REC_INFO_BITS 6 /* This is single byte bit-field */
|
||||
|
||||
/* Maximum lengths for the data in a physical record if the offsets
|
||||
are given in one byte (resp. two byte) format. */
|
||||
#define REC_1BYTE_OFFS_LIMIT 0x7FUL
|
||||
|
|
|
|||
|
|
@ -225,6 +225,8 @@ extern ulong srv_thread_sleep_delay;
|
|||
extern ulong srv_spin_wait_delay;
|
||||
extern ibool srv_priority_boost;
|
||||
|
||||
extern ulint srv_truncated_status_writes;
|
||||
|
||||
extern ulint srv_mem_pool_size;
|
||||
extern ulint srv_lock_table_size;
|
||||
|
||||
|
|
@ -710,11 +712,12 @@ struct export_var_struct{
|
|||
ulint innodb_rows_inserted; /*!< srv_n_rows_inserted */
|
||||
ulint innodb_rows_updated; /*!< srv_n_rows_updated */
|
||||
ulint innodb_rows_deleted; /*!< srv_n_rows_deleted */
|
||||
ulint innodb_truncated_status_writes; /*!< srv_truncated_status_writes */
|
||||
};
|
||||
|
||||
/** Thread slot in the thread table */
|
||||
typedef struct srv_slot_struct srv_slot_t;
|
||||
|
||||
|
||||
/** Thread table is an array of slots */
|
||||
typedef srv_slot_t srv_table_t;
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ Created 1/20/1994 Heikki Tuuri
|
|||
|
||||
#define INNODB_VERSION_MAJOR 1
|
||||
#define INNODB_VERSION_MINOR 1
|
||||
#define INNODB_VERSION_BUGFIX 2
|
||||
#define INNODB_VERSION_BUGFIX 3
|
||||
|
||||
/* The following is the InnoDB version as shown in
|
||||
SELECT plugin_version FROM information_schema.plugins;
|
||||
|
|
@ -78,19 +78,6 @@ the virtual method table (vtable) in GCC 3. */
|
|||
# define ha_innobase ha_innodb
|
||||
#endif /* MYSQL_DYNAMIC_PLUGIN */
|
||||
|
||||
/* if any of the following macros is defined at this point this means
|
||||
that the code from the "right" plug.in was executed and we do not
|
||||
need to include ut0auxconf.h which would either define the same macros
|
||||
or will be empty */
|
||||
#if !defined(HAVE_IB_GCC_ATOMIC_BUILTINS) \
|
||||
&& !defined(HAVE_IB_ATOMIC_PTHREAD_T_GCC) \
|
||||
&& !defined(HAVE_IB_SOLARIS_ATOMICS) \
|
||||
&& !defined(HAVE_IB_ATOMIC_PTHREAD_T_SOLARIS) \
|
||||
&& !defined(SIZEOF_PTHREAD_T) \
|
||||
&& !defined(HAVE_IB_PAUSE_INSTRUCTION)
|
||||
# include "ut0auxconf.h"
|
||||
#endif
|
||||
|
||||
#if (defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)) && !defined(MYSQL_SERVER) && !defined(__WIN__)
|
||||
# undef __WIN__
|
||||
# define __WIN__
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
/* Do not remove this file even though it is empty.
|
||||
This file is included in univ.i and will cause compilation failure
|
||||
if not present.
|
||||
A custom checks have been added in the generated
|
||||
storage/innobase/Makefile.in that is shipped with the InnoDB Plugin
|
||||
source archive. These checks eventually define some macros and put
|
||||
them in this file.
|
||||
This is a hack that has been developed in order to deploy new compile
|
||||
time checks without the need to regenerate the ./configure script that is
|
||||
distributed in the MySQL 5.1 official source archives.
|
||||
If by any chance Makefile.in and ./configure are regenerated and thus
|
||||
the hack from Makefile.in wiped away then the "real" checks from plug.in
|
||||
will take over.
|
||||
*/
|
||||
|
|
@ -53,7 +53,7 @@ Created 2007-03-20 Sunny Bains
|
|||
/* Red black tree typedefs */
|
||||
typedef struct ib_rbt_struct ib_rbt_t;
|
||||
typedef struct ib_rbt_node_struct ib_rbt_node_t;
|
||||
// FIXME: Iterator is a better name than _bound_
|
||||
/* FIXME: Iterator is a better name than _bound_ */
|
||||
typedef struct ib_rbt_bound_struct ib_rbt_bound_t;
|
||||
typedef void (*ib_rbt_print_node)(const ib_rbt_node_t* node);
|
||||
typedef int (*ib_rbt_compare)(const void* p1, const void* p2);
|
||||
|
|
|
|||
|
|
@ -85,9 +85,6 @@ ut_rnd_gen_ulint(void)
|
|||
/*==================*/
|
||||
{
|
||||
ulint rnd;
|
||||
ulint n_bits;
|
||||
|
||||
n_bits = 8 * sizeof(ulint);
|
||||
|
||||
ut_rnd_ulint_counter = UT_RND1 * ut_rnd_ulint_counter + UT_RND2;
|
||||
|
||||
|
|
|
|||
|
|
@ -569,10 +569,8 @@ recv_synchronize_groups(
|
|||
ib_uint64_t start_lsn;
|
||||
ib_uint64_t end_lsn;
|
||||
ib_uint64_t recovered_lsn;
|
||||
ib_uint64_t limit_lsn;
|
||||
|
||||
recovered_lsn = recv_sys->recovered_lsn;
|
||||
limit_lsn = recv_sys->limit_lsn;
|
||||
|
||||
/* Read the last recovered log block to the recovery system buffer:
|
||||
the block is always incomplete */
|
||||
|
|
@ -1659,12 +1657,8 @@ recv_recover_page_func(
|
|||
|
||||
#ifndef UNIV_HOTBACKUP
|
||||
if (modification_to_page) {
|
||||
buf_pool_t* buf_pool;
|
||||
|
||||
ut_a(block);
|
||||
|
||||
buf_pool = buf_pool_from_block(block);
|
||||
|
||||
log_flush_order_mutex_enter();
|
||||
buf_flush_recv_note_modification(block, start_lsn, end_lsn);
|
||||
log_flush_order_mutex_exit();
|
||||
|
|
@ -2908,7 +2902,9 @@ recv_recovery_from_checkpoint_start_func(
|
|||
ib_uint64_t old_scanned_lsn;
|
||||
ib_uint64_t group_scanned_lsn;
|
||||
ib_uint64_t contiguous_lsn;
|
||||
#ifdef UNIV_LOG_ARCHIVE
|
||||
ib_uint64_t archived_lsn;
|
||||
#endif /* UNIV_LOG_ARCHIVE */
|
||||
byte* buf;
|
||||
byte log_hdr_buf[LOG_FILE_HDR_SIZE];
|
||||
ulint err;
|
||||
|
|
@ -2963,7 +2959,9 @@ recv_recovery_from_checkpoint_start_func(
|
|||
|
||||
checkpoint_lsn = mach_read_from_8(buf + LOG_CHECKPOINT_LSN);
|
||||
checkpoint_no = mach_read_from_8(buf + LOG_CHECKPOINT_NO);
|
||||
#ifdef UNIV_LOG_ARCHIVE
|
||||
archived_lsn = mach_read_from_8(buf + LOG_CHECKPOINT_ARCHIVED_LSN);
|
||||
#endif /* UNIV_LOG_ARCHIVE */
|
||||
|
||||
/* Read the first log file header to print a note if this is
|
||||
a recovery from a restored InnoDB Hot Backup */
|
||||
|
|
|
|||
|
|
@ -1482,8 +1482,6 @@ try_again:
|
|||
int create_flag;
|
||||
ibool retry;
|
||||
const char* mode_str = NULL;
|
||||
const char* type_str = NULL;
|
||||
const char* purpose_str = NULL;
|
||||
|
||||
try_again:
|
||||
ut_a(name);
|
||||
|
|
@ -1503,26 +1501,9 @@ try_again:
|
|||
ut_error;
|
||||
}
|
||||
|
||||
if (type == OS_LOG_FILE) {
|
||||
type_str = "LOG";
|
||||
} else if (type == OS_DATA_FILE) {
|
||||
type_str = "DATA";
|
||||
} else {
|
||||
ut_error;
|
||||
}
|
||||
ut_a(type == OS_LOG_FILE || type == OS_DATA_FILE);
|
||||
ut_a(purpose == OS_FILE_AIO || purpose == OS_FILE_NORMAL);
|
||||
|
||||
if (purpose == OS_FILE_AIO) {
|
||||
purpose_str = "AIO";
|
||||
} else if (purpose == OS_FILE_NORMAL) {
|
||||
purpose_str = "NORMAL";
|
||||
} else {
|
||||
ut_error;
|
||||
}
|
||||
|
||||
#if 0
|
||||
fprintf(stderr, "Opening file %s, mode %s, type %s, purpose %s\n",
|
||||
name, mode_str, type_str, purpose_str);
|
||||
#endif
|
||||
#ifdef O_SYNC
|
||||
/* We let O_SYNC only affect log files; note that we map O_DSYNC to
|
||||
O_SYNC because the datasync options seemed to corrupt files in 2001
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
#
|
||||
|
||||
MYSQL_STORAGE_ENGINE(innobase, innodb, [InnoDB Storage Engine],
|
||||
[Transactional Tables using InnoDB], [max,max-no-ndb])
|
||||
[Transactional Tables using InnoDB], [default,max,max-no-ndb])
|
||||
MYSQL_PLUGIN_DIRECTORY(innobase, [storage/innobase])
|
||||
MYSQL_PLUGIN_STATIC(innobase, [libinnobase.a])
|
||||
MYSQL_PLUGIN_DYNAMIC(innobase, [ha_innodb.la])
|
||||
|
|
|
|||
|
|
@ -1283,18 +1283,13 @@ que_run_threads_low(
|
|||
que_thr_t* thr) /*!< in: query thread */
|
||||
{
|
||||
que_thr_t* next_thr;
|
||||
ulint cumul_resource;
|
||||
ulint loop_count;
|
||||
|
||||
ut_ad(thr->state == QUE_THR_RUNNING);
|
||||
ut_a(thr_get_trx(thr)->error_state == DB_SUCCESS);
|
||||
ut_ad(!mutex_own(&kernel_mutex));
|
||||
|
||||
/* cumul_resource counts how much resources the OS thread (NOT the
|
||||
query thread) has spent in this function */
|
||||
|
||||
loop_count = QUE_MAX_LOOPS_WITHOUT_CHECK;
|
||||
cumul_resource = 0;
|
||||
loop:
|
||||
/* Check that there is enough space in the log to accommodate
|
||||
possible log entries by this query step; if the operation can touch
|
||||
|
|
|
|||
|
|
@ -1481,7 +1481,12 @@ run_again:
|
|||
srv_n_rows_updated++;
|
||||
}
|
||||
|
||||
row_update_statistics_if_needed(prebuilt->table);
|
||||
/* We update table statistics only if it is a DELETE or UPDATE
|
||||
that changes indexed columns, UPDATEs that change only non-indexed
|
||||
columns would not affect statistics. */
|
||||
if (node->is_delete || !(node->cmpl_info & UPD_NODE_NO_ORD_CHANGE)) {
|
||||
row_update_statistics_if_needed(prebuilt->table);
|
||||
}
|
||||
|
||||
trx->op_info = "";
|
||||
|
||||
|
|
@ -2808,6 +2813,15 @@ row_truncate_table_for_mysql(
|
|||
|
||||
trx->table_id = table->id;
|
||||
|
||||
/* Lock all index trees for this table, as we will
|
||||
truncate the table/index and possibly change their metadata.
|
||||
All DML/DDL are blocked by table level lock, with
|
||||
a few exceptions such as queries into information schema
|
||||
about the table, MySQL could try to access index stats
|
||||
for this kind of query, we need to use index locks to
|
||||
sync up */
|
||||
dict_table_x_lock_indexes(table);
|
||||
|
||||
if (table->space && !table->dir_path_of_temp_table) {
|
||||
/* Discard and create the single-table tablespace. */
|
||||
ulint space = table->space;
|
||||
|
|
@ -2824,6 +2838,7 @@ row_truncate_table_for_mysql(
|
|||
|| fil_create_new_single_table_tablespace(
|
||||
space, table->name, FALSE, flags,
|
||||
FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) {
|
||||
dict_table_x_unlock_indexes(table);
|
||||
ut_print_timestamp(stderr);
|
||||
fprintf(stderr,
|
||||
" InnoDB: TRUNCATE TABLE %s failed to"
|
||||
|
|
@ -2927,6 +2942,10 @@ next_rec:
|
|||
|
||||
mem_heap_free(heap);
|
||||
|
||||
/* Done with index truncation, release index tree locks,
|
||||
subsequent work relates to table level metadata change */
|
||||
dict_table_x_unlock_indexes(table);
|
||||
|
||||
dict_hdr_get_new_id(&new_id, NULL, NULL);
|
||||
|
||||
info = pars_info_create();
|
||||
|
|
|
|||
|
|
@ -786,7 +786,9 @@ row_purge_step(
|
|||
que_thr_t* thr) /*!< in: query thread */
|
||||
{
|
||||
purge_node_t* node;
|
||||
#ifdef UNIV_DEBUG
|
||||
ulint err;
|
||||
#endif /* UNIV_DEBUG */
|
||||
|
||||
ut_ad(thr);
|
||||
|
||||
|
|
@ -794,7 +796,10 @@ row_purge_step(
|
|||
|
||||
ut_ad(que_node_get_type(node) == QUE_NODE_PURGE);
|
||||
|
||||
err = row_purge(node, thr);
|
||||
#ifdef UNIV_DEBUG
|
||||
err =
|
||||
#endif /* UNIV_DEBUG */
|
||||
row_purge(node, thr);
|
||||
|
||||
ut_ad(err == DB_SUCCESS);
|
||||
|
||||
|
|
|
|||
|
|
@ -3711,6 +3711,42 @@ release_search_latch_if_needed:
|
|||
|
||||
clust_index = dict_table_get_first_index(index->table);
|
||||
|
||||
/* Do some start-of-statement preparations */
|
||||
|
||||
if (!prebuilt->sql_stat_start) {
|
||||
/* No need to set an intention lock or assign a read view */
|
||||
|
||||
if (trx->read_view == NULL
|
||||
&& prebuilt->select_lock_type == LOCK_NONE) {
|
||||
|
||||
fputs("InnoDB: Error: MySQL is trying to"
|
||||
" perform a consistent read\n"
|
||||
"InnoDB: but the read view is not assigned!\n",
|
||||
stderr);
|
||||
trx_print(stderr, trx, 600);
|
||||
fputc('\n', stderr);
|
||||
ut_error;
|
||||
}
|
||||
} else if (prebuilt->select_lock_type == LOCK_NONE) {
|
||||
/* This is a consistent read */
|
||||
/* Assign a read view for the query */
|
||||
|
||||
trx_assign_read_view(trx);
|
||||
prebuilt->sql_stat_start = FALSE;
|
||||
} else {
|
||||
err = lock_table(0, index->table,
|
||||
prebuilt->select_lock_type == LOCK_S
|
||||
? LOCK_IS : LOCK_IX, thr);
|
||||
|
||||
if (err != DB_SUCCESS) {
|
||||
|
||||
goto lock_wait_or_error;
|
||||
}
|
||||
prebuilt->sql_stat_start = FALSE;
|
||||
}
|
||||
|
||||
/* Open or restore index cursor position */
|
||||
|
||||
if (UNIV_LIKELY(direction != 0)) {
|
||||
ibool need_to_process = sel_restore_position_for_mysql(
|
||||
&same_user_rec, BTR_SEARCH_LEAF,
|
||||
|
|
@ -3786,42 +3822,6 @@ release_search_latch_if_needed:
|
|||
}
|
||||
}
|
||||
|
||||
if (!prebuilt->sql_stat_start) {
|
||||
/* No need to set an intention lock or assign a read view */
|
||||
|
||||
if (trx->read_view == NULL
|
||||
&& prebuilt->select_lock_type == LOCK_NONE) {
|
||||
|
||||
fputs("InnoDB: Error: MySQL is trying to"
|
||||
" perform a consistent read\n"
|
||||
"InnoDB: but the read view is not assigned!\n",
|
||||
stderr);
|
||||
trx_print(stderr, trx, 600);
|
||||
fputc('\n', stderr);
|
||||
ut_a(0);
|
||||
}
|
||||
} else if (prebuilt->select_lock_type == LOCK_NONE) {
|
||||
/* This is a consistent read */
|
||||
/* Assign a read view for the query */
|
||||
|
||||
trx_assign_read_view(trx);
|
||||
prebuilt->sql_stat_start = FALSE;
|
||||
} else {
|
||||
ulint lock_mode;
|
||||
if (prebuilt->select_lock_type == LOCK_S) {
|
||||
lock_mode = LOCK_IS;
|
||||
} else {
|
||||
lock_mode = LOCK_IX;
|
||||
}
|
||||
err = lock_table(0, index->table, lock_mode, thr);
|
||||
|
||||
if (err != DB_SUCCESS) {
|
||||
|
||||
goto lock_wait_or_error;
|
||||
}
|
||||
prebuilt->sql_stat_start = FALSE;
|
||||
}
|
||||
|
||||
rec_loop:
|
||||
/*-------------------------------------------------------------*/
|
||||
/* PHASE 4: Look for matching records in a loop */
|
||||
|
|
|
|||
|
|
@ -114,12 +114,17 @@ row_undo_mod_clust_low(
|
|||
btr_pcur_t* pcur;
|
||||
btr_cur_t* btr_cur;
|
||||
ulint err;
|
||||
#ifdef UNIV_DEBUG
|
||||
ibool success;
|
||||
#endif /* UNIV_DEBUG */
|
||||
|
||||
pcur = &(node->pcur);
|
||||
btr_cur = btr_pcur_get_btr_cur(pcur);
|
||||
|
||||
success = btr_pcur_restore_position(mode, pcur, mtr);
|
||||
#ifdef UNIV_DEBUG
|
||||
success =
|
||||
#endif /* UNIV_DEBUG */
|
||||
btr_pcur_restore_position(mode, pcur, mtr);
|
||||
|
||||
ut_ad(success);
|
||||
|
||||
|
|
|
|||
|
|
@ -1626,6 +1626,7 @@ row_upd_clust_rec_by_insert(
|
|||
dict_table_t* table;
|
||||
dtuple_t* entry;
|
||||
ulint err;
|
||||
ibool change_ownership = FALSE;
|
||||
|
||||
ut_ad(node);
|
||||
ut_ad(dict_index_is_clust(index));
|
||||
|
|
@ -1658,10 +1659,11 @@ row_upd_clust_rec_by_insert(
|
|||
index = dict_table_get_first_index(table);
|
||||
offsets = rec_get_offsets(rec, index, offsets_,
|
||||
ULINT_UNDEFINED, &heap);
|
||||
btr_cur_mark_extern_inherited_fields(
|
||||
change_ownership = btr_cur_mark_extern_inherited_fields(
|
||||
btr_cur_get_page_zip(btr_cur),
|
||||
rec, index, offsets, node->update, mtr);
|
||||
if (referenced) {
|
||||
|
||||
/* NOTE that the following call loses
|
||||
the position of pcur ! */
|
||||
|
||||
|
|
@ -1694,10 +1696,11 @@ row_upd_clust_rec_by_insert(
|
|||
|
||||
row_upd_index_entry_sys_field(entry, index, DATA_TRX_ID, trx->id);
|
||||
|
||||
if (node->upd_ext) {
|
||||
if (change_ownership) {
|
||||
/* If we return from a lock wait, for example, we may have
|
||||
extern fields marked as not-owned in entry (marked in the
|
||||
if-branch above). We must unmark them. */
|
||||
if-branch above). We must unmark them, take the ownership
|
||||
back. */
|
||||
|
||||
btr_cur_unmark_dtuple_extern_fields(entry);
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,9 @@ row_vers_impl_x_locked_off_kernel(
|
|||
warning */
|
||||
trx_t* trx;
|
||||
ulint rec_del;
|
||||
#ifdef UNIV_DEBUG
|
||||
ulint err;
|
||||
#endif /* UNIV_DEBUG */
|
||||
mtr_t mtr;
|
||||
ulint comp;
|
||||
|
||||
|
|
@ -169,9 +171,12 @@ row_vers_impl_x_locked_off_kernel(
|
|||
|
||||
heap2 = heap;
|
||||
heap = mem_heap_create(1024);
|
||||
err = trx_undo_prev_version_build(clust_rec, &mtr, version,
|
||||
clust_index, clust_offsets,
|
||||
heap, &prev_version);
|
||||
#ifdef UNIV_DEBUG
|
||||
err =
|
||||
#endif /* UNIV_DEBUG */
|
||||
trx_undo_prev_version_build(clust_rec, &mtr, version,
|
||||
clust_index, clust_offsets,
|
||||
heap, &prev_version);
|
||||
mem_heap_free(heap2); /* free version and clust_offsets */
|
||||
|
||||
if (prev_version == NULL) {
|
||||
|
|
|
|||
|
|
@ -84,6 +84,8 @@ Created 10/8/1995 Heikki Tuuri
|
|||
#include "ha_prototypes.h"
|
||||
#include "trx0i_s.h"
|
||||
#include "os0sync.h" /* for HAVE_ATOMIC_BUILTINS */
|
||||
#include "mysql/plugin.h"
|
||||
#include "mysql/service_thd_wait.h"
|
||||
|
||||
/* This is set to TRUE if the MySQL user has set it in MySQL; currently
|
||||
affects only FOREIGN KEY definition parsing */
|
||||
|
|
@ -422,6 +424,7 @@ UNIV_INTERN ulint srv_n_lock_wait_current_count = 0;
|
|||
UNIV_INTERN ib_int64_t srv_n_lock_wait_time = 0;
|
||||
UNIV_INTERN ulint srv_n_lock_max_wait_time = 0;
|
||||
|
||||
UNIV_INTERN ulint srv_truncated_status_writes = 0;
|
||||
|
||||
/*
|
||||
Set the following to 0 if you want InnoDB to write messages on
|
||||
|
|
@ -1232,7 +1235,9 @@ retry:
|
|||
|
||||
trx->op_info = "waiting in InnoDB queue";
|
||||
|
||||
thd_wait_begin(trx->mysql_thd, THD_WAIT_ROW_TABLE_LOCK);
|
||||
os_event_wait(slot->event);
|
||||
thd_wait_end(trx->mysql_thd);
|
||||
|
||||
trx->op_info = "";
|
||||
|
||||
|
|
@ -1609,7 +1614,9 @@ srv_suspend_mysql_thread(
|
|||
|
||||
/* Suspend this thread and wait for the event. */
|
||||
|
||||
thd_wait_begin(trx->mysql_thd, THD_WAIT_ROW_TABLE_LOCK);
|
||||
os_event_wait(event);
|
||||
thd_wait_end(trx->mysql_thd);
|
||||
|
||||
/* After resuming, reacquire the data dictionary latch if
|
||||
necessary. */
|
||||
|
|
@ -2026,6 +2033,7 @@ srv_export_innodb_status(void)
|
|||
export_vars.innodb_rows_inserted = srv_n_rows_inserted;
|
||||
export_vars.innodb_rows_updated = srv_n_rows_updated;
|
||||
export_vars.innodb_rows_deleted = srv_n_rows_deleted;
|
||||
export_vars.innodb_truncated_status_writes = srv_truncated_status_writes;
|
||||
|
||||
mutex_exit(&srv_innodb_monitor_mutex);
|
||||
}
|
||||
|
|
@ -2631,7 +2639,9 @@ loop:
|
|||
when there is database activity */
|
||||
|
||||
srv_last_log_flush_time = time(NULL);
|
||||
next_itr_time = ut_time_ms();
|
||||
|
||||
/* Sleep for 1 second on entrying the for loop below the first time. */
|
||||
next_itr_time = ut_time_ms() + 1000;
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
ulint cur_time = ut_time_ms();
|
||||
|
|
|
|||
|
|
@ -313,9 +313,10 @@ trx_purge_add_update_undo_to_history(
|
|||
trx_undo_t* undo;
|
||||
trx_rseg_t* rseg;
|
||||
trx_rsegf_t* rseg_header;
|
||||
#ifdef UNIV_DEBUG
|
||||
trx_usegf_t* seg_header;
|
||||
#endif /* UNIV_DEBUG */
|
||||
trx_ulogf_t* undo_header;
|
||||
trx_upagef_t* page_header;
|
||||
ulint hist_size;
|
||||
|
||||
undo = trx->update_undo;
|
||||
|
|
@ -330,8 +331,9 @@ trx_purge_add_update_undo_to_history(
|
|||
rseg->page_no, mtr);
|
||||
|
||||
undo_header = undo_page + undo->hdr_offset;
|
||||
#ifdef UNIV_DEBUG
|
||||
seg_header = undo_page + TRX_UNDO_SEG_HDR;
|
||||
page_header = undo_page + TRX_UNDO_PAGE_HDR;
|
||||
#endif /* UNIV_DEBUG */
|
||||
|
||||
if (undo->state != TRX_UNDO_CACHED) {
|
||||
/* The undo log segment will not be reused */
|
||||
|
|
@ -669,7 +671,6 @@ trx_purge_rseg_get_next_history_log(
|
|||
{
|
||||
page_t* undo_page;
|
||||
trx_ulogf_t* log_hdr;
|
||||
trx_usegf_t* seg_hdr;
|
||||
fil_addr_t prev_log_addr;
|
||||
trx_id_t trx_no;
|
||||
ibool del_marks;
|
||||
|
|
@ -690,7 +691,6 @@ trx_purge_rseg_get_next_history_log(
|
|||
undo_page = trx_undo_page_get_s_latched(rseg->space, rseg->zip_size,
|
||||
rseg->last_page_no, &mtr);
|
||||
log_hdr = undo_page + rseg->last_offset;
|
||||
seg_hdr = undo_page + TRX_UNDO_SEG_HDR;
|
||||
|
||||
/* Increase the purge page count by one for every handled log */
|
||||
|
||||
|
|
@ -1079,12 +1079,8 @@ trx_purge_rec_release(
|
|||
/*==================*/
|
||||
trx_undo_inf_t* cell) /*!< in: storage cell */
|
||||
{
|
||||
trx_undo_arr_t* arr;
|
||||
|
||||
mutex_enter(&(purge_sys->mutex));
|
||||
|
||||
arr = purge_sys->arr;
|
||||
|
||||
trx_purge_arr_remove_info(cell);
|
||||
|
||||
mutex_exit(&(purge_sys->mutex));
|
||||
|
|
|
|||
|
|
@ -743,13 +743,8 @@ trx_undo_arr_remove_info(
|
|||
undo_no_t undo_no)/*!< in: undo number */
|
||||
{
|
||||
trx_undo_inf_t* cell;
|
||||
ulint n_used;
|
||||
ulint n;
|
||||
ulint i;
|
||||
|
||||
n_used = arr->n_used;
|
||||
n = 0;
|
||||
|
||||
for (i = 0;; i++) {
|
||||
cell = trx_undo_arr_get_nth_info(arr, i);
|
||||
|
||||
|
|
|
|||
|
|
@ -249,7 +249,9 @@ trx_sys_create_doublewrite_buf(void)
|
|||
{
|
||||
buf_block_t* block;
|
||||
buf_block_t* block2;
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_block_t* new_block;
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
byte* doublewrite;
|
||||
byte* fseg_header;
|
||||
ulint page_no;
|
||||
|
|
@ -352,8 +354,11 @@ start_again:
|
|||
the page position in the tablespace, then the page
|
||||
has not been written to in doublewrite. */
|
||||
|
||||
new_block = buf_page_get(TRX_SYS_SPACE, 0, page_no,
|
||||
RW_X_LATCH, &mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
new_block =
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
buf_page_get(TRX_SYS_SPACE, 0, page_no,
|
||||
RW_X_LATCH, &mtr);
|
||||
buf_block_dbg_add_level(new_block,
|
||||
SYNC_NO_ORDER_CHECK);
|
||||
|
||||
|
|
|
|||
|
|
@ -1798,7 +1798,6 @@ trx_prepare_off_kernel(
|
|||
/*===================*/
|
||||
trx_t* trx) /*!< in: transaction */
|
||||
{
|
||||
page_t* update_hdr_page;
|
||||
trx_rseg_t* rseg;
|
||||
ib_uint64_t lsn = 0;
|
||||
mtr_t mtr;
|
||||
|
|
@ -1831,7 +1830,7 @@ trx_prepare_off_kernel(
|
|||
}
|
||||
|
||||
if (trx->update_undo) {
|
||||
update_hdr_page = trx_undo_set_state_at_prepare(
|
||||
trx_undo_set_state_at_prepare(
|
||||
trx, trx->update_undo, &mtr);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1072,14 +1072,11 @@ trx_undo_truncate_end(
|
|||
ulint last_page_no;
|
||||
trx_undo_rec_t* rec;
|
||||
trx_undo_rec_t* trunc_here;
|
||||
trx_rseg_t* rseg;
|
||||
mtr_t mtr;
|
||||
|
||||
ut_ad(mutex_own(&(trx->undo_mutex)));
|
||||
ut_ad(mutex_own(&(trx->rseg->mutex)));
|
||||
|
||||
rseg = trx->rseg;
|
||||
|
||||
for (;;) {
|
||||
mtr_start(&mtr);
|
||||
|
||||
|
|
@ -1873,7 +1870,6 @@ trx_undo_set_state_at_prepare(
|
|||
mtr_t* mtr) /*!< in: mtr */
|
||||
{
|
||||
trx_usegf_t* seg_hdr;
|
||||
trx_upagef_t* page_hdr;
|
||||
trx_ulogf_t* undo_header;
|
||||
page_t* undo_page;
|
||||
ulint offset;
|
||||
|
|
@ -1891,7 +1887,6 @@ trx_undo_set_state_at_prepare(
|
|||
undo->hdr_page_no, mtr);
|
||||
|
||||
seg_hdr = undo_page + TRX_UNDO_SEG_HDR;
|
||||
page_hdr = undo_page + TRX_UNDO_PAGE_HDR;
|
||||
|
||||
/*------------------------------*/
|
||||
undo->state = TRX_UNDO_PREPARED;
|
||||
|
|
|
|||
|
|
@ -1,43 +0,0 @@
|
|||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 2009, Innobase Oy. 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
|
||||
Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
If this program compiles, then pthread_t objects can be used as arguments
|
||||
to GCC atomic builtin functions.
|
||||
|
||||
Created March 5, 2009 Vasil Dimov
|
||||
*****************************************************************************/
|
||||
|
||||
#include <pthread.h>
|
||||
#include <string.h>
|
||||
|
||||
int
|
||||
main(int argc, char** argv)
|
||||
{
|
||||
pthread_t x1;
|
||||
pthread_t x2;
|
||||
pthread_t x3;
|
||||
|
||||
memset(&x1, 0x0, sizeof(x1));
|
||||
memset(&x2, 0x0, sizeof(x2));
|
||||
memset(&x3, 0x0, sizeof(x3));
|
||||
|
||||
__sync_bool_compare_and_swap(&x1, x2, x3);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 2009, Innobase Oy. 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
|
||||
Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
If this program compiles and returns 0, then pthread_t objects can be used as
|
||||
arguments to Solaris libc atomic functions.
|
||||
|
||||
Created April 18, 2009 Vasil Dimov
|
||||
*****************************************************************************/
|
||||
|
||||
#include <pthread.h>
|
||||
#include <string.h>
|
||||
|
||||
int
|
||||
main(int argc, char** argv)
|
||||
{
|
||||
pthread_t x1;
|
||||
pthread_t x2;
|
||||
pthread_t x3;
|
||||
|
||||
memset(&x1, 0x0, sizeof(x1));
|
||||
memset(&x2, 0x0, sizeof(x2));
|
||||
memset(&x3, 0x0, sizeof(x3));
|
||||
|
||||
if (sizeof(pthread_t) == 4) {
|
||||
|
||||
atomic_cas_32(&x1, x2, x3);
|
||||
|
||||
} else if (sizeof(pthread_t) == 8) {
|
||||
|
||||
atomic_cas_64(&x1, x2, x3);
|
||||
|
||||
} else {
|
||||
|
||||
return(1);
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 2009, Innobase Oy. 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
|
||||
Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
If this program compiles and returns 0, then GCC atomic funcions are available.
|
||||
|
||||
Created September 12, 2009 Vasil Dimov
|
||||
*****************************************************************************/
|
||||
|
||||
int
|
||||
main(int argc, char** argv)
|
||||
{
|
||||
long x;
|
||||
long y;
|
||||
long res;
|
||||
char c;
|
||||
|
||||
x = 10;
|
||||
y = 123;
|
||||
res = __sync_bool_compare_and_swap(&x, x, y);
|
||||
if (!res || x != y) {
|
||||
return(1);
|
||||
}
|
||||
|
||||
x = 10;
|
||||
y = 123;
|
||||
res = __sync_bool_compare_and_swap(&x, x + 1, y);
|
||||
if (res || x != 10) {
|
||||
return(1);
|
||||
}
|
||||
|
||||
x = 10;
|
||||
y = 123;
|
||||
res = __sync_add_and_fetch(&x, y);
|
||||
if (res != 123 + 10 || x != 123 + 10) {
|
||||
return(1);
|
||||
}
|
||||
|
||||
c = 10;
|
||||
res = __sync_lock_test_and_set(&c, 123);
|
||||
if (res != 10 || c != 123) {
|
||||
return(1);
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 2009, Innobase Oy. 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
|
||||
Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
If this program compiles, then Solaris libc atomic funcions are available.
|
||||
|
||||
Created April 18, 2009 Vasil Dimov
|
||||
*****************************************************************************/
|
||||
#include <atomic.h>
|
||||
|
||||
int
|
||||
main(int argc, char** argv)
|
||||
{
|
||||
ulong_t ulong = 0;
|
||||
uint32_t uint32 = 0;
|
||||
uint64_t uint64 = 0;
|
||||
|
||||
atomic_cas_ulong(&ulong, 0, 1);
|
||||
atomic_cas_32(&uint32, 0, 1);
|
||||
atomic_cas_64(&uint64, 0, 1);
|
||||
atomic_add_long(&ulong, 0);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 2009, Innobase Oy. 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
|
||||
Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
If this program compiles and can be run and returns 0, then the pause
|
||||
instruction is available.
|
||||
|
||||
Created Jul 21, 2009 Vasil Dimov
|
||||
*****************************************************************************/
|
||||
|
||||
int
|
||||
main(int argc, char** argv)
|
||||
{
|
||||
__asm__ __volatile__ ("pause");
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 2009, Innobase Oy. 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
|
||||
Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
This program should compile and when run, print a single line like:
|
||||
#define SIZEOF_PTHREAD_T %d
|
||||
|
||||
Created April 18, 2009 Vasil Dimov
|
||||
*****************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <pthread.h>
|
||||
|
||||
int
|
||||
main(int argc, char** argv)
|
||||
{
|
||||
printf("#define SIZEOF_PTHREAD_T %d\n", (int) sizeof(pthread_t));
|
||||
|
||||
return(0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue