Automerge
This commit is contained in:
commit
95da93d7ac
523
COPYING
523
COPYING
@ -1,352 +1,339 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
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
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
Preamble
|
||||
|
||||
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
|
||||
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
|
||||
the GNU Lesser 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.
|
||||
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
|
||||
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.
|
||||
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
|
||||
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
|
||||
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.
|
||||
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
|
||||
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".
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
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:
|
||||
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.
|
||||
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.
|
||||
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.)
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
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:
|
||||
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,
|
||||
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,
|
||||
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.)
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
NO WARRANTY
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
How to Apply These Terms to Your New Programs
|
||||
=============================================
|
||||
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.
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
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.
|
||||
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.
|
||||
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
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <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 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.
|
||||
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.
|
||||
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.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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.
|
||||
Gnomovision version 69, Copyright (C) year 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.
|
||||
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.
|
||||
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.
|
||||
<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 Lesser General
|
||||
Public License instead of this License.
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2000-2008 MySQL AB
|
||||
/* Copyright 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -13,6 +13,11 @@
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
#define COPYRIGHT_NOTICE "\
|
||||
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.\n\
|
||||
This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n\
|
||||
and you are welcome to modify and redistribute it under the GPL v2 license\n"
|
||||
|
||||
/* mysql command tool
|
||||
* Commands compatible with mSQL by David J. Hughes
|
||||
*
|
||||
@ -1166,6 +1171,8 @@ int main(int argc,char *argv[])
|
||||
mysql_thread_id(&mysql), server_version_string(&mysql));
|
||||
put_info((char*) glob_buffer.ptr(),INFO_INFO);
|
||||
|
||||
put_info(COPYRIGHT_NOTICE, INFO_INFO);
|
||||
|
||||
#ifdef HAVE_READLINE
|
||||
initialize_readline((char*) my_progname);
|
||||
if (!status.batch && !quick && !opt_html && !opt_xml)
|
||||
@ -1208,13 +1215,11 @@ int main(int argc,char *argv[])
|
||||
sprintf(histfile_tmp, "%s.TMP", histfile);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
sprintf(buff, "%s",
|
||||
#ifndef NOT_YET
|
||||
"Type 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\n");
|
||||
#else
|
||||
"Type 'help [[%]function name[%]]' to get help on usage of function.\n");
|
||||
#endif
|
||||
put_info(buff,INFO_INFO);
|
||||
status.exit_status= read_and_execute(!status.batch);
|
||||
if (opt_outfile)
|
||||
@ -1568,10 +1573,7 @@ static void usage(int version)
|
||||
|
||||
if (version)
|
||||
return;
|
||||
printf("\
|
||||
Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.\n\
|
||||
This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n\
|
||||
and you are welcome to modify and redistribute it under the GPL license\n");
|
||||
printf("%s", COPYRIGHT_NOTICE);
|
||||
printf("Usage: %s [OPTIONS] [database]\n", my_progname);
|
||||
my_print_help(my_long_options);
|
||||
print_defaults("my", load_default_groups);
|
||||
|
@ -44,7 +44,7 @@ static DYNAMIC_STRING conn_args;
|
||||
static char *opt_password= 0;
|
||||
static my_bool tty_password= 0;
|
||||
|
||||
static char opt_tmpdir[FN_REFLEN];
|
||||
static char opt_tmpdir[FN_REFLEN] = "";
|
||||
|
||||
#ifndef DBUG_OFF
|
||||
static char *default_dbug_option= (char*) "d:t:O,/tmp/mysql_upgrade.trace";
|
||||
@ -459,7 +459,8 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res,
|
||||
|
||||
DBUG_ENTER("run_query");
|
||||
DBUG_PRINT("enter", ("query: %s", query));
|
||||
if ((fd= create_temp_file(query_file_path, opt_tmpdir,
|
||||
if ((fd= create_temp_file(query_file_path,
|
||||
opt_tmpdir[0] ? opt_tmpdir : NULL,
|
||||
"sql", O_CREAT | O_SHARE | O_RDWR,
|
||||
MYF(MY_WME))) < 0)
|
||||
die("Failed to create temporary file for defaults");
|
||||
|
@ -730,9 +730,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
|
||||
|
||||
switch (ev_type) {
|
||||
case QUERY_EVENT:
|
||||
if (strncmp(((Query_log_event*)ev)->query, "BEGIN", 5) &&
|
||||
strncmp(((Query_log_event*)ev)->query, "COMMIT", 6) &&
|
||||
strncmp(((Query_log_event*)ev)->query, "ROLLBACK", 8) &&
|
||||
if (!((Query_log_event*)ev)->is_trans_keyword() &&
|
||||
shall_skip_database(((Query_log_event*)ev)->db))
|
||||
goto end;
|
||||
if (opt_base64_output_mode == BASE64_OUTPUT_ALWAYS)
|
||||
@ -832,7 +830,11 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
|
||||
print_event_info->common_header_len=
|
||||
glob_description_event->common_header_len;
|
||||
ev->print(result_file, print_event_info);
|
||||
ev->temp_buf= 0; // as the event ref is zeroed
|
||||
if (!remote_opt)
|
||||
ev->free_temp_buf(); // free memory allocated in dump_local_log_entries
|
||||
else
|
||||
// disassociate but not free dump_remote_log_entries time memory
|
||||
ev->temp_buf= 0;
|
||||
/*
|
||||
We don't want this event to be deleted now, so let's hide it (I
|
||||
(Guilhem) should later see if this triggers a non-serious Valgrind
|
||||
@ -1362,7 +1364,6 @@ static int parse_args(int *argc, char*** argv)
|
||||
int ho_error;
|
||||
|
||||
result_file = stdout;
|
||||
load_defaults("my",load_default_groups,argc,argv);
|
||||
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
|
||||
exit(ho_error);
|
||||
if (debug_info_flag)
|
||||
@ -2019,8 +2020,10 @@ int main(int argc, char** argv)
|
||||
|
||||
my_init_time(); // for time functions
|
||||
|
||||
if (load_defaults("my", load_default_groups, &argc, &argv))
|
||||
exit(1);
|
||||
defaults_argv= argv;
|
||||
parse_args(&argc, (char***)&argv);
|
||||
defaults_argv=argv;
|
||||
|
||||
if (!argc)
|
||||
{
|
||||
|
@ -1256,7 +1256,7 @@ void die(const char *fmt, ...)
|
||||
Help debugging by displaying any warnings that might have
|
||||
been produced prior to the error
|
||||
*/
|
||||
if (cur_con)
|
||||
if (cur_con && !cur_con->pending)
|
||||
show_warnings_before_error(&cur_con->mysql);
|
||||
|
||||
cleanup_and_exit(1);
|
||||
|
@ -12,7 +12,7 @@ dnl
|
||||
dnl When changing the major version number please also check the switch
|
||||
dnl statement in mysqlbinlog::check_master_version(). You may also need
|
||||
dnl to update version.c in ndb.
|
||||
AC_INIT([MySQL Server], [5.1.45], [], [mysql])
|
||||
AC_INIT([MySQL Server], [5.1.47], [], [mysql])
|
||||
|
||||
AC_CONFIG_SRCDIR([sql/mysqld.cc])
|
||||
AC_CANONICAL_SYSTEM
|
||||
@ -2711,7 +2711,7 @@ case $SYSTEM_TYPE in
|
||||
fi
|
||||
|
||||
# if there is no readline, but we want to build with readline, we fail
|
||||
if [test "$want_to_use_readline" = "yes"] && [test ! -d "./cmd-line-utils/readline"]
|
||||
if [test "$want_to_use_readline" = "yes"] && [test ! -d "$srcdir/cmd-line-utils/readline"]
|
||||
then
|
||||
AC_MSG_ERROR([This commercially licensed MySQL source package can't
|
||||
be built with libreadline. Please use --with-libedit to use
|
||||
|
10
dbug/dbug.c
10
dbug/dbug.c
@ -455,6 +455,13 @@ static void DbugParse(CODE_STATE *cs, const char *control)
|
||||
rel= control[0] == '+' || control[0] == '-';
|
||||
if ((!rel || (!stack->out_file && !stack->next)))
|
||||
{
|
||||
/*
|
||||
We need to free what's already in init_settings, because unlike
|
||||
the thread related stack frames there's a chance that something
|
||||
is in these variables already.
|
||||
*/
|
||||
if (stack == &init_settings)
|
||||
FreeState(cs, stack, 0);
|
||||
stack->flags= 0;
|
||||
stack->delay= 0;
|
||||
stack->maxdepth= 0;
|
||||
@ -1510,7 +1517,10 @@ void _db_end_()
|
||||
while ((discard= cs->stack))
|
||||
{
|
||||
if (discard == &init_settings)
|
||||
{
|
||||
FreeState (cs, discard, 0);
|
||||
break;
|
||||
}
|
||||
cs->stack= discard->next;
|
||||
FreeState(cs, discard, 1);
|
||||
}
|
||||
|
@ -751,7 +751,7 @@ typedef SOCKET_SIZE_TYPE size_socket;
|
||||
#endif
|
||||
#define MY_NFILE 64 /* This is only used to save filenames */
|
||||
#ifndef OS_FILE_LIMIT
|
||||
#define OS_FILE_LIMIT 65535
|
||||
#define OS_FILE_LIMIT UINT_MAX
|
||||
#endif
|
||||
|
||||
/* #define EXT_IN_LIBNAME */
|
||||
|
@ -950,7 +950,7 @@ extern my_bool resolve_charset(const char *cs_name,
|
||||
extern my_bool resolve_collation(const char *cl_name,
|
||||
CHARSET_INFO *default_cl,
|
||||
CHARSET_INFO **cl);
|
||||
|
||||
extern void free_charsets(void);
|
||||
extern char *get_charsets_dir(char *buf);
|
||||
extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2);
|
||||
extern my_bool init_compiled_charsets(myf flags);
|
||||
|
@ -396,12 +396,12 @@ struct st_mysql_plugin
|
||||
int type; /* the plugin type (a MYSQL_XXX_PLUGIN value) */
|
||||
void *info; /* pointer to type-specific plugin descriptor */
|
||||
const char *name; /* plugin name */
|
||||
const char *author; /* plugin author (for SHOW PLUGINS) */
|
||||
const char *descr; /* general descriptive text (for SHOW PLUGINS ) */
|
||||
const char *author; /* plugin author (for I_S.PLUGINS) */
|
||||
const char *descr; /* general descriptive text (for I_S.PLUGINS) */
|
||||
int license; /* the plugin license (PLUGIN_LICENSE_XXX) */
|
||||
int (*init)(void *); /* the function to invoke when plugin is loaded */
|
||||
int (*deinit)(void *);/* the function to invoke when plugin is unloaded */
|
||||
unsigned int version; /* plugin version (for SHOW PLUGINS) */
|
||||
unsigned int version; /* plugin version (for I_S.PLUGINS) */
|
||||
struct st_mysql_show_var *status_vars;
|
||||
struct st_mysql_sys_var **system_vars;
|
||||
void * __reserved1; /* reserved for dependency checking */
|
||||
@ -801,30 +801,37 @@ void mysql_query_cache_invalidate4(MYSQL_THD thd,
|
||||
const char *key, unsigned int key_length,
|
||||
int using_trx);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
/**
|
||||
Provide a handler data getter to simplify coding
|
||||
*/
|
||||
inline
|
||||
void *
|
||||
thd_get_ha_data(const MYSQL_THD thd, const struct handlerton *hton)
|
||||
{
|
||||
return *thd_ha_data(thd, hton);
|
||||
}
|
||||
void *thd_get_ha_data(const MYSQL_THD thd, const struct handlerton *hton);
|
||||
|
||||
|
||||
/**
|
||||
Provide a handler data setter to simplify coding
|
||||
|
||||
@details
|
||||
Set ha_data pointer (storage engine per-connection information).
|
||||
|
||||
To avoid unclean deactivation (uninstall) of storage engine plugin
|
||||
in the middle of transaction, additional storage engine plugin
|
||||
lock is acquired.
|
||||
|
||||
If ha_data is not null and storage engine plugin was not locked
|
||||
by thd_set_ha_data() in this connection before, storage engine
|
||||
plugin gets locked.
|
||||
|
||||
If ha_data is null and storage engine plugin was locked by
|
||||
thd_set_ha_data() in this connection before, storage engine
|
||||
plugin lock gets released.
|
||||
|
||||
If handlerton::close_connection() didn't reset ha_data, server does
|
||||
it immediately after calling handlerton::close_connection().
|
||||
*/
|
||||
inline
|
||||
void
|
||||
thd_set_ha_data(const MYSQL_THD thd, const struct handlerton *hton,
|
||||
const void *ha_data)
|
||||
{
|
||||
*thd_ha_data(thd, hton)= (void*) ha_data;
|
||||
void thd_set_ha_data(MYSQL_THD thd, const struct handlerton *hton,
|
||||
const void *ha_data);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -137,3 +137,6 @@ void thd_get_xid(const void* thd, MYSQL_XID *xid);
|
||||
void mysql_query_cache_invalidate4(void* thd,
|
||||
const char *key, unsigned int key_length,
|
||||
int using_trx);
|
||||
void *thd_get_ha_data(const void* thd, const struct handlerton *hton);
|
||||
void thd_set_ha_data(void* thd, const struct handlerton *hton,
|
||||
const void *ha_data);
|
||||
|
@ -211,6 +211,7 @@ void STDCALL mysql_server_end()
|
||||
}
|
||||
else
|
||||
{
|
||||
free_charsets();
|
||||
mysql_thread_end();
|
||||
}
|
||||
|
||||
|
@ -99,7 +99,11 @@ TEST_DIRS = t r include std_data std_data/parts collections \
|
||||
suite/ndb suite/ndb/t suite/ndb/r \
|
||||
suite/rpl_ndb suite/rpl_ndb/t suite/rpl_ndb/r \
|
||||
suite/parts suite/parts/t suite/parts/r suite/parts/inc \
|
||||
suite/innodb suite/innodb/t suite/innodb/r suite/innodb/include
|
||||
suite/innodb suite/innodb/t suite/innodb/r suite/innodb/include \
|
||||
suite/engines suite/engines/funcs suite/engines/iuds suite/engines/rr_trx \
|
||||
suite/engines/funcs/r suite/engines/funcs/t suite/engines/iuds/r \
|
||||
suite/engines/iuds/t suite/engines/rr_trx/include suite/engines/rr_trx/r \
|
||||
suite/engines/rr_trx/t
|
||||
|
||||
# Used by dist-hook and install-data-local to copy all
|
||||
# test files into either dist or install directory
|
||||
|
@ -1 +1,7 @@
|
||||
perl mysql-test-run.pl --timer --force --comment=rpl_ndb_row --vardir=var-rpl_ndb_row --suite=rpl_ndb,ndb --mysqld=--binlog-format=row --experimental=collections/default.experimental
|
||||
|
||||
perl mysql-test-run.pl --timer --force --parallel=auto --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --experimental=collections/default.experimental
|
||||
perl mysql-test-run.pl --timer --force --parallel=auto --comment=ps_row --vardir=var-ps_row --ps-protocol --mysqld=--binlog-format=row --experimental=collections/default.experimental
|
||||
perl mysql-test-run.pl --timer --force --parallel=auto --comment=embedded --vardir=var-emebbed --embedded --experimental=collections/default.experimental
|
||||
perl mysql-test-run.pl --timer --force --parallel=auto --comment=rpl_binlog_row --vardir=var-rpl_binlog_row --suite=rpl,binlog --mysqld=--binlog-format=row --experimental=collections/default.experimental
|
||||
perl mysql-test-run.pl --timer --force --parallel=auto --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1 --experimental=collections/default.experimental
|
||||
|
@ -1,5 +1,5 @@
|
||||
perl mysql-test-run.pl --timer --force --parallel=auto --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --experimental=collections/default.experimental
|
||||
perl mysql-test-run.pl --timer --force --parallel=auto --comment=ps_row --vardir=var-ps_row --ps-protocol --mysqld=--binlog-format=row --experimental=collections/default.experimental
|
||||
perl mysql-test-run.pl --timer --force --parallel=auto --comment=embedded --vardir=var-emebbed --embedded --experimental=collections/default.experimental
|
||||
perl mysql-test-run.pl --timer --force --parallel=auto --comment=rpl_binlog_row --vardir=var-rpl_binlog_row --suite=rpl,binlog --mysqld=--binlog-format=row --experimental=collections/default.experimental
|
||||
perl mysql-test-run.pl --timer --force --parallel=auto --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1 --experimental=collections/default.experimental
|
||||
perl mysql-test-run.pl --timer --force --parallel=auto --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --experimental=collections/default.experimental --skip-ndb
|
||||
perl mysql-test-run.pl --timer --force --parallel=auto --comment=ps_row --vardir=var-ps_row --ps-protocol --mysqld=--binlog-format=row --experimental=collections/default.experimental --skip-ndb
|
||||
perl mysql-test-run.pl --timer --force --parallel=auto --comment=embedded --vardir=var-emebbed --embedded --experimental=collections/default.experimental --skip-ndb
|
||||
perl mysql-test-run.pl --timer --force --parallel=auto --comment=rpl_binlog_row --vardir=var-rpl_binlog_row --suite=rpl,binlog --mysqld=--binlog-format=row --experimental=collections/default.experimental --skip-ndb
|
||||
perl mysql-test-run.pl --timer --force --parallel=auto --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1 --experimental=collections/default.experimental --skip-ndb
|
||||
|
@ -3,26 +3,53 @@
|
||||
# The common part of the "rpl_get_master_version_and_clock" test.
|
||||
# Restart slave under network disconnection between slave and master
|
||||
# following the steps:
|
||||
# 1 - Got DBUG_SYNC_POINT lock
|
||||
# 2 - Set DBUG_SYNC_POINT before call mysql_real_query(...) function in get_master_version_and_clock(...) function and hang here
|
||||
# 3 - shutdown master server for simulating network disconnection
|
||||
# 4 - Release DBUG_SYNC_POINT lock
|
||||
# 5 - Check if the slave I/O thread tries to reconnect to master.
|
||||
# 0 - Set DEBUG_SYNC_ACTION to wait
|
||||
# before call mysql_real_query(...) function in get_master_version_and_clock(...)
|
||||
# function and hang here
|
||||
# 1 - activate a sync-point through the $dbug_sync_point argument of the test
|
||||
# 2 - shutdown master server for simulating network disconnection
|
||||
# 3 - signal to the IO thread through $debug_sync_action to unhold from the sync-point
|
||||
# 4 - check if the slave I/O thread tries to reconnect to master.
|
||||
#
|
||||
# Note: Please make sure initialize the $debug_lock when call the test script.
|
||||
# Note: make sure to initialize the $debug_sync_action and $dbug_sync_point
|
||||
# before calling the test script.
|
||||
#
|
||||
# Pattern of usage:
|
||||
#
|
||||
# The caller test supplies the DBUG_EXECUTE_IF name
|
||||
#
|
||||
# let $dbug_sync_point = 'dbug_execute_if_name';
|
||||
#
|
||||
# as well as the action list for DEBUG_SYNC
|
||||
#
|
||||
# let $debug_sync_action= 'now signal signal_name';
|
||||
#
|
||||
# The $dbug_sync_point becomes the value of @@global.debug generating
|
||||
# a newly started IO-slave thread's session value.
|
||||
# Notice incremental operations to add and remove dbug_execute_if_name
|
||||
# from the global variable allows propagation more dbug arguments
|
||||
# out of mtr.
|
||||
# The action list is to fire at proper time according to test logics
|
||||
# (see pp 0-4 above).
|
||||
#
|
||||
|
||||
connection slave;
|
||||
if (`SELECT '$debug_lock' = ''`)
|
||||
if (`SELECT $debug_sync_action = ''`)
|
||||
{
|
||||
--die Cannot continue. Please set value for $debug_lock.
|
||||
--die Cannot continue. Please set value for debug_sync_action.
|
||||
}
|
||||
|
||||
# Restart slave
|
||||
--disable_warnings
|
||||
stop slave;
|
||||
source include/wait_for_slave_to_stop.inc;
|
||||
|
||||
eval SET @@global.debug= "+d,$dbug_sync_point";
|
||||
|
||||
start slave;
|
||||
source include/wait_for_slave_to_start.inc;
|
||||
--echo slave is going to hang in get_master_version_and_clock
|
||||
|
||||
connection master;
|
||||
# Write file to make mysql-test-run.pl expect the "crash", but don't start
|
||||
# it until it's told to
|
||||
@ -35,7 +62,9 @@ EOF
|
||||
shutdown_server 10;
|
||||
|
||||
connection slave;
|
||||
eval SELECT RELEASE_LOCK($debug_lock);
|
||||
--echo slave is unblocked
|
||||
|
||||
eval SET DEBUG_SYNC=$debug_sync_action;
|
||||
|
||||
# Show slave last IO errno
|
||||
connection slave;
|
||||
@ -53,6 +82,12 @@ if (`SELECT '$last_io_errno' = '2013' || # CR_SERVER_LOST
|
||||
--echo NETWORK ERROR
|
||||
}
|
||||
|
||||
# deactivate the sync point of get_master_version_and_clock()
|
||||
# now to avoid restarting IO-thread to re-enter it.
|
||||
# There will be a new IO thread forked out with its @@session.debug
|
||||
# unset.
|
||||
eval set @@global.debug = "-d,$dbug_sync_point";
|
||||
|
||||
# Write file to make mysql-test-run.pl start up the server again
|
||||
--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
restart
|
||||
|
51
mysql-test/include/min_null_cond.inc
Normal file
51
mysql-test/include/min_null_cond.inc
Normal file
@ -0,0 +1,51 @@
|
||||
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a = NULL;
|
||||
SELECT MIN( a ) FROM t1 WHERE a = NULL;
|
||||
|
||||
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a <> NULL;
|
||||
SELECT MIN( a ) FROM t1 WHERE a <> NULL;
|
||||
|
||||
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a > NULL;
|
||||
SELECT MIN( a ) FROM t1 WHERE a > NULL;
|
||||
|
||||
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a < NULL;
|
||||
SELECT MIN( a ) FROM t1 WHERE a < NULL;
|
||||
|
||||
if (!$skip_null_safe_test)
|
||||
{
|
||||
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a <=> NULL;
|
||||
SELECT MIN( a ) FROM t1 WHERE a <=> NULL;
|
||||
}
|
||||
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND 10;
|
||||
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND 10;
|
||||
|
||||
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND NULL;
|
||||
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND NULL;
|
||||
|
||||
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a BETWEEN 10 AND NULL;
|
||||
SELECT MIN( a ) FROM t1 WHERE a BETWEEN 10 AND NULL;
|
||||
|
||||
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0);
|
||||
SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0);
|
||||
|
||||
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a IS NULL;
|
||||
SELECT MIN( a ) FROM t1 WHERE a IS NULL;
|
@ -182,6 +182,8 @@ INSERT INTO global_suppressions VALUES
|
||||
("==[0-9]*== For more details"),
|
||||
/* This comes with innodb plugin tests */
|
||||
("==[0-9]*== Warning: set address range perms: large range"),
|
||||
/* valgrind-3.5.0 dumps this */
|
||||
("==[0-9]*== Command: "),
|
||||
|
||||
/* valgrind warnings: invalid file descriptor -1 in syscall
|
||||
write()/read(). Bug #50414 */
|
||||
|
@ -22,7 +22,7 @@ eval $test_insert;
|
||||
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
wait_for_slave_to_stop;
|
||||
--source include/wait_for_slave_sql_to_stop.inc
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
|
||||
--query_vertical SHOW SLAVE STATUS
|
||||
|
25
mysql-test/include/view_alias.inc
Normal file
25
mysql-test/include/view_alias.inc
Normal file
@ -0,0 +1,25 @@
|
||||
# Routine to be called by t/view.inc
|
||||
#
|
||||
# The variable $after_select must be set before calling this routine.
|
||||
|
||||
eval CREATE VIEW v1 AS SELECT $after_select;
|
||||
SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME = 'v1';
|
||||
#
|
||||
# Extract the VIEW's SELECT from INFORMATION_SCHEMA.VIEWS
|
||||
let $query1 = `SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME = 'v1'`;
|
||||
#
|
||||
# Extract the VIEW's SELECT from SHOW CREATE VIEW
|
||||
# SHOW CREATE VIEW v1
|
||||
# View Create View character_set_client collation_connection
|
||||
# v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select '<--- .....
|
||||
let $value= query_get_value(SHOW CREATE VIEW v1, Create View, 1);
|
||||
let $query2 = `SELECT SUBSTR("$value",INSTR("$value",' as select ') + CHAR_LENGTH(' as '))`;
|
||||
DROP VIEW v1;
|
||||
|
||||
# Recreate the view based on SELECT from INFORMATION_SCHEMA.VIEWS
|
||||
eval CREATE VIEW v1 AS $query1;
|
||||
DROP VIEW v1;
|
||||
# Recreate the view based on SHOW CREATE VIEW
|
||||
eval CREATE VIEW v1 AS $query2;
|
||||
DROP VIEW v1;
|
||||
|
@ -532,6 +532,9 @@ sub collect_one_suite($)
|
||||
next if ($test->{'name'} eq 'main.innodb-autoinc');
|
||||
# Fails with innodb plugin: r6185 Testcases changes not included
|
||||
next if ($test->{'name'} eq 'main.innodb_bug44369');
|
||||
# Fix for BUG47621 is not in InnoDB plugin
|
||||
next if ($test->{'name'} eq 'main.innodb_bug21704');
|
||||
next if ($test->{'name'} eq 'main.innodb_bug47621');
|
||||
# Copy test options
|
||||
my $new_test= My::Test->new();
|
||||
while (my ($key, $value) = each(%$test))
|
||||
|
@ -122,8 +122,8 @@ $opt_threads=1;
|
||||
$pid_file="mysql_stress_test.pid";
|
||||
$opt_mysqltest= ($^O =~ /mswin32/i) ? "mysqltest.exe" : "mysqltest";
|
||||
$opt_check_tests_file="";
|
||||
# OBM adding a setting for 'max-connect-retries=7' the default of 500 is to high
|
||||
@mysqltest_args=("--silent", "-v", "--skip-safemalloc", "--max-connect-retries=7");
|
||||
# OBM adding a setting for 'max-connect-retries=20' the default of 500 is to high
|
||||
@mysqltest_args=("--silent", "-v", "--skip-safemalloc", "--max-connect-retries=20");
|
||||
|
||||
# Client ip address
|
||||
$client_ip=inet_ntoa((gethostbyname(hostname()))[4]);
|
||||
@ -150,7 +150,12 @@ $client_ip=~ s/\.//g;
|
||||
|
||||
%error_strings = ( 'Failed in mysql_real_connect()' => S1,
|
||||
'Can\'t connect' => S1,
|
||||
'not found (Errcode: 2)' => S1 );
|
||||
'not found (Errcode: 2)' => S1,
|
||||
'does not exist' => S1,
|
||||
'Could not open connection \'default\' after \d+ attempts' => S1,
|
||||
'wrong errno ' => S3,
|
||||
'Result length mismatch' => S4,
|
||||
'Result content mismatch' => S4);
|
||||
|
||||
%error_codes = ( 1012 => S2, 1015 => S2, 1021 => S2,
|
||||
1027 => S2, 1037 => S2, 1038 => S2,
|
||||
|
@ -12737,3 +12737,22 @@ SELECT * FROM t1;
|
||||
ERROR HY000: Can't find file: 't1' (errno: 2)
|
||||
DROP TABLE t1;
|
||||
ERROR 42S02: Unknown table 't1'
|
||||
#
|
||||
# BUG#46565 - repair of partition fail for archive engine
|
||||
#
|
||||
# Installing corrupted table files for t1.
|
||||
SELECT * FROM t1;
|
||||
ERROR HY000: Table 't1' is marked as crashed and should be repaired
|
||||
REPAIR TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 repair error Corrupt
|
||||
SELECT * FROM t1;
|
||||
ERROR HY000: Table 't1' is marked as crashed and should be repaired
|
||||
REPAIR TABLE t1 EXTENDED;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 repair status OK
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
DROP TABLE t1;
|
||||
|
@ -404,3 +404,37 @@ describe t1;
|
||||
Field Type Null Key Default Extra
|
||||
bi decimal(19,0) NO 0
|
||||
drop table t1;
|
||||
#
|
||||
# Bug #45360: wrong results
|
||||
#
|
||||
CREATE TABLE t1 (id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
a BIGINT(20) UNSIGNED,
|
||||
b VARCHAR(20));
|
||||
INSERT INTO t1 (a) VALUES
|
||||
(0),
|
||||
(CAST(0x7FFFFFFFFFFFFFFF AS UNSIGNED)),
|
||||
(CAST(0x8000000000000000 AS UNSIGNED)),
|
||||
(CAST(0xFFFFFFFFFFFFFFFF AS UNSIGNED));
|
||||
UPDATE t1 SET b = a;
|
||||
# FFFFFFFFFFFFFFFF
|
||||
EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE a = 18446744073709551615 AND TRIM(a) = b;
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
Note 1003 select 1 AS `1` from `test`.`t1` where ((`test`.`t1`.`a` = 18446744073709551615) and ('18446744073709551615' = `test`.`t1`.`b`))
|
||||
# 8000000000000000
|
||||
EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE a = 9223372036854775808 AND TRIM(a) = b;
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
Note 1003 select 1 AS `1` from `test`.`t1` where ((`test`.`t1`.`a` = 9223372036854775808) and ('9223372036854775808' = `test`.`t1`.`b`))
|
||||
# 7FFFFFFFFFFFFFFF
|
||||
EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE a = 9223372036854775807 AND TRIM(a) = b;
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
Note 1003 select 1 AS `1` from `test`.`t1` where ((`test`.`t1`.`a` = 9223372036854775807) and ('9223372036854775807' = `test`.`t1`.`b`))
|
||||
# 0
|
||||
EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE a = 0 AND TRIM(a) = b;
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
Note 1003 select 1 AS `1` from `test`.`t1` where ((`test`.`t1`.`a` = 0) and ('0' = `test`.`t1`.`b`))
|
||||
DROP TABLE t1;
|
||||
# End of 5.1 tests
|
||||
|
@ -88,7 +88,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1003 select `test`.`t2`.`a` AS `a`,(select count(0) AS `COUNT(*)` from `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t2`.`a`) and (concat(`test`.`t1`.`b`,`test`.`t1`.`c`) = concat('0',`test`.`t2`.`a`,'01')))) AS `x` from `test`.`t2` order by `test`.`t2`.`a`
|
||||
Note 1003 select `test`.`t2`.`a` AS `a`,(select count(0) from `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t2`.`a`) and (concat(`test`.`t1`.`b`,`test`.`t1`.`c`) = concat('0',`test`.`t2`.`a`,'01')))) AS `x` from `test`.`t2` order by `test`.`t2`.`a`
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (a TIMESTAMP);
|
||||
INSERT INTO t1 VALUES (NOW()),(NOW()),(NOW());
|
||||
|
@ -49,6 +49,15 @@ SELECT * FROM t1 WHERE LOWER(a)=LOWER('N');
|
||||
a
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#51976 LDML collations issue (cyrillic example)
|
||||
#
|
||||
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_test_ci);
|
||||
INSERT INTO t1 (a) VALUES ('Hello');
|
||||
SELECT a, UPPER(a), LOWER(a) FROM t1;
|
||||
a UPPER(a) LOWER(a)
|
||||
Hello HELLO hello
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#43827 Server closes connections and restarts
|
||||
#
|
||||
CREATE TABLE t1 (c1 VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_test_ci);
|
||||
|
@ -1230,4 +1230,12 @@ SELECT HEX(DAYNAME(19700101));
|
||||
HEX(DAYNAME(19700101))
|
||||
0427043504420432043504400433
|
||||
SET character_set_connection=latin1;
|
||||
#
|
||||
# Bug#52120 create view cause Assertion failed: 0, file .\item_subselect.cc, line 817
|
||||
#
|
||||
CREATE TABLE t1 (a CHAR(1) CHARSET ascii, b CHAR(1) CHARSET latin1);
|
||||
CREATE VIEW v1 AS SELECT 1 from t1
|
||||
WHERE t1.b <=> (SELECT a FROM t1 WHERE a < SOME(SELECT '1'));
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
|
@ -278,6 +278,18 @@ DELETE FROM t1 ORDER BY (f1(10)) LIMIT 1;
|
||||
ERROR 42000: Incorrect number of arguments for FUNCTION test.f1; expected 0, got 1
|
||||
DROP TABLE t1;
|
||||
DROP FUNCTION f1;
|
||||
#
|
||||
# Bug #49552 : sql_buffer_result cause crash + not found records
|
||||
# in multitable delete/subquery
|
||||
#
|
||||
CREATE TABLE t1(a INT);
|
||||
INSERT INTO t1 VALUES (1),(2),(3);
|
||||
SET SESSION SQL_BUFFER_RESULT=1;
|
||||
DELETE t1 FROM (SELECT SUM(a) a FROM t1) x,t1;
|
||||
SET SESSION SQL_BUFFER_RESULT=DEFAULT;
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
#
|
||||
# Bug#46958: Assertion in Diagnostics_area::set_ok_status, trigger,
|
||||
@ -337,16 +349,4 @@ END |
|
||||
DELETE IGNORE FROM t1;
|
||||
ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug #49552 : sql_buffer_result cause crash + not found records
|
||||
# in multitable delete/subquery
|
||||
#
|
||||
CREATE TABLE t1(a INT);
|
||||
INSERT INTO t1 VALUES (1),(2),(3);
|
||||
SET SESSION SQL_BUFFER_RESULT=1;
|
||||
DELETE t1 FROM (SELECT SUM(a) a FROM t1) x,t1;
|
||||
SET SESSION SQL_BUFFER_RESULT=DEFAULT;
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
@ -168,6 +168,23 @@ WHERE t1.a = d1.a;
|
||||
ERROR 42S22: Unknown column 'd1.a' in 'where clause'
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#48295:
|
||||
# explain extended crash with subquery and ONLY_FULL_GROUP_BY sql_mode
|
||||
#
|
||||
CREATE TABLE t1 (f1 INT);
|
||||
SELECT @@session.sql_mode INTO @old_sql_mode;
|
||||
SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
|
||||
EXPLAIN EXTENDED SELECT 1 FROM t1
|
||||
WHERE f1 > ALL( SELECT t.f1 FROM t1,t1 AS t );
|
||||
ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
Error 1140 Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
|
||||
Note 1003 select 1 AS `1` from `test`.`t1` where <not>(<exists>(...))
|
||||
SET SESSION sql_mode=@old_sql_mode;
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests.
|
||||
#
|
||||
# Bug#37870: Usage of uninitialized value caused failed assertion.
|
||||
#
|
||||
create table t1 (dt datetime not null, t time not null);
|
||||
@ -195,19 +212,18 @@ dt
|
||||
2001-01-01 01:01:01
|
||||
drop tables t1, t2;
|
||||
#
|
||||
# Bug#48295:
|
||||
# explain extended crash with subquery and ONLY_FULL_GROUP_BY sql_mode
|
||||
# Bug#47669: Query showed by EXPLAIN EXTENDED gives different result from original query
|
||||
#
|
||||
CREATE TABLE t1 (f1 INT);
|
||||
SELECT @@session.sql_mode INTO @old_sql_mode;
|
||||
SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
|
||||
EXPLAIN EXTENDED SELECT 1 FROM t1
|
||||
WHERE f1 > ALL( SELECT t.f1 FROM t1,t1 AS t );
|
||||
ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
Error 1140 Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
|
||||
Note 1003 select 1 AS `1` from `test`.`t1` where <not>(<exists>(...))
|
||||
SET SESSION sql_mode=@old_sql_mode;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c int);
|
||||
INSERT INTO t1 VALUES (NULL);
|
||||
CREATE TABLE t2 (d int);
|
||||
INSERT INTO t2 VALUES (NULL), (0);
|
||||
EXPLAIN EXTENDED SELECT (SELECT 1 FROM t2 WHERE d = c) FROM t1;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t1 system NULL NULL NULL NULL 1 100.00
|
||||
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1003 select (select 1 from `test`.`t2` where (`test`.`t2`.`d` = NULL)) AS `(SELECT 1 FROM t2 WHERE d = c)` from `test`.`t1`
|
||||
DROP TABLE t1, t2;
|
||||
End of 5.1 tests.
|
||||
|
@ -631,4 +631,17 @@ CREATE TABLE t1(a CHAR(1),FULLTEXT(a));
|
||||
SELECT 1 FROM t1 WHERE MATCH(a) AGAINST ('') AND ROW(a,a) > ROW(1,1);
|
||||
1
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# BUG#51866 - crash with repair by sort and fulltext keys
|
||||
#
|
||||
CREATE TABLE t1(a CHAR(4), FULLTEXT(a));
|
||||
INSERT INTO t1 VALUES('aaaa');
|
||||
SET myisam_sort_buffer_size=4;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '4'
|
||||
REPAIR TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 repair status OK
|
||||
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
@ -130,4 +130,22 @@ SELECT @query;
|
||||
@query
|
||||
abcde,0,1234
|
||||
DROP PROCEDURE p1;
|
||||
#
|
||||
# Bug #40625: Concat fails on DOUBLE values in a Stored Procedure,
|
||||
# while DECIMAL works
|
||||
#
|
||||
CREATE PROCEDURE p1()
|
||||
BEGIN
|
||||
DECLARE v1 DOUBLE(10,3);
|
||||
SET v1= 100;
|
||||
SET @s = CONCAT('########################################', 40 , v1);
|
||||
SELECT @s;
|
||||
END;//
|
||||
CALL p1();
|
||||
@s
|
||||
########################################40100.000
|
||||
CALL p1();
|
||||
@s
|
||||
########################################40100.000
|
||||
DROP PROCEDURE p1;
|
||||
# End of 5.1 tests
|
||||
|
@ -995,4 +995,19 @@ SELECT 1 FROM
|
||||
1
|
||||
1
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug #52397: another crash with explain extended and group_concat
|
||||
#
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (0), (0);
|
||||
EXPLAIN EXTENDED SELECT 1 FROM
|
||||
(SELECT GROUP_CONCAT(t1.a ORDER BY t1.a ASC) FROM
|
||||
t1 t2, t1 GROUP BY t1.a) AS d;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY <derived2> system NULL NULL NULL NULL 1 100.00
|
||||
2 DERIVED t2 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort
|
||||
2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 Using join buffer
|
||||
Warnings:
|
||||
Note 1003 select 1 AS `1` from (select group_concat(`test`.`t1`.`a` order by `test`.`t1`.`a` ASC separator ',') AS `GROUP_CONCAT(t1.a ORDER BY t1.a ASC)` from `test`.`t1` `t2` join `test`.`t1` group by `test`.`t1`.`a`) `d`
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
|
@ -1307,12 +1307,12 @@ explain extended select encode(f1,'zxcv') as 'enc' from t1;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 const row not found
|
||||
Warnings:
|
||||
Note 1003 select encode('','zxcv') AS `enc` from `test`.`t1`
|
||||
Note 1003 select encode(NULL,'zxcv') AS `enc` from `test`.`t1`
|
||||
explain extended select decode(f1,'zxcv') as 'enc' from t1;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 const row not found
|
||||
Warnings:
|
||||
Note 1003 select decode('','zxcv') AS `enc` from `test`.`t1`
|
||||
Note 1003 select decode(NULL,'zxcv') AS `enc` from `test`.`t1`
|
||||
drop table t1;
|
||||
create table t1 (a bigint not null)engine=myisam;
|
||||
insert into t1 set a = 1024*1024*1024*4;
|
||||
@ -2587,3 +2587,17 @@ FROM t2 WHERE t2.b = 1 GROUP BY t2.b;
|
||||
DECODE((SELECT ENCODE('secret', t1.a) FROM t1,t2 WHERE t1.a = t2.a GROUP BY t1.b LIMIT 1), t2.a)
|
||||
secret
|
||||
DROP TABLE t1, t2;
|
||||
#
|
||||
# Bug#52164 Assertion failed: param.sort_length, file .\filesort.cc, line 149
|
||||
#
|
||||
CREATE TABLE t1 (a LONGBLOB NOT NULL);
|
||||
INSERT INTO t1 VALUES (''),('');
|
||||
SELECT 1 FROM t1, t1 t2
|
||||
ORDER BY QUOTE(t1.a);
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
@ -1526,4 +1526,26 @@ SELECT 1 FROM t1 WHERE a >= GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1
|
||||
1
|
||||
1
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug #51357: crash when using handler commands on spatial indexes
|
||||
#
|
||||
CREATE TABLE t1(a GEOMETRY NOT NULL,SPATIAL INDEX a(a));
|
||||
HANDLER t1 OPEN;
|
||||
HANDLER t1 READ a FIRST;
|
||||
a
|
||||
HANDLER t1 READ a NEXT;
|
||||
a
|
||||
HANDLER t1 READ a PREV;
|
||||
a
|
||||
HANDLER t1 READ a LAST;
|
||||
a
|
||||
HANDLER t1 CLOSE;
|
||||
HANDLER t1 OPEN;
|
||||
HANDLER t1 READ a FIRST;
|
||||
a
|
||||
INSERT INTO t1 VALUES (GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))'));
|
||||
# should not crash
|
||||
HANDLER t1 READ a NEXT;
|
||||
HANDLER t1 CLOSE;
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests.
|
||||
|
@ -1742,7 +1742,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1003 select (select `test`.`t1`.`a` AS `a`) AS `aa`,count(distinct `test`.`t1`.`b`) AS `COUNT(DISTINCT b)` from `test`.`t1` group by ((select `test`.`t1`.`a` AS `a`) + 0)
|
||||
Note 1003 select (select `test`.`t1`.`a`) AS `aa`,count(distinct `test`.`t1`.`b`) AS `COUNT(DISTINCT b)` from `test`.`t1` group by ((select `test`.`t1`.`a`) + 0)
|
||||
EXPLAIN EXTENDED
|
||||
SELECT (SELECT t1.a) aa, COUNT(DISTINCT b) FROM t1 GROUP BY -aa;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
@ -1750,7 +1750,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1003 select (select `test`.`t1`.`a` AS `a`) AS `aa`,count(distinct `test`.`t1`.`b`) AS `COUNT(DISTINCT b)` from `test`.`t1` group by -((select `test`.`t1`.`a` AS `a`))
|
||||
Note 1003 select (select `test`.`t1`.`a`) AS `aa`,count(distinct `test`.`t1`.`b`) AS `COUNT(DISTINCT b)` from `test`.`t1` group by -((select `test`.`t1`.`a`))
|
||||
# should return only one record
|
||||
SELECT (SELECT tt.a FROM t1 tt LIMIT 1) aa, COUNT(DISTINCT b) FROM t1
|
||||
GROUP BY aa;
|
||||
|
@ -2537,4 +2537,234 @@ a
|
||||
1
|
||||
2
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#47762: Incorrect result from MIN() when WHERE tests NOT NULL column
|
||||
# for NULL
|
||||
#
|
||||
## Test for NULLs allowed
|
||||
CREATE TABLE t1 ( a INT, KEY (a) );
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a = NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x x x x x x x Impossible WHERE noticed after reading const tables
|
||||
SELECT MIN( a ) FROM t1 WHERE a = NULL;
|
||||
MIN( a )
|
||||
NULL
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a <> NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x x x x x x x Impossible WHERE noticed after reading const tables
|
||||
SELECT MIN( a ) FROM t1 WHERE a <> NULL;
|
||||
MIN( a )
|
||||
NULL
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a > NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x x x x x x x Impossible WHERE noticed after reading const tables
|
||||
SELECT MIN( a ) FROM t1 WHERE a > NULL;
|
||||
MIN( a )
|
||||
NULL
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a < NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x x x x x x x Impossible WHERE noticed after reading const tables
|
||||
SELECT MIN( a ) FROM t1 WHERE a < NULL;
|
||||
MIN( a )
|
||||
NULL
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a <=> NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x x x x x x x No matching min/max row
|
||||
SELECT MIN( a ) FROM t1 WHERE a <=> NULL;
|
||||
MIN( a )
|
||||
NULL
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND 10;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x x x x x x x Impossible WHERE noticed after reading const tables
|
||||
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND 10;
|
||||
MIN( a )
|
||||
NULL
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x x x x x x x Impossible WHERE noticed after reading const tables
|
||||
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND NULL;
|
||||
MIN( a )
|
||||
NULL
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a BETWEEN 10 AND NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x x x x x x x Impossible WHERE noticed after reading const tables
|
||||
SELECT MIN( a ) FROM t1 WHERE a BETWEEN 10 AND NULL;
|
||||
MIN( a )
|
||||
NULL
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x x x x x x x Impossible WHERE noticed after reading const tables
|
||||
x x x x x x x x x Using where; Using index
|
||||
SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0);
|
||||
MIN( a )
|
||||
NULL
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a IS NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x x x x x x x No matching min/max row
|
||||
SELECT MIN( a ) FROM t1 WHERE a IS NULL;
|
||||
MIN( a )
|
||||
NULL
|
||||
INSERT INTO t1 VALUES (NULL), (NULL);
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a = NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x x x x x x x Impossible WHERE noticed after reading const tables
|
||||
SELECT MIN( a ) FROM t1 WHERE a = NULL;
|
||||
MIN( a )
|
||||
NULL
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a <> NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x x x x x x x Impossible WHERE noticed after reading const tables
|
||||
SELECT MIN( a ) FROM t1 WHERE a <> NULL;
|
||||
MIN( a )
|
||||
NULL
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a > NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x x x x x x x Impossible WHERE noticed after reading const tables
|
||||
SELECT MIN( a ) FROM t1 WHERE a > NULL;
|
||||
MIN( a )
|
||||
NULL
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a < NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x x x x x x x Impossible WHERE noticed after reading const tables
|
||||
SELECT MIN( a ) FROM t1 WHERE a < NULL;
|
||||
MIN( a )
|
||||
NULL
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a <=> NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x x x x x x x Select tables optimized away
|
||||
SELECT MIN( a ) FROM t1 WHERE a <=> NULL;
|
||||
MIN( a )
|
||||
NULL
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND 10;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x x x x x x x Impossible WHERE noticed after reading const tables
|
||||
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND 10;
|
||||
MIN( a )
|
||||
NULL
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x x x x x x x Impossible WHERE noticed after reading const tables
|
||||
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND NULL;
|
||||
MIN( a )
|
||||
NULL
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a BETWEEN 10 AND NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x x x x x x x Impossible WHERE noticed after reading const tables
|
||||
SELECT MIN( a ) FROM t1 WHERE a BETWEEN 10 AND NULL;
|
||||
MIN( a )
|
||||
NULL
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x x x x x x x Impossible WHERE noticed after reading const tables
|
||||
x x x x x x x x x Using where; Using index
|
||||
SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0);
|
||||
MIN( a )
|
||||
NULL
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a IS NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x x x x x x x Select tables optimized away
|
||||
SELECT MIN( a ) FROM t1 WHERE a IS NULL;
|
||||
MIN( a )
|
||||
NULL
|
||||
DROP TABLE t1;
|
||||
## Test for NOT NULLs
|
||||
CREATE TABLE t1 ( a INT NOT NULL PRIMARY KEY);
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
#
|
||||
# NULL-safe operator test disabled for non-NULL indexed columns.
|
||||
#
|
||||
# See bugs
|
||||
#
|
||||
# - Bug#52173: Reading NULL value from non-NULL index gives
|
||||
# wrong result in embedded server
|
||||
#
|
||||
# - Bug#52174: Sometimes wrong plan when reading a MAX value from
|
||||
# non-NULL index
|
||||
#
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a = NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x x x x x x x Impossible WHERE noticed after reading const tables
|
||||
SELECT MIN( a ) FROM t1 WHERE a = NULL;
|
||||
MIN( a )
|
||||
NULL
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a <> NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x x x x x x x Impossible WHERE noticed after reading const tables
|
||||
SELECT MIN( a ) FROM t1 WHERE a <> NULL;
|
||||
MIN( a )
|
||||
NULL
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a > NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x x x x x x x Impossible WHERE noticed after reading const tables
|
||||
SELECT MIN( a ) FROM t1 WHERE a > NULL;
|
||||
MIN( a )
|
||||
NULL
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a < NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x x x x x x x Impossible WHERE noticed after reading const tables
|
||||
SELECT MIN( a ) FROM t1 WHERE a < NULL;
|
||||
MIN( a )
|
||||
NULL
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND 10;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x x x x x x x Impossible WHERE noticed after reading const tables
|
||||
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND 10;
|
||||
MIN( a )
|
||||
NULL
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x x x x x x x Impossible WHERE noticed after reading const tables
|
||||
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND NULL;
|
||||
MIN( a )
|
||||
NULL
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a BETWEEN 10 AND NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x x x x x x x Impossible WHERE noticed after reading const tables
|
||||
SELECT MIN( a ) FROM t1 WHERE a BETWEEN 10 AND NULL;
|
||||
MIN( a )
|
||||
NULL
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x x x x x x x Impossible WHERE noticed after reading const tables
|
||||
x x x x x x x x x Using where; Using index
|
||||
SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0);
|
||||
MIN( a )
|
||||
NULL
|
||||
EXPLAIN
|
||||
SELECT MIN( a ) FROM t1 WHERE a IS NULL;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x x x x x x x Impossible WHERE
|
||||
SELECT MIN( a ) FROM t1 WHERE a IS NULL;
|
||||
MIN( a )
|
||||
NULL
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
@ -756,4 +756,17 @@ TRUNCATE t1;
|
||||
HANDLER t1 READ FIRST;
|
||||
ERROR 42S02: Unknown table 't1' in HANDLER
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# BUG#51877 - HANDLER interface causes invalid memory read
|
||||
#
|
||||
CREATE TABLE t1(a INT, KEY(a));
|
||||
HANDLER t1 OPEN;
|
||||
HANDLER t1 READ a FIRST;
|
||||
a
|
||||
INSERT INTO t1 VALUES(1);
|
||||
HANDLER t1 READ a NEXT;
|
||||
a
|
||||
1
|
||||
HANDLER t1 CLOSE;
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
@ -12,7 +12,7 @@ explain extended select count(a) as b from t1 where a=0 having b >=0;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
Warnings:
|
||||
Note 1003 select count('0') AS `b` from `test`.`t1` where 0 having (`b` >= 0)
|
||||
Note 1003 select count(NULL) AS `b` from `test`.`t1` where 0 having (`b` >= 0)
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (
|
||||
raw_id int(10) NOT NULL default '0',
|
||||
@ -430,4 +430,103 @@ SELECT b, COUNT(DISTINCT a) FROM t1 GROUP BY b HAVING b is NULL;
|
||||
b COUNT(DISTINCT a)
|
||||
NULL 1
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#50995 Having clause on subquery result produces incorrect results.
|
||||
#
|
||||
CREATE TABLE t1
|
||||
(
|
||||
id1 INT,
|
||||
id2 INT NOT NULL,
|
||||
INDEX id1(id2)
|
||||
);
|
||||
INSERT INTO t1 SET id1=1, id2=1;
|
||||
INSERT INTO t1 SET id1=2, id2=1;
|
||||
INSERT INTO t1 SET id1=3, id2=1;
|
||||
SELECT t1.id1,
|
||||
(SELECT 0 FROM DUAL
|
||||
WHERE t1.id1=t1.id1) AS amount FROM t1
|
||||
WHERE t1.id2 = 1
|
||||
HAVING amount > 0
|
||||
ORDER BY t1.id1;
|
||||
id1 amount
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#48916 Server incorrectly processing HAVING clauses with an ORDER BY clause
|
||||
#
|
||||
CREATE TABLE t1 (f1 INT PRIMARY KEY, f2 INT, f3 INT);
|
||||
INSERT INTO t1 VALUES (2,7,9), (4,7,9), (6,2,9), (17,0,9);
|
||||
SELECT table1.f1, table2.f2
|
||||
FROM t1 AS table1
|
||||
JOIN t1 AS table2 ON table1.f3 = table2.f3
|
||||
WHERE table2.f1 = 2
|
||||
GROUP BY table1.f1, table2.f2
|
||||
HAVING (table2.f2 = 8 AND table1.f1 >= 6);
|
||||
f1 f2
|
||||
EXPLAIN EXTENDED
|
||||
SELECT table1.f1, table2.f2
|
||||
FROM t1 AS table1
|
||||
JOIN t1 AS table2 ON table1.f3 = table2.f3
|
||||
WHERE table2.f1 = 2
|
||||
GROUP BY table1.f1, table2.f2
|
||||
HAVING (table2.f2 = 8 AND table1.f1 >= 6);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible HAVING noticed after reading const tables
|
||||
Warnings:
|
||||
Note 1003 select `test`.`table1`.`f1` AS `f1`,'7' AS `f2` from `test`.`t1` `table1` join `test`.`t1` `table2` where ((`test`.`table1`.`f3` = '9')) group by `test`.`table1`.`f1`,'7' having 0
|
||||
EXPLAIN EXTENDED
|
||||
SELECT table1.f1, table2.f2
|
||||
FROM t1 AS table1
|
||||
JOIN t1 AS table2 ON table1.f3 = table2.f3
|
||||
WHERE table2.f1 = 2
|
||||
GROUP BY table1.f1, table2.f2
|
||||
HAVING (table2.f2 = 8);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible HAVING noticed after reading const tables
|
||||
Warnings:
|
||||
Note 1003 select `test`.`table1`.`f1` AS `f1`,'7' AS `f2` from `test`.`t1` `table1` join `test`.`t1` `table2` where ((`test`.`table1`.`f3` = '9')) group by `test`.`table1`.`f1`,'7' having 0
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#52336 Segfault / crash in 5.1 copy_fields (param=0x9872980) at sql_select.cc:15355
|
||||
#
|
||||
CREATE TABLE t1(f1 INT, f2 INT);
|
||||
INSERT INTO t1 VALUES (10,8);
|
||||
CREATE TABLE t2 (f1 INT);
|
||||
INSERT INTO t2 VALUES (5);
|
||||
SELECT COUNT(f1) FROM t2
|
||||
HAVING (7, 9) IN (SELECT f1, MIN(f2) FROM t1);
|
||||
COUNT(f1)
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE t1 (f1 INT, f2 VARCHAR(1));
|
||||
INSERT INTO t1 VALUES (16,'f');
|
||||
INSERT INTO t1 VALUES (16,'f');
|
||||
CREATE TABLE t2 (f1 INT, f2 VARCHAR(1));
|
||||
INSERT INTO t2 VALUES (13,'f');
|
||||
INSERT INTO t2 VALUES (20,'f');
|
||||
CREATE TABLE t3 (f1 INT, f2 VARCHAR(1));
|
||||
INSERT INTO t3 VALUES (7,'f');
|
||||
SELECT t1.f2 FROM t1
|
||||
STRAIGHT_JOIN (t2 JOIN t3 ON t3.f2 = t2.f2 ) ON t3 .f2 = t2 .f2
|
||||
HAVING ('v', 'i') NOT IN (SELECT f2, MIN(f2) FROM t1)
|
||||
ORDER BY f2;
|
||||
f2
|
||||
f
|
||||
f
|
||||
f
|
||||
f
|
||||
DROP TABLES t1,t2,t3;
|
||||
#
|
||||
# Bug#52340 Segfault: read_cached_record (tab=0x94a2634) at sql_select.cc:14411
|
||||
#
|
||||
CREATE TABLE t1 (f1 INT, f2 VARCHAR(1));
|
||||
INSERT INTO t1 VALUES (16,'d');
|
||||
CREATE TABLE t2 (f1 INT, f2 VARCHAR(1));
|
||||
INSERT INTO t2 VALUES (13,'e');
|
||||
INSERT INTO t2 VALUES (20,'d');
|
||||
SELECT MAX(t2.f2) FROM t2 JOIN t1 ON t1.f2
|
||||
HAVING ('e' , 'd') IN
|
||||
(SELECT ts1.f2, ts2.f2 FROM t2 ts1 JOIN t2 ts2 ON ts1.f1)
|
||||
ORDER BY t1.f2;
|
||||
MAX(t2.f2)
|
||||
NULL
|
||||
DROP TABLE t1,t2;
|
||||
End of 5.0 tests
|
||||
|
@ -1161,3 +1161,86 @@ t1 CREATE TABLE `t1` (
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (-685113344), (1), (NULL), (NULL);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
-685113344
|
||||
1
|
||||
2
|
||||
3
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (-685113344), (2), (NULL), (NULL);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
-685113344
|
||||
2
|
||||
3
|
||||
4
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (NULL), (2), (-685113344), (NULL);
|
||||
INSERT INTO t1 VALUES (4), (5), (6), (NULL);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
-685113344
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (NULL), (2), (-685113344), (5);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
-685113344
|
||||
1
|
||||
2
|
||||
5
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1), (2), (-685113344), (NULL);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
-685113344
|
||||
1
|
||||
2
|
||||
3
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
|
@ -25,8 +25,8 @@ ALTER TABLE t1 CHANGE a c INT;
|
||||
ERROR HY000: Error on rename of '#sql-temporary' to './test/t1' (errno: 150)
|
||||
# Ensure that online column rename works.
|
||||
ALTER TABLE t1 CHANGE b c INT;
|
||||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 0
|
||||
affected rows: 3
|
||||
info: Records: 3 Duplicates: 0 Warnings: 0
|
||||
|
||||
# Test renaming the column in the referencing table
|
||||
|
||||
@ -34,8 +34,8 @@ ALTER TABLE t2 CHANGE a c INT;
|
||||
ERROR HY000: Error on rename of '#sql-temporary' to './test/t2' (errno: 150)
|
||||
# Ensure that online column rename works.
|
||||
ALTER TABLE t2 CHANGE b c INT;
|
||||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 0
|
||||
affected rows: 3
|
||||
info: Records: 3 Duplicates: 0 Warnings: 0
|
||||
|
||||
# Test with self-referential constraints
|
||||
|
||||
@ -45,8 +45,8 @@ ALTER TABLE t3 CHANGE b d INT;
|
||||
ERROR HY000: Error on rename of '#sql-temporary' to './test/t3' (errno: 150)
|
||||
# Ensure that online column rename works.
|
||||
ALTER TABLE t3 CHANGE c d INT;
|
||||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 0
|
||||
affected rows: 3
|
||||
info: Records: 3 Duplicates: 0 Warnings: 0
|
||||
|
||||
# Cleanup.
|
||||
|
||||
|
21
mysql-test/r/innodb_bug47621.result
Normal file
21
mysql-test/r/innodb_bug47621.result
Normal file
@ -0,0 +1,21 @@
|
||||
CREATE TABLE bug47621 (salesperson INT) ENGINE=InnoDB;
|
||||
ALTER TABLE bug47621 CHANGE salesperson sales_acct_id INT;
|
||||
create index orgs on bug47621(sales_acct_id);
|
||||
ALTER TABLE bug47621 CHANGE sales_acct_id salesperson INT;
|
||||
drop table bug47621;
|
||||
CREATE TABLE bug47621_sale (
|
||||
salesperson INT,
|
||||
PRIMARY KEY(salesperson)) engine = innodb;
|
||||
CREATE TABLE bug47621_shirt(
|
||||
id SMALLINT,
|
||||
owner INT,
|
||||
FOREIGN KEY(owner)
|
||||
references bug47621_sale(salesperson) ON DELETE RESTRICT)
|
||||
engine = innodb;
|
||||
insert into bug47621_sale values(9);
|
||||
insert into bug47621_shirt values(1, 9);
|
||||
ALTER TABLE bug47621_shirt CHANGE id new_id INT;
|
||||
drop table bug47621_shirt;
|
||||
ALTER TABLE bug47621_sale CHANGE salesperson sales_acct_id INT;
|
||||
ALTER TABLE bug47621_sale ADD INDEX idx (sales_acct_id);
|
||||
drop table bug47621_sale;
|
@ -2281,4 +2281,73 @@ CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb ;
|
||||
SELECT 1 FROM t1 JOIN t1 a USING(a) GROUP BY t1.a,t1.a;
|
||||
1
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#50843: Filesort used instead of clustered index led to
|
||||
# performance degradation.
|
||||
#
|
||||
create table t1(f1 int not null primary key, f2 int) engine=innodb;
|
||||
create table t2(f1 int not null, key (f1)) engine=innodb;
|
||||
insert into t1 values (1,1),(2,2),(3,3);
|
||||
insert into t2 values (1),(2),(3);
|
||||
explain select t1.* from t1 left join t2 using(f1) group by t1.f1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index NULL PRIMARY 4 NULL 3
|
||||
1 SIMPLE t2 ref f1 f1 4 test.t1.f1 1 Using index
|
||||
drop table t1,t2;
|
||||
#
|
||||
#
|
||||
# Bug #39653: find_shortest_key in sql_select.cc does not consider
|
||||
# clustered primary keys
|
||||
#
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c INT, d INT, e INT, f INT,
|
||||
KEY (b,c)) ENGINE=INNODB;
|
||||
INSERT INTO t1 VALUES (1,1,1,1,1,1), (2,2,2,2,2,2), (3,3,3,3,3,3),
|
||||
(4,4,4,4,4,4), (5,5,5,5,5,5), (6,6,6,6,6,6),
|
||||
(7,7,7,7,7,7), (8,8,8,8,8,8), (9,9,9,9,9,9),
|
||||
(11,11,11,11,11,11);
|
||||
EXPLAIN SELECT COUNT(*) FROM t1;
|
||||
id 1
|
||||
select_type SIMPLE
|
||||
table t1
|
||||
type index
|
||||
possible_keys NULL
|
||||
key b
|
||||
key_len 10
|
||||
ref NULL
|
||||
rows 10
|
||||
Extra Using index
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug #49838: DROP INDEX and ADD UNIQUE INDEX for same index may
|
||||
# corrupt definition at engine
|
||||
#
|
||||
CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, KEY k (a,b))
|
||||
ENGINE=InnoDB;
|
||||
ALTER TABLE t1 DROP INDEX k, ADD UNIQUE INDEX k (a,b);
|
||||
SHOW INDEXES FROM t1;;
|
||||
Table t1
|
||||
Non_unique 0
|
||||
Key_name k
|
||||
Seq_in_index 1
|
||||
Column_name a
|
||||
Collation A
|
||||
Cardinality 0
|
||||
Sub_part NULL
|
||||
Packed NULL
|
||||
Null
|
||||
Index_type BTREE
|
||||
Comment
|
||||
Table t1
|
||||
Non_unique 0
|
||||
Key_name k
|
||||
Seq_in_index 2
|
||||
Column_name b
|
||||
Collation A
|
||||
Cardinality 0
|
||||
Sub_part NULL
|
||||
Packed NULL
|
||||
Null
|
||||
Index_type BTREE
|
||||
Comment
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
@ -1117,6 +1117,35 @@ ON t4.a = t5.a
|
||||
ON t1.a = t3.a;
|
||||
a a a a a a
|
||||
DROP TABLE t1,t2,t3,t4,t5,t6;
|
||||
#
|
||||
# Bug#48483: crash in get_best_combination()
|
||||
#
|
||||
CREATE TABLE t1(f1 INT);
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
CREATE VIEW v1 AS SELECT 1 FROM t1 LEFT JOIN t1 AS t2 on 1=1;
|
||||
EXPLAIN EXTENDED
|
||||
SELECT 1 FROM v1 right join v1 AS v2 ON RAND();
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00
|
||||
Warnings:
|
||||
Note 1003 select 1 AS `1` from `test`.`t1` left join `test`.`t1` `t2` on((1 = 1)) left join (`test`.`t1` left join `test`.`t1` `t2` on((1 = 1))) on(rand()) where 1
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#52177 crash with explain, row comparison, join, text field
|
||||
#
|
||||
CREATE TABLE t1 (a TINYINT, b TEXT, KEY (a));
|
||||
INSERT INTO t1 VALUES (0,''),(0,'');
|
||||
FLUSH TABLES;
|
||||
EXPLAIN SELECT 1 FROM t1 LEFT JOIN t1 a ON 1
|
||||
WHERE ROW(t1.a, 1111.11) = ROW(1111.11, 1111.11) AND
|
||||
ROW(t1.b, 1111.11) <=> ROW('','');
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests.
|
||||
CREATE TABLE t1 (f1 int);
|
||||
CREATE TABLE t2 (f1 int);
|
||||
@ -1145,3 +1174,14 @@ NULL
|
||||
NULL
|
||||
1
|
||||
DROP TABLE t1, t2, mm1;
|
||||
#
|
||||
# Bug #50335: Assertion `!(order->used & map)' in eq_ref_table
|
||||
#
|
||||
CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, PRIMARY KEY (a,b));
|
||||
INSERT INTO t1 VALUES (0,0), (1,1);
|
||||
SELECT * FROM t1 STRAIGHT_JOIN t1 t2 ON t1.a=t2.a AND t1.a=t2.b ORDER BY t2.a, t1.a;
|
||||
a b a b
|
||||
0 0 0 0
|
||||
1 1 1 1
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
@ -1289,3 +1289,23 @@ a COUNT( t2.b ) SUM( t2.b ) MAX( t2.b )
|
||||
1 3 6 3
|
||||
NULL 3 6 3
|
||||
DROP TABLE t1, t2;
|
||||
#
|
||||
# Bug#51598 Inconsistent behaviour with a COALESCE statement inside an IN comparison
|
||||
#
|
||||
CREATE TABLE t1(f1 INT, f2 INT, f3 INT);
|
||||
INSERT INTO t1 VALUES (1, NULL, 3);
|
||||
CREATE TABLE t2(f1 INT, f2 INT);
|
||||
INSERT INTO t2 VALUES (2, 1);
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 LEFT JOIN t2 ON t1.f2 = t2.f2
|
||||
WHERE (COALESCE(t1.f1, t2.f1), f3) IN ((1, 3), (2, 2));
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
|
||||
1 SIMPLE t2 system NULL NULL NULL NULL 1 100.00
|
||||
Warnings:
|
||||
Note 1003 select '1' AS `f1`,NULL AS `f2`,'3' AS `f3`,NULL AS `f1`,NULL AS `f2` from `test`.`t1` left join `test`.`t2` on(multiple equal(NULL)) where ((coalesce('1',NULL),'3') in ((1,3),(2,2)))
|
||||
SELECT * FROM t1 LEFT JOIN t2 ON t1.f2 = t2.f2
|
||||
WHERE (COALESCE(t1.f1, t2.f1), f3) IN ((1, 3), (2, 2));
|
||||
f1 f2 f3 f1 f2
|
||||
1 NULL 3 NULL NULL
|
||||
DROP TABLE t1, t2;
|
||||
End of 5.1 tests
|
||||
|
18
mysql-test/r/loaddata.result
Normal file → Executable file
18
mysql-test/r/loaddata.result
Normal file → Executable file
@ -456,6 +456,13 @@ LOAD_FILE("MYSQLTEST_VARDIR/tmp/bug37114.txt")
|
||||
|
||||
set session sql_mode=@OLD_SQL_MODE;
|
||||
DROP TABLE t1,t2;
|
||||
#
|
||||
# Bug #51893: crash with certain characters given to load_file
|
||||
# function on windows
|
||||
#
|
||||
select load_file(0x0A9FB76C661B409C4BEC88098C5DD71B1072F9691F2E827D7EC8F092B299868A3CE196C04F0FB18CAB4E1557EB72331D812379DE7A75CA21C32E7C722C59E5CC33EF262EF04187B0F0EE756FA984DF2EAD37B1E4ADB064C3C5038F2E3B2D661B1C1150AAEB5425512E14D7506166D92D4533872E662F4B2D1428AAB5CCA72E75AA2EF325E196A5A02E2E8278873C64375845994B0F39BE2FF7B478332A7B0AA5E48877C47B6F513E997848AF8CCB8A899F3393AB35333CF0871E36698193862D486B4B9078B70C0A0A507B8A250F3F876F5A067632D5E65193E4445A1EC3A2C9B4C6F07AC334F0F62BC33357CB502E9B1C19D2398B6972AEC2EF21630F8C9134C4F7DD662D8AD7BDC9E19C46720F334B66C22D4BF32ED275144E20E7669FFCF6FC143667C9F02A577F32960FA9F2371BE1FA90E49CBC69C01531F140556854D588DD0E55E1307D78CA38E975CD999F9AEA604266329EE62BFB5ADDA67F549E211ECFBA906C60063696352ABB82AA782D25B17E872EA587871F450446DB1BAE0123D20404A8F2D2698B371002E986C8FCB969A99FF0E150A2709E2ED7633D02ADA87D5B3C9487D27B2BD9D21E2EC3215DCC3CDCD884371281B95A2E9987AAF82EB499C058D9C3E7DC1B66635F60DB121C72F929622DD47B6B2E69F59FF2AE6B63CC2EC60FFBA20EA50569DBAB5DAEFAEB4F03966C9637AB55662EDD28439155A82D053A5299448EDB2E7BEB0F62889E2F84E6C7F34B3212C9AAC32D521D5AB8480993F1906D5450FAB342A0FA6ED223E178BAC036B81E15783604C32A961EA1EF20BE2EBB93D34ED37BC03142B7583303E4557E48551E4BD7CBDDEA146D5485A5D212C35189F0BD6497E66912D2780A59A53B532E12C0A5ED1EC0445D96E8F2DD825221CFE4A65A87AA21DC8750481B9849DD81694C3357A0ED9B78D608D8EDDE28FAFBEC17844DE5709F41E121838DB55639D77E32A259A416D7013B2EB1259FDE1B498CBB9CAEE1D601DF3C915EA91C69B44E6B72062F5F4B3C73F06F2D5AD185E1692E2E0A01E7DD5133693681C52EE13B2BE42D03BDCF48E4E133CF06662339B778E1C3034F9939A433E157449172F7969ACCE1F5D2F65A4E09E4A5D5611EBEDDDBDB0C0C0A);
|
||||
load_file(0x0A9FB76C661B409C4BEC88098C5DD71B1072F9691F2E827D7EC8F092B299868A3CE196C04F0FB18CAB4E1557EB72331D812379DE7A75CA21C32E7C722C59E5CC33EF262EF04187B0F0EE756FA984DF2EAD37B1E4ADB064C3C5038F2E3B2D661B1C1150AAEB5425512E14D7506166D92D4533872E662F4B2D142
|
||||
NULL
|
||||
End of 5.0 tests
|
||||
CREATE TABLE t1 (a int);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
@ -484,4 +491,15 @@ SET character_set_filesystem=default;
|
||||
select @@character_set_filesystem;
|
||||
@@character_set_filesystem
|
||||
binary
|
||||
#
|
||||
# Bug #51850: crash/memory overlap when using load data infile and set
|
||||
# col equal to itself!
|
||||
#
|
||||
CREATE TABLE t1(col0 LONGBLOB);
|
||||
SELECT 'test' INTO OUTFILE 't1.txt';
|
||||
LOAD DATA INFILE 't1.txt' IGNORE INTO TABLE t1 SET col0=col0;
|
||||
SELECT * FROM t1;
|
||||
col0
|
||||
test
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
47
mysql-test/r/log_tables_upgrade.result
Normal file
47
mysql-test/r/log_tables_upgrade.result
Normal file
@ -0,0 +1,47 @@
|
||||
#
|
||||
# Bug#49823: mysql_upgrade fatal error due to general_log / slow_low CSV NULL
|
||||
#
|
||||
USE test;
|
||||
SET @saved_general_log = @@GLOBAL.general_log;
|
||||
SET GLOBAL general_log = OFF;
|
||||
USE mysql;
|
||||
FLUSH TABLES;
|
||||
REPAIR TABLE test.bug49823;
|
||||
Table Op Msg_type Msg_text
|
||||
test.bug49823 repair status OK
|
||||
RENAME TABLE general_log TO renamed_general_log;
|
||||
RENAME TABLE test.bug49823 TO general_log;
|
||||
mtr.global_suppressions OK
|
||||
mtr.test_suppressions OK
|
||||
mysql.columns_priv OK
|
||||
mysql.db OK
|
||||
mysql.event OK
|
||||
mysql.func OK
|
||||
mysql.general_log
|
||||
Error : You can't use locks with log tables.
|
||||
status : OK
|
||||
mysql.help_category OK
|
||||
mysql.help_keyword OK
|
||||
mysql.help_relation OK
|
||||
mysql.help_topic OK
|
||||
mysql.host OK
|
||||
mysql.ndb_binlog_index OK
|
||||
mysql.plugin OK
|
||||
mysql.proc OK
|
||||
mysql.procs_priv OK
|
||||
mysql.renamed_general_log OK
|
||||
mysql.servers OK
|
||||
mysql.slow_log
|
||||
Error : You can't use locks with log tables.
|
||||
status : OK
|
||||
mysql.tables_priv OK
|
||||
mysql.time_zone OK
|
||||
mysql.time_zone_leap_second OK
|
||||
mysql.time_zone_name OK
|
||||
mysql.time_zone_transition OK
|
||||
mysql.time_zone_transition_type OK
|
||||
mysql.user OK
|
||||
DROP TABLE general_log;
|
||||
RENAME TABLE renamed_general_log TO general_log;
|
||||
SET GLOBAL general_log = @saved_general_log;
|
||||
USE test;
|
@ -2219,4 +2219,83 @@ Trigger sql_mode SQL Original Statement character_set_client collation_connectio
|
||||
tr1 CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER INSERT ON t3 FOR EACH ROW CALL foo() latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
DROP TRIGGER tr1;
|
||||
DROP TABLE t1, t2, t3;
|
||||
#
|
||||
# BUG#48265 - MRG_MYISAM problem (works in 5.0.85, does't work in 5.1.40)
|
||||
#
|
||||
CREATE DATABASE `test/1`;
|
||||
CREATE TABLE `test/1`.`t/1`(a INT);
|
||||
CREATE TABLE m1(a INT) ENGINE=MERGE UNION=(`test/1`.`t/1`);
|
||||
SELECT * FROM m1;
|
||||
a
|
||||
SHOW CREATE TABLE m1;
|
||||
Table Create Table
|
||||
m1 CREATE TABLE `m1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`test/1`.`t/1`)
|
||||
DROP TABLE m1;
|
||||
CREATE TABLE `test/1`.m1(a INT) ENGINE=MERGE UNION=(`test/1`.`t/1`);
|
||||
SELECT * FROM `test/1`.m1;
|
||||
a
|
||||
SHOW CREATE TABLE `test/1`.m1;
|
||||
Table Create Table
|
||||
m1 CREATE TABLE `m1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`t/1`)
|
||||
DROP TABLE `test/1`.m1;
|
||||
DROP TABLE `test/1`.`t/1`;
|
||||
CREATE TEMPORARY TABLE `test/1`.`t/1`(a INT);
|
||||
CREATE TEMPORARY TABLE m1(a INT) ENGINE=MERGE UNION=(`test/1`.`t/1`);
|
||||
SELECT * FROM m1;
|
||||
a
|
||||
SHOW CREATE TABLE m1;
|
||||
Table Create Table
|
||||
m1 CREATE TEMPORARY TABLE `m1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`test/1`.`t/1`)
|
||||
DROP TABLE m1;
|
||||
CREATE TEMPORARY TABLE `test/1`.m1(a INT) ENGINE=MERGE UNION=(`test/1`.`t/1`);
|
||||
SELECT * FROM `test/1`.m1;
|
||||
a
|
||||
SHOW CREATE TABLE `test/1`.m1;
|
||||
Table Create Table
|
||||
m1 CREATE TEMPORARY TABLE `m1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`t/1`)
|
||||
DROP TABLE `test/1`.m1;
|
||||
DROP TABLE `test/1`.`t/1`;
|
||||
DROP DATABASE `test/1`;
|
||||
CREATE TABLE `t@1`(a INT);
|
||||
SELECT * FROM m1;
|
||||
a
|
||||
SHOW CREATE TABLE m1;
|
||||
Table Create Table
|
||||
m1 CREATE TABLE `m1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`t@1`)
|
||||
DROP TABLE `t@1`;
|
||||
CREATE DATABASE `test@1`;
|
||||
CREATE TABLE `test@1`.`t@1`(a INT);
|
||||
FLUSH TABLE m1;
|
||||
SELECT * FROM m1;
|
||||
a
|
||||
SHOW CREATE TABLE m1;
|
||||
Table Create Table
|
||||
m1 CREATE TABLE `m1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`test@1`.`t@1`)
|
||||
DROP TABLE m1;
|
||||
DROP TABLE `test@1`.`t@1`;
|
||||
DROP DATABASE `test@1`;
|
||||
#
|
||||
# Bug#51494c rash with join, explain and 'sounds like' operator
|
||||
#
|
||||
CREATE TABLE t1 (a INT) ENGINE=MYISAM;
|
||||
INSERT INTO t1 VALUES(1);
|
||||
CREATE TABLE t2 (b INT NOT NULL,c INT,d INT,e BLOB NOT NULL,
|
||||
KEY idx0 (d, c)) ENGINE=MERGE;
|
||||
EXPLAIN SELECT * FROM t1 NATURAL RIGHT JOIN
|
||||
t2 WHERE b SOUNDS LIKE e AND d = 1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
DROP TABLE t2, t1;
|
||||
End of 5.1 tests
|
||||
|
@ -198,4 +198,15 @@ def IF(i, d, d) IF(i, d, d) 10 10 10 Y 128 0 63
|
||||
def IFNULL(d, d) IFNULL(d, d) 10 10 10 Y 128 0 63
|
||||
def LEAST(d, d) LEAST(d, d) 10 10 10 Y 128 0 63
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#41788 mysql_fetch_field returns org_table == table by a view
|
||||
#
|
||||
CREATE TABLE t1 (f1 INT);
|
||||
CREATE VIEW v1 AS SELECT f1 FROM t1;
|
||||
SELECT f1 FROM v1 va;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def test v1 va f1 f1 3 11 0 Y 32768 0 63
|
||||
f1
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
|
@ -2313,6 +2313,8 @@ INSERT INTO t1 SELECT a+1280,b FROM t1;
|
||||
INSERT INTO t1 SELECT a+2560,b FROM t1;
|
||||
INSERT INTO t1 SELECT a+5120,b FROM t1;
|
||||
SET myisam_sort_buffer_size=4;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '4'
|
||||
REPAIR TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 repair error myisam_sort_buffer_size is too small
|
||||
@ -2339,4 +2341,75 @@ CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#51304: checksum table gives different results
|
||||
# for same data when using bit fields
|
||||
#
|
||||
CREATE TABLE t1(a INT, b BIT(1));
|
||||
INSERT INTO t1 VALUES(1, 0), (2, 1);
|
||||
CREATE TABLE t2 SELECT * FROM t1;
|
||||
CHECKSUM TABLE t1 EXTENDED;
|
||||
Table Checksum
|
||||
test.t1 3775188275
|
||||
CHECKSUM TABLE t2 EXTENDED;
|
||||
Table Checksum
|
||||
test.t2 3775188275
|
||||
CHECKSUM TABLE t3 EXTENDED;
|
||||
Table Checksum
|
||||
test.t3 3775188275
|
||||
DROP TABLE t1, t2, t3;
|
||||
#
|
||||
# BUG#51307 - widespread corruption with partitions and insert...select
|
||||
#
|
||||
CREATE TABLE t1(a CHAR(255), KEY(a));
|
||||
SELECT * FROM t1, t1 AS a1;
|
||||
a a
|
||||
SET myisam_sort_buffer_size=4;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '4'
|
||||
INSERT INTO t1 VALUES
|
||||
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
|
||||
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
|
||||
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
|
||||
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
|
||||
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
|
||||
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
|
||||
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
|
||||
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
|
||||
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
|
||||
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
|
||||
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
|
||||
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
|
||||
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
|
||||
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
|
||||
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
|
||||
('0'),('0'),('0'),('0'),('0'),('0'),('0');
|
||||
Warnings:
|
||||
Error 1034 myisam_sort_buffer_size is too small
|
||||
Error 1034 Number of rows changed from 0 to 157
|
||||
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
|
||||
INSERT INTO t1 VALUES('1');
|
||||
SELECT * FROM t1, t1 AS a1 WHERE t1.a=1 AND a1.a=1;
|
||||
a a
|
||||
1 1
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# BUG#47444 - --myisam_repair_threads>1can result in all index
|
||||
# cardinalities=1
|
||||
#
|
||||
SET myisam_repair_threads=2;
|
||||
SET myisam_sort_buffer_size=4096;
|
||||
CREATE TABLE t1(a CHAR(255), KEY(a), KEY(a), KEY(a));
|
||||
INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9),(0),(1),(2),(3);
|
||||
REPAIR TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 repair status OK
|
||||
SELECT CARDINALITY FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
|
||||
CARDINALITY
|
||||
14
|
||||
14
|
||||
14
|
||||
DROP TABLE t1;
|
||||
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
|
||||
SET myisam_repair_threads=@@global.myisam_repair_threads;
|
||||
End of 5.1 tests
|
||||
|
@ -479,7 +479,7 @@ FLUSH LOGS;
|
||||
RESET MASTER;
|
||||
FLUSH LOGS;
|
||||
#
|
||||
# Test if the 'BEGIN', 'ROLLBACK' and 'COMMIT' are output if the database specified is exist
|
||||
# Test if the 'BEGIN', 'ROLLBACK' and 'COMMIT' are output if the database specified exists
|
||||
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
|
||||
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
|
||||
DELIMITER /*!*/;
|
||||
@ -532,7 +532,7 @@ DELIMITER ;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
#
|
||||
# Test if the 'BEGIN', 'ROLLBACK' and 'COMMIT' are output if the database specified is not exist
|
||||
# Test if the 'BEGIN', 'ROLLBACK' and 'COMMIT' are output if the database specified does not exist
|
||||
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
|
||||
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
|
||||
DELIMITER /*!*/;
|
||||
@ -565,5 +565,76 @@ DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
#
|
||||
# Test if the 'SAVEPOINT', 'ROLLBACK TO' are output if the database specified exists
|
||||
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
|
||||
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
|
||||
DELIMITER /*!*/;
|
||||
SET TIMESTAMP=1266652094/*!*/;
|
||||
SET @@session.pseudo_thread_id=999999999/*!*/;
|
||||
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
|
||||
SET @@session.sql_mode=0/*!*/;
|
||||
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
SET @@session.lc_time_names=0/*!*/;
|
||||
SET @@session.collation_database=DEFAULT/*!*/;
|
||||
BEGIN
|
||||
/*!*/;
|
||||
use test/*!*/;
|
||||
SET TIMESTAMP=1266652094/*!*/;
|
||||
SavePoint mixed_cases
|
||||
/*!*/;
|
||||
use db1/*!*/;
|
||||
SET TIMESTAMP=1266652094/*!*/;
|
||||
INSERT INTO db1.t2 VALUES("in savepoint mixed_cases")
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1266652094/*!*/;
|
||||
INSERT INTO db1.t1 VALUES(40)
|
||||
/*!*/;
|
||||
use test/*!*/;
|
||||
SET TIMESTAMP=1266652094/*!*/;
|
||||
ROLLBACK TO mixed_cases
|
||||
/*!*/;
|
||||
use db1/*!*/;
|
||||
SET TIMESTAMP=1266652094/*!*/;
|
||||
INSERT INTO db1.t2 VALUES("after rollback to")
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1266652094/*!*/;
|
||||
INSERT INTO db1.t1 VALUES(50)
|
||||
/*!*/;
|
||||
COMMIT/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
#
|
||||
# Test if the 'SAVEPOINT', 'ROLLBACK TO' are output if the database specified does not exist
|
||||
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
|
||||
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
|
||||
DELIMITER /*!*/;
|
||||
SET TIMESTAMP=1266652094/*!*/;
|
||||
SET @@session.pseudo_thread_id=999999999/*!*/;
|
||||
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
|
||||
SET @@session.sql_mode=0/*!*/;
|
||||
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
SET @@session.lc_time_names=0/*!*/;
|
||||
SET @@session.collation_database=DEFAULT/*!*/;
|
||||
BEGIN
|
||||
/*!*/;
|
||||
use test/*!*/;
|
||||
SET TIMESTAMP=1266652094/*!*/;
|
||||
SavePoint mixed_cases
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1266652094/*!*/;
|
||||
ROLLBACK TO mixed_cases
|
||||
/*!*/;
|
||||
COMMIT/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
End of 5.0 tests
|
||||
End of 5.1 tests
|
||||
|
@ -2365,7 +2365,7 @@ BEGIN
|
||||
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
|
||||
### INSERT INTO test.t1
|
||||
### SET
|
||||
### @1=b'00000000' /* BIT(8) meta=256 nullable=1 is_null=0 */
|
||||
### @1=b'0' /* BIT(1) meta=1 nullable=1 is_null=0 */
|
||||
### @2=b'0000000000000000000000000000000000000000000000000000000000000000' /* BIT(64) meta=2048 nullable=1 is_null=0 */
|
||||
### @3=-128 (128) /* TINYINT meta=0 nullable=1 is_null=0 */
|
||||
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
|
||||
@ -2458,7 +2458,7 @@ BEGIN
|
||||
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
|
||||
### INSERT INTO test.t1
|
||||
### SET
|
||||
### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
|
||||
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
|
||||
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
|
||||
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
|
||||
### @4=-1 (255) /* TINYINT meta=0 nullable=1 is_null=0 */
|
||||
@ -2553,7 +2553,7 @@ BEGIN
|
||||
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
|
||||
### INSERT INTO test.t1
|
||||
### SET
|
||||
### @1=NULL /* type=16 meta=256 nullable=1 is_null=1 */
|
||||
### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */
|
||||
### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */
|
||||
### @3=NULL /* type=1 meta=0 nullable=1 is_null=1 */
|
||||
### @4=NULL /* type=1 meta=0 nullable=1 is_null=1 */
|
||||
@ -2634,7 +2634,7 @@ BEGIN
|
||||
### @79=3 /* INT meta=0 nullable=1 is_null=0 */
|
||||
### INSERT INTO test.t1
|
||||
### SET
|
||||
### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
|
||||
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
|
||||
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
|
||||
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
|
||||
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
|
||||
@ -2727,7 +2727,7 @@ BEGIN
|
||||
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
|
||||
### UPDATE test.t1
|
||||
### WHERE
|
||||
### @1=b'00000000' /* BIT(8) meta=256 nullable=1 is_null=0 */
|
||||
### @1=b'0' /* BIT(1) meta=1 nullable=1 is_null=0 */
|
||||
### @2=b'0000000000000000000000000000000000000000000000000000000000000000' /* BIT(64) meta=2048 nullable=1 is_null=0 */
|
||||
### @3=-128 (128) /* TINYINT meta=0 nullable=1 is_null=0 */
|
||||
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
|
||||
@ -2807,7 +2807,7 @@ BEGIN
|
||||
### @78=b'00000000' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
|
||||
### @79=1 /* INT meta=0 nullable=1 is_null=0 */
|
||||
### SET
|
||||
### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
|
||||
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
|
||||
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
|
||||
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
|
||||
### @4=-1 (255) /* TINYINT meta=0 nullable=1 is_null=0 */
|
||||
@ -2900,7 +2900,7 @@ BEGIN
|
||||
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
|
||||
### UPDATE test.t1
|
||||
### WHERE
|
||||
### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
|
||||
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
|
||||
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
|
||||
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
|
||||
### @4=-1 (255) /* TINYINT meta=0 nullable=1 is_null=0 */
|
||||
@ -2980,7 +2980,7 @@ BEGIN
|
||||
### @78=b'00000111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
|
||||
### @79=2 /* INT meta=0 nullable=1 is_null=0 */
|
||||
### SET
|
||||
### @1=b'00000000' /* BIT(8) meta=256 nullable=1 is_null=0 */
|
||||
### @1=b'0' /* BIT(1) meta=1 nullable=1 is_null=0 */
|
||||
### @2=b'0000000000000000000000000000000000000000000000000000000000000000' /* BIT(64) meta=2048 nullable=1 is_null=0 */
|
||||
### @3=-128 (128) /* TINYINT meta=0 nullable=1 is_null=0 */
|
||||
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
|
||||
@ -3073,7 +3073,7 @@ BEGIN
|
||||
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
|
||||
### UPDATE test.t1
|
||||
### WHERE
|
||||
### @1=NULL /* type=16 meta=256 nullable=1 is_null=1 */
|
||||
### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */
|
||||
### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */
|
||||
### @3=NULL /* type=1 meta=0 nullable=1 is_null=1 */
|
||||
### @4=NULL /* type=1 meta=0 nullable=1 is_null=1 */
|
||||
@ -3153,7 +3153,7 @@ BEGIN
|
||||
### @78=NULL /* TIMESTAMP meta=63489 nullable=1 is_null=1 */
|
||||
### @79=3 /* INT meta=0 nullable=1 is_null=0 */
|
||||
### SET
|
||||
### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
|
||||
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
|
||||
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
|
||||
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
|
||||
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
|
||||
@ -3246,7 +3246,7 @@ BEGIN
|
||||
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
|
||||
### UPDATE test.t1
|
||||
### WHERE
|
||||
### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
|
||||
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
|
||||
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
|
||||
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
|
||||
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
|
||||
@ -3326,7 +3326,7 @@ BEGIN
|
||||
### @78=b'00000110' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
|
||||
### @79=4 /* INT meta=0 nullable=1 is_null=0 */
|
||||
### SET
|
||||
### @1=NULL /* type=16 meta=256 nullable=1 is_null=1 */
|
||||
### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */
|
||||
### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */
|
||||
### @3=NULL /* type=1 meta=0 nullable=1 is_null=1 */
|
||||
### @4=NULL /* type=1 meta=0 nullable=1 is_null=1 */
|
||||
@ -3419,7 +3419,7 @@ BEGIN
|
||||
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
|
||||
### DELETE FROM test.t1
|
||||
### WHERE
|
||||
### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
|
||||
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
|
||||
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
|
||||
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
|
||||
### @4=-1 (255) /* TINYINT meta=0 nullable=1 is_null=0 */
|
||||
@ -3512,7 +3512,7 @@ BEGIN
|
||||
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
|
||||
### DELETE FROM test.t1
|
||||
### WHERE
|
||||
### @1=b'00000000' /* BIT(8) meta=256 nullable=1 is_null=0 */
|
||||
### @1=b'0' /* BIT(1) meta=1 nullable=1 is_null=0 */
|
||||
### @2=b'0000000000000000000000000000000000000000000000000000000000000000' /* BIT(64) meta=2048 nullable=1 is_null=0 */
|
||||
### @3=-128 (128) /* TINYINT meta=0 nullable=1 is_null=0 */
|
||||
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
|
||||
@ -3605,7 +3605,7 @@ BEGIN
|
||||
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
|
||||
### DELETE FROM test.t1
|
||||
### WHERE
|
||||
### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
|
||||
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
|
||||
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
|
||||
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
|
||||
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
|
||||
@ -3698,7 +3698,7 @@ BEGIN
|
||||
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
|
||||
### DELETE FROM test.t1
|
||||
### WHERE
|
||||
### @1=NULL /* type=16 meta=256 nullable=1 is_null=1 */
|
||||
### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */
|
||||
### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */
|
||||
### @3=NULL /* type=1 meta=0 nullable=1 is_null=1 */
|
||||
### @4=NULL /* type=1 meta=0 nullable=1 is_null=1 */
|
||||
|
@ -2088,4 +2088,15 @@ SELECT 1 FROM t1 JOIN t1 AS t2 USING (a) FOR UPDATE;
|
||||
1
|
||||
1
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# BUG#51868 - crash with myisam_use_mmap and partitioned myisam tables
|
||||
#
|
||||
SET GLOBAL myisam_use_mmap=1;
|
||||
CREATE TABLE t1(a INT) PARTITION BY HASH(a) PARTITIONS 1;
|
||||
INSERT INTO t1 VALUES(0);
|
||||
FLUSH TABLE t1;
|
||||
TRUNCATE TABLE t1;
|
||||
INSERT INTO t1 VALUES(0);
|
||||
DROP TABLE t1;
|
||||
SET GLOBAL myisam_use_mmap=default;
|
||||
End of 5.1 tests
|
||||
|
@ -1,4 +1,46 @@
|
||||
drop table if exists t1;
|
||||
#
|
||||
# Bug#50392: insert_id is not reset for partitioned tables
|
||||
# auto_increment on duplicate entry
|
||||
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY);
|
||||
SET INSERT_ID= 13;
|
||||
INSERT INTO t1 VALUES (NULL);
|
||||
SET INSERT_ID= 12;
|
||||
INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
|
||||
ERROR 23000: Duplicate entry '13' for key 'PRIMARY'
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=14 DEFAULT CHARSET=latin1
|
||||
INSERT INTO t1 VALUES (NULL);
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
12
|
||||
13
|
||||
14
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) PARTITION BY KEY(a);
|
||||
SET INSERT_ID= 13;
|
||||
INSERT INTO t1 VALUES (NULL);
|
||||
SET INSERT_ID= 12;
|
||||
INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
|
||||
ERROR 23000: Duplicate entry '13' for key 'PRIMARY'
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=14 DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY KEY (a) */
|
||||
INSERT INTO t1 VALUES (NULL);
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
12
|
||||
13
|
||||
14
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a INTEGER NOT NULL, PRIMARY KEY (a));
|
||||
INSERT INTO t1 VALUES (1),(1);
|
||||
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||
|
@ -1,4 +1,73 @@
|
||||
drop table if exists t1;
|
||||
drop table if exists t1, t2;
|
||||
#
|
||||
# Bug#51830: Incorrect partition pruning on range partition (regression)
|
||||
#
|
||||
CREATE TABLE t1 (a INT NOT NULL)
|
||||
ENGINE = InnoDB
|
||||
PARTITION BY RANGE(a)
|
||||
(PARTITION p10 VALUES LESS THAN (10),
|
||||
PARTITION p30 VALUES LESS THAN (30),
|
||||
PARTITION p50 VALUES LESS THAN (50),
|
||||
PARTITION p70 VALUES LESS THAN (70),
|
||||
PARTITION p90 VALUES LESS THAN (90));
|
||||
INSERT INTO t1 VALUES (10),(30),(50);
|
||||
INSERT INTO t1 VALUES (70);
|
||||
INSERT INTO t1 VALUES (80);
|
||||
INSERT INTO t1 VALUES (89);
|
||||
INSERT INTO t1 VALUES (90);
|
||||
ERROR HY000: Table has no partition for value 90
|
||||
INSERT INTO t1 VALUES (100);
|
||||
ERROR HY000: Table has no partition for value 100
|
||||
insert INTO t1 VALUES (110);
|
||||
ERROR HY000: Table has no partition for value 110
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 90;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 90;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 90;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 89;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p90 ALL NULL NULL NULL NULL 7 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 89;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p90 ALL NULL NULL NULL NULL 7 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 89;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 100;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 100;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 100;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#50104: Partitioned table with just 1 partion works with fk
|
||||
#
|
||||
CREATE TABLE t2 (
|
||||
id INT,
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE=InnoDB ;
|
||||
CREATE TABLE t1 (
|
||||
id INT NOT NULL AUTO_INCREMENT,
|
||||
parent_id INT DEFAULT NULL,
|
||||
PRIMARY KEY (id),
|
||||
KEY parent_id (parent_id)
|
||||
) ENGINE=InnoDB;
|
||||
ALTER TABLE t1 PARTITION BY HASH (id) PARTITIONS 1;
|
||||
ALTER TABLE t1 ADD CONSTRAINT test_ibfk_1 FOREIGN KEY (parent_id) REFERENCES t2 (id);
|
||||
ERROR HY000: Foreign key clause is not yet supported in conjunction with partitioning
|
||||
ALTER TABLE t1 PARTITION BY HASH (id) PARTITIONS 2;
|
||||
ALTER TABLE t1 ADD CONSTRAINT test_ibfk_1 FOREIGN KEY (parent_id) REFERENCES t2 (id);
|
||||
ERROR HY000: Foreign key clause is not yet supported in conjunction with partitioning
|
||||
DROP TABLE t1, t2;
|
||||
create table t1 (a int not null,
|
||||
b datetime not null,
|
||||
primary key (a,b))
|
||||
|
@ -270,7 +270,7 @@ a
|
||||
8
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 7;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 max range PRIMARY PRIMARY 4 NULL 2 Using where; Using index
|
||||
1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
|
||||
SELECT * FROM t1 WHERE a > 1;
|
||||
a
|
||||
2
|
||||
@ -327,13 +327,13 @@ a
|
||||
8
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 6;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 max range PRIMARY PRIMARY 4 NULL 2 Using where; Using index
|
||||
1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
|
||||
SELECT * FROM t1 WHERE a > 7;
|
||||
a
|
||||
8
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 7;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 max range PRIMARY PRIMARY 4 NULL 2 Using where; Using index
|
||||
1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY)
|
||||
PARTITION BY RANGE (a) (
|
||||
@ -556,7 +556,7 @@ a
|
||||
7
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 6;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 max range PRIMARY PRIMARY 4 NULL 2 Using where; Using index
|
||||
1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
|
||||
SELECT * FROM t1 WHERE a > 1;
|
||||
a
|
||||
2
|
||||
@ -601,13 +601,13 @@ a
|
||||
7
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 5;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 max range PRIMARY PRIMARY 4 NULL 2 Using where; Using index
|
||||
1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
|
||||
SELECT * FROM t1 WHERE a > 6;
|
||||
a
|
||||
7
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 6;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 max range PRIMARY PRIMARY 4 NULL 2 Using where; Using index
|
||||
1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
|
||||
DROP TABLE t1;
|
||||
# test of RANGE and index
|
||||
CREATE TABLE t1 (a DATE, KEY(a))
|
||||
@ -757,10 +757,10 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01,p2001-01-01 range a a 4 NULL 5 Using where; Using index
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1999-02-31';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 pNULL,p2001-01-01 range a a 4 NULL 2 Using where; Using index
|
||||
1 SIMPLE t1 pNULL,p2001-01-01 index a a 4 NULL 7 Using where; Using index
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1999-02-31';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 pNULL,p2001-01-01 range a a 4 NULL 2 Using where; Using index
|
||||
1 SIMPLE t1 pNULL,p2001-01-01 index a a 4 NULL 7 Using where; Using index
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1999-02-31';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 pNULL ref a a 4 const 1 Using where; Using index
|
||||
@ -1086,10 +1086,10 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 range a a 4 NULL 5 Using where; Using index
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1999-02-31';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p2001-01-01,pNULL range a a 4 NULL 2 Using where; Using index
|
||||
1 SIMPLE t1 p2001-01-01,pNULL index a a 4 NULL 7 Using where; Using index
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1999-02-31';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p2001-01-01,pNULL range a a 4 NULL 2 Using where; Using index
|
||||
1 SIMPLE t1 p2001-01-01,pNULL index a a 4 NULL 7 Using where; Using index
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1999-02-31';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 pNULL ref a a 4 const 1 Using where; Using index
|
||||
@ -1101,7 +1101,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 range a a 4 NULL 4 Using where; Using index
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-02' AND '1002-00-00';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 pNULL,p1001-01-01 range a a 4 NULL 2 Using where; Using index
|
||||
1 SIMPLE t1 pNULL,p1001-01-01 index a a 4 NULL 7 Using where; Using index
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0001-01-01,pNULL,p1001-01-01 range a a 4 NULL 3 Using where; Using index
|
||||
@ -2101,6 +2101,21 @@ insert into t7 values (10),(30),(50);
|
||||
explain partitions select * from t7 where a < 5;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
explain partitions select * from t7 where a < 9;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
explain partitions select * from t7 where a <= 9;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
explain partitions select * from t7 where a = 9;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
explain partitions select * from t7 where a >= 9;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t7 p10,p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where
|
||||
explain partitions select * from t7 where a > 9;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t7 p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where
|
||||
explain partitions select * from t7 where a < 10;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
@ -2110,9 +2125,33 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
explain partitions select * from t7 where a = 10;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t7 p30 system NULL NULL NULL NULL 1
|
||||
explain partitions select * from t7 where a >= 10;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t7 p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where
|
||||
explain partitions select * from t7 where a > 10;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t7 p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where
|
||||
explain partitions select * from t7 where a < 89;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t7 p10,p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where
|
||||
explain partitions select * from t7 where a <= 89;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t7 p10,p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where
|
||||
explain partitions select * from t7 where a = 89;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
explain partitions select * from t7 where a > 89;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
explain partitions select * from t7 where a >= 89;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
explain partitions select * from t7 where a < 90;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t7 p10,p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where
|
||||
explain partitions select * from t7 where a <= 90;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t7 p10,p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where
|
||||
explain partitions select * from t7 where a = 90;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
@ -2122,6 +2161,9 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
explain partitions select * from t7 where a >= 90;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
explain partitions select * from t7 where a > 91;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
explain partitions select * from t7 where a > 11 and a < 29;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
@ -2137,6 +2179,21 @@ insert into t7 values (10),(30),(50);
|
||||
explain partitions select * from t7 where a < 5;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
explain partitions select * from t7 where a < 9;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
explain partitions select * from t7 where a <= 9;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
explain partitions select * from t7 where a = 9;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
explain partitions select * from t7 where a >= 9;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t7 p10,p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where
|
||||
explain partitions select * from t7 where a > 9;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t7 p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where
|
||||
explain partitions select * from t7 where a < 10;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
@ -2146,9 +2203,33 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
explain partitions select * from t7 where a = 10;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t7 p30 system NULL NULL NULL NULL 1
|
||||
explain partitions select * from t7 where a >= 10;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t7 p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where
|
||||
explain partitions select * from t7 where a > 10;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t7 p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where
|
||||
explain partitions select * from t7 where a < 89;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t7 p10,p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where
|
||||
explain partitions select * from t7 where a <= 89;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t7 p10,p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where
|
||||
explain partitions select * from t7 where a = 89;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
explain partitions select * from t7 where a > 89;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
explain partitions select * from t7 where a >= 89;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
explain partitions select * from t7 where a < 90;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t7 p10,p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where
|
||||
explain partitions select * from t7 where a <= 90;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t7 p10,p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where
|
||||
explain partitions select * from t7 where a = 90;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
@ -2158,6 +2239,9 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
explain partitions select * from t7 where a >= 90;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
explain partitions select * from t7 where a > 91;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
explain partitions select * from t7 where a > 11 and a < 29;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
|
@ -1,4 +1,18 @@
|
||||
drop table if exists t1, t2;
|
||||
#
|
||||
# Bug#48229: group by performance issue of partitioned table
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
a INT,
|
||||
b INT,
|
||||
KEY a (a,b)
|
||||
)
|
||||
PARTITION BY HASH (a) PARTITIONS 1;
|
||||
INSERT INTO t1 VALUES (0, 580092), (3, 894076), (4, 805483), (4, 913540), (6, 611137), (8, 171602), (9, 599495), (9, 746305), (10, 272829), (10, 847519), (12, 258869), (12, 929028), (13, 288970), (15, 20971), (15, 105839), (16, 788272), (17, 76914), (18, 827274), (19, 802258), (20, 123677), (20, 587729), (22, 701449), (25, 31565), (25, 230782), (25, 442887), (25, 733139), (25, 851020);
|
||||
EXPLAIN SELECT a, MAX(b) FROM t1 WHERE a IN (10, 100, 3) GROUP BY a;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range a a 5 NULL 4 Using where; Using index
|
||||
DROP TABLE t1;
|
||||
create table t1 (a int)
|
||||
partition by range (a)
|
||||
( partition p0 values less than (maxvalue));
|
||||
|
10
mysql-test/r/plugin_not_embedded.result
Normal file
10
mysql-test/r/plugin_not_embedded.result
Normal file
@ -0,0 +1,10 @@
|
||||
#
|
||||
# Bug#51770: UNINSTALL PLUGIN requires no privileges
|
||||
#
|
||||
GRANT INSERT ON mysql.plugin TO bug51770@localhost;
|
||||
INSTALL PLUGIN example SONAME 'ha_example.so';
|
||||
UNINSTALL PLUGIN example;
|
||||
ERROR 42000: DELETE command denied to user 'bug51770'@'localhost' for table 'plugin'
|
||||
GRANT DELETE ON mysql.plugin TO bug51770@localhost;
|
||||
UNINSTALL PLUGIN example;
|
||||
DROP USER bug51770@localhost;
|
@ -1786,7 +1786,7 @@ prepare stmt from "create view v1 (c,d,e,f) as select a,b,a in (select a+2 from
|
||||
execute stmt;
|
||||
show create view v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `c`,`t1`.`b` AS `d`,`t1`.`a` in (select (`t1`.`a` + 2) AS `a+2` from `t1`) AS `e`,`t1`.`a` = all (select `t1`.`a` AS `a` from `t1`) AS `f` from `t1` latin1 latin1_swedish_ci
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `c`,`t1`.`b` AS `d`,`t1`.`a` in (select (`t1`.`a` + 2) from `t1`) AS `e`,`t1`.`a` = all (select `t1`.`a` from `t1`) AS `f` from `t1` latin1 latin1_swedish_ci
|
||||
select * from v1;
|
||||
c d e f
|
||||
drop view v1;
|
||||
@ -1794,7 +1794,7 @@ execute stmt;
|
||||
deallocate prepare stmt;
|
||||
show create view v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `c`,`t1`.`b` AS `d`,`t1`.`a` in (select (`t1`.`a` + 2) AS `a+2` from `t1`) AS `e`,`t1`.`a` = all (select `t1`.`a` AS `a` from `t1`) AS `f` from `t1` latin1 latin1_swedish_ci
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `c`,`t1`.`b` AS `d`,`t1`.`a` in (select (`t1`.`a` + 2) from `t1`) AS `e`,`t1`.`a` = all (select `t1`.`a` from `t1`) AS `f` from `t1` latin1 latin1_swedish_ci
|
||||
select * from v1;
|
||||
c d e f
|
||||
drop view v1;
|
||||
@ -2988,4 +2988,17 @@ select @plaintext;
|
||||
bcd
|
||||
deallocate prepare encode;
|
||||
deallocate prepare decode;
|
||||
#
|
||||
# Bug#52124 memory leaks like a sieve in datetime, timestamp, time, date fields + warnings
|
||||
#
|
||||
CREATE TABLE t1 (a DATETIME NOT NULL, b TINYINT);
|
||||
INSERT INTO t1 VALUES (0, 0),(0, 0);
|
||||
PREPARE stmt FROM "SELECT 1 FROM t1 WHERE
|
||||
ROW(a, b) >= ROW('1', (SELECT 1 FROM t1 WHERE a > 1234))";
|
||||
EXECUTE stmt;
|
||||
1
|
||||
EXECUTE stmt;
|
||||
1
|
||||
DEALLOCATE PREPARE stmt;
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests.
|
||||
|
@ -193,4 +193,17 @@ show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 2
|
||||
drop table t1;
|
||||
#
|
||||
# Bug46615 Assertion in Query_cache::invalidate in INSERT in a VIEW of a MERGE table
|
||||
#
|
||||
CREATE TABLE t1 (c1 INT, c2 INT);
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
CREATE VIEW t1_view AS SELECT c1 FROM t1 NATURAL JOIN t2 ;
|
||||
INSERT INTO t1_view (c1, c2) SELECT c1, c2 FROM t1;
|
||||
ERROR 42S22: Unknown column 'c2' in 'field list'
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP VIEW t1_view;
|
||||
SET AUTOCOMMIT=DEFAULT;
|
||||
set GLOBAL query_cache_size=default;
|
||||
|
@ -457,3 +457,12 @@ abc 1 abc 1
|
||||
select host,user from mysql.user where (host,user) = ('localhost','test');
|
||||
host user
|
||||
drop table t1,t2;
|
||||
#
|
||||
# Bug#52124 memory leaks like a sieve in datetime, timestamp, time, date fields + warnings
|
||||
#
|
||||
CREATE TABLE t1 (a DATETIME NOT NULL, b TINYINT);
|
||||
INSERT INTO t1 VALUES (0, 0),(0, 0);
|
||||
SELECT 1 FROM t1 WHERE ROW(a, b) >=
|
||||
ROW('1', (SELECT 1 FROM t1 WHERE a > 1234));
|
||||
1
|
||||
DROP TABLE t1;
|
||||
|
@ -4050,10 +4050,10 @@ join_0.c1;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
Warnings:
|
||||
Note 1003 select '0' AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by '0','0','0','0','0'
|
||||
Note 1003 select NULL AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by NULL,NULL,NULL,NULL,NULL
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
Note 1003 select '0' AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by '0','0','0','0','0'
|
||||
Note 1003 select NULL AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by NULL,NULL,NULL,NULL,NULL
|
||||
DROP TABLE t1;
|
||||
SELECT 1 AS ` `;
|
||||
|
||||
@ -4648,17 +4648,17 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND b=b AND c=c) OR b > 20;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 const row not found
|
||||
Warnings:
|
||||
Note 1003 select '0' AS `a`,'0' AS `b`,'0' AS `c` from `test`.`t1` where 1
|
||||
Note 1003 select NULL AS `a`,NULL AS `b`,NULL AS `c` from `test`.`t1` where 1
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND a=a AND b=b) OR b > 20;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 const row not found
|
||||
Warnings:
|
||||
Note 1003 select '0' AS `a`,'0' AS `b`,'0' AS `c` from `test`.`t1` where 1
|
||||
Note 1003 select NULL AS `a`,NULL AS `b`,NULL AS `c` from `test`.`t1` where 1
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND b=b AND a=a) OR b > 20;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 const row not found
|
||||
Warnings:
|
||||
Note 1003 select '0' AS `a`,'0' AS `b`,'0' AS `c` from `test`.`t1` where 1
|
||||
Note 1003 select NULL AS `a`,NULL AS `b`,NULL AS `c` from `test`.`t1` where 1
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#45266: Uninitialized variable lead to an empty result.
|
||||
|
@ -9,3 +9,30 @@ SELECT USER();
|
||||
USER()
|
||||
#
|
||||
SHOW PROCESSLIST;
|
||||
#
|
||||
# Bug #37168: Missing variable - skip_name_resolve
|
||||
#
|
||||
SHOW VARIABLES LIKE 'skip_name_resolve';
|
||||
Variable_name Value
|
||||
skip_name_resolve ON
|
||||
SHOW GLOBAL VARIABLES LIKE 'skip_name_resolve';
|
||||
Variable_name Value
|
||||
skip_name_resolve ON
|
||||
SHOW SESSION VARIABLES LIKE 'skip_name_resolve';
|
||||
Variable_name Value
|
||||
skip_name_resolve ON
|
||||
SELECT @@skip_name_resolve;
|
||||
@@skip_name_resolve
|
||||
1
|
||||
SELECT @@LOCAL.skip_name_resolve;
|
||||
ERROR HY000: Variable 'skip_name_resolve' is a GLOBAL variable
|
||||
SELECT @@GLOBAL.skip_name_resolve;
|
||||
@@GLOBAL.skip_name_resolve
|
||||
1
|
||||
SET @@skip_name_resolve=0;
|
||||
ERROR HY000: Variable 'skip_name_resolve' is a read only variable
|
||||
SET @@LOCAL.skip_name_resolve=0;
|
||||
ERROR HY000: Variable 'skip_name_resolve' is a read only variable
|
||||
SET @@GLOBAL.skip_name_resolve=0;
|
||||
ERROR HY000: Variable 'skip_name_resolve' is a read only variable
|
||||
End of 5.1 tests
|
||||
|
@ -32,7 +32,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL NULL
|
||||
Warnings:
|
||||
Note 1249 Select 2 was reduced during optimization
|
||||
Note 1003 select (select 0 AS `0` union select 0 AS `0`) AS `(SELECT (SELECT 0 UNION SELECT 0))`
|
||||
Note 1003 select (select 0 union select 0) AS `(SELECT (SELECT 0 UNION SELECT 0))`
|
||||
SELECT (SELECT 1 FROM (SELECT 1) as b HAVING a=1) as a;
|
||||
ERROR 42S22: Reference 'a' not supported (forward reference in item list)
|
||||
SELECT (SELECT 1 FROM (SELECT 1) as b HAVING b=1) as a,(SELECT 1 FROM (SELECT 1) as c HAVING a=1) as b;
|
||||
@ -50,7 +50,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1
|
||||
Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1
|
||||
Note 1003 select 1 AS `1` from (select 1 AS `a`) `b` having ((select '1' AS `a`) = 1)
|
||||
Note 1003 select 1 AS `1` from (select 1 AS `a`) `b` having ((select '1') = 1)
|
||||
SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1;
|
||||
1
|
||||
1
|
||||
@ -187,7 +187,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
4 SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00
|
||||
NULL UNION RESULT <union1,3> ALL NULL NULL NULL NULL NULL NULL
|
||||
Warnings:
|
||||
Note 1003 (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`b` = (select `test`.`t3`.`a` AS `a` from `test`.`t3` order by 1 desc limit 1))) union (select `test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t4` where (`test`.`t4`.`b` = (select (max(`test`.`t2`.`a`) * 4) AS `max(t2.a)*4` from `test`.`t2`)) order by `a`)
|
||||
Note 1003 (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`b` = (select `test`.`t3`.`a` from `test`.`t3` order by 1 desc limit 1))) union (select `test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t4` where (`test`.`t4`.`b` = (select (max(`test`.`t2`.`a`) * 4) from `test`.`t2`)) order by `a`)
|
||||
select (select a from t3 where a<t2.a*4 order by 1 desc limit 1), a from t2;
|
||||
(select a from t3 where a<t2.a*4 order by 1 desc limit 1) a
|
||||
3 1
|
||||
@ -203,7 +203,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
3 DERIVED t2 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
2 SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where; Using filesort
|
||||
Warnings:
|
||||
Note 1003 select (select `test`.`t3`.`a` AS `a` from `test`.`t3` where (`test`.`t3`.`a` < 8) order by 1 desc limit 1) AS `(select t3.a from t3 where a<8 order by 1 desc limit 1)`,'2' AS `a` from (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`a` > 1)) `tt`
|
||||
Note 1003 select (select `test`.`t3`.`a` from `test`.`t3` where (`test`.`t3`.`a` < 8) order by 1 desc limit 1) AS `(select t3.a from t3 where a<8 order by 1 desc limit 1)`,'2' AS `a` from (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`a` > 1)) `tt`
|
||||
select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3) order by 1 desc limit 1);
|
||||
a
|
||||
2
|
||||
@ -224,7 +224,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.t4.a' of SELECT #3 was resolved in SELECT #1
|
||||
Note 1003 select `test`.`t4`.`b` AS `b`,(select avg((`test`.`t2`.`a` + (select min(`test`.`t3`.`a`) AS `min(t3.a)` from `test`.`t3` where (`test`.`t3`.`a` >= `test`.`t4`.`a`)))) AS `avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a))` from `test`.`t2`) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from `test`.`t4`
|
||||
Note 1003 select `test`.`t4`.`b` AS `b`,(select avg((`test`.`t2`.`a` + (select min(`test`.`t3`.`a`) from `test`.`t3` where (`test`.`t3`.`a` >= `test`.`t4`.`a`)))) from `test`.`t2`) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from `test`.`t4`
|
||||
select * from t3 where exists (select * from t2 where t2.b=t3.a);
|
||||
a
|
||||
7
|
||||
@ -314,7 +314,7 @@ NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1276 Field or reference 'test.t2.a' of SELECT #3 was resolved in SELECT #1
|
||||
Note 1003 select (select '2' AS `a` from `test`.`t1` where ('2' = `test`.`t2`.`a`) union select `test`.`t5`.`a` AS `a` from `test`.`t5` where (`test`.`t5`.`a` = `test`.`t2`.`a`)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2`
|
||||
Note 1003 select (select '2' from `test`.`t1` where ('2' = `test`.`t2`.`a`) union select `test`.`t5`.`a` from `test`.`t5` where (`test`.`t5`.`a` = `test`.`t2`.`a`)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2`
|
||||
select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2;
|
||||
ERROR 21000: Subquery returns more than 1 row
|
||||
create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq));
|
||||
@ -332,7 +332,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
2 DEPENDENT SUBQUERY t7 eq_ref PRIMARY PRIMARY 4 test.t6.clinic_uq 1 100.00 Using index
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.t6.clinic_uq' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1003 select `test`.`t6`.`patient_uq` AS `patient_uq`,`test`.`t6`.`clinic_uq` AS `clinic_uq` from `test`.`t6` where exists(select 1 AS `Not_used` from `test`.`t7` where (`test`.`t7`.`uq` = `test`.`t6`.`clinic_uq`))
|
||||
Note 1003 select `test`.`t6`.`patient_uq` AS `patient_uq`,`test`.`t6`.`clinic_uq` AS `clinic_uq` from `test`.`t6` where exists(select 1 from `test`.`t7` where (`test`.`t7`.`uq` = `test`.`t6`.`clinic_uq`))
|
||||
select * from t1 where a= (select a from t2,t4 where t2.b=t4.b);
|
||||
ERROR 23000: Column 'a' in field list is ambiguous
|
||||
drop table t1,t2,t3;
|
||||
@ -367,7 +367,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
2 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00
|
||||
3 SUBQUERY t8 const PRIMARY PRIMARY 37 1 100.00 Using index
|
||||
Warnings:
|
||||
Note 1003 select 'joce' AS `pseudo`,(select 'test' AS `email` from `test`.`t8` where 1) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from `test`.`t8` where 1
|
||||
Note 1003 select 'joce' AS `pseudo`,(select 'test' from `test`.`t8` where 1) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from `test`.`t8` where 1
|
||||
SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo,email FROM
|
||||
t8 WHERE pseudo='joce');
|
||||
ERROR 21000: Operand should contain 1 column(s)
|
||||
@ -399,7 +399,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
2 SUBQUERY t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index
|
||||
Warnings:
|
||||
Note 1003 select (select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = '2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
|
||||
Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = '2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
|
||||
SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
|
||||
date
|
||||
2002-08-03
|
||||
@ -743,7 +743,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`id`,<exists>(select 1 AS `1` having (<cache>(`test`.`t2`.`id`) = <ref_null_helper>(1)) union select 3 AS `3` having (<cache>(`test`.`t2`.`id`) = <ref_null_helper>(3))))
|
||||
Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`id`,<exists>(select 1 having (<cache>(`test`.`t2`.`id`) = <ref_null_helper>(1)) union select 3 having (<cache>(`test`.`t2`.`id`) = <ref_null_helper>(3))))
|
||||
SELECT * FROM t2 WHERE id IN (SELECT 5 UNION SELECT 3);
|
||||
id
|
||||
SELECT * FROM t2 WHERE id IN (SELECT 5 UNION SELECT 2);
|
||||
@ -906,7 +906,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
2 DEPENDENT SUBQUERY t2 ref_or_null a a 5 func 2 100.00 Using where; Using index
|
||||
2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`a` AS `a`,<in_optimizer>(`test`.`t1`.`a`,<exists>(select 1 AS `Not_used` from `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and ((<cache>(`test`.`t1`.`a`) = `test`.`t2`.`a`) or isnull(`test`.`t2`.`a`))) having <is_not_null_test>(`test`.`t2`.`a`))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1`
|
||||
Note 1003 select `test`.`t1`.`a` AS `a`,<in_optimizer>(`test`.`t1`.`a`,<exists>(select 1 from `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and ((<cache>(`test`.`t1`.`a`) = `test`.`t2`.`a`) or isnull(`test`.`t2`.`a`))) having <is_not_null_test>(`test`.`t2`.`a`))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1`
|
||||
drop table t1,t2,t3;
|
||||
create table t1 (a float);
|
||||
select 10.5 IN (SELECT * from t1 LIMIT 1);
|
||||
@ -1018,19 +1018,19 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 const row not found
|
||||
2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 const row not found
|
||||
Warnings:
|
||||
Note 1003 select (select rand() AS `RAND()` from `test`.`t1`) AS `(SELECT RAND() FROM t1)` from `test`.`t1`
|
||||
Note 1003 select (select rand() from `test`.`t1`) AS `(SELECT RAND() FROM t1)` from `test`.`t1`
|
||||
EXPLAIN EXTENDED SELECT (SELECT ENCRYPT('test') FROM t1) FROM t1;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 const row not found
|
||||
2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 const row not found
|
||||
Warnings:
|
||||
Note 1003 select (select encrypt('test') AS `ENCRYPT('test')` from `test`.`t1`) AS `(SELECT ENCRYPT('test') FROM t1)` from `test`.`t1`
|
||||
Note 1003 select (select encrypt('test') from `test`.`t1`) AS `(SELECT ENCRYPT('test') FROM t1)` from `test`.`t1`
|
||||
EXPLAIN EXTENDED SELECT (SELECT BENCHMARK(1,1) FROM t1) FROM t1;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 const row not found
|
||||
2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 const row not found
|
||||
Warnings:
|
||||
Note 1003 select (select benchmark(1,1) AS `BENCHMARK(1,1)` from `test`.`t1`) AS `(SELECT BENCHMARK(1,1) FROM t1)` from `test`.`t1`
|
||||
Note 1003 select (select benchmark(1,1) from `test`.`t1`) AS `(SELECT BENCHMARK(1,1) FROM t1)` from `test`.`t1`
|
||||
drop table t1;
|
||||
CREATE TABLE `t1` (
|
||||
`mot` varchar(30) character set latin1 NOT NULL default '',
|
||||
@ -1125,7 +1125,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
2 UNCACHEABLE SUBQUERY t1 ALL NULL NULL NULL NULL 3 100.00
|
||||
3 UNCACHEABLE SUBQUERY t1 ALL NULL NULL NULL NULL 3 100.00
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`a` AS `a`,(select (select rand() AS `rand()` from `test`.`t1` limit 1) AS `(select rand() from t1 limit 1)` from `test`.`t1` limit 1) AS `(select (select rand() from t1 limit 1) from t1 limit 1)` from `test`.`t1`
|
||||
Note 1003 select `test`.`t1`.`a` AS `a`,(select (select rand() from `test`.`t1` limit 1) from `test`.`t1` limit 1) AS `(select (select rand() from t1 limit 1) from t1 limit 1)` from `test`.`t1`
|
||||
drop table t1;
|
||||
select t1.Continent, t2.Name, t2.Population from t1 LEFT JOIN t2 ON t1.Code = t2.Country where t2.Population IN (select max(t2.Population) AS Population from t2, t1 where t2.Country = t1.Code group by Continent);
|
||||
ERROR 42S02: Table 'test.t1' doesn't exist
|
||||
@ -1179,7 +1179,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
||||
Warnings:
|
||||
Note 1003 select <in_optimizer>(0,<exists>(select 1 AS `Not_used` from `test`.`t1` `a` where 0)) AS `0 IN (SELECT 1 FROM t1 a)`
|
||||
Note 1003 select <in_optimizer>(0,<exists>(select 1 from `test`.`t1` `a` where 0)) AS `0 IN (SELECT 1 FROM t1 a)`
|
||||
INSERT INTO t1 (pseudo) VALUES ('test1');
|
||||
SELECT 0 IN (SELECT 1 FROM t1 a);
|
||||
0 IN (SELECT 1 FROM t1 a)
|
||||
@ -1189,7 +1189,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
||||
Warnings:
|
||||
Note 1003 select <in_optimizer>(0,<exists>(select 1 AS `Not_used` from `test`.`t1` `a` where 0)) AS `0 IN (SELECT 1 FROM t1 a)`
|
||||
Note 1003 select <in_optimizer>(0,<exists>(select 1 from `test`.`t1` `a` where 0)) AS `0 IN (SELECT 1 FROM t1 a)`
|
||||
drop table t1;
|
||||
CREATE TABLE `t1` (
|
||||
`i` int(11) NOT NULL default '0',
|
||||
@ -1234,7 +1234,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t1 ref salary salary 5 const 1 100.00 Using where
|
||||
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`id` AS `id` from `test`.`t1` where (`test`.`t1`.`salary` = (select max(`test`.`t1`.`salary`) AS `MAX(salary)` from `test`.`t1`))
|
||||
Note 1003 select `test`.`t1`.`id` AS `id` from `test`.`t1` where (`test`.`t1`.`salary` = (select max(`test`.`t1`.`salary`) from `test`.`t1`))
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (
|
||||
ID int(10) unsigned NOT NULL auto_increment,
|
||||
@ -1317,7 +1317,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 func 1 100.00
|
||||
2 DEPENDENT SUBQUERY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using index
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(select 1 AS `Not_used` from `test`.`t1` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t1`.`b`) and (<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`))))
|
||||
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(select 1 from `test`.`t1` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t1`.`b`) and (<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`))))
|
||||
drop table t1, t2, t3;
|
||||
create table t1 (a int, b int, index a (a,b));
|
||||
create table t2 (a int, index a (a));
|
||||
@ -1356,7 +1356,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
2 DEPENDENT SUBQUERY t1 ref a a 5 func 1001 100.00 Using where; Using index
|
||||
2 DEPENDENT SUBQUERY t3 index a a 5 NULL 3 100.00 Using where; Using index; Using join buffer
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(select 1 AS `Not_used` from `test`.`t1` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t1`.`b`) and (<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`))))
|
||||
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(select 1 from `test`.`t1` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t1`.`b`) and (<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`))))
|
||||
insert into t1 values (3,31);
|
||||
select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
|
||||
a
|
||||
@ -1496,7 +1496,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>((`test`.`t3`.`a` < (select max('0') from `test`.`t2`)))
|
||||
Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>((`test`.`t3`.`a` < (select max(NULL) from `test`.`t2`)))
|
||||
select * from t3 where a >= some (select b from t2);
|
||||
a
|
||||
explain extended select * from t3 where a >= some (select b from t2);
|
||||
@ -1504,7 +1504,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>((`test`.`t3`.`a` >= (select min('0') from `test`.`t2`)))
|
||||
Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>((`test`.`t3`.`a` >= (select min(NULL) from `test`.`t2`)))
|
||||
select * from t3 where a >= all (select b from t2 group by 1);
|
||||
a
|
||||
6
|
||||
@ -1515,7 +1515,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>((`test`.`t3`.`a` < <max>(select '0' AS `b` from `test`.`t2` group by 1)))
|
||||
Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>((`test`.`t3`.`a` < <max>(select NULL from `test`.`t2` group by 1)))
|
||||
select * from t3 where a >= some (select b from t2 group by 1);
|
||||
a
|
||||
explain extended select * from t3 where a >= some (select b from t2 group by 1);
|
||||
@ -1523,7 +1523,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>((`test`.`t3`.`a` >= <min>(select '0' AS `b` from `test`.`t2` group by 1)))
|
||||
Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>((`test`.`t3`.`a` >= <min>(select NULL from `test`.`t2` group by 1)))
|
||||
select * from t3 where NULL >= any (select b from t2);
|
||||
a
|
||||
explain extended select * from t3 where NULL >= any (select b from t2);
|
||||
@ -1566,7 +1566,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
2 SUBQUERY t2 ALL NULL NULL NULL NULL 4 100.00 Using temporary; Using filesort
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>((`test`.`t3`.`a` <= <max>(select max(`test`.`t2`.`b`) AS `max(b)` from `test`.`t2` group by `test`.`t2`.`a`)))
|
||||
Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>((`test`.`t3`.`a` <= <max>(select max(`test`.`t2`.`b`) from `test`.`t2` group by `test`.`t2`.`a`)))
|
||||
drop table t2, t3;
|
||||
CREATE TABLE `t1` ( `id` mediumint(9) NOT NULL auto_increment, `taskid` bigint(20) NOT NULL default '0', `dbid` int(11) NOT NULL default '0', `create_date` datetime NOT NULL default '0000-00-00 00:00:00', `last_update` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`id`)) ENGINE=MyISAM CHARSET=latin1 AUTO_INCREMENT=3 ;
|
||||
INSERT INTO `t1` (`id`, `taskid`, `dbid`, `create_date`,`last_update`) VALUES (1, 1, 15, '2003-09-29 10:31:36', '2003-09-29 10:31:36'), (2, 1, 21, now(), now());
|
||||
@ -1743,7 +1743,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 test.tt.id 1 100.00 Using where; Using index
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.tt.id' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1003 select `test`.`tt`.`id` AS `id`,`test`.`tt`.`text` AS `text` from `test`.`t1` `tt` where (not(exists(select `test`.`t1`.`id` AS `id` from `test`.`t1` where ((`test`.`t1`.`id` < 8) and (`test`.`t1`.`id` = `test`.`tt`.`id`)) having (`test`.`t1`.`id` is not null))))
|
||||
Note 1003 select `test`.`tt`.`id` AS `id`,`test`.`tt`.`text` AS `text` from `test`.`t1` `tt` where (not(exists(select `test`.`t1`.`id` from `test`.`t1` where ((`test`.`t1`.`id` < 8) and (`test`.`t1`.`id` = `test`.`tt`.`id`)) having (`test`.`t1`.`id` is not null))))
|
||||
insert into t1 (id, text) values (1000, 'text1000'), (1001, 'text1001');
|
||||
create table t2 (id int not null, text varchar(20) not null default '', primary key (id));
|
||||
insert into t2 (id, text) values (1, 'text1'), (2, 'text2'), (3, 'text3'), (4, 'text4'), (5, 'text5'), (6, 'text6'), (7, 'text7'), (8, 'text8'), (9, 'text9'), (10, 'text10'), (11, 'text1'), (12, 'text2'), (13, 'text3'), (14, 'text4'), (15, 'text5'), (16, 'text6'), (17, 'text7'), (18, 'text8'), (19, 'text9'), (20, 'text10'),(21, 'text1'), (22, 'text2'), (23, 'text3'), (24, 'text4'), (25, 'text5'), (26, 'text6'), (27, 'text7'), (28, 'text8'), (29, 'text9'), (30, 'text10'), (31, 'text1'), (32, 'text2'), (33, 'text3'), (34, 'text4'), (35, 'text5'), (36, 'text6'), (37, 'text7'), (38, 'text8'), (39, 'text9'), (40, 'text10'), (41, 'text1'), (42, 'text2'), (43, 'text3'), (44, 'text4'), (45, 'text5'), (46, 'text6'), (47, 'text7'), (48, 'text8'), (49, 'text9'), (50, 'text10');
|
||||
@ -2279,7 +2279,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.up.a' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1003 select `test`.`up`.`a` AS `a`,`test`.`up`.`b` AS `b` from `test`.`t1` `up` where exists(select 1 AS `Not_used` from `test`.`t1` where (`test`.`t1`.`a` = `test`.`up`.`a`))
|
||||
Note 1003 select `test`.`up`.`a` AS `a`,`test`.`up`.`b` AS `b` from `test`.`t1` `up` where exists(select 1 from `test`.`t1` where (`test`.`t1`.`a` = `test`.`up`.`a`))
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (t1_a int);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
@ -2820,19 +2820,19 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00
|
||||
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 9 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,<in_optimizer>((`test`.`t1`.`one`,`test`.`t1`.`two`),<exists>(select `test`.`t2`.`one` AS `one`,`test`.`t2`.`two` AS `two` from `test`.`t2` where ((`test`.`t2`.`flag` = '0') and trigcond(((<cache>(`test`.`t1`.`one`) = `test`.`t2`.`one`) or isnull(`test`.`t2`.`one`))) and trigcond(((<cache>(`test`.`t1`.`two`) = `test`.`t2`.`two`) or isnull(`test`.`t2`.`two`)))) having (trigcond(<is_not_null_test>(`test`.`t2`.`one`)) and trigcond(<is_not_null_test>(`test`.`t2`.`two`))))) AS `test` from `test`.`t1`
|
||||
Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,<in_optimizer>((`test`.`t1`.`one`,`test`.`t1`.`two`),<exists>(select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where ((`test`.`t2`.`flag` = '0') and trigcond(((<cache>(`test`.`t1`.`one`) = `test`.`t2`.`one`) or isnull(`test`.`t2`.`one`))) and trigcond(((<cache>(`test`.`t1`.`two`) = `test`.`t2`.`two`) or isnull(`test`.`t2`.`two`)))) having (trigcond(<is_not_null_test>(`test`.`t2`.`one`)) and trigcond(<is_not_null_test>(`test`.`t2`.`two`))))) AS `test` from `test`.`t1`
|
||||
explain extended SELECT one,two from t1 where ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N');
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 Using where
|
||||
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 9 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two` from `test`.`t1` where <in_optimizer>((`test`.`t1`.`one`,`test`.`t1`.`two`),<exists>(select `test`.`t2`.`one` AS `one`,`test`.`t2`.`two` AS `two` from `test`.`t2` where ((`test`.`t2`.`flag` = 'N') and (<cache>(`test`.`t1`.`one`) = `test`.`t2`.`one`) and (<cache>(`test`.`t1`.`two`) = `test`.`t2`.`two`))))
|
||||
Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two` from `test`.`t1` where <in_optimizer>((`test`.`t1`.`one`,`test`.`t1`.`two`),<exists>(select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where ((`test`.`t2`.`flag` = 'N') and (<cache>(`test`.`t1`.`one`) = `test`.`t2`.`one`) and (<cache>(`test`.`t1`.`two`) = `test`.`t2`.`two`))))
|
||||
explain extended SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0' group by one,two) as 'test' from t1;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00
|
||||
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 9 100.00 Using where; Using temporary; Using filesort
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,<in_optimizer>((`test`.`t1`.`one`,`test`.`t1`.`two`),<exists>(select `test`.`t2`.`one` AS `one`,`test`.`t2`.`two` AS `two` from `test`.`t2` where (`test`.`t2`.`flag` = '0') group by `test`.`t2`.`one`,`test`.`t2`.`two` having (trigcond(((<cache>(`test`.`t1`.`one`) = `test`.`t2`.`one`) or isnull(`test`.`t2`.`one`))) and trigcond(((<cache>(`test`.`t1`.`two`) = `test`.`t2`.`two`) or isnull(`test`.`t2`.`two`))) and trigcond(<is_not_null_test>(`test`.`t2`.`one`)) and trigcond(<is_not_null_test>(`test`.`t2`.`two`))))) AS `test` from `test`.`t1`
|
||||
Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,<in_optimizer>((`test`.`t1`.`one`,`test`.`t1`.`two`),<exists>(select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where (`test`.`t2`.`flag` = '0') group by `test`.`t2`.`one`,`test`.`t2`.`two` having (trigcond(((<cache>(`test`.`t1`.`one`) = `test`.`t2`.`one`) or isnull(`test`.`t2`.`one`))) and trigcond(((<cache>(`test`.`t1`.`two`) = `test`.`t2`.`two`) or isnull(`test`.`t2`.`two`))) and trigcond(<is_not_null_test>(`test`.`t2`.`one`)) and trigcond(<is_not_null_test>(`test`.`t2`.`two`))))) AS `test` from `test`.`t1`
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (a char(5), b char(5));
|
||||
INSERT INTO t1 VALUES (NULL,'aaa'), ('aaa','aaa');
|
||||
@ -4275,7 +4275,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1003 select 2 AS `2` from `test`.`t1` where exists(select 1 AS `1` from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`))
|
||||
Note 1003 select 2 AS `2` from `test`.`t1` where exists(select 1 from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`))
|
||||
EXPLAIN EXTENDED
|
||||
SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION
|
||||
(SELECT 1 FROM t2 WHERE t1.a = t2.a));
|
||||
@ -4353,13 +4353,13 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
|
||||
2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort
|
||||
Warnings:
|
||||
Note 1003 select 1 AS `1` from `test`.`t1` where <in_optimizer>(1,<exists>(select 1 AS `1` from `test`.`t1` group by `test`.`t1`.`a` having (<cache>(1) = <ref_null_helper>(1))))
|
||||
Note 1003 select 1 AS `1` from `test`.`t1` where <in_optimizer>(1,<exists>(select 1 from `test`.`t1` group by `test`.`t1`.`a` having (<cache>(1) = <ref_null_helper>(1))))
|
||||
EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 IN (SELECT 1 FROM t1 WHERE a > 3 GROUP BY a);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using where; Using temporary; Using filesort
|
||||
Warnings:
|
||||
Note 1003 select 1 AS `1` from `test`.`t1` where <in_optimizer>(1,<exists>(select 1 AS `1` from `test`.`t1` where (`test`.`t1`.`a` > 3) group by `test`.`t1`.`a` having (<cache>(1) = <ref_null_helper>(1))))
|
||||
Note 1003 select 1 AS `1` from `test`.`t1` where <in_optimizer>(1,<exists>(select 1 from `test`.`t1` where (`test`.`t1`.`a` > 3) group by `test`.`t1`.`a` having (<cache>(1) = <ref_null_helper>(1))))
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#45061: Incorrectly market field caused wrong result.
|
||||
@ -4628,3 +4628,92 @@ WHERE t1.a = d1.a;
|
||||
ERROR 42S22: Unknown column 'd1.a' in 'where clause'
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests.
|
||||
Set up test tables.
|
||||
CREATE TABLE t1 (
|
||||
t1_id INT UNSIGNED,
|
||||
PRIMARY KEY(t1_id)
|
||||
) Engine=MyISAM;
|
||||
INSERT INTO t1 (t1_id) VALUES (1), (2), (3), (4), (5);
|
||||
CREATE TABLE t2 SELECT * FROM t1;
|
||||
CREATE TABLE t3 (
|
||||
t3_id INT UNSIGNED AUTO_INCREMENT,
|
||||
t1_id INT UNSIGNED,
|
||||
amount DECIMAL(16,2),
|
||||
PRIMARY KEY(t3_id),
|
||||
KEY(t1_id)
|
||||
) Engine=MyISAM;
|
||||
INSERT INTO t3 (t1_id, t3_id, amount)
|
||||
VALUES (1, 1, 100.00), (2, 2, 200.00), (4, 4, 400.00);
|
||||
This is the 'inner query' running by itself.
|
||||
Produces correct results.
|
||||
SELECT
|
||||
t1.t1_id,
|
||||
IFNULL((SELECT SUM(amount) FROM t3 WHERE t3.t1_id=t1.t1_id), 0) AS total_amount
|
||||
FROM
|
||||
t1
|
||||
LEFT JOIN t2 ON t2.t1_id=t1.t1_id
|
||||
GROUP BY
|
||||
t1.t1_id
|
||||
;
|
||||
t1_id total_amount
|
||||
1 100.00
|
||||
2 200.00
|
||||
3 0.00
|
||||
4 400.00
|
||||
5 0.00
|
||||
SELECT * FROM (the same inner query)
|
||||
Produces correct results.
|
||||
SELECT * FROM (
|
||||
SELECT
|
||||
t1.t1_id,
|
||||
IFNULL((SELECT SUM(amount) FROM t3 WHERE t3.t1_id=t1.t1_id), 0) AS total_amount
|
||||
FROM
|
||||
t1
|
||||
LEFT JOIN t2 ON t2.t1_id=t1.t1_id
|
||||
GROUP BY
|
||||
t1.t1_id
|
||||
) AS t;
|
||||
t1_id total_amount
|
||||
1 100.00
|
||||
2 200.00
|
||||
3 0.00
|
||||
4 400.00
|
||||
5 0.00
|
||||
Now make t2.t1_id part of a key.
|
||||
ALTER TABLE t2 ADD PRIMARY KEY(t1_id);
|
||||
Same inner query by itself.
|
||||
Still correct results.
|
||||
SELECT
|
||||
t1.t1_id,
|
||||
IFNULL((SELECT SUM(amount) FROM t3 WHERE t3.t1_id=t1.t1_id), 0) AS total_amount
|
||||
FROM
|
||||
t1
|
||||
LEFT JOIN t2 ON t2.t1_id=t1.t1_id
|
||||
GROUP BY
|
||||
t1.t1_id;
|
||||
t1_id total_amount
|
||||
1 100.00
|
||||
2 200.00
|
||||
3 0
|
||||
4 400.00
|
||||
5 0
|
||||
SELECT * FROM (the same inner query), now with indexes on the LEFT JOIN
|
||||
SELECT * FROM (
|
||||
SELECT
|
||||
t1.t1_id,
|
||||
IFNULL((SELECT SUM(amount) FROM t3 WHERE t3.t1_id=t1.t1_id), 0) AS total_amount
|
||||
FROM
|
||||
t1
|
||||
LEFT JOIN t2 ON t2.t1_id=t1.t1_id
|
||||
GROUP BY
|
||||
t1.t1_id
|
||||
) AS t;
|
||||
t1_id total_amount
|
||||
1 100.00
|
||||
2 200.00
|
||||
3 0.00
|
||||
4 400.00
|
||||
5 0.00
|
||||
DROP TABLE t3;
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
|
@ -30,7 +30,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using temporary; Using filesort
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.t2.oref' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`oref` AS `oref`,<in_optimizer>(`test`.`t2`.`a`,<exists>(select max(`test`.`t1`.`ie`) AS `max(ie)` from `test`.`t1` where (`test`.`t1`.`oref` = `test`.`t2`.`oref`) group by `test`.`t1`.`grp` having trigcond((<cache>(`test`.`t2`.`a`) = <ref_null_helper>(max(`test`.`t1`.`ie`)))))) AS `Z` from `test`.`t2`
|
||||
Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`oref` AS `oref`,<in_optimizer>(`test`.`t2`.`a`,<exists>(select max(`test`.`t1`.`ie`) from `test`.`t1` where (`test`.`t1`.`oref` = `test`.`t2`.`oref`) group by `test`.`t1`.`grp` having trigcond((<cache>(`test`.`t2`.`a`) = <ref_null_helper>(max(`test`.`t1`.`ie`)))))) AS `Z` from `test`.`t2`
|
||||
explain extended
|
||||
select a, oref from t2
|
||||
where a in (select max(ie) from t1 where oref=t2.oref group by grp);
|
||||
@ -39,7 +39,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using temporary; Using filesort
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.t2.oref' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`oref` AS `oref` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(select max(`test`.`t1`.`ie`) AS `max(ie)` from `test`.`t1` where (`test`.`t1`.`oref` = `test`.`t2`.`oref`) group by `test`.`t1`.`grp` having (<cache>(`test`.`t2`.`a`) = <ref_null_helper>(max(`test`.`t1`.`ie`)))))
|
||||
Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`oref` AS `oref` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(select max(`test`.`t1`.`ie`) from `test`.`t1` where (`test`.`t1`.`oref` = `test`.`t2`.`oref`) group by `test`.`t1`.`grp` having (<cache>(`test`.`t2`.`a`) = <ref_null_helper>(max(`test`.`t1`.`ie`)))))
|
||||
select a, oref, a in (
|
||||
select max(ie) from t1 where oref=t2.oref group by grp union
|
||||
select max(ie) from t1 where oref=t2.oref group by grp
|
||||
@ -68,7 +68,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t3 ALL NULL NULL NULL NULL 2 100.00
|
||||
2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using temporary; Using filesort
|
||||
Warnings:
|
||||
Note 1003 select <in_optimizer>(`test`.`t3`.`a`,<exists>(select max(`test`.`t1`.`ie`) AS `max(ie)` from `test`.`t1` where (`test`.`t1`.`oref` = 4) group by `test`.`t1`.`grp` having trigcond((<cache>(`test`.`t3`.`a`) = <ref_null_helper>(max(`test`.`t1`.`ie`)))))) AS `a in (select max(ie) from t1 where oref=4 group by grp)` from `test`.`t3`
|
||||
Note 1003 select <in_optimizer>(`test`.`t3`.`a`,<exists>(select max(`test`.`t1`.`ie`) from `test`.`t1` where (`test`.`t1`.`oref` = 4) group by `test`.`t1`.`grp` having trigcond((<cache>(`test`.`t3`.`a`) = <ref_null_helper>(max(`test`.`t1`.`ie`)))))) AS `a in (select max(ie) from t1 where oref=4 group by grp)` from `test`.`t3`
|
||||
drop table t1, t2, t3;
|
||||
create table t1 (a int, oref int, key(a));
|
||||
insert into t1 values
|
||||
@ -157,7 +157,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
2 DEPENDENT SUBQUERY t2 ref a a 5 test.t1.b 1 100.00 Using where
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.t3.oref' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1003 select `test`.`t3`.`a` AS `a`,`test`.`t3`.`oref` AS `oref`,<in_optimizer>(`test`.`t3`.`a`,<exists>(select 1 AS `Not_used` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t2`.`b` = `test`.`t3`.`oref`) and trigcond(((<cache>(`test`.`t3`.`a`) = `test`.`t1`.`a`) or isnull(`test`.`t1`.`a`)))) having trigcond(<is_not_null_test>(`test`.`t1`.`a`)))) AS `Z` from `test`.`t3`
|
||||
Note 1003 select `test`.`t3`.`a` AS `a`,`test`.`t3`.`oref` AS `oref`,<in_optimizer>(`test`.`t3`.`a`,<exists>(select 1 from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t2`.`b` = `test`.`t3`.`oref`) and trigcond(((<cache>(`test`.`t3`.`a`) = `test`.`t1`.`a`) or isnull(`test`.`t1`.`a`)))) having trigcond(<is_not_null_test>(`test`.`t1`.`a`)))) AS `Z` from `test`.`t3`
|
||||
drop table t1, t2, t3;
|
||||
create table t1 (a int NOT NULL, b int NOT NULL, key(a));
|
||||
insert into t1 values
|
||||
@ -185,7 +185,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
2 DEPENDENT SUBQUERY t2 ref a a 4 test.t1.b 1 100.00 Using where
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.t3.oref' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1003 select `test`.`t3`.`a` AS `a`,`test`.`t3`.`oref` AS `oref`,<in_optimizer>(`test`.`t3`.`a`,<exists>(select 1 AS `Not_used` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t2`.`b` = `test`.`t3`.`oref`) and trigcond((<cache>(`test`.`t3`.`a`) = `test`.`t1`.`a`))))) AS `Z` from `test`.`t3`
|
||||
Note 1003 select `test`.`t3`.`a` AS `a`,`test`.`t3`.`oref` AS `oref`,<in_optimizer>(`test`.`t3`.`a`,<exists>(select 1 from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`a` = `test`.`t1`.`b`) and (`test`.`t2`.`b` = `test`.`t3`.`oref`) and trigcond((<cache>(`test`.`t3`.`a`) = `test`.`t1`.`a`))))) AS `Z` from `test`.`t3`
|
||||
drop table t1,t2,t3;
|
||||
create table t1 (oref int, grp int);
|
||||
insert into t1 (oref, grp) values
|
||||
@ -209,7 +209,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort
|
||||
Warnings:
|
||||
Note 1276 Field or reference 't2.oref' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`oref` AS `oref`,<in_optimizer>(`test`.`t2`.`a`,<exists>(select count(0) AS `count(*)` from `test`.`t1` group by `test`.`t1`.`grp` having ((`test`.`t1`.`grp` = `test`.`t2`.`oref`) and trigcond((<cache>(`test`.`t2`.`a`) = <ref_null_helper>(count(0))))))) AS `Z` from `test`.`t2`
|
||||
Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`oref` AS `oref`,<in_optimizer>(`test`.`t2`.`a`,<exists>(select count(0) from `test`.`t1` group by `test`.`t1`.`grp` having ((`test`.`t1`.`grp` = `test`.`t2`.`oref`) and trigcond((<cache>(`test`.`t2`.`a`) = <ref_null_helper>(count(0))))))) AS `Z` from `test`.`t2`
|
||||
drop table t1, t2;
|
||||
create table t1 (a int, b int, primary key (a));
|
||||
insert into t1 values (1,1), (3,1),(100,1);
|
||||
@ -258,7 +258,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
2 DEPENDENT SUBQUERY t4 ALL NULL NULL NULL NULL 100 100.00 Using where; Using join buffer
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.t2.oref' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`oref` AS `oref`,<in_optimizer>((`test`.`t2`.`a`,`test`.`t2`.`b`),<exists>(select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` join `test`.`t4` where ((`test`.`t1`.`c` = `test`.`t2`.`oref`) and trigcond(((<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`) or isnull(`test`.`t1`.`a`))) and trigcond(((<cache>(`test`.`t2`.`b`) = `test`.`t1`.`b`) or isnull(`test`.`t1`.`b`)))) having (trigcond(<is_not_null_test>(`test`.`t1`.`a`)) and trigcond(<is_not_null_test>(`test`.`t1`.`b`))))) AS `Z` from `test`.`t2`
|
||||
Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`oref` AS `oref`,<in_optimizer>((`test`.`t2`.`a`,`test`.`t2`.`b`),<exists>(select `test`.`t1`.`a`,`test`.`t1`.`b` from `test`.`t1` join `test`.`t4` where ((`test`.`t1`.`c` = `test`.`t2`.`oref`) and trigcond(((<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`) or isnull(`test`.`t1`.`a`))) and trigcond(((<cache>(`test`.`t2`.`b`) = `test`.`t1`.`b`) or isnull(`test`.`t1`.`b`)))) having (trigcond(<is_not_null_test>(`test`.`t1`.`a`)) and trigcond(<is_not_null_test>(`test`.`t1`.`b`))))) AS `Z` from `test`.`t2`
|
||||
select a,b, oref,
|
||||
(a,b) in (select a,b from t1,t4 where c=t2.oref) Z
|
||||
from t2;
|
||||
@ -703,7 +703,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index
|
||||
2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`b` = `test`.`t1`.`a`) and (not(<in_optimizer>(`test`.`t1`.`a`,<exists>(select 1 AS `Not_used` from `test`.`t1` where ((<cache>(`test`.`t2`.`b`) = `test`.`t1`.`a`) or isnull(`test`.`t1`.`a`)) having <is_not_null_test>(`test`.`t1`.`a`))))))
|
||||
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`b` = `test`.`t1`.`a`) and (not(<in_optimizer>(`test`.`t1`.`a`,<exists>(select 1 from `test`.`t1` where ((<cache>(`test`.`t2`.`b`) = `test`.`t1`.`a`) or isnull(`test`.`t1`.`a`)) having <is_not_null_test>(`test`.`t1`.`a`))))))
|
||||
SELECT a FROM t1, t2 WHERE a=b AND (b NOT IN (SELECT a FROM t1));
|
||||
a
|
||||
SELECT a FROM t1, t2 WHERE a=b AND (b NOT IN (SELECT a FROM t1 WHERE a > 4));
|
||||
@ -864,7 +864,7 @@ Level Code Message
|
||||
Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #2
|
||||
Note 1276 Field or reference 'test.t1.c' of SELECT #3 was resolved in SELECT #2
|
||||
Error 1054 Unknown column 'c' in 'field list'
|
||||
Note 1003 select `c` AS `c` from (select (select count(`test`.`t1`.`a`) AS `COUNT(a)` from (select count(`test`.`t1`.`b`) AS `COUNT(b)` from `test`.`t1`) `x` group by `c`) AS `(SELECT COUNT(a) FROM
|
||||
Note 1003 select `c` AS `c` from (select (select count(`test`.`t1`.`a`) from (select count(`test`.`t1`.`b`) AS `COUNT(b)` from `test`.`t1`) `x` group by `c`) AS `(SELECT COUNT(a) FROM
|
||||
(SELECT COUNT(b) FROM t1) AS x GROUP BY c
|
||||
)` from `test`.`t1` group by `test`.`t1`.`b`) `y`
|
||||
DROP TABLE t1;
|
||||
|
@ -168,4 +168,16 @@ Warning 1618 <DATA DIRECTORY> option ignored
|
||||
Warning 1618 <INDEX DIRECTORY> option ignored
|
||||
DROP TABLE t1;
|
||||
SET @@SQL_MODE=@OLD_SQL_MODE;
|
||||
#
|
||||
# BUG#40980 - Drop table can remove another MyISAM table's
|
||||
# data and index files
|
||||
#
|
||||
CREATE TABLE user(a INT) DATA DIRECTORY='MYSQL_TMP_DIR/mysql'
|
||||
INDEX DIRECTORY='MYSQL_TMP_DIR/mysql';
|
||||
FLUSH TABLE user;
|
||||
# Symlinking mysql database to tmpdir
|
||||
FLUSH TABLE mysql.user;
|
||||
DROP TABLE user;
|
||||
FLUSH TABLE mysql.user;
|
||||
SELECT * FROM mysql.user;
|
||||
End of 5.1 tests
|
||||
|
@ -2087,4 +2087,45 @@ ERROR 42S02: Table 'test.a_nonextisting_table' doesn't exist
|
||||
SELECT * FROM t2;
|
||||
a b
|
||||
DROP TABLE t1, t2;
|
||||
#
|
||||
# Bug#51650 crash with user variables and triggers
|
||||
#
|
||||
DROP TRIGGER IF EXISTS trg1;
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
CREATE TABLE t1 (b VARCHAR(50) NOT NULL);
|
||||
CREATE TABLE t2 (a VARCHAR(10) NOT NULL DEFAULT '');
|
||||
CREATE TRIGGER trg1 AFTER INSERT ON t2
|
||||
FOR EACH ROW BEGIN
|
||||
SELECT 1 FROM t1 c WHERE
|
||||
(@bug51650 IS NULL OR @bug51650 != c.b) AND c.b = NEW.a LIMIT 1 INTO @foo;
|
||||
END//
|
||||
SET @bug51650 = 1;
|
||||
INSERT IGNORE INTO t2 VALUES();
|
||||
Warnings:
|
||||
Warning 1329 No data - zero rows fetched, selected, or processed
|
||||
INSERT IGNORE INTO t1 SET b = '777';
|
||||
INSERT IGNORE INTO t2 SET a = '111';
|
||||
Warnings:
|
||||
Warning 1329 No data - zero rows fetched, selected, or processed
|
||||
SET @bug51650 = 1;
|
||||
INSERT IGNORE INTO t2 SET a = '777';
|
||||
DROP TRIGGER trg1;
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE t1 (id INT NOT NULL);
|
||||
CREATE TABLE t2 (id INT NOT NULL);
|
||||
INSERT t1 VALUES (1),(2),(3);
|
||||
UPDATE t1 SET id=NULL;
|
||||
Warnings:
|
||||
Warning 1048 Column 'id' cannot be null
|
||||
Warning 1048 Column 'id' cannot be null
|
||||
Warning 1048 Column 'id' cannot be null
|
||||
CREATE TRIGGER t1_bu BEFORE UPDATE ON t1 FOR EACH ROW
|
||||
INSERT INTO t2 VALUES (3);
|
||||
UPDATE t1 SET id=NULL;
|
||||
Warnings:
|
||||
Warning 1048 Column 'id' cannot be null
|
||||
Warning 1048 Column 'id' cannot be null
|
||||
Warning 1048 Column 'id' cannot be null
|
||||
DROP TRIGGER t1_bu;
|
||||
DROP TABLE t1,t2;
|
||||
End of 5.1 tests.
|
||||
|
@ -275,4 +275,25 @@ select * from t1 where a between '0000-00-01' and '0000-00-02';
|
||||
a
|
||||
0000-00-01
|
||||
drop table t1;
|
||||
#
|
||||
# Bug#50918: Date columns treated differently in Views than in Base
|
||||
# Tables
|
||||
#
|
||||
CREATE TABLE t1 ( the_date DATE, the_time TIME );
|
||||
INSERT INTO t1 VALUES ( '2010-01-01', '01:01:01' );
|
||||
SELECT * FROM t1 t11 JOIN t1 t12 ON addtime( t11.the_date, t11.the_time ) =
|
||||
addtime( t12.the_date, t12.the_time );
|
||||
the_date the_time the_date the_time
|
||||
2010-01-01 01:01:01 2010-01-01 01:01:01
|
||||
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||
SELECT * FROM t1 JOIN v1 ON addtime( t1.the_date, t1.the_time ) =
|
||||
addtime( v1.the_date, v1.the_time );
|
||||
the_date the_time the_date the_time
|
||||
2010-01-01 01:01:01 2010-01-01 01:01:01
|
||||
SELECT * FROM t1 JOIN v1 ON addtime( t1.the_date, t1.the_time ) =
|
||||
addtime( cast(v1.the_date AS DATETIME), v1.the_time );
|
||||
the_date the_time the_date the_time
|
||||
2010-01-01 01:01:01 2010-01-01 01:01:01
|
||||
DROP TABLE t1;
|
||||
DROP VIEW v1;
|
||||
End of 5.1 tests
|
||||
|
@ -517,7 +517,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.t1.cur_date' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1003 select '1' AS `id`,'2007-04-25 18:30:22' AS `cur_date` from `test`.`t1` where <in_optimizer>('1',<exists>(select 1 AS `Not_used` from `test`.`t1` `x1` where 0))
|
||||
Note 1003 select '1' AS `id`,'2007-04-25 18:30:22' AS `cur_date` from `test`.`t1` where <in_optimizer>('1',<exists>(select 1 from `test`.`t1` `x1` where 0))
|
||||
select * from t1
|
||||
where id in (select id from t1 as x1 where (t1.cur_date is null));
|
||||
id cur_date
|
||||
@ -529,7 +529,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.t2.cur_date' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1003 select '1' AS `id`,'2007-04-25' AS `cur_date` from `test`.`t2` where <in_optimizer>('1',<exists>(select 1 AS `Not_used` from `test`.`t2` `x1` where 0))
|
||||
Note 1003 select '1' AS `id`,'2007-04-25' AS `cur_date` from `test`.`t2` where <in_optimizer>('1',<exists>(select 1 from `test`.`t2` `x1` where 0))
|
||||
select * from t2
|
||||
where id in (select id from t2 as x1 where (t2.cur_date is null));
|
||||
id cur_date
|
||||
@ -543,7 +543,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
2 DEPENDENT SUBQUERY x1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.t1.cur_date' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`cur_date` AS `cur_date` from `test`.`t1` where <in_optimizer>(`test`.`t1`.`id`,<exists>(select 1 AS `Not_used` from `test`.`t1` `x1` where ((`test`.`t1`.`cur_date` = 0) and (<cache>(`test`.`t1`.`id`) = `test`.`x1`.`id`))))
|
||||
Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`cur_date` AS `cur_date` from `test`.`t1` where <in_optimizer>(`test`.`t1`.`id`,<exists>(select 1 from `test`.`t1` `x1` where ((`test`.`t1`.`cur_date` = 0) and (<cache>(`test`.`t1`.`id`) = `test`.`x1`.`id`))))
|
||||
select * from t1
|
||||
where id in (select id from t1 as x1 where (t1.cur_date is null));
|
||||
id cur_date
|
||||
@ -555,7 +555,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
2 DEPENDENT SUBQUERY x1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.t2.cur_date' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1003 select `test`.`t2`.`id` AS `id`,`test`.`t2`.`cur_date` AS `cur_date` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`id`,<exists>(select 1 AS `Not_used` from `test`.`t2` `x1` where ((`test`.`t2`.`cur_date` = 0) and (<cache>(`test`.`t2`.`id`) = `test`.`x1`.`id`))))
|
||||
Note 1003 select `test`.`t2`.`id` AS `id`,`test`.`t2`.`cur_date` AS `cur_date` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`id`,<exists>(select 1 from `test`.`t2` `x1` where ((`test`.`t2`.`cur_date` = 0) and (<cache>(`test`.`t2`.`id`) = `test`.`x1`.`id`))))
|
||||
select * from t2
|
||||
where id in (select id from t2 as x1 where (t2.cur_date is null));
|
||||
id cur_date
|
||||
|
@ -309,4 +309,36 @@ yyyy c4
|
||||
2069 2069
|
||||
DROP TABLE t2, t4;
|
||||
#
|
||||
# Bug #49910: Behavioural change in SELECT/WHERE on YEAR(4) data type
|
||||
#
|
||||
CREATE TABLE t1 (y YEAR NOT NULL, s VARCHAR(4));
|
||||
INSERT INTO t1 (s) VALUES ('bad');
|
||||
Warnings:
|
||||
Warning 1364 Field 'y' doesn't have a default value
|
||||
INSERT INTO t1 (y, s) VALUES (0, 0), (2000, 2000), (2001, 2001);
|
||||
SELECT * FROM t1 ta, t1 tb WHERE ta.y = tb.y;
|
||||
y s y s
|
||||
0000 bad 0000 bad
|
||||
0000 0 0000 bad
|
||||
0000 bad 0000 0
|
||||
0000 0 0000 0
|
||||
2000 2000 2000 2000
|
||||
2001 2001 2001 2001
|
||||
SELECT * FROM t1 WHERE t1.y = 0;
|
||||
y s
|
||||
0000 bad
|
||||
0000 0
|
||||
SELECT * FROM t1 WHERE t1.y = 2000;
|
||||
y s
|
||||
2000 2000
|
||||
SELECT ta.y AS ta_y, ta.s, tb.y AS tb_y, tb.s FROM t1 ta, t1 tb HAVING ta_y = tb_y;
|
||||
ta_y s tb_y s
|
||||
0000 bad 0000 bad
|
||||
0000 0 0000 bad
|
||||
0000 bad 0000 0
|
||||
0000 0 0000 0
|
||||
2000 2000 2000 2000
|
||||
2001 2001 2001 2001
|
||||
DROP TABLE t1;
|
||||
#
|
||||
End of 5.1 tests
|
||||
|
@ -38,8 +38,6 @@ ERROR HY000: Can't initialize function 'reverse_lookup'; Wrong number of argumen
|
||||
select reverse_lookup("127.0.0.1");
|
||||
select reverse_lookup(127,0,0,1);
|
||||
select reverse_lookup("localhost");
|
||||
reverse_lookup("localhost")
|
||||
NULL
|
||||
select avgcost();
|
||||
ERROR HY000: Can't initialize function 'avgcost'; wrong number of arguments: AVGCOST() requires two arguments
|
||||
select avgcost(100,23.76);
|
||||
|
@ -1585,7 +1585,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
2 UNION t1 system NULL NULL NULL NULL 0 0.00 const row not found
|
||||
NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL NULL Using filesort
|
||||
Warnings:
|
||||
Note 1003 select '0' AS `a` from `test`.`t1` union select '0' AS `a` from `test`.`t1` order by `a`
|
||||
Note 1003 select NULL AS `a` from `test`.`t1` union select NULL AS `a` from `test`.`t1` order by `a`
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
#
|
||||
@ -1636,7 +1636,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL NULL Using filesort
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #2
|
||||
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` union select `test`.`t1`.`a` AS `a` from `test`.`t1` order by (select `test`.`t1`.`a` AS `a` from `test`.`t2` where (`test`.`t2`.`b` = 12))
|
||||
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` union select `test`.`t1`.`a` AS `a` from `test`.`t1` order by (select `test`.`t1`.`a` from `test`.`t2` where (`test`.`t2`.`b` = 12))
|
||||
# Should not crash
|
||||
SELECT * FROM t1 UNION SELECT * FROM t1
|
||||
ORDER BY (SELECT a FROM t2 WHERE b = 12);
|
||||
|
@ -514,3 +514,16 @@ ALTER TABLE t2 COMMENT = 'ABC';
|
||||
UPDATE t2, t1 SET t2.f1 = 2, t1.f1 = 9;
|
||||
ALTER TABLE t2 COMMENT = 'DEF';
|
||||
DROP TABLE t1, t2;
|
||||
#
|
||||
# Bug#50545: Single table UPDATE IGNORE crashes on join view in
|
||||
# sql_safe_updates mode.
|
||||
#
|
||||
CREATE TABLE t1 ( a INT, KEY( a ) );
|
||||
INSERT INTO t1 VALUES (0), (1);
|
||||
CREATE VIEW v1 AS SELECT t11.a, t12.a AS b FROM t1 t11, t1 t12;
|
||||
SET SESSION sql_safe_updates = 1;
|
||||
UPDATE IGNORE v1 SET a = 1;
|
||||
ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
|
||||
SET SESSION sql_safe_updates = DEFAULT;
|
||||
DROP TABLE t1;
|
||||
DROP VIEW v1;
|
||||
|
@ -523,6 +523,8 @@ select @@max_user_connections;
|
||||
100
|
||||
set global max_write_lock_count=100;
|
||||
set myisam_sort_buffer_size=100;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '100'
|
||||
set global net_buffer_length=100;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect net_buffer_length value: '100'
|
||||
@ -1493,4 +1495,13 @@ SELECT @@GLOBAL.max_binlog_cache_size;
|
||||
@@GLOBAL.max_binlog_cache_size
|
||||
5368709120
|
||||
SET GLOBAL max_binlog_cache_size = @old_max_binlog_cache_size;
|
||||
#
|
||||
# Bug #37168 : Missing variable - skip_name_resolve
|
||||
#
|
||||
SELECT @@skip_name_resolve;
|
||||
@@skip_name_resolve
|
||||
0
|
||||
SHOW VARIABLES LIKE 'skip_name_resolve';
|
||||
Variable_name Value
|
||||
skip_name_resolve OFF
|
||||
End of 5.1 tests
|
||||
|
@ -10,3 +10,16 @@ set debug= '-P';
|
||||
select @@debug;
|
||||
@@debug
|
||||
T
|
||||
#
|
||||
# Bug #52629: memory leak from sys_var_thd_dbug in
|
||||
# binlog.binlog_write_error
|
||||
#
|
||||
SET GLOBAL debug='d,injecting_fault_writing';
|
||||
SELECT @@global.debug;
|
||||
@@global.debug
|
||||
d,injecting_fault_writing
|
||||
SET GLOBAL debug='';
|
||||
SELECT @@global.debug;
|
||||
@@global.debug
|
||||
|
||||
End of 5.1 tests
|
||||
|
@ -717,7 +717,7 @@ create view v1 as select a from t1;
|
||||
create view v2 as select a from t2 where a in (select a from v1);
|
||||
show create view v2;
|
||||
View Create View character_set_client collation_connection
|
||||
v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t2`.`a` AS `a` from `t2` where `t2`.`a` in (select `v1`.`a` AS `a` from `v1`) latin1 latin1_swedish_ci
|
||||
v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t2`.`a` AS `a` from `t2` where `t2`.`a` in (select `v1`.`a` from `v1`) latin1 latin1_swedish_ci
|
||||
drop view v2, v1;
|
||||
drop table t1, t2;
|
||||
CREATE VIEW `v 1` AS select 5 AS `5`;
|
||||
@ -2982,7 +2982,7 @@ SHOW WARNINGS;
|
||||
Level Code Message
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`pk` AS `pk` from (`t1` join `t2` on(((`t2`.`fk` = `t1`.`pk`) and (`t2`.`ver` = (select max(`t`.`ver`) AS `MAX(t.ver)` from `t2` `t` where (`t`.`org` = `t2`.`org`)))))) latin1 latin1_swedish_ci
|
||||
v1 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`pk` AS `pk` from (`t1` join `t2` on(((`t2`.`fk` = `t1`.`pk`) and (`t2`.`ver` = (select max(`t`.`ver`) from `t2` `t` where (`t`.`org` = `t2`.`org`)))))) latin1 latin1_swedish_ci
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1, t2;
|
||||
DROP FUNCTION IF EXISTS f1;
|
||||
@ -3874,6 +3874,14 @@ CREATE VIEW v1 AS SELECT 1 FROM t1 WHERE
|
||||
ROW(1,1) >= ROW(1, (SELECT 1 FROM t1 WHERE f1 >= ANY ( SELECT '1' )));
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#52120 create view cause Assertion failed: 0, file .\item_subselect.cc, line 817
|
||||
#
|
||||
CREATE TABLE t1 (a CHAR(1) CHARSET latin1, b CHAR(1) CHARSET utf8);
|
||||
CREATE VIEW v1 AS SELECT 1 from t1
|
||||
WHERE t1.b <=> (SELECT a FROM t1 WHERE a < SOME(SELECT '1'));
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
# -----------------------------------------------------------------
|
||||
# -- End of 5.1 tests.
|
||||
# -----------------------------------------------------------------
|
||||
|
111
mysql-test/r/view_alias.result
Normal file
111
mysql-test/r/view_alias.result
Normal file
@ -0,0 +1,111 @@
|
||||
#
|
||||
# Bug#40277 SHOW CREATE VIEW returns invalid SQL
|
||||
# Bug#41999 SHOW CREATE VIEW returns invalid SQL if subquery is used in SELECT list
|
||||
#
|
||||
# 65 characters exceed the maximum length of a column identifier. The system cannot derive the name from statement.
|
||||
# Constant with length = 65 . Expect to get the identifier 'Name_exp_1'.
|
||||
CREATE VIEW v1 AS SELECT '<--- 65 char including the arrows --->';
|
||||
SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME = 'v1';
|
||||
COLUMN_NAME
|
||||
Name_exp_1
|
||||
DROP VIEW v1;
|
||||
CREATE VIEW v1 AS select '<--- 65 char including the arrows --->' AS `Name_exp_1`;
|
||||
DROP VIEW v1;
|
||||
CREATE VIEW v1 AS select '<--- 65 char including the arrows --->' AS `Name_exp_1`;
|
||||
DROP VIEW v1;
|
||||
# Subquery with length = 65 . Expect to get the identifier 'Name_exp_1'.
|
||||
# Attention: Identifier for the column within the subquery will be not generated.
|
||||
CREATE VIEW v1 AS SELECT (SELECT '<--- 54 char including the arrows (+ 11 outside) -->');
|
||||
SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME = 'v1';
|
||||
COLUMN_NAME
|
||||
Name_exp_1
|
||||
DROP VIEW v1;
|
||||
CREATE VIEW v1 AS select (select '<--- 54 char including the arrows (+ 11 outside) -->') AS `Name_exp_1`;
|
||||
DROP VIEW v1;
|
||||
CREATE VIEW v1 AS select (select '<--- 54 char including the arrows (+ 11 outside) -->') AS `Name_exp_1`;
|
||||
DROP VIEW v1;
|
||||
# -----------------------------------------------------------------------------------------------------------------
|
||||
# 64 characters are the maximum length of a column identifier. The system can derive the name from the statement.
|
||||
CREATE VIEW v1 AS SELECT '<--- 64 char including the arrows --->';
|
||||
SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME = 'v1';
|
||||
COLUMN_NAME
|
||||
<--- 64 char including the arrows --->
|
||||
DROP VIEW v1;
|
||||
CREATE VIEW v1 AS select '<--- 64 char including the arrows --->' AS `<--- 64 char including the arrows --->`;
|
||||
DROP VIEW v1;
|
||||
CREATE VIEW v1 AS select '<--- 64 char including the arrows --->' AS `<--- 64 char including the arrows --->`;
|
||||
DROP VIEW v1;
|
||||
CREATE VIEW v1 AS SELECT (SELECT '<--- 53 char including the arrows (+ 11 outside) --->');
|
||||
SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME = 'v1';
|
||||
COLUMN_NAME
|
||||
(SELECT '<--- 53 char including the arrows (+ 11 outside) --->')
|
||||
DROP VIEW v1;
|
||||
CREATE VIEW v1 AS select (select '<--- 53 char including the arrows (+ 11 outside) --->') AS `(SELECT '<--- 53 char including the arrows (+ 11 outside) --->')`;
|
||||
DROP VIEW v1;
|
||||
CREATE VIEW v1 AS select (select '<--- 53 char including the arrows (+ 11 outside) --->') AS `(SELECT '<--- 53 char including the arrows (+ 11 outside) --->')`;
|
||||
DROP VIEW v1;
|
||||
# -----------------------------------------------------------------------------------------------------------------
|
||||
# Identifiers must not have trailing spaces. The system cannot derive the name from a constant with trailing space.
|
||||
# Generated identifiers have at their end the position within the select column list.
|
||||
# 'c2 ' -> 'Name_exp_1' , ' c4 ' -> 'Name_exp_2'
|
||||
CREATE VIEW v1 AS SELECT 'c1', 'c2 ', ' c3', ' c4 ';
|
||||
SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME = 'v1';
|
||||
COLUMN_NAME
|
||||
c1
|
||||
Name_exp_2
|
||||
c3
|
||||
Name_exp_4
|
||||
DROP VIEW v1;
|
||||
CREATE VIEW v1 AS select 'c1' AS `c1`,'c2 ' AS `Name_exp_2`,' c3' AS `c3`,' c4 ' AS `Name_exp_4`;
|
||||
DROP VIEW v1;
|
||||
CREATE VIEW v1 AS select 'c1' AS `c1`,'c2 ' AS `Name_exp_2`,' c3' AS `c3`,' c4 ' AS `Name_exp_4`;
|
||||
DROP VIEW v1;
|
||||
#
|
||||
# Bug#40277 SHOW CREATE VIEW returns invalid SQL
|
||||
#
|
||||
DROP VIEW IF EXISTS v1;
|
||||
DROP TABLE IF EXISTS t1,t2;
|
||||
# Column name exceeds the maximum length.
|
||||
CREATE VIEW v1 AS SELECT '0000000000 1111111111 2222222222 3333333333 4444444444 5555555555';
|
||||
DROP VIEW v1;
|
||||
CREATE VIEW v1 AS select '0000000000 1111111111 2222222222 3333333333 4444444444 5555555555' AS `Name_exp_1`;
|
||||
DROP VIEW v1;
|
||||
# Column names with leading trailing spaces.
|
||||
CREATE VIEW v1 AS SELECT 'c1', 'c2 ', ' c3', ' c4 ';
|
||||
DROP VIEW v1;
|
||||
CREATE VIEW v1 AS select 'c1' AS `c1`,'c2 ' AS `Name_exp_2`,' c3' AS `c3`,' c4 ' AS `Name_exp_4`;
|
||||
DROP VIEW v1;
|
||||
# Column name conflicts with a auto-generated one.
|
||||
CREATE VIEW v1 AS SELECT 'c1', 'c2 ', ' c3', ' c4 ', 'Name_exp_2';
|
||||
DROP VIEW v1;
|
||||
CREATE VIEW v1 AS select 'c1' AS `c1`,'c2 ' AS `Name_exp_2`,' c3' AS `c3`,' c4 ' AS `Name_exp_4`,'Name_exp_2' AS `My_exp_Name_exp_2`;
|
||||
DROP VIEW v1;
|
||||
# Invalid conlumn name in subquery.
|
||||
CREATE VIEW v1 AS SELECT (SELECT ' c1 ');
|
||||
DROP VIEW v1;
|
||||
CREATE VIEW v1 AS select (select ' c1 ') AS `(SELECT ' c1 ')`;
|
||||
DROP VIEW v1;
|
||||
CREATE TABLE t1(a INT);
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
# Test alias in subquery
|
||||
CREATE VIEW v1 AS SELECT a FROM t1 WHERE EXISTS (SELECT 1 FROM t2 AS b WHERE b.a = 0);
|
||||
DROP VIEW v1;
|
||||
CREATE VIEW v1 AS select `test`.`t1`.`a` AS `a` from `test`.`t1` where exists(select 1 from `test`.`t2` `b` where (`b`.`a` = 0));
|
||||
DROP VIEW v1;
|
||||
# Test column alias in subquery
|
||||
CREATE VIEW v1 AS SELECT a FROM t1 WHERE EXISTS (SELECT a AS alias FROM t1 GROUP BY alias);
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where exists(select `t1`.`a` AS `alias` from `t1` group by `t1`.`a`) latin1 latin1_swedish_ci
|
||||
DROP VIEW v1;
|
||||
CREATE VIEW v1 AS select `test`.`t1`.`a` AS `a` from `test`.`t1` where exists(select `test`.`t1`.`a` AS `alias` from `test`.`t1` group by `test`.`t1`.`a`);
|
||||
DROP VIEW v1;
|
||||
# Alias as the expression column name.
|
||||
CREATE VIEW v1 AS SELECT a FROM t1 WHERE EXISTS (SELECT ' a ' AS alias FROM t1 GROUP BY alias);
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where exists(select ' a ' AS `alias` from `t1` group by ' a ') latin1 latin1_swedish_ci
|
||||
DROP VIEW v1;
|
||||
CREATE VIEW v1 AS select `test`.`t1`.`a` AS `a` from `test`.`t1` where exists(select ' a ' AS `alias` from `test`.`t1` group by ' a ');
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1, t2;
|
@ -74,6 +74,23 @@ ERROR XA102: XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was det
|
||||
xa rollback 'a','c';
|
||||
xa start 'a','c';
|
||||
drop table t1;
|
||||
#
|
||||
# BUG#51342 - more xid crashing
|
||||
#
|
||||
CREATE TABLE t1(a INT) ENGINE=InnoDB;
|
||||
XA START 'x';
|
||||
SET SESSION autocommit=0;
|
||||
INSERT INTO t1 VALUES(1);
|
||||
SET SESSION autocommit=1;
|
||||
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state
|
||||
SELECT @@autocommit;
|
||||
@@autocommit
|
||||
0
|
||||
INSERT INTO t1 VALUES(1);
|
||||
XA END 'x';
|
||||
XA COMMIT 'x' ONE PHASE;
|
||||
DROP TABLE t1;
|
||||
SET SESSION autocommit=1;
|
||||
End of 5.0 tests
|
||||
xa start 'a';
|
||||
xa end 'a';
|
||||
|
BIN
mysql-test/std_data/binlog_savepoint.000001
Normal file
BIN
mysql-test/std_data/binlog_savepoint.000001
Normal file
Binary file not shown.
BIN
mysql-test/std_data/bug46565.ARZ
Normal file
BIN
mysql-test/std_data/bug46565.ARZ
Normal file
Binary file not shown.
BIN
mysql-test/std_data/bug46565.frm
Normal file
BIN
mysql-test/std_data/bug46565.frm
Normal file
Binary file not shown.
BIN
mysql-test/std_data/bug48265.frm
Normal file
BIN
mysql-test/std_data/bug48265.frm
Normal file
Binary file not shown.
BIN
mysql-test/std_data/bug49823.CSM
Normal file
BIN
mysql-test/std_data/bug49823.CSM
Normal file
Binary file not shown.
1
mysql-test/std_data/bug49823.CSV
Normal file
1
mysql-test/std_data/bug49823.CSV
Normal file
@ -0,0 +1 @@
|
||||
"2010-02-26 13:32:26","root[root] @ localhost []",2,1,"Query","SELECT 1"
|
|
BIN
mysql-test/std_data/bug49823.frm
Normal file
BIN
mysql-test/std_data/bug49823.frm
Normal file
Binary file not shown.
@ -29,3 +29,32 @@ master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
drop table t1;
|
||||
RESET MASTER;
|
||||
CREATE TABLE t1 ( c1 int , primary key (c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS t2 LIKE t1;
|
||||
TRUNCATE TABLE t2;
|
||||
DROP TABLE t1;
|
||||
###############################################
|
||||
### assertion: No event for 'TRUNCATE TABLE t2'
|
||||
###############################################
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 ( c1 int , primary key (c1)) ENGINE=InnoDB
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; DROP TABLE t1
|
||||
###############################################
|
||||
RESET MASTER;
|
||||
CREATE TEMPORARY TABLE t1 (c1 int) Engine=InnoDB;
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
TRUNCATE t1;
|
||||
DROP TEMPORARY TABLE t1;
|
||||
###############################################
|
||||
### assertion: No event for 'TRUNCATE TABLE t1'
|
||||
###############################################
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
###############################################
|
||||
|
@ -48,12 +48,12 @@ Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # use `test`; savepoint my_savepoint
|
||||
master-bin.000001 # Query # # SAVEPOINT my_savepoint
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t2)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # use `test`; rollback to savepoint my_savepoint
|
||||
master-bin.000001 # Query # # ROLLBACK TO my_savepoint
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
@ -77,12 +77,12 @@ Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # use `test`; savepoint my_savepoint
|
||||
master-bin.000001 # Query # # SAVEPOINT my_savepoint
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t2)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # use `test`; rollback to savepoint my_savepoint
|
||||
master-bin.000001 # Query # # ROLLBACK TO my_savepoint
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
@ -413,7 +413,6 @@ master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # COMMIT
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE table t2
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
|
@ -44,10 +44,10 @@ show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `test`; insert into t1 values(3)
|
||||
master-bin.000001 # Query # # use `test`; savepoint my_savepoint
|
||||
master-bin.000001 # Query # # SAVEPOINT my_savepoint
|
||||
master-bin.000001 # Query # # use `test`; insert into t1 values(4)
|
||||
master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 # Query # # use `test`; rollback to savepoint my_savepoint
|
||||
master-bin.000001 # Query # # ROLLBACK TO my_savepoint
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
@ -70,10 +70,10 @@ show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `test`; insert into t1 values(5)
|
||||
master-bin.000001 # Query # # use `test`; savepoint my_savepoint
|
||||
master-bin.000001 # Query # # SAVEPOINT my_savepoint
|
||||
master-bin.000001 # Query # # use `test`; insert into t1 values(6)
|
||||
master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 # Query # # use `test`; rollback to savepoint my_savepoint
|
||||
master-bin.000001 # Query # # ROLLBACK TO my_savepoint
|
||||
master-bin.000001 # Query # # use `test`; insert into t1 values(7)
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
delete from t1;
|
||||
|
@ -29,3 +29,14 @@ a
|
||||
6
|
||||
8
|
||||
drop table foo;
|
||||
RESET MASTER;
|
||||
create database b51226;
|
||||
use b51226;
|
||||
create temporary table t1(i int);
|
||||
use b51226;
|
||||
create temporary table t1(i int);
|
||||
create temporary table t1(i int);
|
||||
ERROR 42S01: Table 't1' already exists
|
||||
insert into t1 values(1);
|
||||
DROP DATABASE b51226;
|
||||
FLUSH LOGS;
|
||||
|
@ -40,3 +40,40 @@ commit;
|
||||
source include/show_binlog_events.inc;
|
||||
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# BUG#51251
|
||||
#
|
||||
# The test case checks if truncating a temporary table created with
|
||||
# engine InnoDB will not cause the truncate statement to be binlogged.
|
||||
|
||||
# Before patch for BUG#51251, the TRUNCATE statements below would be
|
||||
# binlogged, which would cause the slave to fail with "table does not
|
||||
# exist".
|
||||
|
||||
RESET MASTER;
|
||||
|
||||
CREATE TABLE t1 ( c1 int , primary key (c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS t2 LIKE t1;
|
||||
TRUNCATE TABLE t2;
|
||||
DROP TABLE t1;
|
||||
|
||||
-- echo ###############################################
|
||||
-- echo ### assertion: No event for 'TRUNCATE TABLE t2'
|
||||
-- echo ###############################################
|
||||
-- source include/show_binlog_events.inc
|
||||
-- echo ###############################################
|
||||
|
||||
RESET MASTER;
|
||||
|
||||
CREATE TEMPORARY TABLE t1 (c1 int) Engine=InnoDB;
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
TRUNCATE t1;
|
||||
DROP TEMPORARY TABLE t1;
|
||||
|
||||
-- echo ###############################################
|
||||
-- echo ### assertion: No event for 'TRUNCATE TABLE t1'
|
||||
-- echo ###############################################
|
||||
-- source include/show_binlog_events.inc
|
||||
-- echo ###############################################
|
||||
|
@ -82,3 +82,69 @@ select * from foo;
|
||||
|
||||
# clean up
|
||||
drop table foo;
|
||||
|
||||
#################################################################
|
||||
# BUG#51226
|
||||
#################################################################
|
||||
|
||||
RESET MASTER;
|
||||
|
||||
-- let $dbname=b51226
|
||||
|
||||
connect (con1,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
|
||||
connect (con2,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
|
||||
|
||||
#
|
||||
# action: on con1 create the database and the tmp table
|
||||
#
|
||||
-- connection con1
|
||||
-- eval create database $dbname
|
||||
-- eval use $dbname
|
||||
create temporary table t1(i int);
|
||||
|
||||
#
|
||||
# action: on con1 create the tmp table
|
||||
#
|
||||
-- connection con2
|
||||
-- eval use $dbname
|
||||
create temporary table t1(i int);
|
||||
|
||||
# action: at this point, the last event binlogged contains the
|
||||
# pseudo_thread_id from con2. So now we switch to con1, issue
|
||||
# a statement that fails and close the connection (which logs
|
||||
# implicitely a DROP TEMPORARY TABLE).
|
||||
#
|
||||
# Before the patch this would not log con1's pseudo_thread_id
|
||||
# because the failing statement would reset THD context
|
||||
# (unsetting the thread_specific_used flag, and consequently,
|
||||
# causing the DROP event to be logged without pseudo_thread_id
|
||||
# in its header).
|
||||
|
||||
-- connection con1
|
||||
-- error 1050
|
||||
create temporary table t1(i int);
|
||||
-- disconnect con1
|
||||
|
||||
-- connection default
|
||||
-- let $wait_binlog_event= DROP
|
||||
-- source include/wait_for_binlog_event.inc
|
||||
|
||||
# action: insert in the t1. This would cause the the test to fail,
|
||||
# because when replaying the binlog the previous implicit drop
|
||||
# temp table would have been executed under the wrong
|
||||
# pseudo_thread_id, dropping the tmp table on con2.
|
||||
-- connection con2
|
||||
insert into t1 values(1);
|
||||
-- disconnect con2
|
||||
|
||||
-- connection default
|
||||
-- let $wait_binlog_event= DROP
|
||||
-- source include/wait_for_binlog_event.inc
|
||||
|
||||
-- eval DROP DATABASE $dbname
|
||||
FLUSH LOGS;
|
||||
|
||||
# assertion: assert that when replaying the binary log will succeed,
|
||||
# instead of failing with "Table 'XXX.YYY' doesn't exist"
|
||||
-- let $MYSQLD_DATADIR= `select @@datadir`
|
||||
-- exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 | $MYSQL
|
||||
|
71
mysql-test/suite/engines/README
Normal file
71
mysql-test/suite/engines/README
Normal file
@ -0,0 +1,71 @@
|
||||
|
||||
|
||||
|
||||
This directory includes a set of three test suites aimed as testing functionality
|
||||
in an engine independent way, that is - the tests should work identically against
|
||||
different engines.
|
||||
|
||||
|
||||
The following suites are included:
|
||||
|
||||
1) 'funcs' suite
|
||||
-------------
|
||||
A collection of functional tests covering basic engine and server functionality that can be run
|
||||
against iany engine.
|
||||
|
||||
To run the test suite:
|
||||
cd INSTALL_DIR/mysql-test
|
||||
run: perl ./mysql-test-run.pl --suite=engines/funcs --mysqld=--default-storage-engine=<engine>
|
||||
|
||||
2) 'iuds' suite
|
||||
------------
|
||||
Similar to the above focused on insert/update/delete operations of different different data types.
|
||||
|
||||
To run the test suite:
|
||||
cd INSTALL_DIR/mysql-test
|
||||
run: perl ./mysql-test-run.pl --suite=engines/iuds --mysqld=--default-storage-engine=<engine>
|
||||
|
||||
3) 'rr_trx' suite (transactional engines only)
|
||||
--------------
|
||||
A scenario of multiple client connections verifying transactions with repeatable read isolation level
|
||||
|
||||
To run the test suite with innodb:
|
||||
cd INSTALL_DIR/mysql-test
|
||||
run: perl ./suite/engines/rr_trx/run_stress_tx_rr.pl --engine=<engine> [--duration=<nn>]
|
||||
[--threads=<nn>] [--try] [--help]
|
||||
|
||||
This test is can be run against any transactional engine. However scripts need to be modified in order
|
||||
to support such engines (current scripts support only InnoDB).
|
||||
In order to add support for a new engine, you will need to modify scripts as follows:
|
||||
1) cd to INSTALL_DIR/mysql-test/suite/engines/rr_trx
|
||||
2) Modify the 'run_stress_rr.pl' file by adding an 'elsif' section for your engine and have it
|
||||
include specific values required to be passed as startup parameters to the MySQL server by
|
||||
specifying them using "--mysqld" options (see InnoDB example).
|
||||
3) Copy the 'init_innodb.txt' file to 'init_<engine>.txt file and change its content to be "init_<engine>".
|
||||
4) In the 't' directory copy the "init_innodb.test" file to "init_<engine>.test" and change the value of
|
||||
the '$engine' variable to <engine>.
|
||||
5) In the 'r' directory copy "the init_innodb.result" file to "init_<engine>.result" and change refrences
|
||||
to 'InnoDB' to <engine>.
|
||||
|
||||
|
||||
Known Issues
|
||||
------------
|
||||
1) The 'funcs' and 'iuds' suites currently runs only against MySQL 5.1 server.
|
||||
Running them against MySQL 5.5 will generate errors.
|
||||
|
||||
2) The folowing tests in the 'iuds' suite:
|
||||
- delete_decimal
|
||||
- insert_decimal
|
||||
- update_decimal
|
||||
will return a 'Warning 1264 - Out of range value...' warning if run in a 32-bit environment.
|
||||
Add the '--force' option to prevent the test run from aborting.
|
||||
|
||||
3) The following tests in the 'funcs' suite will fail when run against the innodb_plugin:
|
||||
- crash_manycolumns_string (bug 50495)
|
||||
- ix_unique_lob (bug 52056, masked by an 'Out of memory error' on some 32-bit platforms)
|
||||
- ix_unique_string_length (bug 52056, masked by an 'Out of memory error' on some 32-bit platforms)
|
||||
Add the '--force' option to prevent the test run from aborting.
|
||||
|
||||
4) Some of the rpl_xxx tests in the 'funcs' suite require a secific binlog_forat setting and will be
|
||||
skipped otherwise.
|
||||
|
1141
mysql-test/suite/engines/funcs/r/ai_init_alter_table.result
Normal file
1141
mysql-test/suite/engines/funcs/r/ai_init_alter_table.result
Normal file
File diff suppressed because it is too large
Load Diff
1081
mysql-test/suite/engines/funcs/r/ai_init_create_table.result
Normal file
1081
mysql-test/suite/engines/funcs/r/ai_init_create_table.result
Normal file
File diff suppressed because it is too large
Load Diff
395
mysql-test/suite/engines/funcs/r/ai_init_insert.result
Normal file
395
mysql-test/suite/engines/funcs/r/ai_init_insert.result
Normal file
@ -0,0 +1,395 @@
|
||||
DROP TABLE IF EXISTS t1;
|
||||
create table t1 (c1 VARCHAR(10) NOT NULL COMMENT 'Abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcd', c2 INTEGER COMMENT 'aBcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcd',c3 INTEGER COMMENT '012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789', c4 INTEGER, c5 INTEGER, c6 INTEGER, c7 INTEGER, c8 VARCHAR(100), c9 CHAR(50), c10 DATETIME, c11 DATETIME, c12 DATETIME,c13 DATETIME, INDEX i1 (c1), INDEX i2(c2)
|
||||
) COMMENT='ABCDEFGHIJabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcd';
|
||||
Warnings:
|
||||
Warning 1629 Comment for field 'c1' is too long (max = 255)
|
||||
Warning 1629 Comment for field 'c2' is too long (max = 255)
|
||||
Warning 1629 Comment for field 'c3' is too long (max = 255)
|
||||
Warning 1628 Comment for table 't1' is too long (max = 60)
|
||||
SELECT table_comment,char_length(table_comment) FROM information_schema.tables WHERE table_name='t1';
|
||||
table_comment char_length(table_comment)
|
||||
ABCDEFGHIJabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij 60
|
||||
SELECT column_comment,char_length(column_comment) FROM information_schema.columns WHERE table_name='t1';
|
||||
column_comment char_length(column_comment)
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234 255
|
||||
Abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde 255
|
||||
aBcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde 255
|
||||
SELECT comment FROM information_schema.statistics WHERE table_name='t1';
|
||||
comment
|
||||
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` varchar(10) NOT NULL COMMENT 'Abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde',
|
||||
`c2` int(11) DEFAULT NULL COMMENT 'aBcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde',
|
||||
`c3` int(11) DEFAULT NULL COMMENT '012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234',
|
||||
`c4` int(11) DEFAULT NULL,
|
||||
`c5` int(11) DEFAULT NULL,
|
||||
`c6` int(11) DEFAULT NULL,
|
||||
`c7` int(11) DEFAULT NULL,
|
||||
`c8` varchar(100) DEFAULT NULL,
|
||||
`c9` char(50) DEFAULT NULL,
|
||||
`c10` datetime DEFAULT NULL,
|
||||
`c11` datetime DEFAULT NULL,
|
||||
`c12` datetime DEFAULT NULL,
|
||||
`c13` datetime DEFAULT NULL,
|
||||
KEY `i1` (`c1`),
|
||||
KEY `i2` (`c2`)
|
||||
) ENGINE=ENGINE DEFAULT CHARSET=latin1 COMMENT='ABCDEFGHIJabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij'
|
||||
SELECT table_comment,char_length(table_comment) FROM information_schema.tables WHERE table_name='t1';
|
||||
table_comment char_length(table_comment)
|
||||
ABCDEFGHIJabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij 60
|
||||
SELECT column_comment,char_length(column_comment) FROM information_schema.columns WHERE table_name='t1';
|
||||
column_comment char_length(column_comment)
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234 255
|
||||
Abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde 255
|
||||
aBcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde 255
|
||||
SELECT comment FROM information_schema.statistics WHERE table_name='t1';
|
||||
comment
|
||||
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` varchar(10) NOT NULL COMMENT 'Abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde',
|
||||
`c2` int(11) DEFAULT NULL COMMENT 'aBcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde',
|
||||
`c3` int(11) DEFAULT NULL COMMENT '012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234',
|
||||
`c4` int(11) DEFAULT NULL,
|
||||
`c5` int(11) DEFAULT NULL,
|
||||
`c6` int(11) DEFAULT NULL,
|
||||
`c7` int(11) DEFAULT NULL,
|
||||
`c8` varchar(100) DEFAULT NULL,
|
||||
`c9` char(50) DEFAULT NULL,
|
||||
`c10` datetime DEFAULT NULL,
|
||||
`c11` datetime DEFAULT NULL,
|
||||
`c12` datetime DEFAULT NULL,
|
||||
`c13` datetime DEFAULT NULL,
|
||||
KEY `i1` (`c1`),
|
||||
KEY `i2` (`c2`)
|
||||
) ENGINE=ENGINE DEFAULT CHARSET=latin1 COMMENT='ABCDEFGHIJabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij'
|
||||
SELECT table_comment,char_length(table_comment) FROM information_schema.tables WHERE table_name='t1';
|
||||
table_comment char_length(table_comment)
|
||||
ABCDEFGHIJabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij 60
|
||||
SELECT column_comment,char_length(column_comment) FROM information_schema.columns WHERE table_name='t1';
|
||||
column_comment char_length(column_comment)
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234 255
|
||||
Abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde 255
|
||||
aBcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde 255
|
||||
SELECT comment FROM information_schema.statistics WHERE table_name='t1';
|
||||
comment
|
||||
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` varchar(10) NOT NULL COMMENT 'Abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde',
|
||||
`c2` int(11) DEFAULT NULL COMMENT 'aBcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde',
|
||||
`c3` int(11) DEFAULT NULL COMMENT '012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234',
|
||||
`c4` int(11) DEFAULT NULL,
|
||||
`c5` int(11) DEFAULT NULL,
|
||||
`c6` int(11) DEFAULT NULL,
|
||||
`c7` int(11) DEFAULT NULL,
|
||||
`c8` varchar(100) DEFAULT NULL,
|
||||
`c9` char(50) DEFAULT NULL,
|
||||
`c10` datetime DEFAULT NULL,
|
||||
`c11` datetime DEFAULT NULL,
|
||||
`c12` datetime DEFAULT NULL,
|
||||
`c13` datetime DEFAULT NULL,
|
||||
KEY `i1` (`c1`),
|
||||
KEY `i2` (`c2`)
|
||||
) ENGINE=ENGINE DEFAULT CHARSET=latin1 COMMENT='ABCDEFGHIJabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij'
|
||||
DROP INDEX i1 ON t1;
|
||||
ALTER TABLE t1 DROP INDEX i2;
|
||||
SELECT table_comment,char_length(table_comment) FROM information_schema.tables WHERE table_name='t1';
|
||||
table_comment char_length(table_comment)
|
||||
ABCDEFGHIJabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij 60
|
||||
SELECT column_comment,char_length(column_comment) FROM information_schema.columns WHERE table_name='t1';
|
||||
column_comment char_length(column_comment)
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234 255
|
||||
Abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde 255
|
||||
aBcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde 255
|
||||
SELECT comment FROM information_schema.statistics WHERE table_name='t1';
|
||||
comment
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` varchar(10) NOT NULL COMMENT 'Abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde',
|
||||
`c2` int(11) DEFAULT NULL COMMENT 'aBcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde',
|
||||
`c3` int(11) DEFAULT NULL COMMENT '012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234',
|
||||
`c4` int(11) DEFAULT NULL,
|
||||
`c5` int(11) DEFAULT NULL,
|
||||
`c6` int(11) DEFAULT NULL,
|
||||
`c7` int(11) DEFAULT NULL,
|
||||
`c8` varchar(100) DEFAULT NULL,
|
||||
`c9` char(50) DEFAULT NULL,
|
||||
`c10` datetime DEFAULT NULL,
|
||||
`c11` datetime DEFAULT NULL,
|
||||
`c12` datetime DEFAULT NULL,
|
||||
`c13` datetime DEFAULT NULL
|
||||
) ENGINE=ENGINE DEFAULT CHARSET=latin1 COMMENT='ABCDEFGHIJabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij'
|
||||
SELECT table_comment,char_length(table_comment) FROM information_schema.tables WHERE table_name='t1';
|
||||
table_comment char_length(table_comment)
|
||||
ABCDEFGHIJabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij 60
|
||||
SELECT column_comment,char_length(column_comment) FROM information_schema.columns WHERE table_name='t1';
|
||||
column_comment char_length(column_comment)
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234 255
|
||||
Abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde 255
|
||||
aBcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde 255
|
||||
SELECT comment FROM information_schema.statistics WHERE table_name='t1';
|
||||
comment
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` varchar(10) NOT NULL COMMENT 'Abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde',
|
||||
`c2` int(11) DEFAULT NULL COMMENT 'aBcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde',
|
||||
`c3` int(11) DEFAULT NULL COMMENT '012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234',
|
||||
`c4` int(11) DEFAULT NULL,
|
||||
`c5` int(11) DEFAULT NULL,
|
||||
`c6` int(11) DEFAULT NULL,
|
||||
`c7` int(11) DEFAULT NULL,
|
||||
`c8` varchar(100) DEFAULT NULL,
|
||||
`c9` char(50) DEFAULT NULL,
|
||||
`c10` datetime DEFAULT NULL,
|
||||
`c11` datetime DEFAULT NULL,
|
||||
`c12` datetime DEFAULT NULL,
|
||||
`c13` datetime DEFAULT NULL
|
||||
) ENGINE=ENGINE DEFAULT CHARSET=latin1 COMMENT='ABCDEFGHIJabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij'
|
||||
SELECT table_comment,char_length(table_comment) FROM information_schema.tables WHERE table_name='t1';
|
||||
table_comment char_length(table_comment)
|
||||
ABCDEFGHIJabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij 60
|
||||
SELECT column_comment,char_length(column_comment) FROM information_schema.columns WHERE table_name='t1';
|
||||
column_comment char_length(column_comment)
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234 255
|
||||
Abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde 255
|
||||
aBcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde 255
|
||||
SELECT comment FROM information_schema.statistics WHERE table_name='t1';
|
||||
comment
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` varchar(10) NOT NULL COMMENT 'Abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde',
|
||||
`c2` int(11) DEFAULT NULL COMMENT 'aBcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde',
|
||||
`c3` int(11) DEFAULT NULL COMMENT '012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234',
|
||||
`c4` int(11) DEFAULT NULL,
|
||||
`c5` int(11) DEFAULT NULL,
|
||||
`c6` int(11) DEFAULT NULL,
|
||||
`c7` int(11) DEFAULT NULL,
|
||||
`c8` varchar(100) DEFAULT NULL,
|
||||
`c9` char(50) DEFAULT NULL,
|
||||
`c10` datetime DEFAULT NULL,
|
||||
`c11` datetime DEFAULT NULL,
|
||||
`c12` datetime DEFAULT NULL,
|
||||
`c13` datetime DEFAULT NULL
|
||||
) ENGINE=ENGINE DEFAULT CHARSET=latin1 COMMENT='ABCDEFGHIJabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij'
|
||||
SELECT table_comment,char_length(table_comment) FROM information_schema.tables WHERE table_name='t1';
|
||||
table_comment char_length(table_comment)
|
||||
ABCDEFGHIJabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij 60
|
||||
SELECT column_comment,char_length(column_comment) FROM information_schema.columns WHERE table_name='t1';
|
||||
column_comment char_length(column_comment)
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234 255
|
||||
Abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde 255
|
||||
aBcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde 255
|
||||
SELECT comment FROM information_schema.statistics WHERE table_name='t1';
|
||||
comment
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` varchar(10) NOT NULL COMMENT 'Abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde',
|
||||
`c2` int(11) DEFAULT NULL COMMENT 'aBcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde',
|
||||
`c3` int(11) DEFAULT NULL COMMENT '012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234',
|
||||
`c4` int(11) DEFAULT NULL,
|
||||
`c5` int(11) DEFAULT NULL,
|
||||
`c6` int(11) DEFAULT NULL,
|
||||
`c7` int(11) DEFAULT NULL,
|
||||
`c8` varchar(100) DEFAULT NULL,
|
||||
`c9` char(50) DEFAULT NULL,
|
||||
`c10` datetime DEFAULT NULL,
|
||||
`c11` datetime DEFAULT NULL,
|
||||
`c12` datetime DEFAULT NULL,
|
||||
`c13` datetime DEFAULT NULL
|
||||
) ENGINE=ENGINE DEFAULT CHARSET=latin1 COMMENT='ABCDEFGHIJabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij'
|
||||
SELECT table_comment,char_length(table_comment) FROM information_schema.tables WHERE table_name='t1';
|
||||
table_comment char_length(table_comment)
|
||||
ABCDEFGHIJabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij 60
|
||||
SELECT column_comment,char_length(column_comment) FROM information_schema.columns WHERE table_name='t1';
|
||||
column_comment char_length(column_comment)
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234 255
|
||||
Abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde 255
|
||||
aBcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde 255
|
||||
SELECT comment FROM information_schema.statistics WHERE table_name='t1';
|
||||
comment
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` varchar(10) NOT NULL COMMENT 'Abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde',
|
||||
`c2` int(11) DEFAULT NULL COMMENT 'aBcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde',
|
||||
`c3` int(11) DEFAULT NULL COMMENT '012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234',
|
||||
`c4` int(11) DEFAULT NULL,
|
||||
`c5` int(11) DEFAULT NULL,
|
||||
`c6` int(11) DEFAULT NULL,
|
||||
`c7` int(11) DEFAULT NULL,
|
||||
`c8` varchar(100) DEFAULT NULL,
|
||||
`c9` char(50) DEFAULT NULL,
|
||||
`c10` datetime DEFAULT NULL,
|
||||
`c11` datetime DEFAULT NULL,
|
||||
`c12` datetime DEFAULT NULL,
|
||||
`c13` datetime DEFAULT NULL
|
||||
) ENGINE=ENGINE DEFAULT CHARSET=latin1 COMMENT='ABCDEFGHIJabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij'
|
||||
set sql_mode='TRADITIONAL';
|
||||
SELECT table_comment,char_length(table_comment) FROM information_schema.tables WHERE table_name='t1';
|
||||
table_comment char_length(table_comment)
|
||||
ABCDEFGHIJabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij 60
|
||||
SELECT column_comment,char_length(column_comment) FROM information_schema.columns WHERE table_name='t1';
|
||||
column_comment char_length(column_comment)
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234 255
|
||||
Abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde 255
|
||||
aBcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde 255
|
||||
SELECT comment FROM information_schema.statistics WHERE table_name='t1';
|
||||
comment
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` varchar(10) NOT NULL COMMENT 'Abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde',
|
||||
`c2` int(11) DEFAULT NULL COMMENT 'aBcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde',
|
||||
`c3` int(11) DEFAULT NULL COMMENT '012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234',
|
||||
`c4` int(11) DEFAULT NULL,
|
||||
`c5` int(11) DEFAULT NULL,
|
||||
`c6` int(11) DEFAULT NULL,
|
||||
`c7` int(11) DEFAULT NULL,
|
||||
`c8` varchar(100) DEFAULT NULL,
|
||||
`c9` char(50) DEFAULT NULL,
|
||||
`c10` datetime DEFAULT NULL,
|
||||
`c11` datetime DEFAULT NULL,
|
||||
`c12` datetime DEFAULT NULL,
|
||||
`c13` datetime DEFAULT NULL
|
||||
) ENGINE=ENGINE DEFAULT CHARSET=latin1 COMMENT='ABCDEFGHIJabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij'
|
||||
set sql_mode='TRADITIONAL';
|
||||
SELECT table_comment,char_length(table_comment) FROM information_schema.tables WHERE table_name='t1';
|
||||
table_comment char_length(table_comment)
|
||||
ABCDEFGHIJabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij 60
|
||||
SELECT column_comment,char_length(column_comment) FROM information_schema.columns WHERE table_name='t1';
|
||||
column_comment char_length(column_comment)
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234 255
|
||||
Abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde 255
|
||||
aBcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde 255
|
||||
SELECT comment FROM information_schema.statistics WHERE table_name='t1';
|
||||
comment
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` varchar(10) NOT NULL COMMENT 'Abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde',
|
||||
`c2` int(11) DEFAULT NULL COMMENT 'aBcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde',
|
||||
`c3` int(11) DEFAULT NULL COMMENT '012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234',
|
||||
`c4` int(11) DEFAULT NULL,
|
||||
`c5` int(11) DEFAULT NULL,
|
||||
`c6` int(11) DEFAULT NULL,
|
||||
`c7` int(11) DEFAULT NULL,
|
||||
`c8` varchar(100) DEFAULT NULL,
|
||||
`c9` char(50) DEFAULT NULL,
|
||||
`c10` datetime DEFAULT NULL,
|
||||
`c11` datetime DEFAULT NULL,
|
||||
`c12` datetime DEFAULT NULL,
|
||||
`c13` datetime DEFAULT NULL
|
||||
) ENGINE=ENGINE DEFAULT CHARSET=latin1 COMMENT='ABCDEFGHIJabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij'
|
||||
DROP TABLE t1;
|
1141
mysql-test/suite/engines/funcs/r/ai_init_insert_id.result
Normal file
1141
mysql-test/suite/engines/funcs/r/ai_init_insert_id.result
Normal file
File diff suppressed because it is too large
Load Diff
1081
mysql-test/suite/engines/funcs/r/ai_overflow_error.result
Normal file
1081
mysql-test/suite/engines/funcs/r/ai_overflow_error.result
Normal file
File diff suppressed because it is too large
Load Diff
2521
mysql-test/suite/engines/funcs/r/ai_reset_by_truncate.result
Normal file
2521
mysql-test/suite/engines/funcs/r/ai_reset_by_truncate.result
Normal file
File diff suppressed because it is too large
Load Diff
529
mysql-test/suite/engines/funcs/r/ai_sql_auto_is_null.result
Normal file
529
mysql-test/suite/engines/funcs/r/ai_sql_auto_is_null.result
Normal file
@ -0,0 +1,529 @@
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1(c1 TINYINT AUTO_INCREMENT NULL KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 SMALLINT AUTO_INCREMENT NULL KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 MEDIUMINT AUTO_INCREMENT NULL KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 INT AUTO_INCREMENT NULL KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 INTEGER AUTO_INCREMENT NULL KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 BIGINT AUTO_INCREMENT NULL KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 TINYINT AUTO_INCREMENT NOT NULL KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 SMALLINT AUTO_INCREMENT NOT NULL KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 MEDIUMINT AUTO_INCREMENT NOT NULL KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 INT AUTO_INCREMENT NOT NULL KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 INTEGER AUTO_INCREMENT NOT NULL KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 BIGINT AUTO_INCREMENT NOT NULL KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 TINYINT AUTO_INCREMENT NULL UNIQUE KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 SMALLINT AUTO_INCREMENT NULL UNIQUE KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 MEDIUMINT AUTO_INCREMENT NULL UNIQUE KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 INT AUTO_INCREMENT NULL UNIQUE KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 INTEGER AUTO_INCREMENT NULL UNIQUE KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 BIGINT AUTO_INCREMENT NULL UNIQUE KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 TINYINT AUTO_INCREMENT NOT NULL UNIQUE KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 SMALLINT AUTO_INCREMENT NOT NULL UNIQUE KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 MEDIUMINT AUTO_INCREMENT NOT NULL UNIQUE KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 INT AUTO_INCREMENT NOT NULL UNIQUE KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 INTEGER AUTO_INCREMENT NOT NULL UNIQUE KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 BIGINT AUTO_INCREMENT NOT NULL UNIQUE KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 TINYINT AUTO_INCREMENT NOT NULL PRIMARY KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 SMALLINT AUTO_INCREMENT NOT NULL PRIMARY KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 MEDIUMINT AUTO_INCREMENT NOT NULL PRIMARY KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 INT AUTO_INCREMENT NOT NULL PRIMARY KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 BIGINT AUTO_INCREMENT NOT NULL PRIMARY KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 TINYINT UNSIGNED AUTO_INCREMENT NULL KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 SMALLINT UNSIGNED AUTO_INCREMENT NULL KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 MEDIUMINT UNSIGNED AUTO_INCREMENT NULL KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 INT UNSIGNED AUTO_INCREMENT NULL KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 INTEGER UNSIGNED AUTO_INCREMENT NULL KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 BIGINT UNSIGNED AUTO_INCREMENT NULL KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 TINYINT UNSIGNED AUTO_INCREMENT NOT NULL KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 SMALLINT UNSIGNED AUTO_INCREMENT NOT NULL KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 MEDIUMINT UNSIGNED AUTO_INCREMENT NOT NULL KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 INT UNSIGNED AUTO_INCREMENT NOT NULL KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 INTEGER UNSIGNED AUTO_INCREMENT NOT NULL KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 BIGINT UNSIGNED AUTO_INCREMENT NOT NULL KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 TINYINT UNSIGNED AUTO_INCREMENT NULL UNIQUE KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 SMALLINT UNSIGNED AUTO_INCREMENT NULL UNIQUE KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 MEDIUMINT UNSIGNED AUTO_INCREMENT NULL UNIQUE KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 INT UNSIGNED AUTO_INCREMENT NULL UNIQUE KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 INTEGER UNSIGNED AUTO_INCREMENT NULL UNIQUE KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 BIGINT UNSIGNED AUTO_INCREMENT NULL UNIQUE KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 TINYINT UNSIGNED AUTO_INCREMENT NOT NULL UNIQUE KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 SMALLINT UNSIGNED AUTO_INCREMENT NOT NULL UNIQUE KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 MEDIUMINT UNSIGNED AUTO_INCREMENT NOT NULL UNIQUE KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 INT UNSIGNED AUTO_INCREMENT NOT NULL UNIQUE KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 INTEGER UNSIGNED AUTO_INCREMENT NOT NULL UNIQUE KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 BIGINT UNSIGNED AUTO_INCREMENT NOT NULL UNIQUE KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 TINYINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 SMALLINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 MEDIUMINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 INTEGER UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY );
|
||||
SET SQL_AUTO_IS_NULL = 1;
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
INSERT INTO t1 VALUES(null);
|
||||
SELECT * FROM t1 WHERE c1 IS NULL;
|
||||
c1
|
||||
3
|
||||
DROP TABLE t1;
|
39
mysql-test/suite/engines/funcs/r/an_calendar.result
Normal file
39
mysql-test/suite/engines/funcs/r/an_calendar.result
Normal file
@ -0,0 +1,39 @@
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1(c1 DATE NULL, c2 DATE NULL);
|
||||
SET TIMESTAMP=1171346973;
|
||||
INSERT INTO t1 VALUES(NOW(),NOW());
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'c1' at row 1
|
||||
Note 1265 Data truncated for column 'c2' at row 1
|
||||
INSERT INTO t1 VALUES(NOW(),NOW());
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'c1' at row 1
|
||||
Note 1265 Data truncated for column 'c2' at row 1
|
||||
ANALYZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 TIME NULL, c2 TIME NULL);
|
||||
SET TIMESTAMP=1171346973;
|
||||
INSERT INTO t1 VALUES(NOW(),NOW());
|
||||
INSERT INTO t1 VALUES(NOW(),NOW());
|
||||
ANALYZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 DATETIME NULL, c2 DATETIME NULL);
|
||||
SET TIMESTAMP=1171346973;
|
||||
INSERT INTO t1 VALUES(NOW(),NOW());
|
||||
INSERT INTO t1 VALUES(NOW(),NOW());
|
||||
ANALYZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 TIMESTAMP NULL, c2 TIMESTAMP NULL);
|
||||
SET TIMESTAMP=1171346973;
|
||||
INSERT INTO t1 VALUES(NOW(),NOW());
|
||||
INSERT INTO t1 VALUES(NOW(),NOW());
|
||||
ANALYZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
DROP TABLE t1;
|
99
mysql-test/suite/engines/funcs/r/an_number.result
Normal file
99
mysql-test/suite/engines/funcs/r/an_number.result
Normal file
@ -0,0 +1,99 @@
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1(c1 TINYINT NULL, c2 TINYINT NULL);
|
||||
INSERT INTO t1 VALUES(1,2);
|
||||
INSERT INTO t1 VALUES(3,4);
|
||||
ANALYZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 SMALLINT NULL, c2 SMALLINT NULL);
|
||||
INSERT INTO t1 VALUES(1,2);
|
||||
INSERT INTO t1 VALUES(3,4);
|
||||
ANALYZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 MEDIUMINT NULL, c2 MEDIUMINT NULL);
|
||||
INSERT INTO t1 VALUES(1,2);
|
||||
INSERT INTO t1 VALUES(3,4);
|
||||
ANALYZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 INT NULL, c2 INT NULL);
|
||||
INSERT INTO t1 VALUES(1,2);
|
||||
INSERT INTO t1 VALUES(3,4);
|
||||
ANALYZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 INTEGER NULL, c2 INTEGER NULL);
|
||||
INSERT INTO t1 VALUES(1,2);
|
||||
INSERT INTO t1 VALUES(3,4);
|
||||
ANALYZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 BIGINT NULL, c2 BIGINT NULL);
|
||||
INSERT INTO t1 VALUES(1,2);
|
||||
INSERT INTO t1 VALUES(3,4);
|
||||
ANALYZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 DECIMAL NULL, c2 DECIMAL NULL);
|
||||
INSERT INTO t1 VALUES(1,2);
|
||||
INSERT INTO t1 VALUES(3,4);
|
||||
ANALYZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 DEC NULL, c2 DEC NULL);
|
||||
INSERT INTO t1 VALUES(1,2);
|
||||
INSERT INTO t1 VALUES(3,4);
|
||||
ANALYZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 FIXED NULL, c2 FIXED NULL);
|
||||
INSERT INTO t1 VALUES(1,2);
|
||||
INSERT INTO t1 VALUES(3,4);
|
||||
ANALYZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 NUMERIC NULL, c2 NUMERIC NULL);
|
||||
INSERT INTO t1 VALUES(1,2);
|
||||
INSERT INTO t1 VALUES(3,4);
|
||||
ANALYZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 DOUBLE NULL, c2 DOUBLE NULL);
|
||||
INSERT INTO t1 VALUES(1,2);
|
||||
INSERT INTO t1 VALUES(3,4);
|
||||
ANALYZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 REAL NULL, c2 REAL NULL);
|
||||
INSERT INTO t1 VALUES(1,2);
|
||||
INSERT INTO t1 VALUES(3,4);
|
||||
ANALYZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 DOUBLE PRECISION NULL, c2 DOUBLE PRECISION NULL);
|
||||
INSERT INTO t1 VALUES(1,2);
|
||||
INSERT INTO t1 VALUES(3,4);
|
||||
ANALYZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 FLOAT NULL, c2 FLOAT NULL);
|
||||
INSERT INTO t1 VALUES(1,2);
|
||||
INSERT INTO t1 VALUES(3,4);
|
||||
ANALYZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
DROP TABLE t1;
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user