1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

Merge mysql-5.5-innodb -> mysql-5.5-bugteam

This commit is contained in:
Vasil Dimov
2010-10-01 16:36:35 +03:00
51 changed files with 216 additions and 2734 deletions

View File

@@ -109,20 +109,13 @@ Database: information_schema
| TRIGGERS | | TRIGGERS |
| USER_PRIVILEGES | | USER_PRIVILEGES |
| VIEWS | | VIEWS |
| INNODB_SYS_FIELDS |
| INNODB_TRX |
| INNODB_SYS_INDEXES |
| INNODB_LOCK_WAITS |
| INNODB_SYS_TABLESTATS |
| INNODB_CMP |
| INNODB_SYS_COLUMNS |
| INNODB_CMP_RESET | | INNODB_CMP_RESET |
| INNODB_SYS_FOREIGN_COLS | | INNODB_TRX |
| INNODB_LOCKS |
| INNODB_CMPMEM_RESET | | INNODB_CMPMEM_RESET |
| INNODB_LOCK_WAITS |
| INNODB_CMPMEM | | INNODB_CMPMEM |
| INNODB_SYS_FOREIGN | | INNODB_CMP |
| INNODB_SYS_TABLES | | INNODB_LOCKS |
+---------------------------------------+ +---------------------------------------+
Database: INFORMATION_SCHEMA Database: INFORMATION_SCHEMA
+---------------------------------------+ +---------------------------------------+
@@ -158,20 +151,13 @@ Database: INFORMATION_SCHEMA
| TRIGGERS | | TRIGGERS |
| USER_PRIVILEGES | | USER_PRIVILEGES |
| VIEWS | | VIEWS |
| INNODB_SYS_FIELDS |
| INNODB_TRX |
| INNODB_SYS_INDEXES |
| INNODB_LOCK_WAITS |
| INNODB_SYS_TABLESTATS |
| INNODB_CMP |
| INNODB_SYS_COLUMNS |
| INNODB_CMP_RESET | | INNODB_CMP_RESET |
| INNODB_SYS_FOREIGN_COLS | | INNODB_TRX |
| INNODB_LOCKS |
| INNODB_CMPMEM_RESET | | INNODB_CMPMEM_RESET |
| INNODB_LOCK_WAITS |
| INNODB_CMPMEM | | INNODB_CMPMEM |
| INNODB_SYS_FOREIGN | | INNODB_CMP |
| INNODB_SYS_TABLES | | INNODB_LOCKS |
+---------------------------------------+ +---------------------------------------+
Wildcard: inf_rmation_schema Wildcard: inf_rmation_schema
+--------------------+ +--------------------+

View File

@@ -1,110 +0,0 @@
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES;
TABLE_ID NAME FLAG N_COLS SPACE
11 SYS_FOREIGN 0 7 0
12 SYS_FOREIGN_COLS 0 7 0
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES;
INDEX_ID NAME TABLE_ID TYPE N_FIELDS PAGE_NO SPACE
11 ID_IND 11 3 1 302 0
12 FOR_IND 11 0 1 303 0
13 REF_IND 11 0 1 304 0
14 ID_IND 12 3 2 305 0
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS;
TABLE_ID NAME POS MTYPE PRTYPE LEN
11 ID 0 1 524292 0
11 FOR_NAME 1 1 524292 0
11 REF_NAME 2 1 524292 0
11 N_COLS 3 6 0 4
12 ID 0 1 524292 0
12 POS 1 6 0 4
12 FOR_COL_NAME 2 1 524292 0
12 REF_COL_NAME 3 1 524292 0
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FIELDS;
INDEX_ID NAME POS
11 ID 0
12 FOR_NAME 0
13 REF_NAME 0
14 ID 0
14 POS 1
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN;
ID FOR_NAME REF_NAME N_COLS TYPE
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS;
ID FOR_COL_NAME REF_COL_NAME POS
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS;
TABLE_ID NAME STATS_INITIALIZED NUM_ROWS CLUST_INDEX_SIZE OTHER_INDEX_SIZE MODIFIED_COUNTER AUTOINC MYSQL_HANDLES_OPENED
11 SYS_FOREIGN Uninitialized 0 0 0 0 0 0
12 SYS_FOREIGN_COLS Uninitialized 0 0 0 0 0 0
CREATE TABLE parent (id INT NOT NULL,
PRIMARY KEY (id)) ENGINE=INNODB;
CREATE TABLE child (id INT, parent_id INT,
INDEX par_ind (parent_id),
CONSTRAINT constraint_test
FOREIGN KEY (parent_id) REFERENCES parent(id)
ON DELETE CASCADE) ENGINE=INNODB;
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN;
ID FOR_NAME REF_NAME N_COLS TYPE
test/constraint_test test/child test/parent 1 1
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS;
ID FOR_COL_NAME REF_COL_NAME POS
test/constraint_test parent_id id 0
INSERT INTO parent VALUES(1);
SELECT name, num_rows, mysql_handles_opened
FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name LIKE "%parent";
name num_rows mysql_handles_opened
test/parent 1 1
SELECT NAME, FLAG, N_COLS, SPACE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES;
NAME FLAG N_COLS SPACE
SYS_FOREIGN 0 7 0
SYS_FOREIGN_COLS 0 7 0
test/child 1 5 0
test/parent 1 4 0
SELECT name, n_fields
from INFORMATION_SCHEMA.INNODB_SYS_INDEXES
WHERE table_id In (SELECT table_id from
INFORMATION_SCHEMA.INNODB_SYS_TABLES
WHERE name LIKE "%parent%");
name n_fields
PRIMARY 1
SELECT name, n_fields
from INFORMATION_SCHEMA.INNODB_SYS_INDEXES
WHERE table_id In (SELECT table_id from
INFORMATION_SCHEMA.INNODB_SYS_TABLES
WHERE name LIKE "%child%");
name n_fields
GEN_CLUST_INDEX 0
par_ind 1
SELECT name, pos, mtype, len
from INFORMATION_SCHEMA.INNODB_SYS_COLUMNS
WHERE table_id In (SELECT table_id from
INFORMATION_SCHEMA.INNODB_SYS_TABLES
WHERE name LIKE "%child%");
name pos mtype len
id 0 6 4
parent_id 1 6 4
DROP TABLE child;
DROP TABLE parent;
CREATE TABLE parent (id INT NOT NULL, newid INT NOT NULL,
PRIMARY KEY (id, newid)) ENGINE=INNODB;
CREATE TABLE child (id INT, parent_id INT,
INDEX par_ind (parent_id),
CONSTRAINT constraint_test
FOREIGN KEY (id, parent_id) REFERENCES parent(id, newid)
ON DELETE CASCADE) ENGINE=INNODB;
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN;
ID FOR_NAME REF_NAME N_COLS TYPE
test/constraint_test test/child test/parent 2 1
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS;
ID FOR_COL_NAME REF_COL_NAME POS
test/constraint_test id id 0
test/constraint_test parent_id newid 1
INSERT INTO parent VALUES(1, 9);
SELECT * FROM parent WHERE id IN (SELECT id FROM parent);
id newid
1 9
SELECT name, num_rows, mysql_handles_opened
FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name LIKE "%parent";
name num_rows mysql_handles_opened
test/parent 1 2
DROP TABLE child;
DROP TABLE parent;

View File

@@ -1,3 +0,0 @@
--default-storage-engine=MyISAM
--innodb-strict-mode=0
--innodb-file-per-table=0

View File

@@ -1,94 +0,0 @@
# This is the test for Information Schema System Table View
# that displays the InnoDB system table content through
# information schema tables.
--source include/have_innodb.inc
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES;
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES;
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS;
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FIELDS;
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN;
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS;
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS;
# Create a foreign key constraint, and verify the information
# in INFORMATION_SCHEMA.INNODB_SYS_FOREIGN and
# INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS
CREATE TABLE parent (id INT NOT NULL,
PRIMARY KEY (id)) ENGINE=INNODB;
CREATE TABLE child (id INT, parent_id INT,
INDEX par_ind (parent_id),
CONSTRAINT constraint_test
FOREIGN KEY (parent_id) REFERENCES parent(id)
ON DELETE CASCADE) ENGINE=INNODB;
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN;
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS;
# Insert a row in the table "parent", and see whether that reflected in
# INNODB_SYS_TABLESTATS
INSERT INTO parent VALUES(1);
SELECT name, num_rows, mysql_handles_opened
FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name LIKE "%parent";
SELECT NAME, FLAG, N_COLS, SPACE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES;
SELECT name, n_fields
from INFORMATION_SCHEMA.INNODB_SYS_INDEXES
WHERE table_id In (SELECT table_id from
INFORMATION_SCHEMA.INNODB_SYS_TABLES
WHERE name LIKE "%parent%");
SELECT name, n_fields
from INFORMATION_SCHEMA.INNODB_SYS_INDEXES
WHERE table_id In (SELECT table_id from
INFORMATION_SCHEMA.INNODB_SYS_TABLES
WHERE name LIKE "%child%");
SELECT name, pos, mtype, len
from INFORMATION_SCHEMA.INNODB_SYS_COLUMNS
WHERE table_id In (SELECT table_id from
INFORMATION_SCHEMA.INNODB_SYS_TABLES
WHERE name LIKE "%child%");
DROP TABLE child;
DROP TABLE parent;
# Create table with 2 columns in the foreign key constraint
CREATE TABLE parent (id INT NOT NULL, newid INT NOT NULL,
PRIMARY KEY (id, newid)) ENGINE=INNODB;
CREATE TABLE child (id INT, parent_id INT,
INDEX par_ind (parent_id),
CONSTRAINT constraint_test
FOREIGN KEY (id, parent_id) REFERENCES parent(id, newid)
ON DELETE CASCADE) ENGINE=INNODB;
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN;
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS;
INSERT INTO parent VALUES(1, 9);
# Nested query will open the table handle twice
SELECT * FROM parent WHERE id IN (SELECT id FROM parent);
SELECT name, num_rows, mysql_handles_opened
FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name LIKE "%parent";
DROP TABLE child;
DROP TABLE parent;

View File

@@ -40,12 +40,10 @@ IF(UNIX)
ENDIF() ENDIF()
ENDIF() ENDIF()
# Enable InnoDB's UNIV_DEBUG if MySQL's WITH_DEBUG[_FULL] is defined # Enable InnoDB's UNIV_DEBUG if MySQL's WITH_DEBUG is defined
# enable when this bug is resolved: IF(WITH_DEBUG)
# Bug#54861 Additional connections not handled properly in mtr --embedded ADD_DEFINITIONS("-DUNIV_DEBUG")
#IF(WITH_DEBUG) ENDIF()
# ADD_DEFINITIONS("-DUNIV_DEBUG")
#ENDIF()
IF(NOT MSVC) IF(NOT MSVC)
# either define HAVE_IB_GCC_ATOMIC_BUILTINS or not # either define HAVE_IB_GCC_ATOMIC_BUILTINS or not

View File

@@ -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.

View File

@@ -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.

View File

@@ -565,7 +565,7 @@ RECURSIVE = YES
# excluded from the INPUT source files. This way you can easily exclude a # 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. # 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 # The EXCLUDE_SYMLINKS tag can be used select whether or not files or
# directories that are symbolic links (a Unix filesystem feature) are excluded # directories that are symbolic links (a Unix filesystem feature) are excluded

View File

@@ -207,7 +207,6 @@ noinst_HEADERS= \
include/usr0sess.h \ include/usr0sess.h \
include/usr0sess.ic \ include/usr0sess.ic \
include/usr0types.h \ include/usr0types.h \
include/ut0auxconf.h \
include/ut0byte.h \ include/ut0byte.h \
include/ut0byte.ic \ include/ut0byte.ic \
include/ut0dbg.h \ include/ut0dbg.h \

View File

@@ -603,7 +603,6 @@ btr_page_get_father_node_ptr_func(
ulint line, /*!< in: line where called */ ulint line, /*!< in: line where called */
mtr_t* mtr) /*!< in: mtr */ mtr_t* mtr) /*!< in: mtr */
{ {
page_t* page;
dtuple_t* tuple; dtuple_t* tuple;
rec_t* user_rec; rec_t* user_rec;
rec_t* node_ptr; 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); level = btr_page_get_level(btr_cur_get_page(cursor), mtr);
page = btr_cur_get_page(cursor);
user_rec = btr_cur_get_rec(cursor); user_rec = btr_cur_get_rec(cursor);
ut_a(page_rec_is_user_rec(user_rec)); ut_a(page_rec_is_user_rec(user_rec));
tuple = dict_index_build_node_ptr(index, user_rec, 0, heap, level); 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* left_block;
buf_block_t* right_block; buf_block_t* right_block;
buf_block_t* insert_block; buf_block_t* insert_block;
page_t* insert_page;
page_cur_t* page_cursor; page_cur_t* page_cursor;
rec_t* first_rec; rec_t* first_rec;
byte* buf = 0; /* remove warning */ byte* buf = 0; /* remove warning */
@@ -2157,8 +2154,6 @@ insert_empty:
insert_block = right_block; insert_block = right_block;
} }
insert_page = buf_block_get_frame(insert_block);
/* 7. Reposition the cursor for insert and try insertion */ /* 7. Reposition the cursor for insert and try insertion */
page_cursor = btr_cur_get_page_cur(cursor); page_cursor = btr_cur_get_page_cur(cursor);
@@ -2170,8 +2165,12 @@ insert_empty:
#ifdef UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
{ {
page_t* insert_page
= buf_block_get_frame(insert_block);
page_zip_des_t* insert_page_zip page_zip_des_t* insert_page_zip
= buf_block_get_page_zip(insert_block); = buf_block_get_page_zip(insert_block);
ut_a(!insert_page_zip ut_a(!insert_page_zip
|| page_zip_validate(insert_page_zip, insert_page)); || page_zip_validate(insert_page_zip, insert_page));
} }
@@ -2564,7 +2563,6 @@ btr_compress(
ulint n_recs; ulint n_recs;
ulint max_ins_size; ulint max_ins_size;
ulint max_ins_size_reorg; ulint max_ins_size_reorg;
ulint level;
block = btr_cur_get_block(cursor); block = btr_cur_get_block(cursor);
page = btr_cur_get_page(cursor); page = btr_cur_get_page(cursor);
@@ -2574,7 +2572,6 @@ btr_compress(
ut_ad(mtr_memo_contains(mtr, dict_index_get_lock(index), ut_ad(mtr_memo_contains(mtr, dict_index_get_lock(index),
MTR_MEMO_X_LOCK)); MTR_MEMO_X_LOCK));
ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX)); 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); space = dict_index_get_space(index);
zip_size = dict_table_zip_size(index->table); zip_size = dict_table_zip_size(index->table);

View File

@@ -1954,7 +1954,6 @@ btr_cur_optimistic_update(
page_t* page; page_t* page;
page_zip_des_t* page_zip; page_zip_des_t* page_zip;
rec_t* rec; rec_t* rec;
rec_t* orig_rec;
ulint max_size; ulint max_size;
ulint new_rec_size; ulint new_rec_size;
ulint old_rec_size; ulint old_rec_size;
@@ -1968,7 +1967,7 @@ btr_cur_optimistic_update(
block = btr_cur_get_block(cursor); block = btr_cur_get_block(cursor);
page = buf_block_get_frame(block); page = buf_block_get_frame(block);
orig_rec = rec = btr_cur_get_rec(cursor); rec = btr_cur_get_rec(cursor);
index = cursor->index; index = cursor->index;
ut_ad(!!page_rec_is_comp(rec) == dict_table_is_comp(index->table)); 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)); ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
@@ -4563,17 +4562,20 @@ btr_free_externally_stored_field(
} }
for (;;) { for (;;) {
#ifdef UNIV_SYNC_DEBUG
buf_block_t* rec_block; buf_block_t* rec_block;
#endif /* UNIV_SYNC_DEBUG */
buf_block_t* ext_block; buf_block_t* ext_block;
mtr_start(&mtr); mtr_start(&mtr);
rec_block = buf_page_get(page_get_space_id( #ifdef UNIV_SYNC_DEBUG
page_align(field_ref)), rec_block =
rec_zip_size, #endif /* UNIV_SYNC_DEBUG */
page_get_page_no( buf_page_get(page_get_space_id(page_align(field_ref)),
page_align(field_ref)), rec_zip_size,
RW_X_LATCH, &mtr); page_get_page_no(page_align(field_ref)),
RW_X_LATCH, &mtr);
buf_block_dbg_add_level(rec_block, SYNC_NO_ORDER_CHECK); buf_block_dbg_add_level(rec_block, SYNC_NO_ORDER_CHECK);
page_no = mach_read_from_4(field_ref + BTR_EXTERN_PAGE_NO); page_no = mach_read_from_4(field_ref + BTR_EXTERN_PAGE_NO);

View File

@@ -452,7 +452,6 @@ btr_pcur_move_backward_from_page(
mtr_t* mtr) /*!< in: mtr */ mtr_t* mtr) /*!< in: mtr */
{ {
ulint prev_page_no; ulint prev_page_no;
ulint space;
page_t* page; page_t* page;
buf_block_t* prev_block; buf_block_t* prev_block;
ulint latch_mode; ulint latch_mode;
@@ -488,7 +487,6 @@ btr_pcur_move_backward_from_page(
page = btr_pcur_get_page(cursor); page = btr_pcur_get_page(cursor);
prev_page_no = btr_page_get_prev(page, mtr); 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) { if (prev_page_no == FIL_NULL) {
} else if (btr_pcur_is_before_first_on_page(cursor)) { } else if (btr_pcur_is_before_first_on_page(cursor)) {

View File

@@ -1507,7 +1507,6 @@ btr_search_update_hash_on_delete(
rec_t* rec; rec_t* rec;
ulint fold; ulint fold;
index_id_t index_id; index_id_t index_id;
ibool found;
ulint offsets_[REC_OFFS_NORMAL_SIZE]; ulint offsets_[REC_OFFS_NORMAL_SIZE];
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
rec_offs_init(offsets_); rec_offs_init(offsets_);
@@ -1540,7 +1539,7 @@ btr_search_update_hash_on_delete(
} }
rw_lock_x_lock(&btr_search_latch); 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); rw_lock_x_unlock(&btr_search_latch);
} }

View File

@@ -133,12 +133,18 @@ buf_flush_delete_from_flush_rbt(
/*============================*/ /*============================*/
buf_page_t* bpage) /*!< in: bpage to be removed. */ buf_page_t* bpage) /*!< in: bpage to be removed. */
{ {
#ifdef UNIV_DEBUG
ibool ret = FALSE; ibool ret = FALSE;
#endif /* UNIV_DEBUG */
buf_pool_t* buf_pool = buf_pool_from_bpage(bpage); buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
ut_ad(buf_flush_list_mutex_own(buf_pool)); 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); ut_ad(ret);
} }

View File

@@ -22,4 +22,4 @@ MYSQL_ROOT="$(dirname ${0})/../.."
cd ${MYSQL_ROOT} cd ${MYSQL_ROOT}
cmake -DWITH_INNOBASE_STORAGE_ENGINE:BOOL=ON cmake -DWITH_INNOBASE_STORAGE_ENGINE:BOOL=ON
make -j4 make -j$(nproc)

View File

@@ -627,7 +627,6 @@ dict_create_index_tree_step(
{ {
dict_index_t* index; dict_index_t* index;
dict_table_t* sys_indexes; dict_table_t* sys_indexes;
dict_table_t* table;
dtuple_t* search_tuple; dtuple_t* search_tuple;
ulint zip_size; ulint zip_size;
btr_pcur_t pcur; btr_pcur_t pcur;
@@ -636,7 +635,6 @@ dict_create_index_tree_step(
ut_ad(mutex_own(&(dict_sys->mutex))); ut_ad(mutex_own(&(dict_sys->mutex)));
index = node->index; index = node->index;
table = node->table;
sys_indexes = dict_sys->sys_indexes; sys_indexes = dict_sys->sys_indexes;

View File

@@ -4206,7 +4206,6 @@ dict_update_statistics_low(
dictionary mutex */ dictionary mutex */
{ {
dict_index_t* index; dict_index_t* index;
ulint size;
ulint sum_of_index_sizes = 0; ulint sum_of_index_sizes = 0;
if (table->ibd_file_missing) { if (table->ibd_file_missing) {
@@ -4221,14 +4220,6 @@ dict_update_statistics_low(
return; return;
} }
/* If we have set a high innodb_force_recovery level, do not calculate
statistics, as a badly corrupted index can cause a crash in it. */
if (srv_force_recovery >= SRV_FORCE_NO_IBUF_MERGE) {
return;
}
/* Find out the sizes of the indexes and how many different values /* Find out the sizes of the indexes and how many different values
for the key they approximately have */ for the key they approximately have */
@@ -4240,26 +4231,48 @@ dict_update_statistics_low(
return; return;
} }
while (index) {
size = btr_get_size(index, BTR_TOTAL_SIZE);
index->stat_index_size = size; do {
if (UNIV_LIKELY
(srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE
|| (srv_force_recovery < SRV_FORCE_NO_LOG_REDO
&& dict_index_is_clust(index)))) {
ulint size;
size = btr_get_size(index, BTR_TOTAL_SIZE);
sum_of_index_sizes += size; index->stat_index_size = size;
size = btr_get_size(index, BTR_N_LEAF_PAGES); sum_of_index_sizes += size;
if (size == 0) { size = btr_get_size(index, BTR_N_LEAF_PAGES);
/* The root node of the tree is a leaf */
size = 1; if (size == 0) {
/* The root node of the tree is a leaf */
size = 1;
}
index->stat_n_leaf_pages = size;
btr_estimate_number_of_different_key_vals(index);
} else {
/* If we have set a high innodb_force_recovery
level, do not calculate statistics, as a badly
corrupted index can cause a crash in it.
Initialize some bogus index cardinality
statistics, so that the data can be queried in
various means, also via secondary indexes. */
ulint i;
sum_of_index_sizes++;
index->stat_index_size = index->stat_n_leaf_pages = 1;
for (i = dict_index_get_n_unique(index); i; ) {
index->stat_n_diff_key_vals[i--] = 1;
}
} }
index->stat_n_leaf_pages = size;
btr_estimate_number_of_different_key_vals(index);
index = dict_table_get_next_index(index); index = dict_table_get_next_index(index);
} } while (index);
index = dict_table_get_first_index(table); index = dict_table_get_first_index(table);
@@ -4442,7 +4455,6 @@ dict_index_print_low(
{ {
ib_int64_t n_vals; ib_int64_t n_vals;
ulint i; ulint i;
const char* type_string;
ut_ad(mutex_own(&(dict_sys->mutex))); ut_ad(mutex_own(&(dict_sys->mutex)));
@@ -4457,14 +4469,6 @@ dict_index_print_low(
dict_index_stat_mutex_exit(index); 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, fprintf(stderr,
" INDEX: name %s, id %llu, fields %lu/%lu," " INDEX: name %s, id %llu, fields %lu/%lu,"
" uniq %lu, type %lu\n" " uniq %lu, type %lu\n"

View File

@@ -384,18 +384,13 @@ eval_notfound(
/*==========*/ /*==========*/
func_node_t* func_node) /*!< in: function node */ func_node_t* func_node) /*!< in: function node */
{ {
que_node_t* arg1;
que_node_t* arg2;
sym_node_t* cursor; sym_node_t* cursor;
sel_node_t* sel_node; sel_node_t* sel_node;
ibool ibool_val; ibool ibool_val;
arg1 = func_node->args;
arg2 = que_node_get_next(arg1);
ut_ad(func_node->func == PARS_NOTFOUND_TOKEN); ut_ad(func_node->func == PARS_NOTFOUND_TOKEN);
cursor = arg1; cursor = func_node->args;
ut_ad(que_node_get_type(cursor) == QUE_NODE_SYMBOL); ut_ad(que_node_get_type(cursor) == QUE_NODE_SYMBOL);

View File

@@ -674,6 +674,8 @@ static SHOW_VAR innodb_status_variables[]= {
(char*) &export_vars.innodb_rows_read, SHOW_LONG}, (char*) &export_vars.innodb_rows_read, SHOW_LONG},
{"rows_updated", {"rows_updated",
(char*) &export_vars.innodb_rows_updated, SHOW_LONG}, (char*) &export_vars.innodb_rows_updated, SHOW_LONG},
{"truncated_status_writes",
(char*) &export_vars.innodb_truncated_status_writes, SHOW_LONG},
{NullS, NullS, SHOW_LONG} {NullS, NullS, SHOW_LONG}
}; };
@@ -1271,7 +1273,7 @@ innobase_mysql_tmpfile(void)
#ifdef _WIN32 #ifdef _WIN32
/* Note that on Windows, the integer returned by mysql_tmpfile /* 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 call my_get_osfhandle to get the HANDLE and then convert it
to C runtime filedescriptor. */ to C runtime filedescriptor. */
{ {
@@ -2564,7 +2566,7 @@ static
int int
innobase_start_trx_and_assign_read_view( 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 THD* thd) /*!< in: MySQL thread handle of the user for whom
the transaction should be committed */ the transaction should be committed */
{ {
@@ -2609,7 +2611,7 @@ static
int int
innobase_commit( innobase_commit(
/*============*/ /*============*/
handlerton *hton, /*!< in: Innodb handlerton */ handlerton *hton, /*!< in: Innodb handlerton */
THD* thd, /*!< in: MySQL thread handle of the user for whom THD* thd, /*!< in: MySQL thread handle of the user for whom
the transaction should be committed */ the transaction should be committed */
bool all) /*!< in: TRUE - commit transaction bool all) /*!< in: TRUE - commit transaction
@@ -7206,7 +7208,6 @@ innobase_drop_database(
ulint len = 0; ulint len = 0;
trx_t* trx; trx_t* trx;
char* ptr; char* ptr;
int error;
char* namebuf; char* namebuf;
THD* thd = current_thd; THD* thd = current_thd;
@@ -7249,7 +7250,7 @@ innobase_drop_database(
#else #else
trx = innobase_trx_allocate(thd); trx = innobase_trx_allocate(thd);
#endif #endif
error = row_drop_database_for_mysql(namebuf, trx); row_drop_database_for_mysql(namebuf, trx);
my_free(namebuf); my_free(namebuf);
/* Flush the log to reduce probability that the .frm files and /* Flush the log to reduce probability that the .frm files and
@@ -7707,28 +7708,15 @@ ha_innobase::info(
dict_index_t* index; dict_index_t* index;
ha_rows rec_per_key; ha_rows rec_per_key;
ib_int64_t n_rows; ib_int64_t n_rows;
ulong j;
ulong i;
char path[FN_REFLEN]; char path[FN_REFLEN];
os_file_stat_t stat_info; os_file_stat_t stat_info;
DBUG_ENTER("info"); DBUG_ENTER("info");
/* If we are forcing recovery at a high level, we will suppress /* If we are forcing recovery at a high level, we will suppress
statistics calculation on tables, because that may crash the statistics calculation on tables, because that may crash the
server if an index is badly corrupted. */ server if an index is badly corrupted. */
if (srv_force_recovery >= SRV_FORCE_NO_IBUF_MERGE) {
/* We return success (0) instead of HA_ERR_CRASHED,
because we want MySQL to process this query and not
stop, like it would do if it received the error code
HA_ERR_CRASHED. */
DBUG_RETURN(0);
}
/* We do not know if MySQL can call this function before calling /* We do not know if MySQL can call this function before calling
external_lock(). To be safe, update the thd of the current table external_lock(). To be safe, update the thd of the current table
handle. */ handle. */
@@ -7823,12 +7811,18 @@ ha_innobase::info(
acquiring latches inside InnoDB, we do not call it if we acquiring latches inside InnoDB, we do not call it if we
are asked by MySQL to avoid locking. Another reason to are asked by MySQL to avoid locking. Another reason to
avoid the call is that it uses quite a lot of CPU. avoid the call is that it uses quite a lot of CPU.
See Bug#38185. See Bug#38185. */
We do not update delete_length if no locking is requested if (flag & HA_STATUS_NO_LOCK) {
so the "old" value can remain. delete_length is initialized /* We do not update delete_length if no
to 0 in the ha_statistics' constructor. */ locking is requested so the "old" value can
if (!(flag & HA_STATUS_NO_LOCK)) { remain. delete_length is initialized to 0 in
the ha_statistics' constructor. */
} else if (UNIV_UNLIKELY
(srv_force_recovery >= SRV_FORCE_NO_IBUF_MERGE)) {
/* Avoid accessing the tablespace if
innodb_crash_recovery is set to a high value. */
stats.delete_length = 0;
} else {
/* lock the data dictionary to avoid races with /* lock the data dictionary to avoid races with
ibd_file_missing and tablespace_discarded */ ibd_file_missing and tablespace_discarded */
row_mysql_lock_data_dictionary(prebuilt->trx); row_mysql_lock_data_dictionary(prebuilt->trx);
@@ -7873,6 +7867,7 @@ ha_innobase::info(
} }
if (flag & HA_STATUS_CONST) { if (flag & HA_STATUS_CONST) {
ulong i;
/* Verify the number of index in InnoDB and MySQL /* Verify the number of index in InnoDB and MySQL
matches up. If prebuilt->clust_index_was_generated matches up. If prebuilt->clust_index_was_generated
holds, InnoDB defines GEN_CLUST_INDEX internally */ holds, InnoDB defines GEN_CLUST_INDEX internally */
@@ -7889,6 +7884,7 @@ ha_innobase::info(
} }
for (i = 0; i < table->s->keys; i++) { for (i = 0; i < table->s->keys; i++) {
ulong j;
/* We could get index quickly through internal /* We could get index quickly through internal
index mapping with the index translation table. index mapping with the index translation table.
The identity of index (match up index name with The identity of index (match up index name with
@@ -7954,6 +7950,11 @@ ha_innobase::info(
} }
} }
if (srv_force_recovery >= SRV_FORCE_NO_IBUF_MERGE) {
goto func_exit;
}
if (flag & HA_STATUS_ERRKEY) { if (flag & HA_STATUS_ERRKEY) {
const dict_index_t* err_index; const dict_index_t* err_index;
@@ -7974,6 +7975,7 @@ ha_innobase::info(
stats.auto_increment_value = innobase_peek_autoinc(); stats.auto_increment_value = innobase_peek_autoinc();
} }
func_exit:
prebuilt->trx->op_info = (char*)""; prebuilt->trx->op_info = (char*)"";
DBUG_RETURN(0); DBUG_RETURN(0);
@@ -8976,7 +8978,7 @@ innodb_show_status(
{ {
trx_t* trx; trx_t* trx;
static const char truncated_msg[] = "... truncated...\n"; 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_start = ULINT_UNDEFINED;
ulint trx_list_end = ULINT_UNDEFINED; ulint trx_list_end = ULINT_UNDEFINED;
@@ -9006,6 +9008,7 @@ innodb_show_status(
if (flen > MAX_STATUS_SIZE) { if (flen > MAX_STATUS_SIZE) {
usable_len = MAX_STATUS_SIZE; usable_len = MAX_STATUS_SIZE;
srv_truncated_status_writes++;
} else { } else {
usable_len = flen; usable_len = flen;
} }
@@ -9041,12 +9044,9 @@ innodb_show_status(
mutex_exit(&srv_monitor_file_mutex); 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); my_free(str);
DBUG_RETURN(FALSE); DBUG_RETURN(FALSE);
@@ -9564,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. AUTOINC lock even if the lock mode is set to TRADITIONAL.
@return the autoinc value */ @return the autoinc value */
UNIV_INTERN UNIV_INTERN
@@ -11183,15 +11183,7 @@ i_s_innodb_lock_waits,
i_s_innodb_cmp, i_s_innodb_cmp,
i_s_innodb_cmp_reset, i_s_innodb_cmp_reset,
i_s_innodb_cmpmem, i_s_innodb_cmpmem,
i_s_innodb_cmpmem_reset, 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
mysql_declare_plugin_end; mysql_declare_plugin_end;
/** @brief Initialize the default value of innodb_commit_concurrency. /** @brief Initialize the default value of innodb_commit_concurrency.

File diff suppressed because it is too large Load Diff

View File

@@ -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_cmp_reset;
extern struct st_mysql_plugin i_s_innodb_cmpmem; 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_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 */ #endif /* i_s_h */

View File

@@ -1297,12 +1297,11 @@ ibuf_rec_get_op_type(
const rec_t* rec) /*!< in: ibuf record */ const rec_t* rec) /*!< in: ibuf record */
{ {
ulint len; ulint len;
const byte* field;
ut_ad(ibuf_inside()); ut_ad(ibuf_inside());
ut_ad(rec_get_n_fields_old(rec) > 2); 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) { if (len > 1) {
/* This is a < 4.1.x format record */ /* 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)); rec = page_rec_get_next(page_get_infimum_rec(page));
if (page_rec_is_supremum(rec)) { if (page_rec_is_supremum(rec)) {
/* Empty pages can result from buffered delete operations. fputs("InnoDB: Trying to insert a record from"
The first record from the free list can be used to find the " the insert buffer to an index page\n"
father node. */ "InnoDB: but the index page is empty!\n",
rec = page_header_get_ptr(page, PAGE_FREE); stderr);
if (UNIV_UNLIKELY(rec == NULL)) { 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) if (UNIV_UNLIKELY(rec_get_n_fields(rec, index)

View File

@@ -228,8 +228,8 @@ make sure that a read-ahead batch can be read efficiently in a single
sweep). */ sweep). */
#define BUF_FLUSH_FREE_BLOCK_MARGIN(b) (5 + BUF_READ_AHEAD_AREA(b)) #define BUF_FLUSH_FREE_BLOCK_MARGIN(b) (5 + BUF_READ_AHEAD_AREA(b))
/** Extra margin to apply above BUF_FLUSH_FREE_BLOCK_MARGIN */ /** Extra margin to apply above BUF_FLUSH_FREE_BLOCK_MARGIN */
#define BUF_FLUSH_EXTRA_MARGIN(b) (BUF_FLUSH_FREE_BLOCK_MARGIN(b) / 4 \ #define BUF_FLUSH_EXTRA_MARGIN(b) ((BUF_FLUSH_FREE_BLOCK_MARGIN(b) / 4 \
+ 100) + 100) / srv_buf_pool_instances)
#endif /* !UNIV_HOTBACKUP */ #endif /* !UNIV_HOTBACKUP */
#ifndef UNIV_NONINL #ifndef UNIV_NONINL

View File

@@ -289,7 +289,7 @@ amount of increment. */
Returns the old value of *ptr, atomically sets *ptr to new_val */ Returns the old value of *ptr, atomically sets *ptr to new_val */
# define os_atomic_test_and_set_byte(ptr, 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) #elif defined(HAVE_IB_SOLARIS_ATOMICS)

View File

@@ -806,8 +806,6 @@ rec_print(
dict_index_t* index); /*!< in: record descriptor */ dict_index_t* index); /*!< in: record descriptor */
#endif /* UNIV_HOTBACKUP */ #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 /* Maximum lengths for the data in a physical record if the offsets
are given in one byte (resp. two byte) format. */ are given in one byte (resp. two byte) format. */
#define REC_1BYTE_OFFS_LIMIT 0x7FUL #define REC_1BYTE_OFFS_LIMIT 0x7FUL

View File

@@ -225,6 +225,8 @@ extern ulong srv_thread_sleep_delay;
extern ulong srv_spin_wait_delay; extern ulong srv_spin_wait_delay;
extern ibool srv_priority_boost; extern ibool srv_priority_boost;
extern ulint srv_truncated_status_writes;
extern ulint srv_mem_pool_size; extern ulint srv_mem_pool_size;
extern ulint srv_lock_table_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_inserted; /*!< srv_n_rows_inserted */
ulint innodb_rows_updated; /*!< srv_n_rows_updated */ ulint innodb_rows_updated; /*!< srv_n_rows_updated */
ulint innodb_rows_deleted; /*!< srv_n_rows_deleted */ ulint innodb_rows_deleted; /*!< srv_n_rows_deleted */
ulint innodb_truncated_status_writes; /*!< srv_truncated_status_writes */
}; };
/** Thread slot in the thread table */ /** Thread slot in the thread table */
typedef struct srv_slot_struct srv_slot_t; typedef struct srv_slot_struct srv_slot_t;
/** Thread table is an array of slots */ /** Thread table is an array of slots */
typedef srv_slot_t srv_table_t; typedef srv_slot_t srv_table_t;

View File

@@ -46,7 +46,7 @@ Created 1/20/1994 Heikki Tuuri
#define INNODB_VERSION_MAJOR 1 #define INNODB_VERSION_MAJOR 1
#define INNODB_VERSION_MINOR 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 /* The following is the InnoDB version as shown in
SELECT plugin_version FROM information_schema.plugins; SELECT plugin_version FROM information_schema.plugins;
@@ -78,19 +78,6 @@ the virtual method table (vtable) in GCC 3. */
# define ha_innobase ha_innodb # define ha_innobase ha_innodb
#endif /* MYSQL_DYNAMIC_PLUGIN */ #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__) #if (defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)) && !defined(MYSQL_SERVER) && !defined(__WIN__)
# undef __WIN__ # undef __WIN__
# define __WIN__ # define __WIN__

View File

@@ -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.
*/

View File

@@ -53,7 +53,7 @@ Created 2007-03-20 Sunny Bains
/* Red black tree typedefs */ /* Red black tree typedefs */
typedef struct ib_rbt_struct ib_rbt_t; typedef struct ib_rbt_struct ib_rbt_t;
typedef struct ib_rbt_node_struct ib_rbt_node_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 struct ib_rbt_bound_struct ib_rbt_bound_t;
typedef void (*ib_rbt_print_node)(const ib_rbt_node_t* node); typedef void (*ib_rbt_print_node)(const ib_rbt_node_t* node);
typedef int (*ib_rbt_compare)(const void* p1, const void* p2); typedef int (*ib_rbt_compare)(const void* p1, const void* p2);

View File

@@ -85,9 +85,6 @@ ut_rnd_gen_ulint(void)
/*==================*/ /*==================*/
{ {
ulint rnd; ulint rnd;
ulint n_bits;
n_bits = 8 * sizeof(ulint);
ut_rnd_ulint_counter = UT_RND1 * ut_rnd_ulint_counter + UT_RND2; ut_rnd_ulint_counter = UT_RND1 * ut_rnd_ulint_counter + UT_RND2;

View File

@@ -569,10 +569,8 @@ recv_synchronize_groups(
ib_uint64_t start_lsn; ib_uint64_t start_lsn;
ib_uint64_t end_lsn; ib_uint64_t end_lsn;
ib_uint64_t recovered_lsn; ib_uint64_t recovered_lsn;
ib_uint64_t limit_lsn;
recovered_lsn = recv_sys->recovered_lsn; recovered_lsn = recv_sys->recovered_lsn;
limit_lsn = recv_sys->limit_lsn;
/* Read the last recovered log block to the recovery system buffer: /* Read the last recovered log block to the recovery system buffer:
the block is always incomplete */ the block is always incomplete */
@@ -1659,12 +1657,8 @@ recv_recover_page_func(
#ifndef UNIV_HOTBACKUP #ifndef UNIV_HOTBACKUP
if (modification_to_page) { if (modification_to_page) {
buf_pool_t* buf_pool;
ut_a(block); ut_a(block);
buf_pool = buf_pool_from_block(block);
log_flush_order_mutex_enter(); log_flush_order_mutex_enter();
buf_flush_recv_note_modification(block, start_lsn, end_lsn); buf_flush_recv_note_modification(block, start_lsn, end_lsn);
log_flush_order_mutex_exit(); log_flush_order_mutex_exit();
@@ -2908,7 +2902,9 @@ recv_recovery_from_checkpoint_start_func(
ib_uint64_t old_scanned_lsn; ib_uint64_t old_scanned_lsn;
ib_uint64_t group_scanned_lsn; ib_uint64_t group_scanned_lsn;
ib_uint64_t contiguous_lsn; ib_uint64_t contiguous_lsn;
#ifdef UNIV_LOG_ARCHIVE
ib_uint64_t archived_lsn; ib_uint64_t archived_lsn;
#endif /* UNIV_LOG_ARCHIVE */
byte* buf; byte* buf;
byte log_hdr_buf[LOG_FILE_HDR_SIZE]; byte log_hdr_buf[LOG_FILE_HDR_SIZE];
ulint err; ulint err;
@@ -2963,7 +2959,9 @@ recv_recovery_from_checkpoint_start_func(
checkpoint_lsn = mach_read_from_8(buf + LOG_CHECKPOINT_LSN); checkpoint_lsn = mach_read_from_8(buf + LOG_CHECKPOINT_LSN);
checkpoint_no = mach_read_from_8(buf + LOG_CHECKPOINT_NO); 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); 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 /* Read the first log file header to print a note if this is
a recovery from a restored InnoDB Hot Backup */ a recovery from a restored InnoDB Hot Backup */

View File

@@ -1482,8 +1482,6 @@ try_again:
int create_flag; int create_flag;
ibool retry; ibool retry;
const char* mode_str = NULL; const char* mode_str = NULL;
const char* type_str = NULL;
const char* purpose_str = NULL;
try_again: try_again:
ut_a(name); ut_a(name);
@@ -1503,26 +1501,9 @@ try_again:
ut_error; ut_error;
} }
if (type == OS_LOG_FILE) { ut_a(type == OS_LOG_FILE || type == OS_DATA_FILE);
type_str = "LOG"; ut_a(purpose == OS_FILE_AIO || purpose == OS_FILE_NORMAL);
} else if (type == OS_DATA_FILE) {
type_str = "DATA";
} else {
ut_error;
}
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 #ifdef O_SYNC
/* We let O_SYNC only affect log files; note that we map O_DSYNC to /* 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 O_SYNC because the datasync options seemed to corrupt files in 2001

View File

@@ -1283,18 +1283,13 @@ que_run_threads_low(
que_thr_t* thr) /*!< in: query thread */ que_thr_t* thr) /*!< in: query thread */
{ {
que_thr_t* next_thr; que_thr_t* next_thr;
ulint cumul_resource;
ulint loop_count; ulint loop_count;
ut_ad(thr->state == QUE_THR_RUNNING); ut_ad(thr->state == QUE_THR_RUNNING);
ut_a(thr_get_trx(thr)->error_state == DB_SUCCESS); ut_a(thr_get_trx(thr)->error_state == DB_SUCCESS);
ut_ad(!mutex_own(&kernel_mutex)); 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; loop_count = QUE_MAX_LOOPS_WITHOUT_CHECK;
cumul_resource = 0;
loop: loop:
/* Check that there is enough space in the log to accommodate /* Check that there is enough space in the log to accommodate
possible log entries by this query step; if the operation can touch possible log entries by this query step; if the operation can touch

View File

@@ -1481,7 +1481,12 @@ run_again:
srv_n_rows_updated++; 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 = ""; trx->op_info = "";

View File

@@ -786,7 +786,9 @@ row_purge_step(
que_thr_t* thr) /*!< in: query thread */ que_thr_t* thr) /*!< in: query thread */
{ {
purge_node_t* node; purge_node_t* node;
#ifdef UNIV_DEBUG
ulint err; ulint err;
#endif /* UNIV_DEBUG */
ut_ad(thr); ut_ad(thr);
@@ -794,7 +796,10 @@ row_purge_step(
ut_ad(que_node_get_type(node) == QUE_NODE_PURGE); 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); ut_ad(err == DB_SUCCESS);

View File

@@ -2682,7 +2682,6 @@ row_sel_store_mysql_rec(
ut_ad(prebuilt->mysql_template); ut_ad(prebuilt->mysql_template);
ut_ad(prebuilt->default_rec); ut_ad(prebuilt->default_rec);
ut_ad(rec_offs_validate(rec, NULL, offsets)); ut_ad(rec_offs_validate(rec, NULL, offsets));
ut_ad(!rec_get_deleted_flag(rec, rec_offs_comp(offsets)));
if (UNIV_LIKELY_NULL(prebuilt->blob_heap)) { if (UNIV_LIKELY_NULL(prebuilt->blob_heap)) {
mem_heap_free(prebuilt->blob_heap); mem_heap_free(prebuilt->blob_heap);
@@ -3603,6 +3602,7 @@ row_search_for_mysql(
row_sel_try_search_shortcut_for_mysql(). row_sel_try_search_shortcut_for_mysql().
The latch will not be released until The latch will not be released until
mtr_commit(&mtr). */ mtr_commit(&mtr). */
ut_ad(!rec_get_deleted_flag(rec, comp));
if (!row_sel_store_mysql_rec(buf, prebuilt, if (!row_sel_store_mysql_rec(buf, prebuilt,
rec, offsets)) { rec, offsets)) {
@@ -4230,7 +4230,7 @@ no_gap_lock:
rec = old_vers; rec = old_vers;
} }
} else if (!lock_sec_rec_cons_read_sees(rec, trx->read_view)) { } else {
/* We are looking into a non-clustered index, /* We are looking into a non-clustered index,
and to get the right version of the record we and to get the right version of the record we
have to look also into the clustered index: this have to look also into the clustered index: this
@@ -4238,8 +4238,12 @@ no_gap_lock:
information via the clustered index record. */ information via the clustered index record. */
ut_ad(index != clust_index); ut_ad(index != clust_index);
ut_ad(!dict_index_is_clust(index));
goto requires_clust_rec; if (!lock_sec_rec_cons_read_sees(
rec, trx->read_view)) {
goto requires_clust_rec;
}
} }
} }
@@ -4362,8 +4366,13 @@ requires_clust_rec:
ULINT_UNDEFINED, &heap); ULINT_UNDEFINED, &heap);
result_rec = rec; result_rec = rec;
} }
/* result_rec can legitimately be delete-marked
now that it has been established that it points to a
clustered index record that exists in the read view. */
} else { } else {
result_rec = rec; result_rec = rec;
ut_ad(!rec_get_deleted_flag(rec, comp));
} }
/* We found a qualifying record 'result_rec'. At this point, /* We found a qualifying record 'result_rec'. At this point,

View File

@@ -114,12 +114,17 @@ row_undo_mod_clust_low(
btr_pcur_t* pcur; btr_pcur_t* pcur;
btr_cur_t* btr_cur; btr_cur_t* btr_cur;
ulint err; ulint err;
#ifdef UNIV_DEBUG
ibool success; ibool success;
#endif /* UNIV_DEBUG */
pcur = &(node->pcur); pcur = &(node->pcur);
btr_cur = btr_pcur_get_btr_cur(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); ut_ad(success);

View File

@@ -71,7 +71,9 @@ row_vers_impl_x_locked_off_kernel(
warning */ warning */
trx_t* trx; trx_t* trx;
ulint rec_del; ulint rec_del;
#ifdef UNIV_DEBUG
ulint err; ulint err;
#endif /* UNIV_DEBUG */
mtr_t mtr; mtr_t mtr;
ulint comp; ulint comp;
@@ -169,9 +171,12 @@ row_vers_impl_x_locked_off_kernel(
heap2 = heap; heap2 = heap;
heap = mem_heap_create(1024); heap = mem_heap_create(1024);
err = trx_undo_prev_version_build(clust_rec, &mtr, version, #ifdef UNIV_DEBUG
clust_index, clust_offsets, err =
heap, &prev_version); #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 */ mem_heap_free(heap2); /* free version and clust_offsets */
if (prev_version == NULL) { if (prev_version == NULL) {

View File

@@ -424,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 ib_int64_t srv_n_lock_wait_time = 0;
UNIV_INTERN ulint srv_n_lock_max_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 Set the following to 0 if you want InnoDB to write messages on
@@ -1592,6 +1593,18 @@ srv_suspend_mysql_thread(
row_mysql_unfreeze_data_dictionary(trx); row_mysql_unfreeze_data_dictionary(trx);
break; break;
case RW_X_LATCH: case RW_X_LATCH:
/* There should never be a lock wait when the
dictionary latch is reserved in X mode. Dictionary
transactions should only acquire locks on dictionary
tables, not other tables. All access to dictionary
tables should be covered by dictionary
transactions. */
ut_print_timestamp(stderr);
fputs(" InnoDB: Error: dict X latch held in "
"srv_suspend_mysql_thread\n", stderr);
/* This should never occur. This incorrect handling
was added in the early development of
ha_innobase::add_index() in InnoDB Plugin 1.0. */
/* Release fast index creation latch */ /* Release fast index creation latch */
row_mysql_unlock_data_dictionary(trx); row_mysql_unlock_data_dictionary(trx);
break; break;
@@ -1613,6 +1626,9 @@ srv_suspend_mysql_thread(
row_mysql_freeze_data_dictionary(trx); row_mysql_freeze_data_dictionary(trx);
break; break;
case RW_X_LATCH: case RW_X_LATCH:
/* This should never occur. This incorrect handling
was added in the early development of
ha_innobase::add_index() in InnoDB Plugin 1.0. */
row_mysql_lock_data_dictionary(trx); row_mysql_lock_data_dictionary(trx);
break; break;
} }
@@ -2017,6 +2033,7 @@ srv_export_innodb_status(void)
export_vars.innodb_rows_inserted = srv_n_rows_inserted; export_vars.innodb_rows_inserted = srv_n_rows_inserted;
export_vars.innodb_rows_updated = srv_n_rows_updated; export_vars.innodb_rows_updated = srv_n_rows_updated;
export_vars.innodb_rows_deleted = srv_n_rows_deleted; 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); mutex_exit(&srv_innodb_monitor_mutex);
} }
@@ -2622,7 +2639,9 @@ loop:
when there is database activity */ when there is database activity */
srv_last_log_flush_time = time(NULL); 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++) { for (i = 0; i < 10; i++) {
ulint cur_time = ut_time_ms(); ulint cur_time = ut_time_ms();

View File

@@ -1334,8 +1334,27 @@ innobase_start_or_create_for_mysql(void)
fil_init(srv_file_per_table ? 50000 : 5000, fil_init(srv_file_per_table ? 50000 : 5000,
srv_max_n_open_files); srv_max_n_open_files);
/* Print time to initialize the buffer pool */
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Initializing buffer pool, size =");
if (srv_buf_pool_size >= 1024 * 1024 * 1024) {
fprintf(stderr,
" %.1fG\n",
((double) srv_buf_pool_size) / (1024 * 1024 * 1024));
} else {
fprintf(stderr,
" %.1fM\n",
((double) srv_buf_pool_size) / (1024 * 1024));
}
err = buf_pool_init(srv_buf_pool_size, srv_buf_pool_instances); err = buf_pool_init(srv_buf_pool_size, srv_buf_pool_instances);
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Completed initialization of buffer pool\n");
if (err != DB_SUCCESS) { if (err != DB_SUCCESS) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Fatal error: cannot allocate the memory" "InnoDB: Fatal error: cannot allocate the memory"
@@ -1852,7 +1871,7 @@ innobase_start_or_create_for_mysql(void)
if (srv_print_verbose_log) { if (srv_print_verbose_log) {
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB %s started; " " InnoDB: %s started; "
"log sequence number %llu\n", "log sequence number %llu\n",
INNODB_VERSION_STR, srv_start_lsn); INNODB_VERSION_STR, srv_start_lsn);
} }

View File

@@ -313,9 +313,10 @@ trx_purge_add_update_undo_to_history(
trx_undo_t* undo; trx_undo_t* undo;
trx_rseg_t* rseg; trx_rseg_t* rseg;
trx_rsegf_t* rseg_header; trx_rsegf_t* rseg_header;
#ifdef UNIV_DEBUG
trx_usegf_t* seg_header; trx_usegf_t* seg_header;
#endif /* UNIV_DEBUG */
trx_ulogf_t* undo_header; trx_ulogf_t* undo_header;
trx_upagef_t* page_header;
ulint hist_size; ulint hist_size;
undo = trx->update_undo; undo = trx->update_undo;
@@ -330,8 +331,9 @@ trx_purge_add_update_undo_to_history(
rseg->page_no, mtr); rseg->page_no, mtr);
undo_header = undo_page + undo->hdr_offset; undo_header = undo_page + undo->hdr_offset;
#ifdef UNIV_DEBUG
seg_header = undo_page + TRX_UNDO_SEG_HDR; 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) { if (undo->state != TRX_UNDO_CACHED) {
/* The undo log segment will not be reused */ /* The undo log segment will not be reused */
@@ -669,7 +671,6 @@ trx_purge_rseg_get_next_history_log(
{ {
page_t* undo_page; page_t* undo_page;
trx_ulogf_t* log_hdr; trx_ulogf_t* log_hdr;
trx_usegf_t* seg_hdr;
fil_addr_t prev_log_addr; fil_addr_t prev_log_addr;
trx_id_t trx_no; trx_id_t trx_no;
ibool del_marks; 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, undo_page = trx_undo_page_get_s_latched(rseg->space, rseg->zip_size,
rseg->last_page_no, &mtr); rseg->last_page_no, &mtr);
log_hdr = undo_page + rseg->last_offset; 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 */ /* 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_inf_t* cell) /*!< in: storage cell */
{ {
trx_undo_arr_t* arr;
mutex_enter(&(purge_sys->mutex)); mutex_enter(&(purge_sys->mutex));
arr = purge_sys->arr;
trx_purge_arr_remove_info(cell); trx_purge_arr_remove_info(cell);
mutex_exit(&(purge_sys->mutex)); mutex_exit(&(purge_sys->mutex));

View File

@@ -743,13 +743,8 @@ trx_undo_arr_remove_info(
undo_no_t undo_no)/*!< in: undo number */ undo_no_t undo_no)/*!< in: undo number */
{ {
trx_undo_inf_t* cell; trx_undo_inf_t* cell;
ulint n_used;
ulint n;
ulint i; ulint i;
n_used = arr->n_used;
n = 0;
for (i = 0;; i++) { for (i = 0;; i++) {
cell = trx_undo_arr_get_nth_info(arr, i); cell = trx_undo_arr_get_nth_info(arr, i);

View File

@@ -249,7 +249,9 @@ trx_sys_create_doublewrite_buf(void)
{ {
buf_block_t* block; buf_block_t* block;
buf_block_t* block2; buf_block_t* block2;
#ifdef UNIV_SYNC_DEBUG
buf_block_t* new_block; buf_block_t* new_block;
#endif /* UNIV_SYNC_DEBUG */
byte* doublewrite; byte* doublewrite;
byte* fseg_header; byte* fseg_header;
ulint page_no; ulint page_no;
@@ -352,8 +354,11 @@ start_again:
the page position in the tablespace, then the page the page position in the tablespace, then the page
has not been written to in doublewrite. */ has not been written to in doublewrite. */
new_block = buf_page_get(TRX_SYS_SPACE, 0, page_no, #ifdef UNIV_SYNC_DEBUG
RW_X_LATCH, &mtr); 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, buf_block_dbg_add_level(new_block,
SYNC_NO_ORDER_CHECK); SYNC_NO_ORDER_CHECK);

View File

@@ -1798,7 +1798,6 @@ trx_prepare_off_kernel(
/*===================*/ /*===================*/
trx_t* trx) /*!< in: transaction */ trx_t* trx) /*!< in: transaction */
{ {
page_t* update_hdr_page;
trx_rseg_t* rseg; trx_rseg_t* rseg;
ib_uint64_t lsn = 0; ib_uint64_t lsn = 0;
mtr_t mtr; mtr_t mtr;
@@ -1831,7 +1830,7 @@ trx_prepare_off_kernel(
} }
if (trx->update_undo) { if (trx->update_undo) {
update_hdr_page = trx_undo_set_state_at_prepare( trx_undo_set_state_at_prepare(
trx, trx->update_undo, &mtr); trx, trx->update_undo, &mtr);
} }

View File

@@ -1072,14 +1072,11 @@ trx_undo_truncate_end(
ulint last_page_no; ulint last_page_no;
trx_undo_rec_t* rec; trx_undo_rec_t* rec;
trx_undo_rec_t* trunc_here; trx_undo_rec_t* trunc_here;
trx_rseg_t* rseg;
mtr_t mtr; mtr_t mtr;
ut_ad(mutex_own(&(trx->undo_mutex))); ut_ad(mutex_own(&(trx->undo_mutex)));
ut_ad(mutex_own(&(trx->rseg->mutex))); ut_ad(mutex_own(&(trx->rseg->mutex)));
rseg = trx->rseg;
for (;;) { for (;;) {
mtr_start(&mtr); mtr_start(&mtr);
@@ -1873,7 +1870,6 @@ trx_undo_set_state_at_prepare(
mtr_t* mtr) /*!< in: mtr */ mtr_t* mtr) /*!< in: mtr */
{ {
trx_usegf_t* seg_hdr; trx_usegf_t* seg_hdr;
trx_upagef_t* page_hdr;
trx_ulogf_t* undo_header; trx_ulogf_t* undo_header;
page_t* undo_page; page_t* undo_page;
ulint offset; ulint offset;
@@ -1891,7 +1887,6 @@ trx_undo_set_state_at_prepare(
undo->hdr_page_no, mtr); undo->hdr_page_no, mtr);
seg_hdr = undo_page + TRX_UNDO_SEG_HDR; seg_hdr = undo_page + TRX_UNDO_SEG_HDR;
page_hdr = undo_page + TRX_UNDO_PAGE_HDR;
/*------------------------------*/ /*------------------------------*/
undo->state = TRX_UNDO_PREPARED; undo->state = TRX_UNDO_PREPARED;

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}