diff options
442 files changed, 7332 insertions, 5917 deletions
diff --git a/.bzrignore b/.bzrignore index ea2554de265..45cd7f2dc78 100644 --- a/.bzrignore +++ b/.bzrignore @@ -9,6 +9,7 @@ *.core *.d *.da +*.dir *.dll *.dylib *.exe @@ -31,6 +32,7 @@ *.pdb *.reject *.res +*.rule *.sbr *.so *.so.* @@ -38,6 +40,8 @@ *.user *.vcproj *.vcproj.cmake +*.vcxproj +*.vcxproj.filters */*.dir/* */*_pure_*warnings */.deps @@ -46,7 +50,7 @@ */debug/* */minsizerel/* */release/* -*/relwithdebinfo/* +RelWithDebInfo *~ .*.swp ./CMakeCache.txt @@ -1,4 +1,4 @@ -MySQL Server
+MySQL Server 5.5
This is a release of MySQL, a dual-license SQL database server.
For the avoidance of doubt, this particular copy of the software
@@ -54,2210 +54,3 @@ You can browse the MySQL Reference Manual online or download it in any of several formats at the URL given earlier in this file.
Source distributions include a local copy of the manual in the
Docs directory.
-
-********************************************************************
-
-Third-Party Component Notices
-
-*********************************************************************
-
-%%The following software may be included in this product:
-FindGTest.cmake (part of CMake 2.8.0)
-
-Use of any of this software is governed by the terms of the license below:
-
-# Copyright 2009 Kitware, Inc.
-# Copyright 2009 Philip Lowman
-# Copyright 2009 Daniel Blezek
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#===========================================================================
-# (To distributed this file outside of CMake, substitute the full
-# License text for the above reference.)
-#
-# Thanks to Daniel Blezek for the GTEST_ADD_TESTS code
-
-
-Text of Copyright.txt mentioned above:
-
-CMake - Cross Platform Makefile Generator
-Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-* Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-* Neither the names of Kitware, Inc., the Insight Software Consortium,
- nor the names of their contributors may be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-***************************************************************************
-
-%%The following software may be included in this product:
-Cmake
-
-Use of any of this software is governed by the terms of the license below:
-
-CMake is distributed under BSD License
-
- Copyright (c) 2008, Kitware, Inc.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are
- met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
- * Neither the name of Kitware, Inc. nor the names of its
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY Kitware, Inc. "AS IS" AND ANY EXPRESS OR
- IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL Kitware Inc. BE LIABLE FOR ANY DIRECT,
- INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-
-Additional License(s)
-
-cmake-2.4.8/Utilities/cmtar/compat/gethostname.c:
- gethostname.c: minimal substitute for missing gethostname() function
- created 2000-Mar-02 jmk
- requires SVR4 uname() and -lc
-
- by Jim Knoble
- Copyright ? 2000 Jim Knoble
-
- Permission to use, copy, modify, distribute, and sell this software
- and its documentation for any purpose is hereby granted without fee,
- provided that the above copyright notice appear in all copies and
- that both that copyright notice and this permission notice appear in
- supporting documentation.
-
- This software is provided "as is", without warranty of any kind,
- express or implied, including but not limited to the warranties of
- merchantability, fitness for a particular purpose and
- noninfringement. In no event shall the author(s) be liable for any
- claim, damages or other liability, whether in an action of contract,
- tort or otherwise, arising from, out of or in connection with the
- software or the use or other dealings in the software.
-
-----------------------------------
-
-* Originally written by Steven M. Bellovin while
-* at the University of North Carolina at Chapel Hill. Later tweaked by
-* a couple of people on Usenet. Completely overhauled by Rich $alz
-* and Jim Berets in August, 1990.
-*
-* This code is in the public domain and has no copyright.
-
--------------------------------
-
- THIS CODE IS SPECIFICALLY EXEMPTED FROM THE NCURSES PACKAGE COPYRIGHT.
- You may freely copy it for use as a template for your own field types.
- If you develop a field type that might be of general use, please send
- it back to the ncurses maintainers for inclusion in the next version.
-
-**************************************************************************
-
- * Author : Per Foreby, perf@efd.lth.se
- * Author : Juergen Pfeifer, juergen.pfeifer@gmx.net
-
-**************************************************************************
-
-----------------------------------------
-
- Copyright (c) 2002 Insight Consortium. All rights reserved.
- See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for
- details.
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the above copyright notices for more information.
-
---------------------------------------------
-
- Skeleton parser for Yacc-like parsing with Bison,
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software
- Foundation, Inc.
-
- 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, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-
- As a special exception, when this file is copied by Bison into a
- Bison output file, you may use that output file without restriction.
- This special exception was added by the Free Software Foundation
- in version 1.24 of Bison.
-
----------------------------------------------------
-
-cmake-2.4.8/Utilities/cmzlib/zlib.h:
- zlib.h -- interface of the 'zlib' general purpose compression library
- version 1.1.4, March 11th, 2002
-
- Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must
- not be misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source
- distribution.
-
- Jean-loup Gailly Mark Adler
-
-----------------------------------------------
-
- This source code was modified by Martin Hedenfalk for use in Curl. His
- latest changes were done 2000-09-18.
-
- It has since been patched away like a madman by Daniel Stenberg to make it
- better applied to curl conditions, and to make it not use globals, pollute
- name space and more. This source code awaits a rewrite to work around the
- paragraph 2 in the BSD licenses as explained below.
-
- Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Hgskolan
- It has since been patched and modified a lot by Daniel Stenberg to make it
- better applied to curl conditions, and to make it not use globals, pollute
- name space and more. This source code awaits a rewrite to work around the
- paragraph 2 in the BSD licenses as explained below.
-
- Copyright (c) 1998, 1999 Kungliga Tekniska Hgskolan
- (Royal Institute of Technology, Stockholm, Sweden).
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- 3. Neither the name of the Institute nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
-
----------------------------------------------
-
- Permission to use, copy, modify, and distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
- CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
-
---------------------------------------------------
-
-cmake-2.4.8/Utilities/cmcurl/inet_pton.c,
-cmake-2.4.8/Source/CTest/Curl/inet_pton.c:
- This is from the BIND 4.9.4 release, modified to compile by itself
-
- Copyright (c) 1996 by Internet Software Consortium.
-
- Permission to use, copy, modify, and distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
-
- THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
- DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT,
- OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
- USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-
--------------------------------------------------------
-
-* Copyright (C) 2001 by Eric Kidd. All rights reserved.
-* Copyright (C) 2001 by Luke Howard. All rights reserved.
-* Copyright (C) 2002 Ximian, Inc.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions
-* are met:
-* 1. Redistributions of source code must retain the above copyright
-* notice, this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright
-* notice, this list of conditions and the following disclaimer in the
-* documentation and/or other materials provided with the distribution.
-* 3. The name of the author may not be used to endorse or promote products
-* derived from this software without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
-* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
-* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-* SUCH DAMAGE.
-
----------------------------------------------------
-
- Copyright (c) 1994
- The Regents of the University of California. All rights reserved.
-
- This code is derived from software contributed to Berkeley by
- Chuck Karish of Mindcraft, Inc.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the University nor the names of its contributors
- Copyright (c) 1985, 1986 The Regents of the University of California.
- All rights reserved.
-
- This code is derived from software contributed to Berkeley by
- James A. Woods, derived from original work by Spencer Thomas
- and Joseph Orost.
-
-------------------------------------------------
-
- Copyright (c) 1989, 1993, 1994
- The Regents of the University of California. All rights reserved.
-
- This code is derived from software contributed to Berkeley by
- Guido van Rossum.
-
- Copyright (c) 1990 The Regents of the University of California.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. All advertising materials mentioning features or use of this software
- must display the following acknowledgement:
- This product includes software developed by the University of
- California, Berkeley and its contributors.
- 4. Neither the name of the University nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
-
-------------------------------------------------------
-
- Project ___| | | | _ \| |
- / __| | | | |_) | |
- | (__| |_| | _ <| |___
- \___|\___/|_| \_\_____|
-
- Copyright (C) 1998 - 2004, Daniel Stenberg, , et al.
-
- Copyright (C) 2004, Daniel Stenberg, , et al.
-
- This software is licensed as described in the file COPYING, which
- you should have received as part of this distribution. The terms
- are also available at http://curl.haxx.se/docs/copyright.html.
-
- You may opt to use, copy, modify, merge, publish, distribute and/or sell
- copies of the Software, and permit persons to whom the Software is
- furnished to do so, under the terms of the COPYING file.
-
- This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- KIND, either express or implied.
-
-------------------------------------------------------------
-
-***************************************************************************
- Copyright (c) 1998 Free Software Foundation, Inc.
- Copyright (c) 1998,2000 Free Software Foundation, Inc.
-
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, distribute with modifications, sublicense, and/or sell copies
- of the Software, and to permit persons to whom the Software is furnished
- to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
- NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
- Except as contained in this notice, the name(s) of the above copyright
- holders shall not be used in advertising or otherwise to promote the sale,
- use or other dealings in this Software without prior written
- authorization.
-***************************************************************************
-
-------------------------------------------------------
-
- Copyright (c) 1997 Todd C. Miller
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the author may not be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
- THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
-
-***************************************************************************
-
-%%The following software may be included in this product:
-Fred Fish's Dbug Library
-
-Use of any of this software is governed by the terms of the license below:
-
- * N O T I C E *
- * *
- * Copyright Abandoned, 1987, Fred Fish *
- * *
- * *
- * This previously copyrighted work has been placed into the public *
- * domain by the author and may be freely used for any purpose, *
- * private or commercial. *
- * *
- * Because of the number of inquiries I was receiving about the use *
- * of this product in commercially developed works I have decided to *
- * simply make it public domain to further its unrestricted use. I *
- * specifically would be most happy to see this material become a *
- * part of the standard Unix distributions by AT&T and the Berkeley *
- * Computer Science Research Group, and a standard part of the GNU *
- * system from the Free Software Foundation. *
- * *
- * I would appreciate it, as a courtesy, if this notice is left in *
- * all copies and derivative works. Thank you. *
- * *
- * The author makes no warranty of any kind with respect to this *
- * product and explicitly disclaims any implied warranties of mer- *
- * chantability or fitness for any particular purpose. *
-
-***************************************************************************
-
-%%The following software may be included in this product:
-dbug_analyze.c (part of Fred Fish's Dbug Library)
-
-Use of any of this software is governed by the terms of the license below:
-
-* Copyright Abandoned, 1987, Fred Fish *
-* *
-* *
-* This previously copyrighted work has been placed into the public *
-* domain by the author and may be freely used for any purpose, *
-* private or commercial. *
-* *
-* Because of the number of inquiries I was receiving about the use *
-* of this product in commercially developed works I have decided to *
-* simply make it public domain to further its unrestricted use. I *
-* specifically would be most happy to see this material become a *
-* part of the standard Unix distributions by AT&T and the Berkeley *
-* Computer Science Research Group, and a standard part of the GNU *
-* system from the Free Software Foundation. *
-* *
-* I would appreciate it, as a courtesy, if this notice is left in *
-* all copies and derivative works. Thank you. *
-* *
-* The author makes no warranty of any kind with respect to this *
-* product and explicitly disclaims any implied warranties of mer- *
-* chantability or fitness for any particular purpose. *
-
-***************************************************************************
-
-%%The following software may be included in this product:
-GNU Libtool, only ltmain.sh, libtool, auto-gen fil
-
-Use of any of this software is governed by the terms of the license below:
-
-ltmain.sh inclusion:
-# ltmain.sh - Provide generalized library-building support services.
-# NOTE: Changing this file will not affect anything until you rerun configure.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
-# 2007 Free Software Foundation, Inc.
-# Originally by Gordon Matzigkeit , 1996
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-libtool inclusion:
-# libtoolT - Provide generalized library-building support services.
-# Generated automatically by (GNU mysql 5.1.30)
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-# 2006, 2007 Free Software Foundation, Inc.
-#
-# This file is part of GNU Libtool:
-# Originally by Gordon Matzigkeit , 1996
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-Auto-generated files:
-# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building
-# support services.
-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-# 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
-#
-# This file is part of GNU Libtool:
-# Originally by Gordon Matzigkeit , 1996
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-Additional License(s)
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-***************************************************************************
-
-%%The following software may be included in this product:
-innochecksum.c
-
-Use of any of this software is governed by the terms of the license below:
-
-GNU GENERAL PUBLIC LICENSE
-
-Version 2, June 1991
-
-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.
-
-Preamble
-
-The licenses for most software are designed to take away your freedom to share
-and change it. By contrast, the GNU General Public License is intended to
-guarantee your freedom to share and change free software--to make sure the
-software is free for all its users. This General Public License applies to most
-of the Free Software Foundation's software and to any other program whose
-authors commit to using it. (Some other Free Software Foundation software is
-covered by the GNU 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.
-
-To protect your rights, we need to make restrictions that forbid anyone to deny
-you these rights or to ask you to surrender the rights. These restrictions
-translate to certain responsibilities for you if you distribute copies of the
-software, or if you modify it.
-
-For example, if you distribute copies of such a program, whether gratis or for a
-fee, you must give the recipients all the rights that you have. You must make
-sure that they, too, receive or can get the source code. And you must show them
-these terms so they know their rights.
-
-We protect your rights with two steps: (1) copyright the software, and (2) offer
-you this license which gives you legal permission to copy, distribute and/or
-modify the software.
-
-Also, for each author's protection and ours, we want to make certain that
-everyone understands that there is no warranty for this free software. If the
-software is modified by someone else and passed on, we want its recipients to
-know that what they have is not the original, so that any problems introduced by
-others will not reflect on the original authors' reputations.
-
-Finally, any free program is threatened constantly by software patents. We wish
-to avoid the danger that redistributors of a free program will individually
-obtain patent licenses, in effect making the program proprietary. To prevent
-this, we have made it clear that any patent must be licensed for everyone's free
-use or not licensed at all.
-
-The precise terms and conditions for copying, distribution and modification follow.
-TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-0. This License applies to any program or other work which contains a notice
-placed by the copyright holder saying it may be distributed under the terms of
-this General Public License. The "Program", below, refers to any such program or
-work, and a "work based on the Program" means either the Program or any
-derivative work under copyright law: that is to say, a work containing the
-Program or a portion of it, either verbatim or with modifications and/or
-translated into another language. (Hereinafter, translation is included without
-limitation in the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not covered by
-this License; they are outside its scope. The act of running the Program is not
-restricted, and the output from the Program is covered only if its contents
-constitute a work based on the Program (independent of having been made by
-running the Program). Whether that is true depends on what the Program does.
-
-1. You may copy and distribute verbatim copies of the Program's source code as
-you receive it, in any medium, provided that you conspicuously and appropriately
-publish on each copy an appropriate copyright notice and disclaimer of warranty;
-keep intact all the notices that refer to this License and to the absence of any
-warranty; and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and you may at
-your option offer warranty protection in exchange for a fee.
-
-2. You may modify your copy or copies of the Program or any portion of it, thus
-forming a work based on the Program, and copy and distribute such modifications
-or work under the terms of Section 1 above, provided that you also meet all of
-these conditions:
-
- a) You must cause the modified files to carry prominent notices stating that
-you changed the files and the date of any change.
- b) You must cause any work that you distribute or publish, that in whole or
-in part contains or is derived from the Program or any part thereof, to be
-licensed as a whole at no charge to all third parties under the terms of this
-License.
- c) If the modified program normally reads commands interactively when run,
-you must cause it, when started running for such interactive use in the most
-ordinary way, to print or display an announcement including an appropriate
-copyright notice and a notice that there is no warranty (or else, saying that
-you provide a warranty) and that users may redistribute the program under these
-conditions, and telling the user how to view a copy of this License. (Exception:
-if the Program itself is interactive but does not normally print such an
-announcement, your work based on the Program is not required to print an
-announcement.)
-
-These requirements apply to the modified work as a whole. If identifiable
-sections of that work are not derived from the Program, and can be reasonably
-considered independent and separate works in themselves, then this License, and
-its terms, do not apply to those sections when you distribute them as separate
-works. But when you distribute the same sections as part of a whole which is a
-work based on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the entire whole,
-and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest your
-rights to work written entirely by you; rather, the intent is to exercise the
-right to control the distribution of derivative or collective works based on the
-Program.
-
-In addition, mere aggregation of another work not based on the Program with the
-Program (or with a work based on the Program) on a volume of a storage or
-distribution medium does not bring the other work under the scope of this License.
-
-3. You may copy and distribute the Program (or a work based on it, under Section
-2) in object code or executable form under the terms of Sections 1 and 2 above
-provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable source
-code, which must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange; or,
- b) Accompany it with a written offer, valid for at least three years, to
-give any third party, for a charge no more than your cost of physically
-performing source distribution, a complete machine-readable copy of the
-corresponding source code, to be distributed under the terms of Sections 1 and 2
-above on a medium customarily used for software interchange; or,
- c) Accompany it with the information you received as to the offer to
-distribute corresponding source code. (This alternative is allowed only for
-noncommercial distribution and only if you received the program in object code
-or executable form with such an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for making
-modifications to it. For an executable work, complete source code means all the
-source code for all modules it contains, plus any associated interface
-definition files, plus the scripts used to control compilation and installation
-of the executable. However, as a special exception, the source code distributed
-need not include anything that is normally distributed (in either source or
-binary form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component itself
-accompanies the executable.
-
-If distribution of executable or object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the source code
-from the same place counts as distribution of the source code, even though third
-parties are not compelled to copy the source along with the object code.
-
-4. You may not copy, modify, sublicense, or distribute the Program except as
-expressly provided under this License. Any attempt otherwise to copy, modify,
-sublicense or distribute the Program is void, and will automatically terminate
-your rights under this License. However, parties who have received copies, or
-rights, from you under this License will not have their licenses terminated so
-long as such parties remain in full compliance.
-
-5. You are not required to accept this License, since you have not signed it.
-However, nothing else grants you permission to modify or distribute the Program
-or its derivative works. These actions are prohibited by law if you do not
-accept this License. Therefore, by modifying or distributing the Program (or any
-work based on the Program), you indicate your acceptance of this License to do
-so, and all its terms and conditions for copying, distributing or modifying the
-Program or works based on it.
-
-6. Each time you redistribute the Program (or any work based on the Program),
-the recipient automatically receives a license from the original licensor to
-copy, distribute or modify the Program subject to these terms and conditions.
-You may not impose any further restrictions on the recipients' exercise of the
-rights granted herein. You are not responsible for enforcing compliance by third
-parties to this License.
-
-7. If, as a consequence of a court judgment or allegation of patent infringement
-or for any other reason (not limited to patent issues), conditions are imposed
-on you (whether by court order, agreement or otherwise) that contradict the
-conditions of this License, they do not excuse you from the conditions of this
-License. If you cannot distribute so as to satisfy simultaneously your
-obligations under this License and any other pertinent obligations, then as a
-consequence you may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by all those
-who receive copies directly or indirectly through you, then the only way you
-could satisfy both it and this License would be to refrain entirely from
-distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply and the
-section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any patents or
-other property right claims or to contest validity of any such claims; this
-section has the sole purpose of protecting the integrity of the free software
-distribution system, which is implemented by public license practices. Many
-people have made generous contributions to the wide range of software
-distributed through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing to
-distribute software through any other system and a licensee cannot impose that
-choice.
-
-This section is intended to make thoroughly clear what is believed to be a
-consequence of the rest of this License.
-
-8. If the distribution and/or use of the Program is restricted in certain
-countries either by patents or by copyrighted interfaces, the original copyright
-holder who places the Program under this License may add an explicit
-geographical distribution limitation excluding those countries, so that
-distribution is permitted only in or among countries not thus excluded. In such
-case, this License incorporates the limitation as if written in the body of this
-License.
-
-9. The Free Software Foundation may publish revised and/or new versions of the
-General Public License from time to time. Such new versions will be similar in
-spirit to the present version, but may differ in detail to address new problems
-or concerns.
-
-Each version is given a distinguishing version number. If the Program specifies
-a version number of this License which applies to it and "any later version",
-you have the option of following the terms and conditions either of that version
-or of any later version published by the Free Software Foundation. If the
-Program does not specify a version number of this License, you may choose any
-version ever published by the Free Software Foundation.
-
-10. If you wish to incorporate parts of the Program into other free programs
-whose distribution conditions are different, write to the author to ask for
-permission. For software which is copyrighted by the Free Software Foundation,
-write to the Free Software Foundation; we sometimes make exceptions for this.
-Our decision will be guided by the two goals of preserving the free status of
-all derivatives of our free software and of promoting the sharing and reuse of
-software generally.
-
-NO WARRANTY
-
-11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE
-PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED
-IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS
-IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT
-NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL
-ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE
-PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
-SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY
-TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF
-THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
-PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-END OF TERMS AND CONDITIONS
-How to Apply These Terms to Your New Programs
-
-If you develop a new program, and you want it to be of the greatest possible use
-to the public, the best way to achieve this is to make it free software which
-everyone can redistribute and change under these terms.
-
-To do so, attach the following notices to the program. It is safest to attach
-them to the start of each source file to most effectively convey the exclusion
-of warranty; and each file should have at least the "copyright" line and a
-pointer to where the full notice is found.
-
-one line to give the program's name and an idea of what it does.
-Copyright (C) yyyy name of author
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 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) 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.
-
-You should also get your employer (if you work as a programmer) or your school,
-if any, to sign a "copyright disclaimer" for the program, if necessary. Here is
-a sample; alter the names:
-
-Yoyodyne, Inc., hereby disclaims all copyright
-interest in the program `Gnomovision'
-(which makes passes at compilers) written
-by James Hacker.
-
-signature of Ty Coon, 1 April 1989
-Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may consider
-it more useful to permit linking proprietary applications with the library. If
-this is what you want to do, use the GNU Lesser General Public License instead
-of this License.
-
-Additional Documentation License(s)
-
-innochecksum.c is documented in the MySQL Reference
-Manual at http://dev.mysql.com/doc/refman/5.1/en/innochecksum.html
-The Reference Manual is not licensed under the GPL; rather, it
-is offered under normal copyright, but with permission to
-copy/redistribute electronically.
-
-***************************************************************************
-
-%%The following software may be included in this product:
-lib_sql.cc
-
-Use of any of this software is governed by the terms of the license below:
-
-/*
- * Copyright (c) 2000
- * SWsoft company
- *
- * This material is provided "as is", with absolutely no warranty expressed
- * or implied. Any use is at your own risk.
- *
- * Permission to use or copy this software for any purpose is hereby granted
- * without fee, provided the above notices are retained on all copies.
- * Permission to modify the code and to distribute modified code is granted,
- * provided the above notices are retained, and a notice that the code was
- * modified is included with the above copyright notice.
- *
-
- This code was modified by the MySQL team
-*/
-
-***************************************************************************
-
-%%The following software may be included in this product:
-libevent
-
-Use of any of this software is governed by the terms of the license below:
-
-/*
- * Copyright (c) 2000-2004 Niels Provos
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-Additional License(s)
-
-http://creativecommons.org/licenses/publicdomain
-
-***************************************************************************
-
-%%The following software may be included in this product:
-Async DNS Library
-
-Use of any of this software is governed by the terms of the license below:
-
-/* Async DNS Library
- * Adam Langley
- * http://www.imperialviolet.org/eventdns.html
- * Public Domain code
- *
- * This software is Public Domain. To view a copy of the public domain dedication,
- * visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
- * Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
- *
- * I ask and expect, but do not require, that all derivative works contain an
- * attribution similar to:
- * Parts developed by Adam Langley
- *
- * You may wish to replace the word "Parts" with something else depending on
- * the amount of original code.
- *
- * (Derivative works does not include programs which link against, run or include
- * the source verbatim in their source distributions)
- *
- * Version: 0.1b
- */
-
-***************************************************************************
-
-%%The following software may be included in this product:
-log.c
-
-Use of any of this software is governed by the terms of the license below:
-
-/* $OpenBSD: err.c,v 1.2 2002/06/25 15:50:15 mickey Exp $ */
-
-/*
- * log.c
- *
- * Based on err.c, which was adapted from OpenBSD libc *err* *warn* code.
- *
- * Copyright (c) 2005 Nick Mathewson
- *
- * Copyright (c) 2000 Dug Song
- *
- * Copyright (c) 1993
- * The Regents of the University of California. All rights
-reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-***************************************************************************
-
-%%The following software may be included in this product:
-min_heap.h
-
-Use of any of this software is governed by the terms of the license below:
-
-/*
- * Copyright (c) 2006 Maxim Yegorushkin
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-***************************************************************************
-
-%%The following software may be included in this product:
-win32.c
-
-Use of any of this software is governed by the terms of the license below:
-
-/*
- * Copyright 2000-2002 Niels Provos
- * Copyright 2003 Michael A. Davis
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-***************************************************************************
-
-%%The following software may be included in this product:
-regex++
-
-Use of any of this software is governed by the terms of the license below:
-
-Copyright 1992, 1993, 1994 Henry Spencer. All rights reserved.
-This software is not subject to any license of the American Telephone
-and Telegraph Company or of the Regents of the University of California.
-
-Permission is granted to anyone to use this software for any purpose on
-any computer system, and to alter it and redistribute it, subject
-to the following restrictions:
-
-1. The author is not responsible for the consequences of use of this
- software, no matter how awful, even if they arise from flaws in it.
-
-2. The origin of this software must not be misrepresented, either by
- explicit claim or by omission. Since few users ever read sources,
- credits must appear in the documentation.
-
-3. Altered versions must be plainly marked as such, and must not be
- misrepresented as being the original software. Since few users
- ever read sources, credits must appear in the documentation.
-
-4. This notice may not be removed or altered.
-
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-/*-
- * Copyright (c) 1994
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)COPYRIGHT 8.1 (Berkeley) 3/16/94
- */
-
-***************************************************************************
-
-%%The following software may be included in this product:
-Richard A. O'Keefe strings package
-
-Use of any of this software is governed by the terms of the license below:
-
-These files are in the public domain. This includes getopt.c, which
-is the work of Henry Spencer, University of Toronto Zoology, who says of
-it "None of this software is derived from Bell software. I had no access
-to the source for Bell's versions at the time I wrote it. This software
-is hereby explicitly placed in the public domain. It may be used for
-any purpose on any machine by anyone." I would greatly prefer it if *my*
-material received no military use.
-
-***************************************************************************
-
-%%The following software may be included in this product:
-t_ctype.h
-
-Use of any of this software is governed by the terms of the license below:
-
-http://bioinfo.mbb.yale.edu/genome/yeast/cluster/database/mysql/include/t_ctype.h
-
-/*
- Copyright (C) 1998, 1999 by Pruet Boonma, all rights reserved.
- Copyright (C) 1998 by Theppitak Karoonboonyanan, all rights reserved.
- Permission to use, copy, modify, distribute and sell this software
- and its documentation for any purpose is hereby granted without fee,
- provided that the above copyright notice appear in all copies.
- Smaphan Raruenrom and Pruet Boonma makes no representations about
- the suitability of this software for any purpose. It is provided
- "as is" without express or implied warranty.
-*/
-
-***************************************************************************
-
-%%The following software may be included in this product:
-SHA-1 in C
-
-Use of any of this software is governed by the terms of the license below:
-
- SHA-1 in C
- By Steve Reid
- 100% Public Domain
-
-Additional License(s)
-
-100% Public Domain
-
-***************************************************************************
-
-%%The following software may be included in this product:
-TCMalloc (part of google-perftools)
-
-Use of any of this software is governed by the terms of the license below:
-
-# Copyright (c) 1998-2006, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-Additional License(s)
-
-*** File src/tests/ptmalloc/thread-m.h contains this GPLv2 (or later)
-text:
-
-/* Basic platform-independent macro definitions for mutexes and
- thread-specific data.
- Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Wolfram Gloger , 1996.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite
- 330, Boston, MA 02111-1307, USA. */
-
-
-
-*** File src/tests/ptmalloc/malloc-machine.h contains this BSD like text:
-
-/* Basic platform-independent macro definitions for mutexes,
- thread-specific data and parameters for malloc.
- Posix threads (pthreads) version.
- Copyright (C) 2004 Wolfram Gloger .
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that (i) the above copyright notices and this permission
-notice appear in all copies of the software and related documentation,
-and (ii) the name of Wolfram Gloger may not be used in any advertising
-or publicity relating to the software.
-
-THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
-EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
-WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-
-IN NO EVENT SHALL WOLFRAM GLOGER BE LIABLE FOR ANY SPECIAL,
-INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY
-DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY
-OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
-*/
-
-***************************************************************************
-
-%%The following software may be included in this product:
-The tz database
-
-Use of any of this software is governed by the terms of the license below:
-
-Sources for Time Zone and Daylight Saving Time Data
-@(#)tz-link.htm 7.54
-
-Please send corrections to this web page to the time zone mailing list.
-The tz database
-
-The public-domain time zone database contains code and data that represent the
-history of local time for many representative locations around the globe. It is
-updated periodically to reflect changes made by political bodies to time zone
-boundaries, UTC offsets, and daylight-saving rules. This database (often called
-tz or zoneinfo) is used by several implementations, including the GNU C Library
-used in GNU/Linux, FreeBSD, NetBSD, OpenBSD, Cygwin, DJGPP, HP-UX, IRIX, Mac OS
-X, OpenVMS, Solaris, Tru64, and UnixWare.
-
-Each location in the database represents a national region where all clocks
-keeping local time have agreed since 1970. Locations are identified by continent
-or ocean and then by the name of the location, which is typically the largest
-city within the region. For example, America/New_York represents most of the US
-eastern time zone; America/Phoenix represents most of Arizona, which uses
-mountain time without daylight saving time (DST); America/Detroit represents
-most of Michigan, which uses eastern time but with different DST rules in 1975;
-and other entries represent smaller regions like Starke County, Indiana, which
-switched from central to eastern time in 1991 and switched back in 2006. To use
-the database on an extended POSIX implementation set the TZ environment variable
-to the location's full name, e.g., TZ="America/New_York".
-
-In the tz database's FTP distribution the code is in the file tzcodeC.tar.gz,
-where C is the code's version; similarly, the data are in tzdataD.tar.gz, where
-D is the data's version. The following shell commands download these files to a
-GNU/Linux or similar host; see the downloaded README file for what to do next.
-
-wget 'ftp://elsie.nci.nih.gov/pub/tz*.tar.gz'
-gzip -dc tzcode*.tar.gz | tar -xf -
-gzip -dc tzdata*.tar.gz | tar -xf -
-
-The code lets you compile the tz source files into machine-readable binary
-files, one for each location. It also lets you read a tz binary file and
-interpret time stamps for that location.
-
-The data are by no means authoritative. If you find errors, please send changes
-to the time zone mailing list. You can also subscribe to the mailing list,
-retrieve the archive of old messages (in gzip compressed format), or retrieve
-archived older versions of code and data; there is also a smaller HTTP mirror.
-
-***************************************************************************
-
-%%The following software may be included in this product:
-UnicodeData.txt
-
-Use of any of this software is governed by the terms of the license below:
-
-Unicode Terms of Use
-
- For the general privacy policy governing access to this site, see the
- Unicode Privacy Policy. For trademark usage, see the Unicode
- Consortium (R) Trademarks and Logo Policy.
- Notice to End User: Terms of Use
- Carefully read the following legal agreement ("Agreement"). Use or
- copying of the software and/or codes provided with this agreement (The
- "Software") constitutes your acceptance of these terms
-
- 1. Unicode Copyright.
- 1. Copyright (c) 1991-2008 Unicode, Inc. All rights reserved.
- 2. Certain documents and files on this website contain a
- legend indicating that "Modification is permitted." Any person
- is hereby authorized, without fee, to modify such documents
- and files to create derivative works conforming to the
- Unicode (R) Standard, subject to Terms and Conditions herein.
- 3. Any person is hereby authorized, without fee, to view, use,
- reproduce, and distribute all documents and files solely for
- informational purposes in the creation of products supporting
- the Unicode Standard, subject to the Terms and Conditions
- herein.
- 4. Further specifications of rights and restrictions
- pertaining to the use of the particular set of data files
- known as the "Unicode Character Database" can be found in
- Exhibit 1.
- 5. Each version of the Unicode Standard has further
- specifications of rights and restrictions of use. For the book
- editions, these are found on the back of the title page. For
- the online edition, certain files (such as the PDF files for
- book chapters and code charts) carry specific restrictions.
- All other files are covered under these general Terms of Use.
- To request a permission to reproduce any part of the Unicode
- Standard, please contact the Unicode Consortium.
- 6. No license is granted to "mirror" the Unicode website where
- a fee is charged for access to the "mirror" site.
- 7. Modification is not permitted with respect to this
- document. All copies of this document must be verbatim.
- 2. Restricted Rights Legend. Any technical data or software which is
- licensed to the United States of America, its agencies and/or
- instrumentalities under this Agreement is commercial technical data
- or commercial computer software developed exclusively at private
- expense as defined in FAR 2.101, or DFARS 252.227-7014 (June 1995),
- as applicable. For technical data, use, duplication, or disclosure
- by the Government is subject to restrictions as set forth in DFARS
- 202.227-7015 Technical Data, Commercial and Items (Nov 1995) and
- this Agreement. For Software, in accordance with FAR 12-212 or DFARS
- 227-7202, as applicable, use, duplication or disclosure by the
- Government is subject to the restrictions set forth in this
- Agreement.
- 3. Warranties and Disclaimers.
- 1. This publication and/or website may include technical or
- typographical errors or other inaccuracies . Changes are
- periodically added to the information herein; these changes
- will be incorporated in new editions of the publication and/or
- website. Unicode may make improvements and/or changes in the
- product(s) and/or program(s) described in this publication
- and/or website at any time.
- 2. If this file has been purchased on magnetic or optical
- media from Unicode, Inc. the sole and exclusive remedy for any
- claim will be exchange of the defective media within ninety
- (90) days of original purchase.
- 3. EXCEPT AS PROVIDED IN SECTION C.2, THIS PUBLICATION AND/OR
- SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND
- EITHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT
- LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UNICODE AND ITS
- LICENSORS ASSUME NO RESPONSIBILITY FOR ERRORS OR OMISSIONS IN
- THIS PUBLICATION AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH ARE
- REFERENCED BY OR LINKED TO THIS PUBLICATION OR THE UNICODE
- WEBSITE.
- 4. Waiver of Damages. In no event shall Unicode or its licensors be
- liable for any special, incidental, indirect or consequential
- damages of any kind, or any damages whatsoever, whether or not
- Unicode was advised of the possibility of the damage, including,
- without limitation, those resulting from the following: loss of use,
- data or profits, in connection with the use, modification or
- distribution of this information or its derivatives.
- 5. Trademarks.
- 1. Unicode and the Unicode logo are registered trademarks of
- Unicode, Inc.
- 2. This site contains product names and corporate names of
- other companies. All product names and company names and logos
- mentioned herein are the trademarks or registered trademarks
- of their respective owners. Other products and corporate names
- mentioned herein which are trademarks of a third party are
- used only for explanation and for the owners' benefit and with
- no intent to infringe.
- 3. Use of third party products or information referred to
- herein is at the user's risk.
- 6. Miscellaneous.
- 1. Jurisdiction and Venue. This server is operated from a
- location in the State of California, United States of America.
- Unicode makes no representation that the materials are
- appropriate for use in other locations. If you access this
- server from other locations, you are responsible for
- compliance with local laws. This Agreement, all use of this
- site and any claims and damages resulting from use of this
- site are governed solely by the laws of the State of
- California without regard to any principles which would apply
- the laws of a different jurisdiction. The user agrees that any
- disputes regarding this site shall be resolved solely in the
- courts located in Santa Clara County, California. The user
- agrees said courts have personal jurisdiction and agree to
- waive any right to transfer the dispute to any other forum.
- 2. Modification by Unicode Unicode shall have the right to
- modify this Agreement at any time by posting it to this site.
- The user may not assign any part of this Agreement without
- Unicode's prior written consent.
- 3. Taxes. The user agrees to pay any taxes arising from access
- to this website or use of the information herein, except for
- those based on Unicode's net income.
- 4. Severability. If any provision of this Agreement is
- declared invalid or unenforceable, the remaining provisions of
- this Agreement shall remain in effect.
- 5. Entire Agreement. This Agreement constitutes the entire
- agreement between the parties.
-
-EXHIBIT 1
-UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
-
- Unicode Data Files include all data files under the directories
-http://www.unicode.org/Public/, http://www.unicode.org/reports/, and
-http://www.unicode.org/cldr/data/ . Unicode Software includes any source code
-published in the Unicode Standard or under the directories
-http://www.unicode.org/Public/, http://www.unicode.org/reports/, and
-http://www.unicode.org/cldr/data/.
-
- NOTICE TO USER: Carefully read the following legal agreement. BY
-DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S DATA FILES
-("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), YOU UNEQUIVOCALLY ACCEPT, AND
-AGREE TO BE BOUND BY, ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU
-DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES
-OR SOFTWARE.
-
- COPYRIGHT AND PERMISSION NOTICE
-
- Copyright (c) 1991-2008 Unicode, Inc. All rights reserved. Distributed under
-the Terms of Use in http://www.unicode.org/copyright.html.
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
-of the Unicode data files and any associated documentation (the "Data Files") or
-Unicode software and any associated documentation (the "Software") to deal in
-the Data Files or Software without restriction, including without limitation the
-rights to use, copy, modify, merge, publish, distribute, and/or sell copies of
-the Data Files or Software, and to permit persons to whom the Data Files or
-Software are furnished to do so, provided that (a) the above copyright notice(s)
-and this permission notice appear with all copies of the Data Files or Software,
-(b) both the above copyright notice(s) and this permission notice appear in
-associated documentation, and (c) there is clear notice in each modified Data
-File or in the Software as well as in the documentation associated with the Data
-File(s) or Software that the data or software has been modified.
-
- THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD
-PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
-NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
-DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE.
-
- Except as contained in this notice, the name of a copyright holder shall not
-be used in advertising or otherwise to promote the sale, use or other dealings
-in these Data Files or Software without prior written authorization of the
-copyright holder.
-
- Unicode and the Unicode logo are trademarks of Unicode, Inc., and may be
-registered in some jurisdictions. All other trademarks and registered trademarks
-mentioned herein are the property of their respective owners.
-
-***************************************************************************
-
-%%The following software may be included in this product:
-zlib
-
-Use of any of this software is governed by the terms of the license below:
-
-/* zlib.h -- interface of the 'zlib' general purpose compression library
- version 1.2.3, July 18th, 2005
-
- Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
- Jean-loup Gailly jloup@gzip.org
- Mark Adler madler@alumni.caltech.edu
-
-*/
-
-***************************************************************************
-
-%%The following software may be included in this product:
-dtoa.c
-
-Use of any of this software is governed by the terms of the license below:
-
-/****************************************************************
-
- This file incorporates work covered by the following copyright and
- permission notice:
-
- The author of this software is David M. Gay.
-
- Copyright (c) 1991, 2000, 2001 by Lucent Technologies.
-
- Permission to use, copy, modify, and distribute this software for any
- purpose without fee is hereby granted, provided that this entire
- notice is included in all copies of any software which is or includes a copy
- or modification of this software and in all copies of the supporting
- documentation for such software.
-
- THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
- WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY
- REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
- OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
-
- ***************************************************************/
-
-***************************************************************************
-
-%%The following software may be included in this product:
-getarg.{c,h}
-
-Use of any of this software is governed by the terms of the license below:
-
-/* Copyright (C) 2003 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-/*
- * Copyright (c) 1997, 1999 Kungliga Tekniska H366gskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-***************************************************************************
-
-%%The following software may be included in this product:
-MD5 message-digest algorithm (md5_hash.cpp)
-
-Use of any of this software is governed by the terms of the license below:
-
-/*
- * This code implements the MD5 message-digest algorithm.
- * The algorithm is due to Ron Rivest. This code was
- * written by Colin Plumb in 1993, no copyright is claimed.
- * This code is in the public domain; do with it what you wish.
- *
- * Equivalent code is available from RSA Data Security, Inc.
- * This code has been tested against that, and is equivalent,
- * except that you don't need to include two pages of legalese
- * with every copy.
- *
- * The code has been modified by Mikael Ronstroem to handle
- * calculating a hash value of a key that is always a multiple
- * of 4 bytes long. Word 0 of the calculated 4-word hash value
- * is returned as the hash value.
- */
-
-***************************************************************************
-
-%%The following software may be included in this product:
-nt_servc.{cc,h}
-
-Use of any of this software is governed by the terms of the license below:
-
-/**
- @file
-
- @brief
- Windows NT Service class library.
-
- Copyright Abandoned 1998 Irena Pancirov - Irnet Snc
- This file is public domain and comes with NO WARRANTY of any kind
-*/
-
-***************************************************************************
-
-%%The following software may be included in this product:
-GNU Readline
-
-Use of any of this software is governed by the terms of the license below:
-
-GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- 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.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU 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.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 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) 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.
-
-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.
-
- , 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.
-
-***************************************************************************
-
-%%The following software may be included in this product:
-pstack (part of GNU Binutils)
-
-Use of any of this software is governed by the terms of the license below:
-
-pstack is comprised of various .c and .h files; all begin like this:
-
-/* bucomm.h -- binutils common include file.
- Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
-
-This file is part of GNU Binutils.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-***************************************************************************
-
-%%The following software may be included in this product:
-libiberty.h (part of pstack GNU Binutils)
-
-Use of any of this software is governed by the terms of the license below:
-
-See
-http://www.koders.com/c/fid99F596804BBE22C076522B848D5575F142079064.aspx
-
-/* Function declarations for libiberty.
- Written by Cygnus Support, 1994.
-
- The libiberty library provides a number of functions which are
- missing on some operating systems. We do not declare those here,
- to avoid conflicts with the system header files on operating
- systems that do support those functions. In this file we only
- declare those functions which are specific to libiberty. */
-
-***************************************************************************
-
-%%The following software may be included in this product:
-ieee.h (part of pstack GNU Binutils)
-
-Use of any of this software is governed by the terms of the license below:
-
-See
-http://src.opensolaris.org/source/xref//sfw/usr/src/cmd/gdb/gdb-6.3/include/ieee.h
-
-
-/* IEEE Standard 695-1980 "Universal Format for Object Modules"
- header file
- Contributed by Cygnus Support. */
-
-***************************************************************************
-
-%%The following software may be included in this product:
-pstack.c (part of pstack GNU Binutils)
-
-Use of any of this software is governed by the terms of the license below:
-
-/*
- pstack.c -- asynchronous stack trace of a running process
- Copyright (c) 1999 Ross Thompson
- Author: Ross Thompson
- Critical bug fix: Tim Waugh
-*/
-
-/*
- This file is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-**********************************************************************
@@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=5 -MYSQL_VERSION_PATCH=11 +MYSQL_VERSION_PATCH=13 MYSQL_VERSION_EXTRA= diff --git a/client/client_priv.h b/client/client_priv.h index 0652444be64..ae8d049f8e6 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -75,6 +75,7 @@ enum options_client OPT_SLAP_POST_SYSTEM, OPT_SLAP_COMMIT, OPT_SLAP_DETACH, + OPT_SLAP_NO_DROP, OPT_MYSQL_REPLACE_INTO, OPT_BASE64_OUTPUT_MODE, OPT_SERVER_ID, OPT_FIX_TABLE_NAMES, OPT_FIX_DB_NAMES, OPT_SSL_VERIFY_SERVER_CERT, OPT_AUTO_VERTICAL_OUTPUT, diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index 580caa38c0d..82cea8e78c9 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -369,7 +369,8 @@ int main(int argc,char *argv[]) /* Return 0 if all commands are PING */ for (; argc > 0; argv++, argc--) { - if (find_type(argv[0], &command_typelib, 2) != ADMIN_PING) + if (find_type(argv[0], &command_typelib, FIND_TYPE_BASIC) != + ADMIN_PING) { error= 1; break; @@ -592,7 +593,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) for (; argc > 0 ; argv++,argc--) { - switch (find_type(argv[0],&command_typelib,2)) { + switch (find_type(argv[0],&command_typelib, FIND_TYPE_BASIC)) { case ADMIN_CREATE: { char buff[FN_REFLEN+20]; @@ -931,7 +932,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) if (typed_password[0]) { - bool old= (find_type(argv[0], &command_typelib, 2) == + bool old= (find_type(argv[0], &command_typelib, FIND_TYPE_BASIC) == ADMIN_OLD_PASSWORD); #ifdef __WIN__ size_t pw_len= strlen(typed_password); diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 91b075a8970..e8a37ecfe5f 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -714,10 +714,18 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev, */ start_datetime= 0; offset= 0; // print everything and protect against cycling rec_count + /* + Skip events according to the --server-id flag. However, don't + skip format_description or rotate events, because they they + are really "global" events that are relevant for the entire + binlog, even if they have a server_id. Also, we have to read + the format_description event so that we can parse subsequent + events. + */ + if (ev_type != ROTATE_EVENT && + server_id && (server_id != ev->server_id)) + goto end; } - if (server_id && (server_id != ev->server_id)) - /* skip just this event, continue processing the log. */ - goto end; if (((my_time_t)(ev->when) >= stop_datetime) || (pos >= stop_position_mot)) { diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index f38d674ae8d..78a1ec7d87d 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -42,7 +42,7 @@ static char *opt_password = 0, *current_user = 0, *default_charset= 0, *current_host= 0; static char *opt_plugin_dir= 0, *opt_default_auth= 0; static int first_error = 0; -DYNAMIC_ARRAY tables4repair; +DYNAMIC_ARRAY tables4repair, tables4rebuild; #ifdef HAVE_SMEM static char *shared_memory_base_name=0; #endif @@ -626,6 +626,27 @@ static int fix_database_storage_name(const char *name) return rc; } +static int rebuild_table(char *name) +{ + char *query, *ptr; + int rc= 0; + query= (char*)my_malloc(sizeof(char) * (12 + fixed_name_length(name) + 6 + 1), + MYF(MY_WME)); + if (!query) + return 1; + ptr= strmov(query, "ALTER TABLE "); + ptr= fix_table_name(ptr, name); + ptr= strxmov(ptr, " FORCE", NullS); + if (mysql_real_query(sock, query, (uint)(ptr - query))) + { + fprintf(stderr, "Failed to %s\n", query); + fprintf(stderr, "Error: %s\n", mysql_error(sock)); + rc= 1; + } + my_free(query); + return rc; +} + static int process_one_db(char *database) { if (what_to_do == DO_UPGRADE) @@ -739,7 +760,7 @@ static void print_result() MYSQL_ROW row; char prev[NAME_LEN*2+2]; uint i; - my_bool found_error=0; + my_bool found_error=0, table_rebuild=0; res = mysql_use_result(sock); @@ -758,8 +779,14 @@ static void print_result() */ if (found_error && opt_auto_repair && what_to_do != DO_REPAIR && strcmp(row[3],"OK")) - insert_dynamic(&tables4repair, (uchar*) prev); + { + if (table_rebuild) + insert_dynamic(&tables4rebuild, (uchar*) prev); + else + insert_dynamic(&tables4repair, (uchar*) prev); + } found_error=0; + table_rebuild=0; if (opt_silent) continue; } @@ -769,7 +796,11 @@ static void print_result() { printf("%s\n%-9s: %s", row[0], row[2], row[3]); if (strcmp(row[2],"note")) + { found_error=1; + if (opt_auto_repair && strstr(row[3], "ALTER TABLE") != NULL) + table_rebuild=1; + } } else printf("%-9s: %s", row[2], row[3]); @@ -778,7 +809,12 @@ static void print_result() } /* add the last table to be repaired to the list */ if (found_error && opt_auto_repair && what_to_do != DO_REPAIR) - insert_dynamic(&tables4repair, (uchar*) prev); + { + if (table_rebuild) + insert_dynamic(&tables4rebuild, (uchar*) prev); + else + insert_dynamic(&tables4repair, (uchar*) prev); + } mysql_free_result(res); } @@ -876,7 +912,8 @@ int main(int argc, char **argv) } if (opt_auto_repair && - my_init_dynamic_array(&tables4repair, sizeof(char)*(NAME_LEN*2+2),16,64)) + (my_init_dynamic_array(&tables4repair, sizeof(char)*(NAME_LEN*2+2),16,64) || + my_init_dynamic_array(&tables4rebuild, sizeof(char)*(NAME_LEN*2+2),16,64))) { first_error = 1; goto end; @@ -894,7 +931,7 @@ int main(int argc, char **argv) { uint i; - if (!opt_silent && tables4repair.elements) + if (!opt_silent && (tables4repair.elements || tables4rebuild.elements)) puts("\nRepairing tables"); what_to_do = DO_REPAIR; for (i = 0; i < tables4repair.elements ; i++) @@ -902,11 +939,16 @@ int main(int argc, char **argv) char *name= (char*) dynamic_array_ptr(&tables4repair, i); handle_request_for_tables(name, fixed_name_length(name)); } + for (i = 0; i < tables4rebuild.elements ; i++) + rebuild_table((char*) dynamic_array_ptr(&tables4rebuild, i)); } end: dbDisconnect(current_host); if (opt_auto_repair) + { delete_dynamic(&tables4repair); + delete_dynamic(&tables4rebuild); + } my_free(opt_password); #ifdef HAVE_SMEM my_free(shared_memory_base_name); diff --git a/client/mysqldump.c b/client/mysqldump.c index c2d526edd4e..90d63bff8e7 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, 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 @@ -4650,7 +4650,7 @@ static ulong find_set(TYPELIB *lib, const char *x, uint length, for (; pos != end && *pos != ','; pos++) ; var_len= (uint) (pos - start); strmake(buff, start, min(sizeof(buff) - 1, var_len)); - find= find_type(buff, lib, var_len); + find= find_type(buff, lib, FIND_TYPE_BASIC); if (!find) { *err_pos= (char*) start; diff --git a/client/mysqlslap.c b/client/mysqlslap.c index 237fa18c226..88e80c0c7f8 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -128,7 +128,7 @@ const char *delimiter= "\n"; const char *create_schema_string= "mysqlslap"; -static my_bool opt_preserve= TRUE; +static my_bool opt_preserve= TRUE, opt_no_drop= FALSE; static my_bool debug_info_flag= 0, debug_check_flag= 0; static my_bool opt_only_print= FALSE; static my_bool opt_compress= FALSE, tty_password= FALSE, @@ -607,6 +607,8 @@ static struct my_option my_long_options[] = REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"iterations", 'i', "Number of times to run the tests.", &iterations, &iterations, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0}, + {"no-drop", OPT_SLAP_NO_DROP, "Do not drop the schema after the test.", + &opt_no_drop, &opt_no_drop, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"number-char-cols", 'x', "Number of VARCHAR columns to create in table if specifying --auto-generate-sql.", &num_char_cols_opt, &num_char_cols_opt, 0, GET_STR, REQUIRED_ARG, @@ -1149,8 +1151,11 @@ get_options(int *argc,char ***argv) if (!user) user= (char *)"root"; - /* If something is created we clean it up, otherwise we leave schemas alone */ - if (create_string || auto_generate_sql) + /* + If something is created and --no-drop is not specified, we drop the + schema. + */ + if (!opt_no_drop && (create_string || auto_generate_sql)) opt_preserve= FALSE; if (auto_generate_sql && (create_string || user_supplied_query)) diff --git a/client/mysqltest.cc b/client/mysqltest.cc index ffc99a3dffd..4f067c54429 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -8017,7 +8017,7 @@ void get_command_type(struct st_command* command) save= command->query[command->first_word_len]; command->query[command->first_word_len]= 0; - type= find_type(command->query, &command_typelib, 1+2); + type= find_type(command->query, &command_typelib, FIND_TYPE_NO_PREFIX); command->query[command->first_word_len]= save; if (type > 0) { @@ -8334,13 +8334,15 @@ int main(int argc, char **argv) } var_set_string("MYSQLTEST_FILE", cur_file->file_name); init_re(); + + /* Cursor protcol implies ps protocol */ + if (cursor_protocol) + ps_protocol= 1; + ps_protocol_enabled= ps_protocol; sp_protocol_enabled= sp_protocol; view_protocol_enabled= view_protocol; cursor_protocol_enabled= cursor_protocol; - /* Cursor protcol implies ps protocol */ - if (cursor_protocol_enabled) - ps_protocol_enabled= 1; st_connection *con= connections; #ifdef EMBEDDED_LIBRARY diff --git a/cmake/mysql_version.cmake b/cmake/mysql_version.cmake index 3ed93020e8a..5aca3c825a6 100644 --- a/cmake/mysql_version.cmake +++ b/cmake/mysql_version.cmake @@ -17,7 +17,7 @@ # Global constants, only to be changed between major releases. # -SET(SHARED_LIB_MAJOR_VERSION "16") +SET(SHARED_LIB_MAJOR_VERSION "18") SET(PROTOCOL_VERSION "10") SET(DOT_FRM_VERSION "6") diff --git a/cmake/os/Windows.cmake b/cmake/os/Windows.cmake index 0dbfde5294c..b51f3a2dc52 100644 --- a/cmake/os/Windows.cmake +++ b/cmake/os/Windows.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2010 Sun Microsystems, Inc +# Copyright (C) 2010, 2011, 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 @@ -192,3 +192,4 @@ IF(NOT HAVE_SIZE_OF_SSIZE_T) ENDIF() SET(FN_NO_CASE_SENSE 1) +SET(USE_SYMDIR 1) diff --git a/cmake/os/WindowsCache.cmake b/cmake/os/WindowsCache.cmake index ff068bfeaf6..3a36f3c780b 100644 --- a/cmake/os/WindowsCache.cmake +++ b/cmake/os/WindowsCache.cmake @@ -76,9 +76,6 @@ SET(HAVE_FTRUNCATE CACHE INTERNAL "") SET(HAVE_GETADDRINFO 1 CACHE INTERNAL "") SET(HAVE_GETCWD 1 CACHE INTERNAL "") SET(HAVE_GETHOSTBYADDR_R CACHE INTERNAL "") -SET(HAVE_GETHOSTBYNAME_R CACHE INTERNAL "") -SET(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE CACHE INTERNAL "") -SET(HAVE_GETHOSTBYNAME_R_RETURN_INT CACHE INTERNAL "") SET(HAVE_GETHRTIME CACHE INTERNAL "") SET(HAVE_GETLINE CACHE INTERNAL "") SET(HAVE_GETNAMEINFO CACHE INTERNAL "") diff --git a/config.h.cmake b/config.h.cmake index 7de8f716e77..fdff4222417 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -157,7 +157,6 @@ #cmakedefine HAVE_GETADDRINFO 1 #cmakedefine HAVE_GETCWD 1 #cmakedefine HAVE_GETHOSTBYADDR_R 1 -#cmakedefine HAVE_GETHOSTBYNAME_R 1 #cmakedefine HAVE_GETHRTIME 1 #cmakedefine HAVE_GETLINE 1 #cmakedefine HAVE_GETNAMEINFO 1 @@ -448,8 +447,6 @@ #cmakedefine HAVE_SOLARIS_STYLE_GETHOST 1 -#cmakedefine HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE 1 -#cmakedefine HAVE_GETHOSTBYNAME_R_RETURN_INT 1 #cmakedefine MY_ATOMIC_MODE_DUMMY 1 #cmakedefine MY_ATOMIC_MODE_RWLOCKS 1 @@ -513,6 +510,7 @@ #cmakedefine EXTRA_DEBUG 1 #cmakedefine BACKUP_TEST 1 #cmakedefine CYBOZU 1 +#cmakedefine USE_SYMDIR 1 /* Character sets and collations */ #cmakedefine MYSQL_DEFAULT_CHARSET_NAME "@MYSQL_DEFAULT_CHARSET_NAME@" diff --git a/configure.cmake b/configure.cmake index 90a01ff913c..c0bc1261d15 100644 --- a/configure.cmake +++ b/configure.cmake @@ -350,7 +350,6 @@ CHECK_FUNCTION_EXISTS (fseeko HAVE_FSEEKO) CHECK_FUNCTION_EXISTS (fsync HAVE_FSYNC) CHECK_FUNCTION_EXISTS (getcwd HAVE_GETCWD) CHECK_FUNCTION_EXISTS (gethostbyaddr_r HAVE_GETHOSTBYADDR_R) -CHECK_FUNCTION_EXISTS (gethostbyname_r HAVE_GETHOSTBYNAME_R) CHECK_FUNCTION_EXISTS (gethrtime HAVE_GETHRTIME) CHECK_FUNCTION_EXISTS (getnameinfo HAVE_GETNAMEINFO) CHECK_FUNCTION_EXISTS (getpass HAVE_GETPASS) @@ -921,44 +920,6 @@ CHECK_CXX_SOURCE_COMPILES(" " HAVE_SOLARIS_STYLE_GETHOST) -CHECK_CXX_SOURCE_COMPILES(" - #undef inline - #if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT) - #define _REENTRANT - #endif - #include <pthread.h> - #include <sys/types.h> - #include <sys/socket.h> - #include <netinet/in.h> - #include <arpa/inet.h> - #include <netdb.h> - int main() - { - int ret = gethostbyname_r((const char *) 0, - (struct hostent*) 0, (char*) 0, 0, (struct hostent **) 0, (int *) 0); - return 0; - }" - HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) - -CHECK_CXX_SOURCE_COMPILES(" - #undef inline - #if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT) - #define _REENTRANT - #endif - #include <pthread.h> - #include <sys/types.h> - #include <sys/socket.h> - #include <netinet/in.h> - #include <arpa/inet.h> - #include <netdb.h> - int main() - { - int ret = gethostbyname_r((const char *) 0, (struct hostent*) 0, (struct hostent_data*) 0); - return 0; - }" - HAVE_GETHOSTBYNAME_R_RETURN_INT) - - # Use of ALARMs to wakeup on timeout on sockets # # This feature makes use of a mutex and is a scalability hog we diff --git a/extra/perror.c b/extra/perror.c index 382805c5dfd..3c00b9b11d7 100644 --- a/extra/perror.c +++ b/extra/perror.c @@ -32,7 +32,7 @@ static my_bool verbose, print_all_codes; #include "../include/my_base.h" #include "../mysys/my_handler_errors.h" -#include "../include/my_handler.h" +// #include "../include/my_compare.h" #ifdef WITH_NDBCLUSTER_STORAGE_ENGINE static my_bool ndb_code; @@ -240,7 +240,39 @@ static my_bool print_win_error_msg(DWORD error, my_bool verbose) } #endif +/* + Register handler error messages for usage with my_error() + NOTES + This is safe to call multiple times as my_error_register() + will ignore calls to register already registered error numbers. +*/ + +static const char **get_handler_error_messages() +{ + return handler_error_messages; +} + +void my_handler_error_register(void) +{ + /* + If you got compilation error here about compile_time_assert array, check + that every HA_ERR_xxx constant has a corresponding error message in + handler_error_messages[] list (check mysys/ma_handler_errors.h and + include/my_base.h). + */ + compile_time_assert(HA_ERR_FIRST + array_elements(handler_error_messages) == + HA_ERR_LAST + 1); + my_error_register(get_handler_error_messages, HA_ERR_FIRST, + HA_ERR_FIRST+ array_elements(handler_error_messages)-1); +} + + +void my_handler_error_unregister(void) +{ + my_error_unregister(HA_ERR_FIRST, + HA_ERR_FIRST+ array_elements(handler_error_messages)-1); +} int main(int argc,char *argv[]) { diff --git a/extra/yassl/src/yassl_int.cpp b/extra/yassl/src/yassl_int.cpp index 8e4a9aa95ec..5af2f180bb1 100644 --- a/extra/yassl/src/yassl_int.cpp +++ b/extra/yassl/src/yassl_int.cpp @@ -308,7 +308,7 @@ SSL::SSL(SSL_CTX* ctx) SetError(YasslError(err)); return; } - else if (serverSide) { + else if (serverSide && !(ctx->GetCiphers().setSuites_)) { // remove RSA or DSA suites depending on cert key type ProtocolVersion pv = secure_.get_connection().version_; diff --git a/include/decimal.h b/include/decimal.h index 530ed9e1757..90946f65ac6 100644 --- a/include/decimal.h +++ b/include/decimal.h @@ -29,14 +29,14 @@ typedef struct st_decimal_t { int internal_str2dec(const char *from, decimal_t *to, char **end, my_bool fixed); -int decimal2string(decimal_t *from, char *to, int *to_len, +int decimal2string(const decimal_t *from, char *to, int *to_len, int fixed_precision, int fixed_decimals, char filler); int decimal2ulonglong(decimal_t *from, ulonglong *to); int ulonglong2decimal(ulonglong from, decimal_t *to); int decimal2longlong(decimal_t *from, longlong *to); int longlong2decimal(longlong from, decimal_t *to); -int decimal2double(decimal_t *from, double *to); +int decimal2double(const decimal_t *from, double *to); int double2decimal(double from, decimal_t *to); int decimal_actual_fraction(decimal_t *from); int decimal2bin(decimal_t *from, uchar *to, int precision, int scale); @@ -47,17 +47,17 @@ int decimal_bin_size(int precision, int scale); int decimal_result_size(decimal_t *from1, decimal_t *from2, char op, int param); -int decimal_intg(decimal_t *from); -int decimal_add(decimal_t *from1, decimal_t *from2, decimal_t *to); -int decimal_sub(decimal_t *from1, decimal_t *from2, decimal_t *to); -int decimal_cmp(decimal_t *from1, decimal_t *from2); -int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to); -int decimal_div(decimal_t *from1, decimal_t *from2, decimal_t *to, +int decimal_intg(const decimal_t *from); +int decimal_add(const decimal_t *from1, const decimal_t *from2, decimal_t *to); +int decimal_sub(const decimal_t *from1, const decimal_t *from2, decimal_t *to); +int decimal_cmp(const decimal_t *from1, const decimal_t *from2); +int decimal_mul(const decimal_t *from1, const decimal_t *from2, decimal_t *to); +int decimal_div(const decimal_t *from1, const decimal_t *from2, decimal_t *to, int scale_incr); -int decimal_mod(decimal_t *from1, decimal_t *from2, decimal_t *to); -int decimal_round(decimal_t *from, decimal_t *to, int new_scale, +int decimal_mod(const decimal_t *from1, const decimal_t *from2, decimal_t *to); +int decimal_round(const decimal_t *from, decimal_t *to, int new_scale, decimal_round_mode mode); -int decimal_is_zero(decimal_t *from); +int decimal_is_zero(const decimal_t *from); void max_decimal(int precision, int frac, decimal_t *to); #define string2decimal(A,B,C) internal_str2dec((A), (B), (C), 0) diff --git a/include/heap.h b/include/heap.h index 755a1aa3fed..74851c7b454 100644 --- a/include/heap.h +++ b/include/heap.h @@ -30,7 +30,7 @@ extern "C" { #include <my_pthread.h> #include <thr_lock.h> -#include "my_handler.h" +#include "my_compare.h" #include "my_tree.h" /* defines used by heap-funktions */ diff --git a/include/my_handler.h b/include/my_compare.h index ba0d3fc313f..ebc91a912cd 100644 --- a/include/my_handler.h +++ b/include/my_compare.h @@ -1,22 +1,20 @@ -/* Copyright (C) 2002-2006 MySQL AB +/* Copyright (c) 2011, 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 Library General Public - License as published by the Free Software Foundation; version 2 - of the License. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + 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 Library General Public - License along with this library; 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _my_handler_h -#define _my_handler_h +#ifndef _my_compare_h +#define _my_compare_h #include "myisampack.h" #ifdef __cplusplus @@ -114,9 +112,6 @@ extern int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a, register uchar *b, uint key_length, uint nextflag, uint *diff_pos); -extern HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, uchar *a); -extern void my_handler_error_register(void); -extern void my_handler_error_unregister(void); /* Inside an in-memory data record, memory pointers to pieces of the record (like BLOBs) are stored in their native byte order and in @@ -127,4 +122,4 @@ extern void my_handler_error_unregister(void); } #endif -#endif /* _my_handler_h */ +#endif /* _my_compare_h */ diff --git a/include/my_global.h b/include/my_global.h index 02f4eb596d0..0ff4ea5484b 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB, 2009 Sun Microsystems, Inc +/* Copyright (c) 2000, 2011, 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 @@ -285,7 +285,7 @@ C_MODE_END #define ulonglong2double(A) my_ulonglong2double(A) #define my_off_t2double(A) my_ulonglong2double(A) C_MODE_START -double my_ulonglong2double(unsigned long long A); +inline double my_ulonglong2double(unsigned long long A) { return (double A); } C_MODE_END #endif /* _AIX */ @@ -301,9 +301,6 @@ C_MODE_END #undef HAVE_PWRITE #endif -#ifdef UNDEF_HAVE_GETHOSTBYNAME_R /* For OSF4.x */ -#undef HAVE_GETHOSTBYNAME_R -#endif #ifdef UNDEF_HAVE_INITGROUPS /* For AIX 4.3 */ #undef HAVE_INITGROUPS #endif diff --git a/include/my_net.h b/include/my_net.h index 5762f5da06e..ce2ee6ce8ca 100644 --- a/include/my_net.h +++ b/include/my_net.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, 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 @@ -73,38 +73,6 @@ C_MODE_START #define in_addr_t uint32 #endif -/* - Handling of gethostbyname_r() -*/ - -#if !defined(HAVE_GETHOSTBYNAME_R) -struct hostent *my_gethostbyname_r(const char *name, - struct hostent *result, char *buffer, - int buflen, int *h_errnop); -void my_gethostbyname_r_free(); -#elif defined(HAVE_PTHREAD_ATTR_CREATE) || defined(_AIX) || defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) -struct hostent *my_gethostbyname_r(const char *name, - struct hostent *result, char *buffer, - int buflen, int *h_errnop); -#define my_gethostbyname_r_free() -#if !defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) && !defined(HPUX10) -#define GETHOSTBYNAME_BUFF_SIZE sizeof(struct hostent_data) -#endif /* !defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) */ - -#elif defined(HAVE_GETHOSTBYNAME_R_RETURN_INT) -#define GETHOSTBYNAME_BUFF_SIZE sizeof(struct hostent_data) -struct hostent *my_gethostbyname_r(const char *name, - struct hostent *result, char *buffer, - int buflen, int *h_errnop); -#define my_gethostbyname_r_free() -#else -#define my_gethostbyname_r(A,B,C,D,E) gethostbyname_r((A),(B),(C),(D),(E)) -#define my_gethostbyname_r_free() -#endif /* !defined(HAVE_GETHOSTBYNAME_R) */ - -#ifndef GETHOSTBYNAME_BUFF_SIZE -#define GETHOSTBYNAME_BUFF_SIZE 2048 -#endif C_MODE_END #endif diff --git a/include/myisam.h b/include/myisam.h index cb641e12e8e..839bea1d18b 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc +/* Copyright (C) 2000, 2011, 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 @@ -30,7 +31,7 @@ extern "C" { #ifndef _keycache_h #include "keycache.h" #endif -#include "my_handler.h" +#include "my_compare.h" #include <mysql/plugin.h> /* diff --git a/include/mysql.h.pp b/include/mysql.h.pp index 0a5c3d83148..169a8b30e2b 100644 --- a/include/mysql.h.pp +++ b/include/mysql.h.pp @@ -227,7 +227,7 @@ typedef struct st_typelib { extern my_ulonglong find_typeset(char *x, TYPELIB *typelib,int *error_position); extern int find_type_or_exit(const char *x, TYPELIB *typelib, const char *option); -extern int find_type(char *x, const TYPELIB *typelib, unsigned int full_name); +extern int find_type(const char *x, const TYPELIB *typelib, unsigned int flags); extern void make_type(char *to,unsigned int nr,TYPELIB *typelib); extern const char *get_type(TYPELIB *typelib,unsigned int nr); extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from); diff --git a/include/mysql_com.h b/include/mysql_com.h index f4c023721de..c35a604781d 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -114,6 +114,10 @@ enum enum_server_command #define FIELD_IN_PART_FUNC_FLAG (1 << 19)/* Field part of partition func */ #define FIELD_IN_ADD_INDEX (1<< 20) /* Intern: Field used in ADD INDEX */ #define FIELD_IS_RENAMED (1<< 21) /* Intern: Field is being renamed */ +#define FIELD_FLAGS_STORAGE_MEDIA 22 /* Field storage media, bit 22-23, + reserved by MySQL Cluster */ +#define FIELD_FLAGS_COLUMN_FORMAT 24 /* Field column format, bit 24-25, + reserved by MySQL Cluster */ #define REFRESH_GRANT 1 /* Refresh grant tables */ #define REFRESH_LOG 2 /* Start on new log file */ diff --git a/include/typelib.h b/include/typelib.h index 3badb14c96e..00dbafea34e 100644 --- a/include/typelib.h +++ b/include/typelib.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, 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 @@ -29,7 +29,17 @@ typedef struct st_typelib { /* Different types saved here */ extern my_ulonglong find_typeset(char *x, TYPELIB *typelib,int *error_position); extern int find_type_or_exit(const char *x, TYPELIB *typelib, const char *option); -extern int find_type(char *x, const TYPELIB *typelib, unsigned int full_name); +#define FIND_TYPE_BASIC 0 +/** makes @c find_type() require the whole name, no prefix */ +#define FIND_TYPE_NO_PREFIX (1 << 0) +/** always implicitely on, so unused, but old code may pass it */ +#define FIND_TYPE_NO_OVERWRITE (1 << 1) +/** makes @c find_type() accept a number */ +#define FIND_TYPE_ALLOW_NUMBER (1 << 2) +/** makes @c find_type() treat ',' as terminator */ +#define FIND_TYPE_COMMA_TERM (1 << 3) + +extern int find_type(const char *x, const TYPELIB *typelib, unsigned int flags); extern void make_type(char *to,unsigned int nr,TYPELIB *typelib); extern const char *get_type(TYPELIB *typelib,unsigned int nr); extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from); diff --git a/include/violite.h b/include/violite.h index f4083216894..140f021ebb4 100644 --- a/include/violite.h +++ b/include/violite.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, 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 @@ -93,6 +93,8 @@ ssize_t vio_pending(Vio *vio); my_bool vio_get_normalized_ip_string(const struct sockaddr *addr, int addr_length, char *ip_string, size_t ip_string_size); +my_bool vio_is_no_name_error(int err_code); + int vio_getnameinfo(const struct sockaddr *sa, char *hostname, size_t hostname_size, char *port, size_t port_size, diff --git a/mysql-test/collections/default.daily b/mysql-test/collections/default.daily index 75c03d4d47b..e8b15acb34d 100644 --- a/mysql-test/collections/default.daily +++ b/mysql-test/collections/default.daily @@ -1,15 +1,15 @@ -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=normal --vardir=var-normal --report-features -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=row --vardir=var-row --mysqld=--binlog-format=row -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps_row --vardir=var-ps_row --mysqld=--binlog-format=row --ps-protocol -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-embedded --embedded -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps --vardir=var-ps --ps-protocol -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1 -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps_funcs1 --vardir=var-ps_funcs_1 --suite=funcs_1 --ps-protocol -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=funcs2 --vardir=var-funcs2 --suite=funcs_2 -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=partitions --vardir=var-parts --suite=parts -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=stress --vardir=var-stress --suite=stress -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=jp --vardir=var-jp --suite=jp -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=nist --vardir=var-nist --suite=nist +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=normal --vardir=var-normal --report-features --skip-test-list=collections/disabled-daily.list --unit-tests +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=row --vardir=var-row --mysqld=--binlog-format=row --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps_row --vardir=var-ps_row --mysqld=--binlog-format=row --ps-protocol --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-embedded --embedded --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps --vardir=var-ps --ps-protocol --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1 --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps_funcs1 --vardir=var-ps_funcs_1 --suite=funcs_1 --ps-protocol --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=funcs2 --vardir=var-funcs2 --suite=funcs_2 --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=partitions --vardir=var-parts --suite=parts --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=stress --vardir=var-stress --suite=stress --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=jp --vardir=var-jp --suite=jp --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=nist --vardir=var-nist --suite=nist --skip-test-list=collections/disabled-daily.list perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=nist+ps --vardir=var-ps_nist --suite=nist --ps-protocol diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index a95419fbc19..5afbba36843 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -2,6 +2,9 @@ # in alphabetical order. This also helps with merge conflict resolution. binlog.binlog_multi_engine # joro : NDB tests marked as experimental as agreed with bochklin +binlog.binlog_bug23533 # WL#5867: skozlov: test case moved from unused bugs suite +binlog.binlog_bug36391 # WL#5867: skozlov: test case moved from unused bugs suite + funcs_1.charset_collation_1 # depends on compile-time decisions @@ -15,16 +18,11 @@ main.type_float @freebsd # Bug#38965 2010-05-04 alik test cases main.wait_timeout @solaris # Bug#51244 2010-04-26 alik wait_timeout fails on OpenSolaris rpl.rpl_innodb_bug28430 # Bug#46029 +rpl.rpl_bug37426 # WL#5867: skozlov: test case moved from unused bugs suite sys_vars.max_sp_recursion_depth_func @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun sys_vars.plugin_dir_basic # Bug#52223 2010-11-24 alik Test "plugin_dir_basic" does not support RPM build (test) directory structure -sys_vars.slow_query_log_func @solaris # Bug#54819 2010-06-26 alik sys_vars.slow_query_log_func fails sporadically on Solaris 10 sys_vars.wait_timeout_func # Bug#41255 2010-04-26 alik wait_timeout_func fails -sys_vars.sys_vars # Bug #59148 2011-01-10 joro 'INSTALL PLUGIN rpl_semi_sync_master' fails in release build with debug binaries -sys_vars.rpl_semi_sync_master_enabled_basic # Bug #59148 2011-01-10 joro 'INSTALL PLUGIN rpl_semi_sync_master' fails in release build with debug binaries -sys_vars.rpl_semi_sync_master_timeout_basic # Bug #59148 2011-01-10 joro 'INSTALL PLUGIN rpl_semi_sync_master' fails in release build with debug binaries -sys_vars.rpl_semi_sync_master_trace_level_basic # Bug #59148 2011-01-10 joro 'INSTALL PLUGIN rpl_semi_sync_master' fails in release build with debug binaries -sys_vars.rpl_semi_sync_master_wait_no_slave_basic # Bug #59148 2011-01-10 joro 'INSTALL PLUGIN rpl_semi_sync_master' fails in release build with debug binaries # BUG #59055 : All ndb tests should be removed from the repository # Leaving the sys_vars tests for now. sys_vars.all_vars.test fails on removing ndb tests diff --git a/mysql-test/collections/default.push b/mysql-test/collections/default.push index a213706498e..c8402aecd75 100644 --- a/mysql-test/collections/default.push +++ b/mysql-test/collections/default.push @@ -1,4 +1,4 @@ -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 --skip-test-list=collections/disabled-per-push.list +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 --skip-test-list=collections/disabled-per-push.list --unit-tests 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 --skip-test-list=collections/disabled-per-push.list 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 --skip-test-list=collections/disabled-per-push.list diff --git a/mysql-test/collections/default.weekly b/mysql-test/collections/default.weekly index a1339fcf0fc..40f0548f374 100755 --- a/mysql-test/collections/default.weekly +++ b/mysql-test/collections/default.weekly @@ -1,7 +1,7 @@ -perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=big-tests --experimental=collections/default.experimental --vardir=var-big-tests --big-test --testcase-timeout=60 --suite-timeout=600 main.alter_table-big main.archive-big main.count_distinct3 main.create-big main.events_stress main.events_time_zone main.information_schema-big main.log_tables-big main.merge-big main.mysqlbinlog_row_big main.read_many_rows_innodb main.ssl-big main.sum_distinct-big main.type_newdecimal-big main.variables-big parts.part_supported_sql_func_innodb parts.partition_alter1_1_2_innodb parts.partition_alter1_2_innodb parts.partition_alter2_1_1_innodb parts.partition_alter2_1_2_innodb parts.partition_alter2_2_2_innodb parts.partition_alter4_innodb funcs_1.myisam_views-big -perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-stmt-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam -perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-row-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-binlog-row-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --do-test=rpl --mysqld=--binlog-format=row -perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-mixed-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-binlog-mixed-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --do-test=rpl --mysqld=--binlog-format=mixed -perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-stmt-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb -perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-row-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-binlog-row-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --do-test=rpl --mysqld=--binlog-format=row -perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-mixed-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-binlog-mixed-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --do-test=rpl --mysqld=--binlog-format=mixed +perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=big-tests --experimental=collections/default.experimental --vardir=var-big-tests --big-test --testcase-timeout=60 --suite-timeout=600 main.alter_table-big main.archive-big main.count_distinct3 main.create-big main.events_stress main.events_time_zone main.information_schema-big main.log_tables-big main.merge-big main.mysqlbinlog_row_big main.read_many_rows_innodb main.ssl-big main.sum_distinct-big main.type_newdecimal-big main.variables-big parts.part_supported_sql_func_innodb parts.partition_alter1_1_2_innodb parts.partition_alter1_2_innodb parts.partition_alter2_1_1_innodb parts.partition_alter2_1_2_innodb parts.partition_alter2_2_2_innodb parts.partition_alter4_innodb funcs_1.myisam_views-big --skip-test-list=collections/disabled-weekly.list +perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-stmt-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --skip-test-list=collections/disabled-weekly.list +perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-row-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-binlog-row-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --do-test=rpl --mysqld=--binlog-format=row --skip-test-list=collections/disabled-weekly.list +perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-mixed-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-binlog-mixed-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --do-test=rpl --mysqld=--binlog-format=mixed --skip-test-list=collections/disabled-weekly.list +perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-stmt-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --skip-test-list=collections/disabled-weekly.list +perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-row-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-binlog-row-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --do-test=rpl --mysqld=--binlog-format=row --skip-test-list=collections/disabled-weekly.list +perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-mixed-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-binlog-mixed-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --do-test=rpl --mysqld=--binlog-format=mixed --skip-test-list=collections/disabled-weekly.list diff --git a/mysql-test/extra/binlog_tests/binlog.test b/mysql-test/extra/binlog_tests/binlog.test index 54aa08ff3ab..c0a8c3f6120 100644 --- a/mysql-test/extra/binlog_tests/binlog.test +++ b/mysql-test/extra/binlog_tests/binlog.test @@ -345,6 +345,7 @@ SHOW SESSION VARIABLES LIKE "%_checks"; --echo # INSERT INTO t1 VALUES(2) --echo # foreign_key_checks=1 and unique_checks=1 --echo # It should not change current session's variables, even error happens +call mtr.add_suppression("Slave SQL.*Could not execute Write_rows event on table test.t1; Duplicate entry .2. for key .PRIMARY., Error_code: 1062"); --error 1062 BINLOG ' dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE= diff --git a/mysql-test/extra/binlog_tests/database.test b/mysql-test/extra/binlog_tests/database.test index 326ecedb60e..d071415bf65 100644 --- a/mysql-test/extra/binlog_tests/database.test +++ b/mysql-test/extra/binlog_tests/database.test @@ -30,3 +30,30 @@ drop table tt1, t1; source include/show_binlog_events.inc; FLUSH STATUS; + + +--echo # +--echo # Bug#11765416 58381: FAILED DROP DATABASE CAN BREAK STATEMENT +--echo # BASED REPLICATION +--echo # + +--disable_warnings +DROP DATABASE IF EXISTS db1; +DROP TABLE IF EXISTS t3; +--enable_warnings + +CREATE DATABASE db1; +CREATE TABLE db1.t1 (a INT); +CREATE TABLE db1.t2 (b INT, KEY(b)) engine=innodb; +CREATE TABLE t3 (a INT, KEY (a), FOREIGN KEY(a) REFERENCES db1.t2(b)) + engine=innodb; +RESET MASTER; + +--error ER_ROW_IS_REFERENCED +DROP DATABASE db1; # Fails because of the fk +SHOW TABLES FROM db1; # t1 was dropped, t2 remains +--source include/show_binlog_events.inc # Check that the binlog drops t1 + +# Cleanup +DROP TABLE t3; +DROP DATABASE db1; diff --git a/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test b/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test index 0e7bb2d02b0..54b5c95080e 100644 --- a/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test +++ b/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test @@ -382,6 +382,7 @@ source include/start_slave.inc; CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*"); CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*"); CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*"); +CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master. Message: error writing to the binary log"); connection master; TRUNCATE t1; diff --git a/mysql-test/extra/rpl_tests/rpl_conflicts.test b/mysql-test/extra/rpl_tests/rpl_conflicts.test index ea3c053cb0e..2fbf3dba5dc 100644 --- a/mysql-test/extra/rpl_tests/rpl_conflicts.test +++ b/mysql-test/extra/rpl_tests/rpl_conflicts.test @@ -97,6 +97,7 @@ if (`SELECT @@global.binlog_format != 'ROW' OR @@global.slave_exec_mode = 'STRIC --disable_query_log --eval SELECT "$err" as 'Last_SQL_Error (expected "duplicate key" error)' --enable_query_log + call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.* Error_code: 1062"); SELECT * FROM t1; @@ -142,6 +143,7 @@ connection slave; # replication continues. if (`SELECT @@global.binlog_format = 'ROW' AND @@global.slave_exec_mode = 'STRICT'`) { --echo ---- Wait until slave stops with an error ---- + call mtr.add_suppression("Slave SQL.*Can.t find record in .t1., Error_code: 1032"); let $slave_sql_errno= 1032; # ER_KEY_NOT_FOUND source include/wait_for_slave_sql_error.inc; diff --git a/mysql-test/extra/rpl_tests/rpl_extra_col_master.test b/mysql-test/extra/rpl_tests/rpl_extra_col_master.test index a7b1c021c97..513bc949c5d 100644 --- a/mysql-test/extra/rpl_tests/rpl_extra_col_master.test +++ b/mysql-test/extra/rpl_tests/rpl_extra_col_master.test @@ -121,6 +121,15 @@ SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9, hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20; #connection slave; + +--disable_query_log +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 2 type mismatch.* 1535"); +call mtr.add_suppression("Slave.*Can.t DROP .c7.; check that column.key exists.* Error_code: 1091"); +call mtr.add_suppression("Slave.*Unknown column .c7. in .t15.* Error_code: 1054"); +call mtr.add_suppression("Slave.*Key column .c6. doesn.t exist in table.* Error_code: 1072"); +call mtr.add_suppression("Slave SQL.*Column 2 of table .test.t1.. cannot be converted from type.* Error_code: 1677"); +--enable_query_log + sync_slave_with_master; --echo --echo * Select count and 20 rows from Slave * diff --git a/mysql-test/extra/rpl_tests/rpl_extra_col_slave.test b/mysql-test/extra/rpl_tests/rpl_extra_col_slave.test index 6c51b63886b..482c7e44922 100644 --- a/mysql-test/extra/rpl_tests/rpl_extra_col_slave.test +++ b/mysql-test/extra/rpl_tests/rpl_extra_col_slave.test @@ -14,6 +14,7 @@ ################################################# call mtr.add_suppression("Slave: Unknown table 't6' Error_code: 1051"); +call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]*. cannot be converted from type.* Error_code: 1677"); --echo **** Diff Table Def Start **** @@ -769,6 +770,10 @@ RESET MASTER; connection slave; START SLAVE; +call mtr.add_suppression("Error .Unknown table .t6.. on query.* Error_code: 1051"); +call mtr.add_suppression("Error .Duplicate column name .c6.. on query.* Error_code: 1060"); +call mtr.add_suppression("Table definition on master and slave does not match: Column . ...e mismatch.* Error_code: 1535"); + --echo *** Master Data Insert *** connection master; set @b1 = 'b1b1b1b1'; diff --git a/mysql-test/extra/rpl_tests/rpl_loaddata.test b/mysql-test/extra/rpl_tests/rpl_loaddata.test index 00dd736280a..0b3fcc25b33 100644 --- a/mysql-test/extra/rpl_tests/rpl_loaddata.test +++ b/mysql-test/extra/rpl_tests/rpl_loaddata.test @@ -69,6 +69,8 @@ eval $lower_stmt_head infile '../../std_data/rpl_loaddata.dat' into table t1; save_master_pos; connection slave; # 1062 = ER_DUP_ENTRY +call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* Error_code: 1062"); +call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.*error code=1062.*Error on slave:.*Error_code: 0"); --let $slave_sql_errno= 1062 --source include/wait_for_slave_sql_error_and_skip.inc diff --git a/mysql-test/extra/rpl_tests/rpl_record_compare.test b/mysql-test/extra/rpl_tests/rpl_record_compare.test index f29e4fb791a..210aee025d0 100644 --- a/mysql-test/extra/rpl_tests/rpl_record_compare.test +++ b/mysql-test/extra/rpl_tests/rpl_record_compare.test @@ -62,4 +62,24 @@ UPDATE t1 SET c1= 0; DROP TABLE t1; -- sync_slave_with_master +# +# BUG#11766865: 60091: RBR + NO PK + UPDATE NULL VALUE --> SLAVE BREAK WITH ERROR HA_ERR_END_OF_ +# + +--connection master +--source include/rpl_reset.inc +--connection master + +--eval CREATE TABLE t1 (c1 int(11) NOT NULL, c2 int(11) NOT NULL, c3 int(11) DEFAULT '-1') ENGINE=$engine DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (1,2,NULL); +UPDATE t1 SET c1=1, c2=2, c3=-1 WHERE c1=1 AND c2=2 AND ISNULL(c3); + +--sync_slave_with_master + +--let $diff_tables=master:test.t1, slave:test.t1 +--source include/diff_tables.inc + +--connection master +DROP TABLE t1; +--sync_slave_with_master diff --git a/mysql-test/extra/rpl_tests/rpl_row_basic.test b/mysql-test/extra/rpl_tests/rpl_row_basic.test index 7bbe4c63a7d..fee0cace294 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_basic.test +++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test @@ -382,6 +382,9 @@ source include/diff_tables.inc; connection slave; SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* Error_code: 1535"); +call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table test.t1.* Error_code: 1032"); +call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t.. cannot be converted from type.*, Error_code: 1677"); --let $rpl_only_running_threads= 1 --source include/rpl_reset.inc diff --git a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test index 9e752e4b69f..76432febd5e 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test +++ b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test @@ -147,6 +147,8 @@ sync_slave_with_master; connection master; INSERT INTO t4 VALUES (4); connection slave; +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column [012] type mismatch.* Error_code: 1535"); +call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]. cannot be converted from type.* Error_code: 1677"); --let $slave_skip_counter= 2 --let $slave_sql_errno= 1677 --let $show_slave_sql_error= 1 diff --git a/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test b/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test index d4140785878..cc69c08fe7c 100644 --- a/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test +++ b/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test @@ -25,6 +25,7 @@ drop table t1; connection slave; --source include/wait_for_slave_sql_to_stop.inc +call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.* error code=1062.*Error on slave:.* Error_code: 0"); let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1); let $errno= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1); --echo Error: "$error" (expected different error codes on master and slave) diff --git a/mysql-test/extra/rpl_tests/rpl_stop_middle_group.test b/mysql-test/extra/rpl_tests/rpl_stop_middle_group.test index 8f2246c6abf..977d93ec36d 100644 --- a/mysql-test/extra/rpl_tests/rpl_stop_middle_group.test +++ b/mysql-test/extra/rpl_tests/rpl_stop_middle_group.test @@ -23,6 +23,8 @@ insert into tm set a=null; # to simulate killed status on the slave commit; connection slave; +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); +call mtr.add_suppression("Slave SQL.*Slave SQL Thread stopped with incomplete event group having non-transactional changes"); # slave will catch the killed status but won't shut down immediately # only after the whole group has done (commit) diff --git a/mysql-test/include/ctype_numconv.inc b/mysql-test/include/ctype_numconv.inc index 571b8207107..ad308d20695 100644 --- a/mysql-test/include/ctype_numconv.inc +++ b/mysql-test/include/ctype_numconv.inc @@ -1765,6 +1765,22 @@ SELECT HEX(DATE_SUB(DATE('2007-08-03'), INTERVAL 1 DAY)) AS field_date, HEX(DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE)) AS field_datetime; +--echo # +--echo # Bug#11926811 / Bug#60625 Illegal mix of collations +--echo # +SELECT @@collation_connection; +DELIMITER //; +CREATE PROCEDURE p1() +BEGIN + DECLARE v_LastPaymentDate DATETIME DEFAULT NULL; + SELECT v_LastPaymentDate < NOW(); + EXPLAIN EXTENDED SELECT v_LastPaymentDate < NOW(); + SHOW WARNINGS; + EXPLAIN EXTENDED SELECT CONCAT(v_LastPaymentDate, NOW()); +END// +DELIMITER ;// +CALL p1; +DROP PROCEDURE p1; --echo # --echo # Bug#52159 returning time type from function and empty left join causes debug assertion diff --git a/mysql-test/include/have_plugin_auth.inc b/mysql-test/include/have_plugin_auth.inc index 41f11419c64..44ff4c2520d 100644 --- a/mysql-test/include/have_plugin_auth.inc +++ b/mysql-test/include/have_plugin_auth.inc @@ -2,3 +2,4 @@ disable_query_log; --require r/true.require select (PLUGIN_LIBRARY LIKE 'auth_test_plugin%') as `TRUE` FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME='test_plugin_server'; +enable_query_log; diff --git a/mysql-test/include/mix1.inc b/mysql-test/include/mix1.inc index 3481d572514..b7146e24d0a 100644 --- a/mysql-test/include/mix1.inc +++ b/mysql-test/include/mix1.inc @@ -634,6 +634,10 @@ drop table t1; drop table bug29807; create table bug29807 (a int); drop table bug29807; +--disable_query_log +call mtr.add_suppression("InnoDB: Error: table .test...bug29807. does not exist in the InnoDB internal"); +call mtr.add_suppression("Cannot find or open table test\/bug29807 from"); +--enable_query_log # diff --git a/mysql-test/include/mtr_warnings.sql b/mysql-test/include/mtr_warnings.sql index 78cc9882d79..b4e8cdc59c2 100644 --- a/mysql-test/include/mtr_warnings.sql +++ b/mysql-test/include/mtr_warnings.sql @@ -71,7 +71,7 @@ SET @@collation_connection = @collation_connection_saved|| -- Insert patterns that should always be suppressed -- INSERT INTO global_suppressions VALUES - ("'SELECT UNIX_TIMESTAMP\\(\\)' failed on master"), + (".SELECT UNIX_TIMESTAMP... failed on master"), ("Aborted connection"), ("Client requested master to start replication from impossible position"), ("Could not find first log file name in binary log"), @@ -125,11 +125,9 @@ INSERT INTO global_suppressions VALUES ("Slave: The incident LOST_EVENTS occured on the master"), ("Slave: Unknown error.* 1105"), ("Slave: Can't drop database.* database doesn't exist"), - ("Slave SQL:.*(Error_code: \[\[:digit:\]\]+|Query:.*)"), ("Sort aborted"), ("Time-out in NDB"), ("Warning:\s+One can only use the --user.*root"), - ("Warning:\s+Setting lower_case_table_names=2"), ("Warning:\s+Table:.* on (delete|rename)"), ("You have an error in your SQL syntax"), ("deprecated"), @@ -142,53 +140,20 @@ INSERT INTO global_suppressions VALUES ("slave SQL thread aborted"), ("Slave: .*Duplicate entry"), - /* - Special case, made as specific as possible, for: - Bug #28436: Incorrect position in SHOW BINLOG EVENTS causes - server coredump - */ - - ("Error in Log_event::read_log_event\\\(\\\): 'Sanity check failed', data_len: 258, event_type: 49"), - ("Statement may not be safe to log in statement format"), - /* test case for Bug#bug29807 copies a stray frm into database */ - ("InnoDB: Error: table `test`.`bug29807` does not exist in the InnoDB internal"), - ("Cannot find or open table test\/bug29807 from"), - /* innodb foreign key tests that fail in ALTER or RENAME produce this */ ("InnoDB: Error: in ALTER TABLE `test`.`t[123]`"), ("InnoDB: Error: in RENAME TABLE table `test`.`t1`"), ("InnoDB: Error: table `test`.`t[123]` does not exist in the InnoDB internal"), - /* Test case for Bug#14233 produces the following warnings: */ - ("Stored routine 'test'.'bug14233_1': invalid value in column mysql.proc"), - ("Stored routine 'test'.'bug14233_2': invalid value in column mysql.proc"), - ("Stored routine 'test'.'bug14233_3': invalid value in column mysql.proc"), - /* BUG#32080 - Excessive warnings on Solaris: setrlimit could not change the size of core files */ ("setrlimit could not change the size of core files to 'infinity'"), - /* - rpl_extrColmaster_*.test, the slave thread produces warnings - when it get updates to a table that has more columns on the - master - */ - ("Slave: Unknown column 'c7' in 't15' Error_code: 1054"), - ("Slave: Can't DROP 'c7'.* 1091"), - ("Slave: Key column 'c6'.* 1072"), ("The slave I.O thread stops because a fatal error is encountered when it try to get the value of SERVER_ID variable from master."), - (".SELECT UNIX_TIMESTAMP... failed on master, do not trust column Seconds_Behind_Master of SHOW SLAVE STATUS"), - - /* Special case for Bug #26402 in show_check.test - - Question marks are not valid file name parts on Windows. Ignore - this error message. - */ - ("Can't find file: '.\\\\test\\\\\\?{8}.frm'"), - ("Slave: Unknown table 't1' Error_code: 1051"), /* Added 2009-08-XX after fixing Bug #42408 */ @@ -217,14 +182,6 @@ INSERT INTO global_suppressions VALUES ("==[0-9]*== Warning: invalid file descriptor -1 in syscall read()"), /* - Transient network failures that cause warnings on reconnect. - BUG#47743 and BUG#47983. - */ - ("Slave I/O: Get master SERVER_ID failed with error:.*"), - ("Slave I/O: Get master clock failed with error:.*"), - ("Slave I/O: Get master COLLATION_SERVER failed with error:.*"), - ("Slave I/O: Get master TIME_ZONE failed with error:.*"), - /* BUG#42147 - Concurrent DML and LOCK TABLE ... READ for InnoDB table cause warnings in errlog Note: This is a temporary suppression until Bug#42147 can be diff --git a/mysql-test/include/not_crashrep.inc b/mysql-test/include/not_crashrep.inc new file mode 100644 index 00000000000..e126f339a5f --- /dev/null +++ b/mysql-test/include/not_crashrep.inc @@ -0,0 +1,24 @@ +# Check if CrashReporter is enabled and would open a window + +perl; +sub skip_test { + # Only relevant on Mac OS X + return 0 unless $^O eq 'darwin'; + my $crep= `defaults read com.apple.CrashReporter DialogType`; + return 0 if $?; + chomp ($crep); + $crep= lc $crep; + return ($crep eq 'basic' || $crep eq 'developer'); +} +my $skip= skip_test(); +open (F, ">" . $ENV{'MYSQL_TMP_DIR'} . "/crashrep.inc"); +print F "let \$crashrep= $skip;\n"; +close F; +EOF + +--source $MYSQL_TMP_DIR/crashrep.inc +--remove_file $MYSQL_TMP_DIR/crashrep.inc + +if ($crashrep) { + --skip CrashReporter would popup a window +} diff --git a/mysql-test/include/wait_for_status_var.inc b/mysql-test/include/wait_for_status_var.inc index 86831164c71..1ab58ffb548 100644 --- a/mysql-test/include/wait_for_status_var.inc +++ b/mysql-test/include/wait_for_status_var.inc @@ -81,7 +81,7 @@ while (`$_query`) sleep 0.1; let $_show_status_value= query_get_value("SHOW $status_type STATUS LIKE '$status_var'", Value, 1); let $_query= SELECT NOT('$_show_status_value' $_status_var_comparsion '$status_var_value'); - if ($is_number) + if ($_is_number) { let $_query= SELECT NOT($_show_status_value $_status_var_comparsion $status_var_value); } diff --git a/mysql-test/lib/My/Find.pm b/mysql-test/lib/My/Find.pm index a44c9a7508c..521adecfd13 100644 --- a/mysql-test/lib/My/Find.pm +++ b/mysql-test/lib/My/Find.pm @@ -28,8 +28,6 @@ use My::Platform; use base qw(Exporter); our @EXPORT= qw(my_find_bin my_find_dir my_find_file NOT_REQUIRED); -our $vs_config_dir; - my $bin_extension= ".exe" if IS_WINDOWS; # Helper function to be used for fourth parameter to find functions @@ -158,7 +156,8 @@ sub my_find_paths { # User can select to look in a special build dir # which is a subdirectory of any of the paths my @extra_dirs; - my $build_dir= $vs_config_dir || $ENV{MTR_VS_CONFIG} || $ENV{MTR_BUILD_DIR}; + my $build_dir= $::opt_config_dir || $ENV{MTR_VS_CONFIG} + || $ENV{MTR_BUILD_DIR}; push(@extra_dirs, $build_dir) if defined $build_dir; if (defined $extension){ diff --git a/mysql-test/lib/mtr_misc.pl b/mysql-test/lib/mtr_misc.pl index 678d3829226..a7b5afd9fd7 100644 --- a/mysql-test/lib/mtr_misc.pl +++ b/mysql-test/lib/mtr_misc.pl @@ -1,5 +1,5 @@ # -*- cperl -*- -# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2011, 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 Library General Public @@ -36,6 +36,7 @@ sub start_timer($); sub has_expired($); sub init_timers(); sub mark_time_used($); +sub mark_time_idle(); sub add_total_times($); sub print_times_used($$); sub print_total_times($); @@ -224,6 +225,7 @@ my %time_used= ( 'ch-warn' => 0, 'test' => 0, 'init' => 0, + 'admin' => 0, ); my %time_text= ( @@ -232,7 +234,8 @@ my %time_text= ( 'check' => "Check-testcase", 'ch-warn' => "Check for warnings", 'test' => "Test execution", - 'init' => "Initialization etc.", + 'init' => "Initialization/cleanup", + 'admin' => "Test administration", ); # Counts number of reports from workers @@ -255,6 +258,10 @@ sub mark_time_used($) { $last_timer_set= $curr_time; } +sub mark_time_idle() { + $last_timer_set= gettimeofday() if $opt_report_times; +} + sub add_total_times($) { my ($dummy, $num, @line)= split (" ", $_[0]); diff --git a/mysql-test/lib/mtr_report.pm b/mysql-test/lib/mtr_report.pm index f86be0d4c68..2fec916c724 100644 --- a/mysql-test/lib/mtr_report.pm +++ b/mysql-test/lib/mtr_report.pm @@ -32,6 +32,7 @@ our @EXPORT= qw(report_option mtr_print_line mtr_print_thick_line use mtr_match; use My::Platform; use POSIX qw[ _exit ]; +use IO::Handle qw[ flush ]; require "mtr_io.pl"; my $tot_real_time= 0; @@ -72,7 +73,7 @@ sub _mtr_report_test_name ($) { print _name(). _timestamp(); printf "%-40s ", $tname; my $worker = $tinfo->{worker}; - printf "w$worker " if $worker; + print "w$worker " if defined $worker; return $tname; } @@ -487,6 +488,7 @@ sub mtr_warning (@) { # Print error to screen and then exit sub mtr_error (@) { + IO::Handle::flush(\*STDOUT) if IS_WINDOWS; print STDERR _name(). _timestamp(). "mysql-test-run: *** ERROR: ". join(" ", @_). "\n"; if (IS_WINDOWS) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index b0295f8380a..0d227170476 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -194,6 +194,10 @@ my $opt_debug_common; our $opt_debug_server; our @opt_cases; # The test cases names in argv our $opt_embedded_server; +# -1 indicates use default, override with env.var. +my $opt_ctest= env_or_val(MTR_UNIT_TESTS => -1); +# Unit test report stored here for delayed printing +my $ctest_report; # Options used when connecting to an already running server my %opts_extern; @@ -215,9 +219,12 @@ our %gprof_dirs; our $glob_debugger= 0; our $opt_gdb; our $opt_client_gdb; +our $opt_dbx; +our $opt_client_dbx; our $opt_ddd; our $opt_client_ddd; our $opt_manual_gdb; +our $opt_manual_dbx; our $opt_manual_ddd; our $opt_manual_debug; our $opt_debugger; @@ -493,6 +500,10 @@ sub main { mtr_error("Not all tests completed"); } + mark_time_used('init'); + + push @$completed, run_ctest() if $opt_ctest; + mtr_print_line(); if ( $opt_gcov ) { @@ -500,6 +511,11 @@ sub main { $opt_gcov_msg, $opt_gcov_err); } + if ($ctest_report) { + print "$ctest_report\n"; + mtr_print_line(); + } + print_total_times($opt_parallel) if $opt_report_times; mtr_report_stats("Completed", $completed); @@ -533,7 +549,9 @@ sub run_test_server ($$$) { my $s= IO::Select->new(); $s->add($server); while (1) { + mark_time_used('admin'); my @ready = $s->can_read(1); # Wake up once every second + mark_time_idle(); foreach my $sock (@ready) { if ($sock == $server) { # New client connected @@ -875,7 +893,7 @@ sub run_worker ($) { if ( $opt_gprof ) { gprof_collect (find_mysqld($basedir), keys %gprof_dirs); } - mark_time_used('init'); + mark_time_used('admin'); print_times_used($server, $thread_num); exit($valgrind_reports); } @@ -988,6 +1006,9 @@ sub command_line_setup { 'ddd' => \$opt_ddd, 'client-ddd' => \$opt_client_ddd, 'manual-ddd' => \$opt_manual_ddd, + 'dbx' => \$opt_dbx, + 'client-dbx' => \$opt_client_dbx, + 'manual-dbx' => \$opt_manual_dbx, 'debugger=s' => \$opt_debugger, 'client-debugger=s' => \$opt_client_debugger, 'strace-client:s' => \$opt_strace_client, @@ -1055,6 +1076,7 @@ sub command_line_setup { 'max-connections=i' => \$opt_max_connections, 'default-myisam!' => \&collect_option, 'report-times' => \$opt_report_times, + 'unit-tests!' => \$opt_ctest, 'help|h' => \$opt_usage, # list-options is internal, not listed in help @@ -1412,6 +1434,12 @@ sub command_line_setup { $opt_ddd= undef; } + if ($opt_dbx) { + mtr_warning("Silently converting --dbx to --client-dbx in embedded mode"); + $opt_client_dbx= $opt_dbx; + $opt_dbx= undef; + } + if ($opt_debugger) { mtr_warning("Silently converting --debugger to --client-debugger in embedded mode"); @@ -1420,7 +1448,7 @@ sub command_line_setup { } if ( $opt_gdb || $opt_ddd || $opt_manual_gdb || $opt_manual_ddd || - $opt_manual_debug || $opt_debugger ) + $opt_manual_debug || $opt_debugger || $opt_dbx || $opt_manual_dbx) { mtr_error("You need to use the client debug options for the", "embedded server. Ex: --client-gdb"); @@ -1448,6 +1476,7 @@ sub command_line_setup { # -------------------------------------------------------------------------- if ( $opt_gdb || $opt_client_gdb || $opt_ddd || $opt_client_ddd || $opt_manual_gdb || $opt_manual_ddd || $opt_manual_debug || + $opt_dbx || $opt_client_dbx || $opt_manual_dbx || $opt_debugger || $opt_client_debugger ) { # Indicate that we are using debugger @@ -1485,6 +1514,14 @@ sub command_line_setup { } # -------------------------------------------------------------------------- + # Don't run ctest if tests or suites named + # -------------------------------------------------------------------------- + + $opt_ctest= 0 if $opt_ctest == -1 && ($opt_suites || @opt_cases); + # Override: disable if running in the PB test environment + $opt_ctest= 0 if $opt_ctest == -1 && defined $ENV{PB2WORKDIR}; + + # -------------------------------------------------------------------------- # Check use of wait-all # -------------------------------------------------------------------------- @@ -3740,7 +3777,7 @@ sub run_testcase ($) { do_before_run_mysqltest($tinfo); - mark_time_used('init'); + mark_time_used('admin'); if ( $opt_check_testcases and check_testcase($tinfo, "before") ){ # Failed to record state of server or server crashed @@ -4682,6 +4719,9 @@ sub mysqld_start ($$) { { ddd_arguments(\$args, \$exe, $mysqld->name()); } + if ( $opt_dbx || $opt_manual_dbx ) { + dbx_arguments(\$args, \$exe, $mysqld->name()); + } elsif ( $opt_debugger ) { debugger_arguments(\$args, \$exe, $mysqld->name()); @@ -5210,7 +5250,7 @@ sub start_mysqltest ($) { my $exe= $exe_mysqltest; my $args; - mark_time_used('init'); + mark_time_used('admin'); mtr_init_args(\$args); @@ -5352,6 +5392,9 @@ sub start_mysqltest ($) { { ddd_arguments(\$args, \$exe, "client"); } + if ( $opt_client_dbx ) { + dbx_arguments(\$args, \$exe, "client"); + } elsif ( $opt_client_debugger ) { debugger_arguments(\$args, \$exe, "client"); @@ -5386,23 +5429,11 @@ sub gdb_arguments { # Remove the old gdbinit file unlink($gdb_init_file); - if ( $type eq "client" ) - { - # write init file for client - mtr_tofile($gdb_init_file, - "set args $str\n" . - "break main\n"); - } - else - { - # write init file for mysqld - mtr_tofile($gdb_init_file, - "set args $str\n" . - "break mysql_parse\n" . - "commands 1\n" . - "disable 1\n" . - "end\n"); - } + # write init file for mysqld or client + mtr_tofile($gdb_init_file, + "set args $str\n" . + "break main\n" . + "run"); if ( $opt_manual_gdb ) { @@ -5449,24 +5480,12 @@ sub ddd_arguments { # Remove the old gdbinit file unlink($gdb_init_file); - if ( $type eq "client" ) - { - # write init file for client - mtr_tofile($gdb_init_file, - "set args $str\n" . - "break main\n"); - } - else - { - # write init file for mysqld - mtr_tofile($gdb_init_file, - "file $$exe\n" . - "set args $str\n" . - "break mysql_parse\n" . - "commands 1\n" . - "disable 1\n" . - "end"); - } + # write init file for mysqld or client + mtr_tofile($gdb_init_file, + "file $$exe\n" . + "set args $str\n" . + "break main\n" . + "run"); if ( $opt_manual_ddd ) { @@ -5496,6 +5515,46 @@ sub ddd_arguments { # +# Modify the exe and args so that program is run in dbx in xterm +# +sub dbx_arguments { + my $args= shift; + my $exe= shift; + my $type= shift; + + # Put $args into a single string + my $str= join " ", @$$args; + + if ( $opt_manual_dbx ) { + print "\nTo start dbx for $type, type in another window:\n"; + print "cd $glob_mysql_test_dir; dbx -c \"stop in main; " . + "run $str\" $$exe\n"; + + # Indicate the exe should not be started + $$exe= undef; + return; + } + + $$args= []; + mtr_add_arg($$args, "-title"); + mtr_add_arg($$args, "$type"); + mtr_add_arg($$args, "-e"); + + if ( $exe_libtool ) { + mtr_add_arg($$args, $exe_libtool); + mtr_add_arg($$args, "--mode=execute"); + } + + mtr_add_arg($$args, "dbx"); + mtr_add_arg($$args, "-c"); + mtr_add_arg($$args, "stop in main; run $str"); + mtr_add_arg($$args, "$$exe"); + + $$exe= "xterm"; +} + + +# # Modify the exe and args so that program is run in the selected debugger # sub debugger_arguments { @@ -5526,18 +5585,6 @@ sub debugger_arguments { $$exe= $debugger; } - elsif ( $debugger eq "dbx" ) - { - # xterm -e dbx -r exe arg1 .. argn - - unshift(@$$args, $$exe); - unshift(@$$args, "-r"); - unshift(@$$args, $debugger); - unshift(@$$args, "-e"); - - $$exe= "xterm"; - - } else { mtr_error("Unknown argument \"$debugger\" passed to --debugger"); @@ -5648,6 +5695,78 @@ sub valgrind_exit_reports() { return $found_err; } +sub run_ctest() { + my $olddir= getcwd(); + chdir ($bindir) or die ("Could not chdir to $bindir"); + my $tinfo; + my $no_ctest= (IS_WINDOWS) ? 256 : -1; + my $ctest_vs= ""; + + # Just ignore if not configured/built to run ctest + if (! -f "CTestTestfile.cmake") { + chdir($olddir); + return; + } + + # Add vs-config option if needed + $ctest_vs= "-C $opt_vs_config" if $opt_vs_config; + + # Also silently ignore if we don't have ctest and didn't insist + # Special override: also ignore in Pushbuild, some platforms may not have it + # Now, run ctest and collect output + my $ctest_out= `ctest $ctest_vs 2>&1`; + if ($? == $no_ctest && $opt_ctest == -1 && ! defined $ENV{PB2WORKDIR}) { + chdir($olddir); + return; + } + + # Create minimalistic "test" for the reporting + $tinfo = My::Test->new + ( + name => 'unit_tests', + ); + # Set dummy worker id to align report with normal tests + $tinfo->{worker} = 0 if $opt_parallel > 1; + + my $ctfail= 0; # Did ctest fail? + if ($?) { + $ctfail= 1; + $tinfo->{result}= 'MTR_RES_FAILED'; + $tinfo->{comment}= "ctest failed with exit code $?, see result below"; + $ctest_out= "" unless $ctest_out; + } + my $ctfile= "$opt_vardir/ctest.log"; + my $ctres= 0; # Did ctest produce report summary? + + open (CTEST, " > $ctfile") or die ("Could not open output file $ctfile"); + + # Put ctest output in log file, while analyzing results + for (split ('\n', $ctest_out)) { + print CTEST "$_\n"; + if (/tests passed/) { + $ctres= 1; + $ctest_report .= "\nUnit tests: $_\n"; + } + if ( /FAILED/ or /\(Failed\)/ ) { + $ctfail= 1; + $ctest_report .= " $_\n"; + } + } + close CTEST; + + # Set needed 'attributes' for test reporting + $tinfo->{comment}.= "\nctest did not pruduce report summary" if ! $ctres; + $tinfo->{result}= ($ctres && !$ctfail) + ? 'MTR_RES_PASSED' : 'MTR_RES_FAILED'; + $ctest_report .= "Report from unit tests in $ctfile"; + $tinfo->{failures}= ($tinfo->{result} eq 'MTR_RES_FAILED'); + + mark_time_used('test'); + mtr_report_test($tinfo); + chdir($olddir); + return $tinfo; +} + # # Usage # @@ -5766,6 +5885,7 @@ Options for debugging the product client-ddd Start mysqltest client in ddd client-debugger=NAME Start mysqltest in the selected debugger client-gdb Start mysqltest client in gdb + client-dbx Start mysqltest client in dbx ddd Start mysqld in ddd debug Dump trace output for all servers and client programs debug-common Same as debug, but sets 'd' debug flags to @@ -5774,12 +5894,15 @@ Options for debugging the product tracing debugger=NAME Start mysqld in the selected debugger gdb Start the mysqld(s) in gdb + dbx Start the mysqld(s) in dbx manual-debug Let user manually start mysqld in debugger, before running test(s) manual-gdb Let user manually start mysqld in gdb, before running test(s) manual-ddd Let user manually start mysqld in ddd, before running test(s) + manual-dbx Let user manually start mysqld in dbx, before running + test(s) strace-client[=path] Create strace output for mysqltest client, optionally specifying name and path to the trace program to use. Example: $0 --strace-client=ktrace @@ -5866,6 +5989,9 @@ Misc options engine to InnoDB. report-times Report how much time has been spent on different phases of test execution. + nounit-tests Do not run unit tests. Normally run if configured + and if not running named tests/suites + unit-tests Run unit tests even if they would otherwise not be run Some options that control enabling a feature for normal test runs, can be turned off by prepending 'no' to the option, e.g. --notimer. diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 69b93555ec0..eba9562a8c3 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -1391,3 +1391,16 @@ CREATE DATABASE db1 CHARACTER SET utf8; CREATE TABLE db1.t1 (bar TINYTEXT, KEY (bar(100))); ALTER TABLE db1.t1 ADD baz INT; DROP DATABASE db1; +# +# Bug#11938039 RE-EXECUTION OF FRM-ONLY ALTER TABLE WITH RENAME +# CLAUSE FAILS OR ABORTS SERVER. +# +drop table if exists t1; +create table t1 (a int); +prepare stmt1 from 'alter table t1 alter column a set default 1, rename to t2'; +execute stmt1; +rename table t2 to t1; +# The below statement should succeed and not emit error or abort server. +execute stmt1; +deallocate prepare stmt1; +drop table t2; diff --git a/mysql-test/r/archive_plugin.result b/mysql-test/r/archive_plugin.result index 221b343cca5..90c1f10bf19 100644 --- a/mysql-test/r/archive_plugin.result +++ b/mysql-test/r/archive_plugin.result @@ -10,6 +10,9 @@ UNINSTALL PLUGIN archive; INSTALL PLUGIN archive SONAME 'ha_archive.so'; CREATE TABLE t1(a int) ENGINE=ARCHIVE; DROP TABLE t1; +SELECT 1; +1 +1 UNINSTALL PLUGIN archive; UNINSTALL PLUGIN archive; ERROR 42000: PLUGIN archive does not exist diff --git a/mysql-test/r/blackhole_plugin.result b/mysql-test/r/blackhole_plugin.result index 9fc0cacd9cc..4ef9fa0fa47 100644 --- a/mysql-test/r/blackhole_plugin.result +++ b/mysql-test/r/blackhole_plugin.result @@ -10,6 +10,9 @@ UNINSTALL PLUGIN blackhole; INSTALL PLUGIN blackhole SONAME 'ha_blackhole.so'; CREATE TABLE t1(a int) ENGINE=BLACKHOLE; DROP TABLE t1; +SELECT 1; +1 +1 UNINSTALL PLUGIN blackhole; UNINSTALL PLUGIN blackhole; ERROR 42000: PLUGIN blackhole does not exist diff --git a/mysql-test/r/bootstrap.result b/mysql-test/r/bootstrap.result index 3301ca74324..484724373d2 100644 --- a/mysql-test/r/bootstrap.result +++ b/mysql-test/r/bootstrap.result @@ -6,3 +6,15 @@ set @my_max_allowed_packet= @@max_allowed_packet; set global max_allowed_packet=100*@@max_allowed_packet; set global max_allowed_packet=@my_max_allowed_packet; drop table t1; +End of 5.1 tests +# +# Bug #11766306: 59393: HAVE_INNODB=YES WHEN MYSQLD +# STARTED WITH --SKIP-INNODB +# +SHOW VARIABLES LIKE 'have_innodb'; +Variable_name Value +have_innodb DISABLED +SELECT SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb'; +SUPPORT +NO +End of 5.5 tests diff --git a/mysql-test/r/ctype_binary.result b/mysql-test/r/ctype_binary.result index 58cd4b3524b..291dcfdf92a 100644 --- a/mysql-test/r/ctype_binary.result +++ b/mysql-test/r/ctype_binary.result @@ -2807,6 +2807,32 @@ HEX(DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE)) AS fie field_str1 field1_str2 field_date field_datetime 323030372D30382D30322032333A35393A3030 323030372D30382D30332031373A33323A3030 323030372D30382D3032 323030372D30382D30332031373A33323A3030 # +# Bug#11926811 / Bug#60625 Illegal mix of collations +# +SELECT @@collation_connection; +@@collation_connection +binary +CREATE PROCEDURE p1() +BEGIN +DECLARE v_LastPaymentDate DATETIME DEFAULT NULL; +SELECT v_LastPaymentDate < NOW(); +EXPLAIN EXTENDED SELECT v_LastPaymentDate < NOW(); +SHOW WARNINGS; +EXPLAIN EXTENDED SELECT CONCAT(v_LastPaymentDate, NOW()); +END// +CALL p1; +v_LastPaymentDate < NOW() +NULL +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Level Code Message +Note 1003 select (v_LastPaymentDate@0 < now()) AS `v_LastPaymentDate < NOW()` +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select concat(v_LastPaymentDate@0,now()) AS `CONCAT(v_LastPaymentDate, NOW())` +DROP PROCEDURE p1; +# # Bug#52159 returning time type from function and empty left join causes debug assertion # CREATE FUNCTION f1() RETURNS TIME RETURN 1; diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result index 24604d9d5fc..58f023b2b79 100644 --- a/mysql-test/r/ctype_cp1251.result +++ b/mysql-test/r/ctype_cp1251.result @@ -3199,6 +3199,32 @@ HEX(DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE)) AS fie field_str1 field1_str2 field_date field_datetime 323030372D30382D30322032333A35393A3030 323030372D30382D30332031373A33323A3030 323030372D30382D3032 323030372D30382D30332031373A33323A3030 # +# Bug#11926811 / Bug#60625 Illegal mix of collations +# +SELECT @@collation_connection; +@@collation_connection +cp1251_general_ci +CREATE PROCEDURE p1() +BEGIN +DECLARE v_LastPaymentDate DATETIME DEFAULT NULL; +SELECT v_LastPaymentDate < NOW(); +EXPLAIN EXTENDED SELECT v_LastPaymentDate < NOW(); +SHOW WARNINGS; +EXPLAIN EXTENDED SELECT CONCAT(v_LastPaymentDate, NOW()); +END// +CALL p1; +v_LastPaymentDate < NOW() +NULL +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Level Code Message +Note 1003 select (v_LastPaymentDate@0 < now()) AS `v_LastPaymentDate < NOW()` +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select concat(convert(v_LastPaymentDate@0 using cp1251),now()) AS `CONCAT(v_LastPaymentDate, NOW())` +DROP PROCEDURE p1; +# # Bug#52159 returning time type from function and empty left join causes debug assertion # CREATE FUNCTION f1() RETURNS TIME RETURN 1; diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index 6f773270dff..2ecb9d6aeba 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -3226,6 +3226,32 @@ HEX(DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE)) AS fie field_str1 field1_str2 field_date field_datetime 323030372D30382D30322032333A35393A3030 323030372D30382D30332031373A33323A3030 323030372D30382D3032 323030372D30382D30332031373A33323A3030 # +# Bug#11926811 / Bug#60625 Illegal mix of collations +# +SELECT @@collation_connection; +@@collation_connection +latin1_swedish_ci +CREATE PROCEDURE p1() +BEGIN +DECLARE v_LastPaymentDate DATETIME DEFAULT NULL; +SELECT v_LastPaymentDate < NOW(); +EXPLAIN EXTENDED SELECT v_LastPaymentDate < NOW(); +SHOW WARNINGS; +EXPLAIN EXTENDED SELECT CONCAT(v_LastPaymentDate, NOW()); +END// +CALL p1; +v_LastPaymentDate < NOW() +NULL +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Level Code Message +Note 1003 select (v_LastPaymentDate@0 < now()) AS `v_LastPaymentDate < NOW()` +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select concat(v_LastPaymentDate@0,now()) AS `CONCAT(v_LastPaymentDate, NOW())` +DROP PROCEDURE p1; +# # Bug#52159 returning time type from function and empty left join causes debug assertion # CREATE FUNCTION f1() RETURNS TIME RETURN 1; @@ -3246,5 +3272,20 @@ maketime(`a`,`a`,`a`) DROP TABLE t1; SET sql_mode=default; # +# Bug#11764503 (Bug#57341) Query in EXPLAIN EXTENDED shows wrong characters +# +SET NAMES utf8; +EXPLAIN EXTENDED SELECT 'abcdó', _latin1'abcdó', _utf8'abcdó'; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select 'abcdó' AS `abcdó`,_latin1'abcd\xC3\xB3' AS `abcdó`,_utf8'abcd\xC3\xB3' AS `abcdó` +SET NAMES latin1; +EXPLAIN EXTENDED SELECT 'abcdó', _latin1'abcdó', _utf8'abcdó'; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select 'abcdó' AS `abcdó`,_latin1'abcd\xC3\xB3' AS `abcdó`,_utf8'abcd\xC3\xB3' AS `abcdó` +# # End of 5.5 tests # diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index e41544f2197..e687822c235 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -4060,6 +4060,32 @@ HEX(DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE)) AS fie field_str1 field1_str2 field_date field_datetime 0032003000300037002D00300038002D00300032002000320033003A00350039003A00300030 0032003000300037002D00300038002D00300033002000310037003A00330032003A00300030 323030372D30382D3032 323030372D30382D30332031373A33323A3030 # +# Bug#11926811 / Bug#60625 Illegal mix of collations +# +SELECT @@collation_connection; +@@collation_connection +ucs2_general_ci +CREATE PROCEDURE p1() +BEGIN +DECLARE v_LastPaymentDate DATETIME DEFAULT NULL; +SELECT v_LastPaymentDate < NOW(); +EXPLAIN EXTENDED SELECT v_LastPaymentDate < NOW(); +SHOW WARNINGS; +EXPLAIN EXTENDED SELECT CONCAT(v_LastPaymentDate, NOW()); +END// +CALL p1; +v_LastPaymentDate < NOW() +NULL +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Level Code Message +Note 1003 select (v_LastPaymentDate@0 < now()) AS `v_LastPaymentDate < NOW()` +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select concat(convert(v_LastPaymentDate@0 using ucs2),convert(now() using ucs2)) AS `CONCAT(v_LastPaymentDate, NOW())` +DROP PROCEDURE p1; +# # Bug#52159 returning time type from function and empty left join causes debug assertion # CREATE FUNCTION f1() RETURNS TIME RETURN 1; diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index ababfe51621..db981fbe298 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -4938,6 +4938,32 @@ HEX(DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE)) AS fie field_str1 field1_str2 field_date field_datetime 323030372D30382D30322032333A35393A3030 323030372D30382D30332031373A33323A3030 323030372D30382D3032 323030372D30382D30332031373A33323A3030 # +# Bug#11926811 / Bug#60625 Illegal mix of collations +# +SELECT @@collation_connection; +@@collation_connection +utf8_general_ci +CREATE PROCEDURE p1() +BEGIN +DECLARE v_LastPaymentDate DATETIME DEFAULT NULL; +SELECT v_LastPaymentDate < NOW(); +EXPLAIN EXTENDED SELECT v_LastPaymentDate < NOW(); +SHOW WARNINGS; +EXPLAIN EXTENDED SELECT CONCAT(v_LastPaymentDate, NOW()); +END// +CALL p1; +v_LastPaymentDate < NOW() +NULL +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Level Code Message +Note 1003 select (v_LastPaymentDate@0 < now()) AS `v_LastPaymentDate < NOW()` +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select concat(convert(v_LastPaymentDate@0 using utf8),now()) AS `CONCAT(v_LastPaymentDate, NOW())` +DROP PROCEDURE p1; +# # Bug#52159 returning time type from function and empty left join causes debug assertion # CREATE FUNCTION f1() RETURNS TIME RETURN 1; @@ -4969,5 +4995,20 @@ GROUP BY INSERT('', t2.a, t1.a, (@@global.max_binlog_size)); ERROR 23000: Duplicate entry '107374182410737418241' for key 'group_key' DROP TABLE t1; # +# Bug#11764503 (Bug#57341) Query in EXPLAIN EXTENDED shows wrong characters +# +SET NAMES latin1; +EXPLAIN EXTENDED SELECT 'abcdÃÂÃÄÅ', _latin1'abcdÃÂÃÄÅ', _utf8'abcdÃÂÃÄÅ' AS u; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select 'abcdÃÂÃÄÅ' AS `abcdÃÂÃÄÅ`,_latin1'abcd\xC3\x81\xC3\x82\xC3\x83\xC3\x84\xC3\x85' AS `abcdÃÂÃÄÅ`,_utf8'abcd\xC3\x81\xC3\x82\xC3\x83\xC3\x84\xC3\x85' AS `u` +SET NAMES utf8; +EXPLAIN EXTENDED SELECT 'abcdÃÂÃÄÅ', _latin1'abcdÃÂÃÄÅ', _utf8'abcdÃÂÃÄÅ'; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select 'abcdÃÂÃÄÅ' AS `abcdÃÂÃÄÅ`,_latin1'abcd\xC3\x81\xC3\x82\xC3\x83\xC3\x84\xC3\x85' AS `abcdÃÂÂÃÄÅ`,_utf8'abcd\xC3\x81\xC3\x82\xC3\x83\xC3\x84\xC3\x85' AS `abcdÃÂÃÄÅ` +# # End of 5.5 tests # diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result index a27c7dc18ee..b0ca5daaea2 100644 --- a/mysql-test/r/events_bugs.result +++ b/mysql-test/r/events_bugs.result @@ -747,6 +747,15 @@ event_name originator ev1 4294967295 DROP EVENT ev1; SET GLOBAL server_id = @old_server_id; +CREATE DATABASE event_test12; +USE event_test12; +CREATE EVENT ev1 ON SCHEDULE EVERY 1 DAY DO SELECT 1; +CREATE DATABASE event_test1; +USE event_test1; +SHOW EVENTS; +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +DROP DATABASE event_test1; +DROP DATABASE event_test12; DROP DATABASE events_test; SET GLOBAL event_scheduler= 'ON'; SET @@global.concurrent_insert= @concurrent_insert; diff --git a/mysql-test/r/flush.result b/mysql-test/r/flush.result index b1e2e48eca8..bbfea2dade8 100644 --- a/mysql-test/r/flush.result +++ b/mysql-test/r/flush.result @@ -451,3 +451,18 @@ unlock tables; handler t1 close; # Cleanup. drop tables t1, t2; +# +# Bug#57649 FLUSH TABLES under FLUSH TABLES <list> WITH READ LOCK leads +# to assert failure. +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a INT); +FLUSH TABLES t1 WITH READ LOCK; +FLUSH TABLES; +ERROR HY000: Table 't1' was locked with a READ lock and can't be updated +CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a= 1; +ERROR HY000: Table 't1' was locked with a READ lock and can't be updated +ALTER TABLE t1 COMMENT 'test'; +ERROR HY000: Table 't1' was locked with a READ lock and can't be updated +UNLOCK TABLES; +DROP TABLE t1; diff --git a/mysql-test/r/flush_read_lock.result b/mysql-test/r/flush_read_lock.result index 2b1071a92b2..cd7083405bf 100644 --- a/mysql-test/r/flush_read_lock.result +++ b/mysql-test/r/flush_read_lock.result @@ -431,6 +431,7 @@ Success: Was able to run 'execute stmt1' under FTWRL. Success: Was able to run 'execute stmt1' with FTWRL active in another connection. Success: Was able to run FTWRL while 'execute stmt1' was active in another connection. deallocate prepare stmt1; +call mtr.add_suppression("Slave SQL.*Can.t execute the query because you have a conflicting read lock., Error_code: 1223"); # # 9.2.b) EXECUTE for statement which is incompatible with FTWRL # should be also incompatible. diff --git a/mysql-test/r/func_analyse.result b/mysql-test/r/func_analyse.result index 1820782d2f8..f82439090f6 100644 --- a/mysql-test/r/func_analyse.result +++ b/mysql-test/r/func_analyse.result @@ -123,3 +123,29 @@ CREATE TABLE t2 SELECT 1 FROM t1, t1 t3 GROUP BY t3.a PROCEDURE ANALYSE(); ERROR HY000: Incorrect usage of PROCEDURE and non-SELECT DROP TABLE t1; End of 5.0 tests +# +# Bug#11765202: Dbug_violation_helper::~Dbug_violation_helper(): Assertion `!_entered' failed. +# +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1 (a VARCHAR(2) CHARSET UTF8 NOT NULL); +INSERT INTO t1 VALUES ('e'),('e'),('e-'); +SELECT * FROM t1 PROCEDURE ANALYSE(); +Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype +test.t1.a e e- 1 2 0 0 1.3333 NULL ENUM('e','e-') NOT NULL +DROP TABLE t1; +# +# Bug#11756242 48137: PROCEDURE ANALYSE() LEAKS MEMORY WHEN RETURNING NULL +# +CREATE TABLE t1(f1 INT) ENGINE=MYISAM; +CREATE TABLE t2(f2 INT) ENGINE=INNODB; +INSERT INTO t2 VALUES (1); +SELECT DISTINCTROW f1 FROM t1 NATURAL RIGHT OUTER JOIN t2 PROCEDURE ANALYSE(); +Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype +test.t1.f1 NULL NULL 0 0 0 1 0.0 0.0 CHAR(0) +SELECT * FROM t2 LIMIT 1 PROCEDURE ANALYSE(); +Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype +test.t2.f2 1 1 1 1 0 0 1.0000 0.0000 ENUM('1') NOT NULL +DROP TABLE t1, t2; +End of 5.1 tests diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index 2716a06b22f..b299ba69a91 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -1737,6 +1737,26 @@ SELECT MIN(GET_LOCK('aaaaaaaaaaaaaaaaa',0) / '0b11111111111111111111111111111111 SELECT MIN(GET_LOCK('aaaaaaaaaaaaaaaaa',0) / '0b1111111111111111111111111111111111111111111111111111111111111111111111111' ^ (RAND())); SELECT RELEASE_LOCK('aaaaaaaaaaaaaaaaa'); # +# Bug #11766094 - 59132: MIN() AND MAX() REMOVE UNSIGNEDNESS +# +CREATE TABLE t1 (a BIGINT UNSIGNED); +INSERT INTO t1 VALUES (18446668621106209655); +SELECT MAX(LENGTH(a)), LENGTH(MAX(a)), MIN(a), MAX(a), CONCAT(MIN(a)), CONCAT(MAX(a)) FROM t1; +MAX(LENGTH(a)) LENGTH(MAX(a)) MIN(a) MAX(a) CONCAT(MIN(a)) CONCAT(MAX(a)) +20 20 18446668621106209655 18446668621106209655 18446668621106209655 18446668621106209655 +DROP TABLE t1; +# +# Bug #11766270 59343: YEAR(4): INCORRECT RESULT AND VALGRIND WARNINGS WITH MIN/MAX, UNION +# +CREATE TABLE t1(f1 YEAR(4)); +INSERT INTO t1 VALUES (0000),(2001); +(SELECT MAX(f1) FROM t1) UNION (SELECT MAX(f1) FROM t1); +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def MAX(f1) MAX(f1) 13 4 4 Y 32864 0 63 +MAX(f1) +2001 +DROP TABLE t1; +# End of 5.1 tests # # Bug#52123 Assertion failed: aggregator == aggr->Aggrtype(), diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result index fdeec2755ca..0b6117581f3 100644 --- a/mysql-test/r/func_in.result +++ b/mysql-test/r/func_in.result @@ -770,4 +770,10 @@ CASE a WHEN a THEN a END NULL DROP TABLE t1; # +# Bug #11766212 59270: NOT IN (YEAR( ... ), ... ) PRODUCES MANY VALGRIND WARNINGS +# +SELECT 1 IN (YEAR(FROM_UNIXTIME(NULL)) ,1); +1 IN (YEAR(FROM_UNIXTIME(NULL)) ,1) +1 +# End of 5.1 tests diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index 3149a2a3344..525ee0dc506 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -514,6 +514,13 @@ t1 CREATE TABLE `t1` ( `C` varchar(23) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; +# +# Bug#11764994 57900: CREATE TABLE .. SELECT ASSERTS SCALE >= 0 && PRECISION > 0 && SCALE <= PR +# +CREATE TABLE t1 SELECT CEIL(LINESTRINGFROMWKB(1) DIV NULL); +DROP TABLE t1; +CREATE TABLE t1 SELECT FLOOR(LINESTRINGFROMWKB(1) DIV NULL); +DROP TABLE t1; End of 5.1 tests # # Bug #8433: Overflow must be an error @@ -656,3 +663,11 @@ Warning 1366 Incorrect decimal value: '' for column '' at row -1 SELECT 1 div null; 1 div null NULL +# +# Bug #11792200 - DIVIDING LARGE NUMBERS CAUSES STACK CORRUPTIONS +# +select (1.175494351E-37 div 1.7976931348623157E+308); +(1.175494351E-37 div 1.7976931348623157E+308) +0 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '' diff --git a/mysql-test/r/func_set.result b/mysql-test/r/func_set.result index 14ebc8203ec..ba9500bff46 100644 --- a/mysql-test/r/func_set.result +++ b/mysql-test/r/func_set.result @@ -159,3 +159,45 @@ SELECT CONVERT( a USING latin1 ) FROM t2; CONVERT( a USING latin1 ) DROP TABLE t1, t2; +# +# BUG#59405: FIND_IN_SET won't work normaly after upgrade from 5.1 to 5.5 +# +CREATE TABLE t1(days set('1','2','3','4','5','6','7')); +INSERT INTO t1 VALUES('1,2,3,4,5,6,7'), (NULL), ('1,2,3,4,5,6,7'); + +SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), days); +days +1,2,3,4,5,6,7 +1,2,3,4,5,6,7 +SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), days) IS UNKNOWN; +days +NULL +SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), NULL); +days +SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), NULL) IS UNKNOWN; +days +1,2,3,4,5,6,7 +NULL +1,2,3,4,5,6,7 +SELECT * FROM t1 WHERE FIND_IN_SET(7, days); +days +1,2,3,4,5,6,7 +1,2,3,4,5,6,7 +SELECT * FROM t1 WHERE FIND_IN_SET(8, days); +days +SELECT * FROM t1 WHERE FIND_IN_SET(NULL, days); +days +SELECT * FROM t1 WHERE FIND_IN_SET(NULL, days) IS UNKNOWN; +days +1,2,3,4,5,6,7 +NULL +1,2,3,4,5,6,7 +SELECT * FROM t1 WHERE FIND_IN_SET(NULL, NULL); +days +SELECT * FROM t1 WHERE FIND_IN_SET(NULL, NULL) IS UNKNOWN; +days +1,2,3,4,5,6,7 +NULL +1,2,3,4,5,6,7 + +DROP TABLE t1; diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index bbc86ddeda0..43e37dab9d5 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -1347,6 +1347,36 @@ Warning 1292 Truncated incorrect time value: '' Warning 1292 Truncated incorrect time value: '' Warning 1292 Truncated incorrect time value: '' DROP TABLE t1; +# +# Bug#11766112 59151:UNINITIALIZED VALUES IN EXTRACT_DATE_TIME WITH STR_TO_DATE(SPACE(..) ... +# +SELECT STR_TO_DATE(SPACE(2),'1'); +STR_TO_DATE(SPACE(2),'1') +0000-00-00 +# +# Bug#11765216 58154: UNINITIALIZED VARIABLE FORMAT IN STR_TO_DATE FUNCTION +# +SET GLOBAL SQL_MODE=''; +DO STR_TO_DATE((''), FROM_DAYS(@@GLOBAL.SQL_MODE)); +SET GLOBAL SQL_MODE=DEFAULT; +# +# Bug#11766087 59125: VALGRIND UNINITIALISED VALUE WARNING IN ULL2DEC, LONGLONG2DECIMAL +# +SELECT FORMAT(YEAR(STR_TO_DATE('',GET_FORMAT(TIME,''))),1); +FORMAT(YEAR(STR_TO_DATE('',GET_FORMAT(TIME,''))),1) +NULL +# +# Bug#11766126 59166: ANOTHER DATETIME VALGRIND UNINITIALIZED WARNING +# +SELECT CAST((MONTH(FROM_UNIXTIME(@@GLOBAL.SQL_MODE))) AS BINARY(1025)); +CAST((MONTH(FROM_UNIXTIME(@@GLOBAL.SQL_MODE))) AS BINARY(1025)) +NULL +# +# Bug#11766124 59164: VALGRIND: UNINITIALIZED VALUE IN NUMBER_TO_DATETIME +# +SELECT ADDDATE(MONTH(FROM_UNIXTIME(NULL)),INTERVAL 1 HOUR); +ADDDATE(MONTH(FROM_UNIXTIME(NULL)),INTERVAL 1 HOUR) +NULL End of 5.1 tests # # Bug#57039: constant subtime expression returns incorrect result. @@ -1376,3 +1406,15 @@ NULL 1 NULL SET storage_engine=NULL; ERROR 42000: Variable 'storage_engine' can't be set to the value of 'NULL' # +# Bug #59686 crash in String::copy() with time data type +# +SELECT min(timestampadd(month, 1>'', from_days('%Z'))); +min(timestampadd(month, 1>'', from_days('%Z'))) +NULL +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '%Z' +create table t1(a time); +insert into t1 values ('00:00:00'),('00:01:00'); +select 1 from t1 where 1 < some (select cast(a as datetime) from t1); +1 +drop table t1; diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 38f09d3b759..7603e4b1b1c 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -54,7 +54,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA' @@ -125,7 +125,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 @@ -172,7 +172,7 @@ max_updates 20 max_connections 30 max_user_connections 0 plugin -authentication_string +authentication_string NULL show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 20 MAX_CONNECTIONS_PER_HOUR 30 @@ -284,7 +284,6 @@ Warnings: Warning 1364 Field 'ssl_cipher' doesn't have a default value Warning 1364 Field 'x509_issuer' doesn't have a default value Warning 1364 Field 'x509_subject' doesn't have a default value -Warning 1364 Field 'authentication_string' doesn't have a default value insert into mysql.db (host, db, user, select_priv) values ('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y'); alter table mysql.db order by db asc; @@ -1452,6 +1451,199 @@ DROP DATABASE mysqltest2; DROP USER testuser@localhost; use test; +# +# Test for bug #36544 "DROP USER does not remove stored function +# privileges". +# +create database mysqltest1; +create function mysqltest1.f1() returns int return 0; +create procedure mysqltest1.p1() begin end; +# +# 1) Check that DROP USER properly removes privileges on both +# stored procedures and functions. +# +create user mysqluser1@localhost; +grant execute on function mysqltest1.f1 to mysqluser1@localhost; +grant execute on procedure mysqltest1.p1 to mysqluser1@localhost; +# Quick test that granted privileges are properly reflected +# in privilege tables and in in-memory structures. +show grants for mysqluser1@localhost; +Grants for mysqluser1@localhost +GRANT USAGE ON *.* TO 'mysqluser1'@'localhost' +GRANT EXECUTE ON PROCEDURE `mysqltest1`.`p1` TO 'mysqluser1'@'localhost' +GRANT EXECUTE ON FUNCTION `mysqltest1`.`f1` TO 'mysqluser1'@'localhost' +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost'; +db routine_name routine_type proc_priv +mysqltest1 f1 FUNCTION Execute +mysqltest1 p1 PROCEDURE Execute +# +# Create connection 'bug_36544_con1' as 'mysqluser1@localhost'. +call mysqltest1.p1(); +select mysqltest1.f1(); +mysqltest1.f1() +0 +# +# Switch to connection 'default'. +drop user mysqluser1@localhost; +# +# Test that dropping of user is properly reflected in +# both privilege tables and in in-memory structures. +# +# Switch to connection 'bug36544_con1'. +# The connection cold be alive but should not be able to +# access to any of the stored routines. +call mysqltest1.p1(); +ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.p1' +select mysqltest1.f1(); +ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.f1' +# +# Switch to connection 'default'. +# +# Now create user with the same name and check that he +# has not inherited privileges. +create user mysqluser1@localhost; +show grants for mysqluser1@localhost; +Grants for mysqluser1@localhost +GRANT USAGE ON *.* TO 'mysqluser1'@'localhost' +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost'; +db routine_name routine_type proc_priv +# +# Create connection 'bug_36544_con2' as 'mysqluser1@localhost'. +# Newly created user should not be able to access any of the routines. +call mysqltest1.p1(); +ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.p1' +select mysqltest1.f1(); +ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.f1' +# +# Switch to connection 'default'. +# +# 2) Check that RENAME USER properly updates privileges on both +# stored procedures and functions. +# +grant execute on function mysqltest1.f1 to mysqluser1@localhost; +grant execute on procedure mysqltest1.p1 to mysqluser1@localhost; +# +# Create one more user to make in-memory hashes non-trivial. +# User names 'mysqluser11' and 'mysqluser10' were selected +# to trigger bug discovered during code inspection. +create user mysqluser11@localhost; +grant execute on function mysqltest1.f1 to mysqluser11@localhost; +grant execute on procedure mysqltest1.p1 to mysqluser11@localhost; +# Also create a couple of tables to test for another bug +# discovered during code inspection (again table names were +# chosen especially to trigger the bug). +create table mysqltest1.t11 (i int); +create table mysqltest1.t22 (i int); +grant select on mysqltest1.t22 to mysqluser1@localhost; +grant select on mysqltest1.t11 to mysqluser1@localhost; +# Quick test that granted privileges are properly reflected +# in privilege tables and in in-memory structures. +show grants for mysqluser1@localhost; +Grants for mysqluser1@localhost +GRANT USAGE ON *.* TO 'mysqluser1'@'localhost' +GRANT SELECT ON `mysqltest1`.`t11` TO 'mysqluser1'@'localhost' +GRANT SELECT ON `mysqltest1`.`t22` TO 'mysqluser1'@'localhost' +GRANT EXECUTE ON PROCEDURE `mysqltest1`.`p1` TO 'mysqluser1'@'localhost' +GRANT EXECUTE ON FUNCTION `mysqltest1`.`f1` TO 'mysqluser1'@'localhost' +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost'; +db routine_name routine_type proc_priv +mysqltest1 f1 FUNCTION Execute +mysqltest1 p1 PROCEDURE Execute +select db, table_name, table_priv from mysql.tables_priv where user='mysqluser1' and host='localhost'; +db table_name table_priv +mysqltest1 t11 Select +mysqltest1 t22 Select +# +# Switch to connection 'bug36544_con2'. +call mysqltest1.p1(); +select mysqltest1.f1(); +mysqltest1.f1() +0 +select * from mysqltest1.t11; +i +select * from mysqltest1.t22; +i +# +# Switch to connection 'default'. +rename user mysqluser1@localhost to mysqluser10@localhost; +# +# Test that there are no privileges left for mysqluser1. +# +# Switch to connection 'bug36544_con2'. +# The connection cold be alive but should not be able to +# access to any of the stored routines or tables. +call mysqltest1.p1(); +ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.p1' +select mysqltest1.f1(); +ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.f1' +select * from mysqltest1.t11; +ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 't11' +select * from mysqltest1.t22; +ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 't22' +# +# Switch to connection 'default'. +# +# Now create user with the old name and check that he +# has not inherited privileges. +create user mysqluser1@localhost; +show grants for mysqluser1@localhost; +Grants for mysqluser1@localhost +GRANT USAGE ON *.* TO 'mysqluser1'@'localhost' +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost'; +db routine_name routine_type proc_priv +select db, table_name, table_priv from mysql.tables_priv where user='mysqluser1' and host='localhost'; +db table_name table_priv +# +# Create connection 'bug_36544_con3' as 'mysqluser1@localhost'. +# Newly created user should not be able to access to any of the +# stored routines or tables. +call mysqltest1.p1(); +ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.p1' +select mysqltest1.f1(); +ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.f1' +select * from mysqltest1.t11; +ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 't11' +select * from mysqltest1.t22; +ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 't22' +# +# Switch to connection 'default'. +# +# Now check that privileges became associated with a new user +# name - mysqluser10. +# +show grants for mysqluser10@localhost; +Grants for mysqluser10@localhost +GRANT USAGE ON *.* TO 'mysqluser10'@'localhost' +GRANT SELECT ON `mysqltest1`.`t22` TO 'mysqluser10'@'localhost' +GRANT SELECT ON `mysqltest1`.`t11` TO 'mysqluser10'@'localhost' +GRANT EXECUTE ON PROCEDURE `mysqltest1`.`p1` TO 'mysqluser10'@'localhost' +GRANT EXECUTE ON FUNCTION `mysqltest1`.`f1` TO 'mysqluser10'@'localhost' +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser10' and host='localhost'; +db routine_name routine_type proc_priv +mysqltest1 f1 FUNCTION Execute +mysqltest1 p1 PROCEDURE Execute +select db, table_name, table_priv from mysql.tables_priv where user='mysqluser10' and host='localhost'; +db table_name table_priv +mysqltest1 t11 Select +mysqltest1 t22 Select +# +# Create connection 'bug_36544_con4' as 'mysqluser10@localhost'. +call mysqltest1.p1(); +select mysqltest1.f1(); +mysqltest1.f1() +0 +select * from mysqltest1.t11; +i +select * from mysqltest1.t22; +i +# +# Switch to connection 'default'. +# +# Clean-up. +drop user mysqluser1@localhost; +drop user mysqluser10@localhost; +drop user mysqluser11@localhost; +drop database mysqltest1; End of 5.0 tests set names utf8; grant select on test.* to юзер_юзер@localhost; @@ -1546,11 +1738,7 @@ fn2() 2 DROP USER 'userbug33464'@'localhost'; DROP FUNCTION fn1; -Warnings: -Warning 1403 There is no such grant defined for user 'userbug33464' on host 'localhost' on routine 'fn1' DROP FUNCTION fn2; -Warnings: -Warning 1403 There is no such grant defined for user 'userbug33464' on host 'localhost' on routine 'fn2' DROP PROCEDURE sp3; DROP USER 'userbug33464'@'localhost'; USE test; diff --git a/mysql-test/r/grant2.result b/mysql-test/r/grant2.result index b5e82794658..70388b06daf 100644 --- a/mysql-test/r/grant2.result +++ b/mysql-test/r/grant2.result @@ -287,7 +287,6 @@ Warnings: Warning 1364 Field 'ssl_cipher' doesn't have a default value Warning 1364 Field 'x509_issuer' doesn't have a default value Warning 1364 Field 'x509_subject' doesn't have a default value -Warning 1364 Field 'authentication_string' doesn't have a default value create user mysqltest_A@'%'; rename user mysqltest_B@'%' to mysqltest_C@'%'; drop user mysqltest_C@'%'; @@ -355,7 +354,6 @@ Warnings: Warning 1364 Field 'ssl_cipher' doesn't have a default value Warning 1364 Field 'x509_issuer' doesn't have a default value Warning 1364 Field 'x509_subject' doesn't have a default value -Warning 1364 Field 'authentication_string' doesn't have a default value INSERT INTO mysql.db (host, db, user, select_priv) VALUES ('%','TESTDB','mysqltest_1','Y'); FLUSH PRIVILEGES; diff --git a/mysql-test/r/innodb_mysql_lock.result b/mysql-test/r/innodb_mysql_lock.result index bf1c3a89f40..cd9487721b6 100644 --- a/mysql-test/r/innodb_mysql_lock.result +++ b/mysql-test/r/innodb_mysql_lock.result @@ -148,3 +148,25 @@ COMMIT; # Connection default DROP TABLE t1, t2; DROP VIEW v1; +# +# Bug#11815600 [ERROR] INNODB COULD NOT FIND INDEX PRIMARY +# KEY NO 0 FOR TABLE IN ERROR LOG +# +DROP TABLE IF EXISTS t1; +# Connection default +CREATE TABLE t1 (id INT PRIMARY KEY, value INT) ENGINE = InnoDB; +INSERT INTO t1 VALUES (1, 12345); +START TRANSACTION; +SELECT * FROM t1; +id value +1 12345 +# Connection con1 +SET lock_wait_timeout=1; +ALTER TABLE t1 ADD INDEX idx(value); +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +# Connection default +SELECT * FROM t1; +id value +1 12345 +COMMIT; +DROP TABLE t1; diff --git a/mysql-test/r/innodb_mysql_sync.result b/mysql-test/r/innodb_mysql_sync.result index 58948835f66..71f567a4ad2 100644 --- a/mysql-test/r/innodb_mysql_sync.result +++ b/mysql-test/r/innodb_mysql_sync.result @@ -94,64 +94,6 @@ SET DEBUG_SYNC= 'RESET'; # Bug#42230 during add index, cannot do queries on storage engines # that implement add_index # -DROP DATABASE IF EXISTS db1; -DROP TABLE IF EXISTS t1; -# Test 1: Secondary index, should not block reads (original test case). -# Connection default -CREATE DATABASE db1; -CREATE TABLE db1.t1(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, value INT) engine=innodb; -INSERT INTO db1.t1(value) VALUES (1), (2); -SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; -# Sending: -ALTER TABLE db1.t1 ADD INDEX(value); -# Connection con1 -SET DEBUG_SYNC= "now WAIT_FOR manage"; -USE db1; -SELECT * FROM t1; -id value -1 1 -2 2 -SET DEBUG_SYNC= "now SIGNAL query"; -# Connection default -# Reaping: ALTER TABLE db1.t1 ADD INDEX(value) -DROP DATABASE db1; -# Test 2: Primary index (implicit), should block reads. -CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL) engine=innodb; -SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; -# Sending: -ALTER TABLE t1 ADD UNIQUE INDEX(a); -# Connection con1 -SET DEBUG_SYNC= "now WAIT_FOR manage"; -USE test; -# Sending: -SELECT * FROM t1; -# Connection con2 -# Waiting for SELECT to be blocked by the metadata lock on t1 -SET DEBUG_SYNC= "now SIGNAL query"; -# Connection default -# Reaping: ALTER TABLE t1 ADD UNIQUE INDEX(a) -# Connection con1 -# Reaping: SELECT * FROM t1 -a b -# Test 3: Primary index (explicit), should block reads. -# Connection default -ALTER TABLE t1 DROP INDEX a; -SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; -# Sending: -ALTER TABLE t1 ADD PRIMARY KEY (a); -# Connection con1 -SET DEBUG_SYNC= "now WAIT_FOR manage"; -# Sending: -SELECT * FROM t1; -# Connection con2 -# Waiting for SELECT to be blocked by the metadata lock on t1 -SET DEBUG_SYNC= "now SIGNAL query"; -# Connection default -# Reaping: ALTER TABLE t1 ADD PRIMARY KEY (a) -# Connection con1 -# Reaping: SELECT * FROM t1 -a b -# Test 4: Secondary unique index, should not block reads. -# Connection default -SET DEBUG_SYNC= "RESET"; -DROP TABLE t1; +# +# DISABLED due to Bug#11815600 +# diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result index 1c59f41cfc0..78d169230a3 100644 --- a/mysql-test/r/loaddata.result +++ b/mysql-test/r/loaddata.result @@ -532,4 +532,11 @@ a 0 1 DROP TABLE t1; +# +# Bug#11765139 58069: LOAD DATA INFILE: VALGRIND REPORTS INVALID MEMORY READS AND WRITES WITH U +# +CREATE TABLE t1(f1 INT); +SELECT 0xE1BB30 INTO OUTFILE 't1.dat'; +LOAD DATA INFILE 't1.dat' IGNORE INTO TABLE t1 CHARACTER SET utf8; +DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/r/lowercase_table2.result b/mysql-test/r/lowercase_table2.result index caee7a7662b..abd16641b56 100644 --- a/mysql-test/r/lowercase_table2.result +++ b/mysql-test/r/lowercase_table2.result @@ -175,6 +175,35 @@ TABLE_SCHEMA TABLE_NAME mysqltest_lc2 myUC use test; drop database mysqltest_LC2; +# +# Bug #11758687: 50924: object names not resolved correctly +# on lctn2 systems +# +CREATE DATABASE BUP_XPFM_COMPAT_DB2; +CREATE TABLE BUP_XPFM_COMPAT_DB2.TABLE2 (c13 INT) DEFAULT CHARSET latin1; +CREATE TABLE BUP_XPFM_COMPAT_DB2.table1 (c13 INT) DEFAULT CHARSET latin1; +CREATE TABLE bup_xpfm_compat_db2.table3 (c13 INT) DEFAULT CHARSET latin1; +CREATE TRIGGER BUP_XPFM_COMPAT_DB2.trigger1 AFTER INSERT +ON BUP_XPFM_COMPAT_DB2.table1 FOR EACH ROW +update BUP_XPFM_COMPAT_DB2.table1 set c13=12; +| +CREATE TRIGGER BUP_XPFM_COMPAT_DB2.TRIGGER2 AFTER INSERT +ON BUP_XPFM_COMPAT_DB2.TABLE2 FOR EACH ROW +update BUP_XPFM_COMPAT_DB2.table1 set c13=12; +| +CREATE TRIGGER BUP_XPFM_COMPAT_DB2.TrigGer3 AFTER INSERT +ON BUP_XPFM_COMPAT_DB2.TaBle3 FOR EACH ROW +update BUP_XPFM_COMPAT_DB2.table1 set c13=12; +| +SELECT trigger_schema, trigger_name, event_object_table FROM +INFORMATION_SCHEMA.TRIGGERS +WHERE trigger_schema COLLATE utf8_bin = 'BUP_XPFM_COMPAT_DB2' + ORDER BY trigger_schema, trigger_name; +trigger_schema trigger_name event_object_table +BUP_XPFM_COMPAT_DB2 trigger1 table1 +BUP_XPFM_COMPAT_DB2 TRIGGER2 TABLE2 +BUP_XPFM_COMPAT_DB2 TrigGer3 table3 +DROP DATABASE BUP_XPFM_COMPAT_DB2; # End of 5.1 tests # # Test for bug #44738 "fill_schema_table_from_frm() opens tables without diff --git a/mysql-test/r/mysqladmin.result b/mysql-test/r/mysqladmin.result index 748152bffcc..8a9b009946b 100644 --- a/mysql-test/r/mysqladmin.result +++ b/mysql-test/r/mysqladmin.result @@ -10,3 +10,10 @@ mysqld is alive # Displaying the output : mysqld is alive mysqld is alive +# +# BUG#11766184 - 59234: cmdline clients crash --defaults-extra-file +# with no .cnf or .ini extension. +# +# Creating an empty file 'cnf_file' +# Using --defaults-extra-file option with 'cnf_file'. +mysqld is alive diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index 0b9f6db05b8..5a47b6700c0 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -903,3 +903,15 @@ master-bin.000002 # Query # # CREATE DATABASE test1 master-bin.000002 # Query # # use `test1`; CREATE TABLE t1(id int) master-bin.000002 # Query # # use `test1`; DROP TABLE `t1` /* generated by server */ master-bin.000002 # Query # # DROP DATABASE test1 +RESET MASTER; +USE test; +CREATE TABLE t1 (a INT); +SET GLOBAL SERVER_ID = 2; +DROP TABLE t1; +FLUSH LOGS; +SHOW TABLES IN test; +Tables_in_test +t1 +SHOW TABLES IN test; +Tables_in_test +SET GLOBAL SERVER_ID = 1; diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result index ef46eba5ccb..42fb1945d8b 100644 --- a/mysql-test/r/mysqlcheck.result +++ b/mysql-test/r/mysqlcheck.result @@ -109,7 +109,7 @@ mysql.time_zone_name Table is already up to date mysql.time_zone_transition Table is already up to date mysql.time_zone_transition_type Table is already up to date mysql.user Table is already up to date -create table t1 (a int); +create table t1 (a int) engine=myisam; create view v1 as select * from t1; test.t1 OK test.t1 Table is already up to date @@ -117,14 +117,14 @@ test.t1 OK test.t1 Table is already up to date drop view v1; drop table t1; -create table `t``1`(a int); -create table `t 1`(a int); +create table `t``1`(a int) engine=myisam; +create table `t 1`(a int) engine=myisam; test.t 1 OK test.t`1 OK drop table `t``1`, `t 1`; create database d_bug25347; use d_bug25347; -create table t_bug25347 (a int); +create table t_bug25347 (a int) engine=myisam; create view v_bug25347 as select * from t_bug25347; insert into t_bug25347 values (1),(2),(3); flush tables; @@ -164,15 +164,15 @@ Table Op Msg_type Msg_text test.v1 check status OK information_schema.routines check note The storage engine for the table doesn't support check drop view v1; -CREATE TABLE t1(a INT); -CREATE TABLE t2(a INT); +CREATE TABLE t1(a INT) engine=myisam; +CREATE TABLE t2(a INT) engine=myisam; test.t1 Error : Incorrect information in file: './test/t1.frm' error : Corrupt test.t2 OK DROP TABLE t1, t2; End of 5.0 tests -create table t1(a int); +create table t1(a int) engine=myisam; create view v1 as select * from t1; show tables; Tables_in_test @@ -192,7 +192,7 @@ v-1 drop view v1, `v-1`; drop table t1; SET NAMES utf8; -CREATE TABLE `#mysql50#@` (a INT); +CREATE TABLE `#mysql50#@` (a INT) engine=myisam; SHOW TABLES; Tables_in_test #mysql50#@ @@ -203,7 +203,7 @@ SHOW TABLES; Tables_in_test @ DROP TABLE `@`; -CREATE TABLE `Ñ` (a INT); +CREATE TABLE `Ñ` (a INT) engine=myisam; SET NAMES DEFAULT; mysqlcheck --default-character-set="latin1" --databases test test.? @@ -216,8 +216,8 @@ DROP TABLE `Ñ`; SET NAMES DEFAULT; CREATE DATABASE `#mysql50#a@b`; USE `#mysql50#a@b`; -CREATE TABLE `#mysql50#c@d` (a INT); -CREATE TABLE t1 (a INT); +CREATE TABLE `#mysql50#c@d` (a INT) engine=myisam; +CREATE TABLE t1 (a INT) engine=myisam; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_SCHEMA="#mysql50#a@b" ORDER BY trigger_name; TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -246,12 +246,12 @@ USE test; # Bug #31821: --all-in-1 and --fix-table-names don't work together # drop table if exists `#mysql50#t1-1`; -create table `#mysql50#t1-1` (a int); +create table `#mysql50#t1-1` (a int) engine=myisam; show tables like 't1-1'; Tables_in_test (t1-1) t1-1 drop table `t1-1`; -create table `#mysql50#t1-1` (a int); +create table `#mysql50#t1-1` (a int) engine=myisam; show tables like 't1-1'; Tables_in_test (t1-1) t1-1 @@ -260,3 +260,67 @@ End of 5.1 tests # # Bug #35269: mysqlcheck behaves different depending on order of parameters # +# +# Bug#11755431 47205: MAP 'REPAIR TABLE' TO RECREATE +ANALYZE FOR +# ENGINES NOT SUPPORTING NATIVE +# +DROP TABLE IF EXISTS bug47205; +# +# Test 1: Check that ALTER TABLE ... rebuilds the table +CREATE TABLE bug47205(a VARCHAR(20) PRIMARY KEY) +DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci engine=innodb; +INSERT INTO bug47205 VALUES ("foobar"); +FLUSH TABLE bug47205; +# Replace the FRM with a 5.0 FRM that will require upgrade +# Should indicate that ALTER TABLE ... FORCE is needed +CHECK TABLE bug47205 FOR UPGRADE; +Table Op Msg_type Msg_text +test.bug47205 check error Table rebuild required. Please do "ALTER TABLE `bug47205` FORCE" or dump/reload to fix it! +# ALTER TABLE ... FORCE should rebuild the table +# and therefore output "affected rows: 1" +ALTER TABLE bug47205 FORCE; +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +# Table should now be ok +CHECK TABLE bug47205 FOR UPGRADE; +Table Op Msg_type Msg_text +test.bug47205 check status OK +DROP TABLE bug47205; +# +# Test 2: InnoDB - REPAIR not supported +CREATE TABLE bug47205(a VARCHAR(20) PRIMARY KEY) +DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci engine=innodb; +FLUSH TABLE bug47205; +# Replace the FRM with a 5.0 FRM that will require upgrade +# Should indicate that ALTER TABLE .. FORCE is needed +CHECK TABLE bug47205 FOR UPGRADE; +Table Op Msg_type Msg_text +test.bug47205 check error Table rebuild required. Please do "ALTER TABLE `bug47205` FORCE" or dump/reload to fix it! +# Running mysqlcheck to check and upgrade +test.bug47205 +error : Table rebuild required. Please do "ALTER TABLE `bug47205` FORCE" or dump/reload to fix it! + +Repairing tables +# Table should now be ok +CHECK TABLE bug47205 FOR UPGRADE; +Table Op Msg_type Msg_text +test.bug47205 check status OK +DROP TABLE bug47205; +# +# Test 3: MyISAM - REPAIR supported +# Use an old FRM that will require upgrade +# Should indicate that REPAIR TABLE is needed +CHECK TABLE bug47205 FOR UPGRADE; +Table Op Msg_type Msg_text +test.bug47205 check error Table upgrade required. Please do "REPAIR TABLE `bug47205`" or dump/reload to fix it! +# Running mysqlcheck to check and upgrade +test.bug47205 +error : Table upgrade required. Please do "REPAIR TABLE `bug47205`" or dump/reload to fix it! + +Repairing tables +test.bug47205 OK +# Table should now be ok +CHECK TABLE bug47205 FOR UPGRADE; +Table Op Msg_type Msg_text +test.bug47205 check status OK +DROP TABLE bug47205; diff --git a/mysql-test/r/mysqld--help-notwin.result b/mysql-test/r/mysqld--help-notwin.result index 6659a291e0b..b4faa833c1b 100644 --- a/mysql-test/r/mysqld--help-notwin.result +++ b/mysql-test/r/mysqld--help-notwin.result @@ -309,6 +309,10 @@ The following options may be given as the first argument: max_join_size records return an error --max-length-for-sort-data=# Max number of bytes in sorted records + --max-long-data-size=# + The maximum BLOB length to send to server from + mysql_send_long_data API. Deprecated option; use + max_allowed_packet instead. --max-prepared-stmt-count=# Maximum number of prepared statements in the server --max-relay-log-size=# @@ -830,6 +834,7 @@ max-error-count 64 max-heap-table-size 16777216 max-join-size 18446744073709551615 max-length-for-sort-data 1024 +max-long-data-size 1048576 max-prepared-stmt-count 16382 max-relay-log-size 0 max-seeks-for-key 18446744073709551615 diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result index 240c29294e2..361d30620f7 100644 --- a/mysql-test/r/mysqld--help-win.result +++ b/mysql-test/r/mysqld--help-win.result @@ -308,6 +308,10 @@ The following options may be given as the first argument: max_join_size records return an error --max-length-for-sort-data=# Max number of bytes in sorted records + --max-long-data-size=# + The maximum BLOB length to send to server from + mysql_send_long_data API. Deprecated option; use + max_allowed_packet instead. --max-prepared-stmt-count=# Maximum number of prepared statements in the server --max-relay-log-size=# @@ -833,6 +837,7 @@ max-error-count 64 max-heap-table-size 16777216 max-join-size 18446744073709551615 max-length-for-sort-data 1024 +max-long-data-size 1048576 max-prepared-stmt-count 16382 max-relay-log-size 0 max-seeks-for-key 18446744073709551615 diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 8972b12abb9..c204947a763 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -4626,6 +4626,39 @@ DELIMITER ; /*!50003 SET collation_connection = @saved_col_connection */ ; ALTER DATABASE `test-database` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; DROP DATABASE `test-database`; +USE `test`; # # End of 5.1 tests # +# +# Verify that two modes can be given in --compatible; +# and are reflected in SET SQL_MODE in the mysqldump output. +# Also verify that a prefix of the mode's name is enough. +# +CREATE TABLE t1 (a INT); +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE IF EXISTS `t1`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +); +/*!40101 SET character_set_client = @saved_cs_client */; + +LOCK TABLES `t1` WRITE; +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +DROP TABLE t1; diff --git a/mysql-test/r/mysqlslap.result b/mysql-test/r/mysqlslap.result index 4cb01490407..abbac76b3b4 100644 --- a/mysql-test/r/mysqlslap.result +++ b/mysql-test/r/mysqlslap.result @@ -225,3 +225,25 @@ DROP SCHEMA IF EXISTS `mysqlslap`; DROP PROCEDURE IF EXISTS p1; CREATE PROCEDURE p1() SELECT 1; DROP PROCEDURE p1; +# +# Bug #11765157 - 58090: mysqlslap drops schema specified in +# create_schema if auto-generate-sql also set. +# +# 'bug58090' database should not be present. +SHOW DATABASES; +Database +information_schema +mtr +mysql +performance_schema +test +# 'bug58090' database should be present. +SHOW DATABASES; +Database +information_schema +bug58090 +mtr +mysql +performance_schema +test +DROP DATABASE bug58090; diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result index f03ab28b484..1e65f889ea0 100644 --- a/mysql-test/r/order_by.result +++ b/mysql-test/r/order_by.result @@ -1429,6 +1429,7 @@ CALL mtr.add_suppression("Out of sort memory"); select * from t1 order by b; ERROR HY001: Out of sort memory, consider increasing server sort buffer size drop table t1; +call mtr.add_suppression("Out of sort memory; increase server sort buffer size"); # # Bug #39844: Query Crash Mysql Server 5.0.67 # diff --git a/mysql-test/r/packet.result b/mysql-test/r/packet.result index ecbb47d4ee0..dcc2c608d0b 100644 --- a/mysql-test/r/packet.result +++ b/mysql-test/r/packet.result @@ -3,6 +3,7 @@ set @net_buffer_length=@@global.net_buffer_length; set global max_allowed_packet=100; Warnings: Warning 1292 Truncated incorrect max_allowed_packet value: '100' +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' set global net_buffer_length=100; Warnings: Warning 1292 Truncated incorrect net_buffer_length value: '100' diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 1d7a08e9a7c..49e7f4a6ec9 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -1,5 +1,43 @@ drop table if exists t1, t2; # +# Bug#59297: Can't find record in 'tablename' on update inner join +# +CREATE TABLE t1 ( +a char(2) NOT NULL, +b char(2) NOT NULL, +c int(10) unsigned NOT NULL, +d varchar(255) DEFAULT NULL, +e varchar(1000) DEFAULT NULL, +PRIMARY KEY (a, b, c), +KEY (a), +KEY (a, b) +) +/*!50100 PARTITION BY KEY (a) +PARTITIONS 20 */; +INSERT INTO t1 (a, b, c, d, e) VALUES +('07', '03', 343, '1', '07_03_343'), +('01', '04', 343, '2', '01_04_343'), +('01', '06', 343, '3', '01_06_343'), +('01', '07', 343, '4', '01_07_343'), +('01', '08', 343, '5', '01_08_343'), +('01', '09', 343, '6', '01_09_343'), +('03', '03', 343, '7', '03_03_343'), +('03', '06', 343, '8', '03_06_343'), +('03', '07', 343, '9', '03_07_343'), +('04', '03', 343, '10', '04_03_343'), +('04', '06', 343, '11', '04_06_343'), +('05', '03', 343, '12', '05_03_343'), +('11', '03', 343, '13', '11_03_343'), +('11', '04', 343, '14', '11_04_343') +; +UPDATE t1 AS A, +(SELECT '03' AS a, '06' AS b, 343 AS c, 'last' AS d) AS B +SET A.e = B.d +WHERE A.a = '03' +AND A.b = '06' +AND A.c = 343; +DROP TABLE t1; +# # Bug#57778: failed primary key add to partitioned innodb table # inconsistent and crashes # diff --git a/mysql-test/r/partition_error.result b/mysql-test/r/partition_error.result index 87eafb234a8..252a6b4386a 100644 --- a/mysql-test/r/partition_error.result +++ b/mysql-test/r/partition_error.result @@ -710,95 +710,8 @@ DROP TABLE t1; CREATE TABLE t1 (c TIMESTAMP) PARTITION BY HASH (c) PARTITIONS 4; ERROR HY000: Field 'c' is of a not allowed type for this type of partitioning +# Moved to partition_myisam, since it was MyISAM specific # Added test with existing TIMESTAMP partitioning (when it was allowed). -CREATE TABLE t1 (a TIMESTAMP) -PARTITION BY HASH (UNIX_TIMESTAMP(a)); -INSERT INTO t1 VALUES ('2000-01-02 03:04:05'); -SELECT * FROM t1; -a -2000-01-02 03:04:05 -FLUSH TABLES; -# replacing t1.frm with TO_DAYS(a) which was allowed earlier. -# Disable warnings, since the result would differ when running with -# --ps-protocol (only for the 'SELECT * FROM t1' statement). -SELECT * FROM t1; -a -2000-01-02 03:04:05 -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (TO_DAYS(a)) */ -INSERT INTO t1 VALUES ('2001-02-03 04:05:06'); -SELECT * FROM t1; -a -2000-01-02 03:04:05 -2001-02-03 04:05:06 -ALTER TABLE t1 ADD PARTITION PARTITIONS 2; -Warnings: -Warning 1486 Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed -ALTER TABLE t1 -PARTITION BY RANGE (TO_DAYS(a)) -(PARTITION p0 VALUES LESS THAN (10000), -PARTITION p1 VALUES LESS THAN (MAXVALUE)); -ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (TO_DAYS(a)) -PARTITIONS 3 */ -CREATE TABLE t2 LIKE t1; -SHOW CREATE TABLE t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (TO_DAYS(a)) -PARTITIONS 3 */ -Warnings: -Warning 1486 Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed -DROP TABLE t2; -CREATE TABLE t2 SELECT * FROM t1; -DROP TABLE t2; -ALTER TABLE t1 PARTITION BY HASH (UNIX_TIMESTAMP(a)); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (UNIX_TIMESTAMP(a)) */ -ALTER TABLE t1 ADD PARTITION PARTITIONS 2; -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY HASH (UNIX_TIMESTAMP(a)) -PARTITIONS 3 */ -SELECT * FROM t1; -a -2000-01-02 03:04:05 -2001-02-03 04:05:06 -DROP TABLE t1; -# -# Bug#49161: Out of memory; restart server and try again (needed 2 bytes) -# -CREATE TABLE t1 (a INT) PARTITION BY HASH (a); -FLUSH TABLES; -CHECK TABLE t1; -Table Op Msg_type Msg_text -test.t1 check Error Failed to read from the .par file -test.t1 check Error Incorrect information in file: './test/t1.frm' -test.t1 check error Corrupt -SELECT * FROM t1; -ERROR HY000: Failed to read from the .par file -# Note that it is currently impossible to drop a partitioned table -# without the .par file -DROP TABLE t1; -ERROR 42S02: Unknown table 't1' # # Bug#49477: Assertion `0' failed in ha_partition.cc:5530 # with temporary table and partitions @@ -831,10 +744,10 @@ Table Create Table t1 CREATE TABLE `t1` ( `id` int(11) DEFAULT NULL, `purchased` date DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=<curr_engine> DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(purchased)) SUBPARTITION BY HASH (TO_DAYS(purchased)) -(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ +(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = <curr_engine>) */ DROP TABLE t1; CREATE TABLE t1 (id INT, purchased DATE) PARTITION BY RANGE(YEAR(purchased)) @@ -852,12 +765,12 @@ Table Create Table t1 CREATE TABLE `t1` ( `id` int(11) DEFAULT NULL, `purchased` date DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=<curr_engine> DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(purchased)) SUBPARTITION BY HASH (TO_DAYS(purchased)) (PARTITION p0 VALUES LESS THAN MAXVALUE - (SUBPARTITION sp0 ENGINE = MyISAM, - SUBPARTITION sp1 ENGINE = MyISAM)) */ + (SUBPARTITION sp0 ENGINE = <curr_engine>, + SUBPARTITION sp1 ENGINE = <curr_engine>)) */ DROP TABLE t1; CREATE TABLE t1 (id INT, purchased DATE) PARTITION BY RANGE(YEAR(purchased)) @@ -872,53 +785,11 @@ Table Create Table t1 CREATE TABLE `t1` ( `id` int(11) DEFAULT NULL, `purchased` date DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=<curr_engine> DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(purchased)) -(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ +(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = <curr_engine>) */ DROP TABLE t1; SET @@sql_mode= @org_mode; -# -# 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' @@ -928,19 +799,6 @@ PARTITION BY KEY (a) PARTITIONS 2; INSERT INTO t1 VALUES (1),(1); ERROR 23000: Duplicate entry '1' for key 'PRIMARY' DROP TABLE t1; -CREATE TABLE t1 (a INT) -PARTITION BY HASH (a) -( PARTITION p0 ENGINE=MyISAM, -PARTITION p1); -ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL -CREATE TABLE t1 (a INT) -PARTITION BY LIST (a) -SUBPARTITION BY HASH (a) -( PARTITION p0 VALUES IN (0) -( SUBPARTITION s0, SUBPARTITION s1 ENGINE=MyISAM, SUBPARTITION s2), -PARTITION p1 VALUES IN (1) -( SUBPARTITION s3 ENGINE=MyISAM, SUBPARTITION s4, SUBPARTITION s5 ENGINE=MyISAM)); -ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL CREATE TABLE t1 ( a int ) diff --git a/mysql-test/r/partition_myisam.result b/mysql-test/r/partition_myisam.result new file mode 100644 index 00000000000..57228c8d9a0 --- /dev/null +++ b/mysql-test/r/partition_myisam.result @@ -0,0 +1,241 @@ +DROP TABLE IF EXISTS t1, t2; +# +# Bug#50036: Inconsistent errors when using TIMESTAMP +# columns/expressions +# Added test with existing TIMESTAMP partitioning (when it was allowed). +CREATE TABLE t1 (a TIMESTAMP) +ENGINE = MyISAM +PARTITION BY HASH (UNIX_TIMESTAMP(a)); +INSERT INTO t1 VALUES ('2000-01-02 03:04:05'); +SELECT * FROM t1; +a +2000-01-02 03:04:05 +FLUSH TABLES; +# replacing t1.frm with TO_DAYS(a) which was allowed earlier. +# Disable warnings, since the result would differ when running with +# --ps-protocol (only for the 'SELECT * FROM t1' statement). +SELECT * FROM t1; +a +2000-01-02 03:04:05 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP +) ENGINE=<curr_engine> DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY HASH (TO_DAYS(a)) */ +INSERT INTO t1 VALUES ('2001-02-03 04:05:06'); +SELECT * FROM t1; +a +2000-01-02 03:04:05 +2001-02-03 04:05:06 +ALTER TABLE t1 ADD PARTITION PARTITIONS 2; +Warnings: +Warning 1486 Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed +ALTER TABLE t1 +PARTITION BY RANGE (TO_DAYS(a)) +(PARTITION p0 VALUES LESS THAN (10000), +PARTITION p1 VALUES LESS THAN (MAXVALUE)); +ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY HASH (TO_DAYS(a)) +PARTITIONS 3 */ +CREATE TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY HASH (TO_DAYS(a)) +PARTITIONS 3 */ +Warnings: +Warning 1486 Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed +DROP TABLE t2; +CREATE TABLE t2 SELECT * FROM t1; +DROP TABLE t2; +ALTER TABLE t1 PARTITION BY HASH (UNIX_TIMESTAMP(a)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY HASH (UNIX_TIMESTAMP(a)) */ +ALTER TABLE t1 ADD PARTITION PARTITIONS 2; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY HASH (UNIX_TIMESTAMP(a)) +PARTITIONS 3 */ +SELECT * FROM t1; +a +2000-01-02 03:04:05 +2001-02-03 04:05:06 +DROP TABLE t1; +# +# Bug#31931: Mix of handlers error message +# +CREATE TABLE t1 (a INT) +PARTITION BY HASH (a) +( PARTITION p0 ENGINE=MyISAM, +PARTITION p1); +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL +CREATE TABLE t1 (a INT) +PARTITION BY LIST (a) +SUBPARTITION BY HASH (a) +( PARTITION p0 VALUES IN (0) +( SUBPARTITION s0, SUBPARTITION s1 ENGINE=MyISAM, SUBPARTITION s2), +PARTITION p1 VALUES IN (1) +( SUBPARTITION s3 ENGINE=MyISAM, SUBPARTITION s4, SUBPARTITION s5 ENGINE=MyISAM)); +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL +# +# Bug#49161: Out of memory; restart server and try again (needed 2 bytes) +# +CREATE TABLE t1 (a INT) +ENGINE = MyISAM +PARTITION BY HASH (a); +FLUSH TABLES; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check Error Failed to read from the .par file +test.t1 check Error Incorrect information in file: './test/t1.frm' +test.t1 check error Corrupt +SELECT * FROM t1; +ERROR HY000: Failed to read from the .par file +# Note that it is currently impossible to drop a partitioned table +# without the .par file +DROP TABLE t1; +ERROR 42S02: Unknown table '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) +ENGINE = MyISAM; +SET INSERT_ID= 13; +INSERT INTO t1 VALUES (NULL); +SET INSERT_ID= 12; +# For transactional engines, 12 will not be inserted, since the failing +# statement is rolled back. +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); +# NOTE: 12 exists only in non transactional engines! +SELECT * FROM t1; +a +12 +13 +14 +DROP TABLE t1; +CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) +ENGINE = MyISAM +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; +# Bug#30102 test +CREATE TABLE t1 (a INT) +ENGINE = MyISAM +PARTITION BY RANGE (a) +(PARTITION p0 VALUES LESS THAN (6), +PARTITION `p1....................` VALUES LESS THAN (9), +PARTITION p2 VALUES LESS THAN MAXVALUE); +# List of files in database `test`, all original t1-files here +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD +t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1.frm +t1.par +INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +# Renaming to a file name where the first partition is 250 chars +# and the second partition is 350 chars +RENAME TABLE t1 TO `t2_new..............................................end`; +Got one of the listed errors +# List of files in database `test`, should not be any t2-files here +# List of files in database `test`, should be all t1-files here +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD +t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1.frm +t1.par +SELECT * FROM t1; +a +1 +10 +2 +3 +4 +5 +6 +7 +8 +9 +# List of files in database `test`, should be all t1-files here +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD +t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1.frm +t1.par +# Renaming to a file name where the first partition is 156 chars +# and the second partition is 256 chars +RENAME TABLE t1 TO `t2_............................_end`; +Got one of the listed errors +# List of files in database `test`, should not be any t2-files here +# List of files in database `test`, should be all t1-files here +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD +t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1.frm +t1.par +SELECT * FROM t1; +a +1 +10 +2 +3 +4 +5 +6 +7 +8 +9 +DROP TABLE t1; +# Should not be any files left here +# End of bug#30102 test. diff --git a/mysql-test/r/partition_not_embedded.result b/mysql-test/r/partition_not_embedded.result deleted file mode 100644 index c942189a956..00000000000 --- a/mysql-test/r/partition_not_embedded.result +++ /dev/null @@ -1,81 +0,0 @@ -DROP TABLE IF EXISTS t1, t2; -# Bug#30102 test -CREATE TABLE t1 (a INT) -PARTITION BY RANGE (a) -(PARTITION p0 VALUES LESS THAN (6), -PARTITION `p1....................` VALUES LESS THAN (9), -PARTITION p2 VALUES LESS THAN MAXVALUE); -# List of files in database `test`, all original t1-files here -t1#P#p0.MYD -t1#P#p0.MYI -t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD -t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI -t1#P#p2.MYD -t1#P#p2.MYI -t1.frm -t1.par -INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); -# Renaming to a file name where the first partition is 250 chars -# and the second partition is 350 chars -RENAME TABLE t1 TO `t2_new..............................................end`; -Got one of the listed errors -# List of files in database `test`, should not be any t2-files here -# List of files in database `test`, should be all t1-files here -t1#P#p0.MYD -t1#P#p0.MYI -t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD -t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI -t1#P#p2.MYD -t1#P#p2.MYI -t1.frm -t1.par -SELECT * FROM t1; -a -1 -10 -2 -3 -4 -5 -6 -7 -8 -9 -# List of files in database `test`, should be all t1-files here -t1#P#p0.MYD -t1#P#p0.MYI -t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD -t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI -t1#P#p2.MYD -t1#P#p2.MYI -t1.frm -t1.par -# Renaming to a file name where the first partition is 156 chars -# and the second partition is 256 chars -RENAME TABLE t1 TO `t2_............................_end`; -Got one of the listed errors -# List of files in database `test`, should not be any t2-files here -# List of files in database `test`, should be all t1-files here -t1#P#p0.MYD -t1#P#p0.MYI -t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD -t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI -t1#P#p2.MYD -t1#P#p2.MYI -t1.frm -t1.par -SELECT * FROM t1; -a -1 -10 -2 -3 -4 -5 -6 -7 -8 -9 -DROP TABLE t1; -# Should not be any files left here -# End of bug#30102 test. diff --git a/mysql-test/r/partition_symlink.result b/mysql-test/r/partition_symlink.result index 60184d11d9c..f26a1642a52 100644 --- a/mysql-test/r/partition_symlink.result +++ b/mysql-test/r/partition_symlink.result @@ -6,11 +6,12 @@ DROP DATABASE IF EXISTS mysqltest2; CREATE USER mysqltest_1@localhost; CREATE DATABASE mysqltest2; USE mysqltest2; -CREATE TABLE t1 (a INT); +CREATE TABLE t1 (a INT) ENGINE = MyISAM; INSERT INTO t1 VALUES (0); # user mysqltest_1: USE test; CREATE TABLE t1 (a INT) +ENGINE = MyISAM PARTITION BY LIST (a) ( PARTITION p0 VALUES IN (0) DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp' @@ -47,6 +48,7 @@ DROP DATABASE mysqltest2; CREATE DATABASE mysqltest2; USE mysqltest2; CREATE TABLE t1 (a INT) +ENGINE = MyISAM PARTITION BY LIST (a) ( PARTITION p0 VALUES IN (0) DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp' @@ -58,6 +60,7 @@ DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp' # user mysqltest_1: USE test; CREATE TABLE t1 (a INT) +ENGINE = MyISAM PARTITION BY LIST (a) ( PARTITION p0 VALUES IN (0) DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp' @@ -68,6 +71,7 @@ DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp' ); Got one of the listed errors CREATE TABLE t1 (a INT) +ENGINE = MyISAM PARTITION BY LIST (a) ( PARTITION p0 VALUES IN (0) DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp' @@ -82,6 +86,7 @@ DROP DATABASE mysqltest2; USE test; DROP USER mysqltest_1@localhost; create table t2 (i int ) +ENGINE = MyISAM partition by range (i) ( partition p01 values less than (1000) @@ -94,6 +99,7 @@ select @@sql_mode; @@sql_mode NO_DIR_IN_CREATE create table t1 (i int ) +ENGINE = MyISAM partition by range (i) ( partition p01 values less than (1000) @@ -113,10 +119,12 @@ t2 CREATE TABLE `t2` ( DROP TABLE t1, t2; set @@sql_mode=@org_mode; create table t1 (a int) +ENGINE = MyISAM partition by key (a) (partition p0 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data'); Got one of the listed errors create table t1 (a int) +ENGINE = MyISAM partition by key (a) (partition p0, partition p1 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data'); diff --git a/mysql-test/r/plugin_auth.result b/mysql-test/r/plugin_auth.result index 7f26cdf447a..91a5d2d8478 100644 --- a/mysql-test/r/plugin_auth.result +++ b/mysql-test/r/plugin_auth.result @@ -342,4 +342,109 @@ select USER(),CURRENT_USER(); USER() CURRENT_USER() uplain@localhost uplain@localhost DROP USER uplain@localhost; +# +# Bug #59038 : mysql.user.authentication_string column +# causes configuration wizard to fail +INSERT INTO mysql.user( +Host, +User, +Password, +Select_priv, +Insert_priv, +Update_priv, +Delete_priv, +Create_priv, +Drop_priv, +Reload_priv, +Shutdown_priv, +Process_priv, +File_priv, +Grant_priv, +References_priv, +Index_priv, +Alter_priv, +Show_db_priv, +Super_priv, +Create_tmp_table_priv, +Lock_tables_priv, +Execute_priv, +Repl_slave_priv, +Repl_client_priv, +/*!50001 +Create_view_priv, +Show_view_priv, +Create_routine_priv, +Alter_routine_priv, +Create_user_priv, +*/ +ssl_type, +ssl_cipher, +x509_issuer, +x509_subject, +max_questions, +max_updates, +max_connections) +VALUES ( +'localhost', +'inserttest', '', +'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', +'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', +/*!50001 'Y', 'Y', 'Y', 'Y', 'Y', */'', '', '', '', '0', '0', '0'); +FLUSH PRIVILEGES; +DROP USER inserttest@localhost; +SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE +COLUMN_NAME IN ('authentication_string', 'plugin') AND +TABLE_NAME='user' AND +TABLE_SCHEMA='mysql' +ORDER BY COLUMN_NAME; +IS_NULLABLE COLUMN_NAME +YES authentication_string +YES plugin +# +# Bug #11936829: diff. between mysql.user (authentication_string) +# in fresh and upgraded 5.5.11 +# +SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS +WHERE TABLE_SCHEMA= 'mysql' AND TABLE_NAME= 'user' AND +COLUMN_NAME IN ('plugin', 'authentication_string') +ORDER BY COLUMN_NAME; +IS_NULLABLE COLUMN_NAME +YES authentication_string +YES plugin +ALTER TABLE mysql.user MODIFY plugin char(64) DEFAULT '' NOT NULL; +ALTER TABLE mysql.user MODIFY authentication_string TEXT NOT NULL; +Run mysql_upgrade on a 5.5.10 external authentication column layout +mtr.global_suppressions OK +mtr.test_suppressions OK +mysql.columns_priv OK +mysql.db OK +mysql.event OK +mysql.func OK +mysql.general_log 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.proxies_priv OK +mysql.servers OK +mysql.slow_log 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 +SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS +WHERE TABLE_SCHEMA= 'mysql' AND TABLE_NAME= 'user' AND +COLUMN_NAME IN ('plugin', 'authentication_string') +ORDER BY COLUMN_NAME; +IS_NULLABLE COLUMN_NAME +YES authentication_string +YES plugin End of 5.5 tests diff --git a/mysql-test/r/plugin_auth_qa.result b/mysql-test/r/plugin_auth_qa.result index d1ecf6a6470..d1128cf04ee 100644 --- a/mysql-test/r/plugin_auth_qa.result +++ b/mysql-test/r/plugin_auth_qa.result @@ -105,7 +105,7 @@ CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string plug test_plugin_server plug_dest -plug_dest +plug_dest NULL DROP USER plug, plug_dest; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; @@ -115,7 +115,7 @@ DROP USER plug; CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plug_dest +plug_dest NULL DROP USER plug_dest; GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; @@ -125,7 +125,7 @@ CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string plug test_plugin_server plug_dest -plug_dest +plug_dest NULL DROP USER plug, plug_dest; GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS 'plug_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; @@ -135,7 +135,7 @@ DROP USER plug; CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plug_dest +plug_dest NULL DROP USER plug_dest; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; @@ -145,7 +145,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_pas SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string plug test_plugin_server plug_dest -plug_dest +plug_dest NULL DROP USER plug, plug_dest; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; @@ -155,7 +155,7 @@ DROP USER plug; GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plug_dest +plug_dest NULL DROP USER plug_dest; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; @@ -210,7 +210,7 @@ DROP USER plüg; CREATE USER plüg_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plüg_dest +plüg_dest NULL DROP USER plüg_dest; SET NAMES ascii; CREATE USER 'plüg' IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest'; @@ -221,7 +221,7 @@ DROP USER 'plüg'; CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -pl??g_dest +pl??g_dest NULL DROP USER 'plüg_dest'; SET NAMES latin1; ========== test 1.1.1.5 ==================================== @@ -235,7 +235,7 @@ DROP USER 'plug'; CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plüg_dest +plüg_dest NULL DROP USER 'plüg_dest'; SET NAMES utf8; CREATE USER plüg IDENTIFIED WITH 'test_plügin_server' AS 'plüg_dest'; @@ -248,7 +248,7 @@ DROP USER 'plüg'; CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plüg_dest +plüg_dest NULL DROP USER 'plüg_dest'; CREATE USER plüg IDENTIFIED WITH test_plugin_server AS 'plüg_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; @@ -258,7 +258,7 @@ DROP USER plüg; CREATE USER plüg_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plüg_dest +plüg_dest NULL DROP USER plüg_dest; ========== test 1.1.1.2/1.1.2.2============================= SET @auth_name= 'test_plugin_server'; @@ -278,7 +278,7 @@ DROP USER plug; CREATE USER 'hh''s_plug_dest' IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -hh's_plug_dest +hh's_plug_dest NULL DROP USER 'hh''s_plug_dest'; ========== test 1.1.1.4 ==================================== CREATE USER plug IDENTIFIED WITH hh''s_test_plugin_server AS 'plug_dest'; @@ -294,7 +294,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string grant_user test_plugin_server plug_dest -plug_dest +plug_dest NULL DROP USER grant_user,plug_dest; set @save_sql_mode= @@sql_mode; SET @@sql_mode=no_auto_create_user; @@ -315,13 +315,13 @@ CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; user plugin authentication_string password grant_user test_plugin_server plug_dest -plug_dest *939AEE68989794C0F408277411C26055CDF41119 +plug_dest NULL *939AEE68989794C0F408277411C26055CDF41119 DROP USER plug_dest; GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_user_passwd'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; user plugin authentication_string password grant_user test_plugin_server plug_dest -plug_dest *560881EB651416CEF77314D07D55EDCD5FC1BD6D +plug_dest NULL *560881EB651416CEF77314D07D55EDCD5FC1BD6D DROP USER grant_user,plug_dest; set @@sql_mode= @save_sql_mode; DROP DATABASE test_user_db; diff --git a/mysql-test/r/plugin_auth_qa_1.result b/mysql-test/r/plugin_auth_qa_1.result index 00ee47b56b3..51c7260d9ae 100644 --- a/mysql-test/r/plugin_auth_qa_1.result +++ b/mysql-test/r/plugin_auth_qa_1.result @@ -20,7 +20,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_pas GRANT PROXY ON plug_dest TO plug_user; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plug_dest +plug_dest NULL plug_user test_plugin_server plug_dest 1) current_user() @@ -73,7 +73,7 @@ GRANT PROXY ON new_dest TO plug_user; ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES) SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -new_dest +new_dest NULL plug_user test_plugin_server plug_dest DROP USER plug_user,new_dest; CREATE USER plug_user @@ -91,7 +91,7 @@ GRANT PROXY ON new_dest TO plug_user; ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES) SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -new_dest +new_dest NULL plug_user test_plugin_server plug_dest DROP USER plug_user,new_dest; CREATE USER plug_user @@ -113,13 +113,13 @@ connection default; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string new_user test_plugin_server plug_dest -plug_dest +plug_dest NULL disconnect plug_user; UPDATE mysql.user SET user='plug_user' WHERE user='new_user'; FLUSH PRIVILEGES; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plug_dest +plug_dest NULL plug_user test_plugin_server plug_dest DROP USER plug_dest,plug_user; ========== test 1.3 ======================================== @@ -135,26 +135,26 @@ connection default; disconnect plug_user; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plug_dest +plug_dest NULL plug_user test_plugin_server plug_dest UPDATE mysql.user SET user='new_user' WHERE user='plug_user'; FLUSH PRIVILEGES; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string new_user test_plugin_server plug_dest -plug_dest +plug_dest NULL UPDATE mysql.user SET authentication_string='new_dest' WHERE user='new_user'; FLUSH PRIVILEGES; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string new_user test_plugin_server new_dest -plug_dest +plug_dest NULL UPDATE mysql.user SET plugin='new_plugin_server' WHERE user='new_user'; FLUSH PRIVILEGES; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string new_user new_plugin_server new_dest -plug_dest +plug_dest NULL connect(plug_user,localhost,new_user,new_dest); ERROR HY000: Plugin 'new_plugin_server' is not loaded UPDATE mysql.user SET plugin='test_plugin_server' WHERE user='new_user'; @@ -163,7 +163,7 @@ FLUSH PRIVILEGES; GRANT PROXY ON new_dest TO new_user; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -new_dest +new_dest NULL new_user test_plugin_server new_dest connect(plug_user,localhost,new_user,new_dest); select USER(),CURRENT_USER(); @@ -176,9 +176,9 @@ FLUSH PRIVILEGES; CREATE USER new_dest IDENTIFIED BY 'new_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -new_dest +new_dest NULL new_user test_plugin_server new_dest -plug_dest +plug_dest NULL GRANT ALL PRIVILEGES ON test.* TO new_user; connect(plug_user,localhost,new_dest,new_dest_passwd); select USER(),CURRENT_USER(); @@ -193,7 +193,7 @@ CREATE USER proxied_user IDENTIFIED BY 'proxied_user_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string test_plugin_server proxied_user -proxied_user +proxied_user NULL connect(proxy_con,localhost,proxied_user,proxied_user_passwd); SELECT USER(),CURRENT_USER(); USER() CURRENT_USER() @@ -230,7 +230,7 @@ CREATE USER proxied_user IDENTIFIED BY 'proxied_user_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string test_plugin_server proxied_user -proxied_user +proxied_user NULL connect(proxy_con,localhost,proxied_user,proxied_user_passwd); SELECT USER(),CURRENT_USER(); USER() CURRENT_USER() @@ -273,11 +273,11 @@ GRANT PROXY ON proxied_user_5 TO ''@''; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string test_plugin_server proxied_user -proxied_user_1 -proxied_user_2 -proxied_user_3 -proxied_user_4 -proxied_user_5 +proxied_user_1 NULL +proxied_user_2 NULL +proxied_user_3 NULL +proxied_user_4 NULL +proxied_user_5 NULL connect(proxy_con_1,localhost,proxied_user_1,'proxied_user_1_pwd'); connect(proxy_con_2,localhost,proxied_user_2,proxied_user_2_pwd); connect(proxy_con_3,localhost,proxied_user_3,proxied_user_3_pwd); diff --git a/mysql-test/r/plugin_auth_qa_2.result b/mysql-test/r/plugin_auth_qa_2.result index 99fe9c6f5a9..f4706e5aa0b 100644 --- a/mysql-test/r/plugin_auth_qa_2.result +++ b/mysql-test/r/plugin_auth_qa_2.result @@ -7,7 +7,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_1_dest identified by 'dest_pas GRANT PROXY ON qa_test_1_dest TO qa_test_1_user; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -qa_test_1_dest +qa_test_1_dest NULL qa_test_1_user qa_auth_interface qa_test_1_dest SELECT @@proxy_user; @@proxy_user @@ -20,7 +20,7 @@ current_user() user() @@local.proxy_user @@local.external_user qa_test_1_user@% qa_test_1_user@localhost NULL NULL SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -qa_test_1_dest +qa_test_1_dest NULL qa_test_1_user qa_auth_interface qa_test_1_dest DROP USER qa_test_1_user; DROP USER qa_test_1_dest; @@ -33,8 +33,8 @@ GRANT PROXY ON qa_test_2_dest TO qa_test_2_user; GRANT PROXY ON authenticated_as TO qa_test_2_user; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -authenticated_as -qa_test_2_dest +authenticated_as NULL +qa_test_2_dest NULL qa_test_2_user qa_auth_interface qa_test_2_dest SELECT @@proxy_user; @@proxy_user @@ -47,8 +47,8 @@ current_user() user() @@local.proxy_user @@local.external_user authenticated_as@% user_name@localhost 'qa_test_2_user'@'%' 'qa_test_2_user'@'%' SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -authenticated_as -qa_test_2_dest +authenticated_as NULL +qa_test_2_dest NULL qa_test_2_user qa_auth_interface qa_test_2_dest DROP USER qa_test_2_user; DROP USER qa_test_2_dest; @@ -83,8 +83,8 @@ GRANT PROXY ON qa_test_5_dest TO qa_test_5_user; GRANT PROXY ON qa_test_5_dest TO ''@'localhost'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; user plugin authentication_string password - *DFCACE76914AD7BD801FC1A1ECF6562272621A22 -qa_test_5_dest *DFCACE76914AD7BD801FC1A1ECF6562272621A22 + NULL *DFCACE76914AD7BD801FC1A1ECF6562272621A22 +qa_test_5_dest NULL *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_5_user qa_auth_interface qa_test_5_dest exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=qa_test_5_user --password=qa_test_5_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 ERROR 1045 (28000): Access denied for user 'qa_test_5_user'@'localhost' (using password: YES) @@ -98,7 +98,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_6_dest identified by 'dest_pas GRANT PROXY ON qa_test_6_dest TO qa_test_6_user; SELECT user,plugin,authentication_string,password FROM mysql.user; user plugin authentication_string password -qa_test_6_dest *DFCACE76914AD7BD801FC1A1ECF6562272621A22 +qa_test_6_dest NULL *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_6_user qa_auth_interface qa_test_6_dest root root @@ -109,7 +109,7 @@ ERROR 1045 (28000): Access denied for user 'qa_test_6_user'@'localhost' (using p GRANT PROXY ON qa_test_6_dest TO root IDENTIFIED WITH qa_auth_interface AS 'qa_test_6_dest'; SELECT user,plugin,authentication_string,password FROM mysql.user; user plugin authentication_string password -qa_test_6_dest *DFCACE76914AD7BD801FC1A1ECF6562272621A22 +qa_test_6_dest NULL *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_6_user qa_auth_interface qa_test_6_dest root root @@ -121,7 +121,7 @@ ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: Y REVOKE PROXY ON qa_test_6_dest FROM root; SELECT user,plugin,authentication_string FROM mysql.user; user plugin authentication_string -qa_test_6_dest +qa_test_6_dest NULL qa_test_6_user qa_auth_interface qa_test_6_dest root root diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 17f639cdca3..afa105a39b8 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -3731,5 +3731,19 @@ CREATE TABLE t1 (a INT); BEGIN; PREPARE stmt1 FROM "SELECT * FROM t1"; DROP TABLE t1; + +# +# Bug#56115: invalid memory reads when PS selecting from +# information_schema tables +# Bug#58701: crash in Field::make_field, cursor-protocol +# +# NOTE: MTR should be run both with --ps-protocol and --cursor-protocol. +# + +SELECT * +FROM (SELECT 1 UNION SELECT 2) t; +1 +1 +2 # -# End of 6.0 tests. +# End of 5.5 tests. diff --git a/mysql-test/r/shm.result b/mysql-test/r/shm.result index 4f57049406d..53b2483d97e 100644 --- a/mysql-test/r/shm.result +++ b/mysql-test/r/shm.result @@ -2155,6 +2155,8 @@ mysqld is alive SET @max_allowed_packet= @@global.max_allowed_packet; SET @net_buffer_length= @@global.net_buffer_length; SET GLOBAL max_allowed_packet= 1024; +Warnings: +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' SET GLOBAL net_buffer_length= 1024; ERROR 1153 (08S01) at line 1: Got a packet bigger than 'max_allowed_packet' bytes SET GLOBAL max_allowed_packet= @max_allowed_packet; diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index feeba25c536..8c0757fe0d6 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -1338,6 +1338,7 @@ Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length I DROP DATABASE `ä`; show columns from `#mysql50#????????`; Got one of the listed errors +call mtr.add_suppression("Can.t find file: '.\\\\test\\\\\\?{8}.frm'"); DROP TABLE IF EXISTS t1; DROP PROCEDURE IF EXISTS p1; CREATE TABLE t1(c1 INT); diff --git a/mysql-test/r/sp-destruct.result b/mysql-test/r/sp-destruct.result index a3c8574d141..dc03016c516 100644 --- a/mysql-test/r/sp-destruct.result +++ b/mysql-test/r/sp-destruct.result @@ -1,4 +1,5 @@ call mtr.add_suppression("Column count of mysql.proc is wrong. Expected 20, found 19. The table is probably corrupted"); +call mtr.add_suppression("Stored routine .test...bug14233_[123].: invalid value in column mysql.proc"); use test; drop procedure if exists bug14233; drop function if exists bug14233; diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 243bfb6c07d..f9b338dd414 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -7452,4 +7452,34 @@ c1 # Cleanup drop table t1; drop procedure p1; + +# -- +# -- Bug 11765684 - 58674: SP-cache does not detect changes in +# -- pre-locking list caused by triggers +# --- +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +DROP TABLE IF EXISTS t3; +DROP PROCEDURE IF EXISTS p1; +CREATE TABLE t1(a INT); +CREATE TABLE t2(a INT); +CREATE TABLE t3(a INT); +CREATE PROCEDURE p1() +INSERT INTO t1(a) VALUES (1); + +CREATE TRIGGER t1_ai AFTER INSERT ON t1 +FOR EACH ROW +INSERT INTO t2(a) VALUES (new.a); + +CALL p1(); + +CREATE TRIGGER t1_bi BEFORE INSERT ON t1 +FOR EACH ROW +INSERT INTO t3(a) VALUES (new.a); + +CALL p1(); + +DROP TABLE t1, t2, t3; +DROP PROCEDURE p1; + # End of 5.5 test diff --git a/mysql-test/r/sp_notembedded.result b/mysql-test/r/sp_notembedded.result index 7da95416e29..6b6c98ea226 100644 --- a/mysql-test/r/sp_notembedded.result +++ b/mysql-test/r/sp_notembedded.result @@ -249,8 +249,6 @@ max_updates, max_connections, max_user_connections) VALUES('%', 'mysqltest_1', password(''), 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'N', 'N', 'N', 'N', 'N', 'N', 'Y', 'Y', 'N', 'N', 'Y', 'Y', 'N', 'N', 'N', 'N', 'N', 'Y', 'Y', 'N', '', '', '', '', '0', '0', '0', '0'); -Warnings: -Warning 1364 Field 'authentication_string' doesn't have a default value FLUSH PRIVILEGES; CREATE PROCEDURE p1(i INT) BEGIN END; DROP PROCEDURE p1; diff --git a/mysql-test/r/ssl_cipher.result b/mysql-test/r/ssl_cipher.result new file mode 100644 index 00000000000..78081300b5b --- /dev/null +++ b/mysql-test/r/ssl_cipher.result @@ -0,0 +1,9 @@ +# +# BUG#11760210 - SSL_CIPHER_LIST NOT SET OR RETURNED FOR "SHOW STATUS LIKE 'SSL_CIPHER_LIST'" +# +SHOW STATUS LIKE 'Ssl_cipher'; +Variable_name Value +Ssl_cipher AES128-SHA +SHOW STATUS LIKE 'Ssl_cipher_list'; +Variable_name Value +Ssl_cipher_list AES128-SHA diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index b516585fc37..b1af35c6bbf 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -5058,6 +5058,24 @@ i DROP TABLE t1,t1s,t2s; End of 5.1 tests # +# Bug #11765713 58705: +# OPTIMIZER LET ENGINE DEPEND ON UNINITIALIZED VALUES +# CREATED BY OPT_SUM_QUERY +# +CREATE TABLE t1(a INT NOT NULL, KEY (a)); +INSERT INTO t1 VALUES (0), (1); +SELECT 1 as foo FROM t1 WHERE a < SOME +(SELECT a FROM t1 WHERE a <=> +(SELECT a FROM t1) +); +ERROR 21000: Subquery returns more than 1 row +SELECT 1 as foo FROM t1 WHERE a < SOME +(SELECT a FROM t1 WHERE a <=> +(SELECT a FROM t1 where a is null) +); +foo +DROP TABLE t1; +# # Bug #57704: Cleanup code dies with void TABLE::set_keyread(bool): # Assertion `file' failed. # diff --git a/mysql-test/r/subselect_innodb.result b/mysql-test/r/subselect_innodb.result index 6c6d563e284..ab623ad6a28 100644 --- a/mysql-test/r/subselect_innodb.result +++ b/mysql-test/r/subselect_innodb.result @@ -245,3 +245,12 @@ x NULL drop procedure p1; drop tables t1,t2,t3; +# +# Bug#60085 crash in Item::save_in_field() with time data type +# +CREATE TABLE t1(a date, b int, unique(b), unique(a), key(b)) engine=innodb; +INSERT INTO t1 VALUES ('2011-05-13', 0); +SELECT * FROM t1 WHERE b < (SELECT CAST(a as date) FROM t1 GROUP BY a); +a b +2011-05-13 0 +DROP TABLE t1; diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result index 0028f2ce5c1..0e0d555d492 100644 --- a/mysql-test/r/system_mysql_db.result +++ b/mysql-test/r/system_mysql_db.result @@ -120,8 +120,8 @@ user CREATE TABLE `user` ( `max_updates` int(11) unsigned NOT NULL DEFAULT '0', `max_connections` int(11) unsigned NOT NULL DEFAULT '0', `max_user_connections` int(11) unsigned NOT NULL DEFAULT '0', - `plugin` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', - `authentication_string` text COLLATE utf8_bin NOT NULL, + `plugin` char(64) COLLATE utf8_bin DEFAULT '', + `authentication_string` text COLLATE utf8_bin, PRIMARY KEY (`Host`,`User`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges' show create table func; diff --git a/mysql-test/r/tablespace.result b/mysql-test/r/tablespace.result new file mode 100644 index 00000000000..38d450ae430 --- /dev/null +++ b/mysql-test/r/tablespace.result @@ -0,0 +1,112 @@ +CREATE TABLE t1(a int) TABLESPACE ts ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) TABLESPACE ts STORAGE DISK ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) TABLESPACE ts STORAGE MEMORY ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts STORAGE MEMORY */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) STORAGE MEMORY ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 STORAGE MEMORY */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) STORAGE DISK ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 STORAGE DISK */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) TABLESPACE ts ENGINE=MyISAM; +ALTER TABLE t1 ADD COLUMN b int; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) TABLESPACE ts STORAGE DISK ENGINE=MyISAM; +ALTER TABLE t1 ADD COLUMN b int; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) ENGINE=MyISAM; +ALTER TABLE t1 TABLESPACE ts; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +ALTER TABLE t1 TABLESPACE ts2; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts2 */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) ENGINE=MyISAM; +ALTER TABLE t1 STORAGE MEMORY; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 STORAGE MEMORY */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +ALTER TABLE t1 STORAGE DISK; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 STORAGE DISK */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) ENGINE=MyISAM; +ALTER TABLE t1 STORAGE MEMORY TABLESPACE ts; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts STORAGE MEMORY */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +ALTER TABLE t1 STORAGE DISK TABLESPACE ts2; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts2 STORAGE DISK */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + `d` int(11) NOT NULL, + `e` int(11) DEFAULT NULL, + `f` int(11) DEFAULT NULL, + `g` int(11) DEFAULT NULL, + `h` int(11) NOT NULL, + `i` int(11) DEFAULT NULL, + `j` int(11) DEFAULT NULL, + `k` int(11) DEFAULT NULL, + PRIMARY KEY (`a`) +) /*!50100 TABLESPACE the_tablespacename STORAGE DISK */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result index b24c5b87fa0..11e0d7313b7 100644 --- a/mysql-test/r/trigger.result +++ b/mysql-test/r/trigger.result @@ -821,7 +821,6 @@ drop trigger t1_bi; create trigger t1_bi after insert on t1 for each row insert into t3 values (new.id); execute stmt1; call p1(); -ERROR 42S02: Table 'test.t3' doesn't exist deallocate prepare stmt1; drop procedure p1; drop table t1, t2, t3; diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result index 41345be5b8d..96bd025aaed 100644 --- a/mysql-test/r/type_date.result +++ b/mysql-test/r/type_date.result @@ -296,6 +296,18 @@ 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; +# +# Bug#59685 crash in String::length with date types +# +CREATE TABLE t1(a DATE, b YEAR, KEY(a)); +INSERT INTO t1 VALUES ('2011-01-01',2011); +SELECT b = (SELECT CONVERT(a, DATE) FROM t1 GROUP BY a) FROM t1; +b = (SELECT CONVERT(a, DATE) FROM t1 GROUP BY a) +1 +SELECT b = CONVERT((SELECT CONVERT(a, DATE) FROM t1 GROUP BY a), DATE) FROM t1; +b = CONVERT((SELECT CONVERT(a, DATE) FROM t1 GROUP BY a), DATE) +1 +DROP TABLE t1; End of 5.1 tests # # Bug #33629: last_day function can return null, but has 'not null' diff --git a/mysql-test/r/variables-notembedded.result b/mysql-test/r/variables-notembedded.result index 8c6d54757ed..ceac676589f 100644 --- a/mysql-test/r/variables-notembedded.result +++ b/mysql-test/r/variables-notembedded.result @@ -108,3 +108,27 @@ SET @@session.slave_skip_errors= 7; ERROR HY000: Variable 'slave_skip_errors' is a read only variable SET @@global.slave_skip_errors= 7; ERROR HY000: Variable 'slave_skip_errors' is a read only variable +# +# Bug #11766769 : 59959: SMALL VALUES OF --MAX-ALLOWED-PACKET +# ARE NOT BEING HONORED +# +CREATE TABLE t1 (a MEDIUMTEXT); +SET GLOBAL max_allowed_packet=2048; +Warnings: +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' +SET GLOBAL net_buffer_length=4096; +Warnings: +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' +SHOW SESSION VARIABLES LIKE 'max_allowed_packet'; +Variable_name Value +max_allowed_packet 2048 +SHOW SESSION VARIABLES LIKE 'net_buffer_length'; +Variable_name Value +net_buffer_length 4096 +ERROR 08S01: Got a packet bigger than 'max_allowed_packet' bytes +SELECT LENGTH(a) FROM t1; +LENGTH(a) +SET GLOBAL max_allowed_packet=default; +SET GLOBAL net_buffer_length=default; +DROP TABLE t1; +End of 5.1 tests diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 5d6caf21182..2b71117f789 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -505,6 +505,7 @@ set low_priority_updates=1; set global max_allowed_packet=100; Warnings: Warning 1292 Truncated incorrect max_allowed_packet value: '100' +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' set global max_binlog_cache_size=100; Warnings: Warning 1292 Truncated incorrect max_binlog_cache_size value: '100' @@ -1059,6 +1060,8 @@ set global max_write_lock_count =default; set global myisam_data_pointer_size =@my_myisam_data_pointer_size; set global myisam_max_sort_file_size =@my_myisam_max_sort_file_size; set global net_buffer_length =@my_net_buffer_length; +Warnings: +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' set global net_write_timeout =@my_net_write_timeout; set global net_read_timeout =@my_net_read_timeout; set global query_cache_limit =@my_query_cache_limit; @@ -1540,6 +1543,25 @@ ERROR HY000: Cannot drop default keycache SET @@global.key_cache_block_size=0; Warnings: Warning 1292 Truncated incorrect key_cache_block_size value: '0' +select @@max_long_data_size; +@@max_long_data_size +1048576 +# +# Bug#11766424 59527: DECIMAL_BIN_SIZE: ASSERTION `SCALE >= 0 && PRECISION > 0 && SCALE <= PRE +# +CREATE TABLE t1(f1 DECIMAL(1,1) UNSIGNED); +INSERT INTO t1 VALUES (0.2),(0.1); +SELECT 1 FROM t1 GROUP BY @a:= (SELECT ROUND(f1) FROM t1 WHERE @a=f1); +1 +1 +DROP TABLE t1; +CREATE TABLE t1 AS SELECT @a:= CAST(1 AS UNSIGNED) AS a; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(1) unsigned NOT NULL DEFAULT '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; SET @@global.max_binlog_cache_size=DEFAULT; SET @@global.max_join_size=DEFAULT; SET @@global.key_buffer_size=@kbs; diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index fdeed10701d..ce404c7dce2 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -4012,6 +4012,15 @@ DROP TABLE t1; # CREATE VIEW v1 AS SELECT 1 IN (1 LIKE 2,0) AS f; DROP VIEW v1; +# +# Bug 11829681 - 60295: ERROR 1356 ON VIEW THAT EXECUTES FINE AS A QUERY +# +CREATE TABLE t1 (a INT); +CREATE VIEW v1 AS SELECT s.* FROM t1 s, t1 b HAVING a; +SELECT * FROM v1; +a +DROP VIEW v1; +DROP TABLE t1; # ----------------------------------------------------------------- # -- End of 5.1 tests. # ----------------------------------------------------------------- diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result index 70b54ffceaf..4e706de382b 100644 --- a/mysql-test/r/warnings.result +++ b/mysql-test/r/warnings.result @@ -316,3 +316,25 @@ SHOW ERRORS; Level Code Message Error 1051 Unknown table 't1' End of 5.0 tests + +-- Bug#55847 + +DROP TABLE IF EXISTS t1; +DROP FUNCTION IF EXISTS f1; +CREATE TABLE t1(a INT UNIQUE); +CREATE FUNCTION f1(x INT) RETURNS INT +BEGIN +INSERT INTO t1 VALUES(x); +INSERT INTO t1 VALUES(x); +RETURN x; +END| + +SHOW TABLES WHERE f1(11) = 11; +ERROR 23000: Duplicate entry '11' for key 'a' + +SHOW WARNINGS; +Level Code Message +Error 1062 Duplicate entry '11' for key 'a' + +DROP TABLE t1; +DROP FUNCTION f1; diff --git a/mysql-test/r/xa.result b/mysql-test/r/xa.result index ad0d103c1e0..7b580abb19f 100644 --- a/mysql-test/r/xa.result +++ b/mysql-test/r/xa.result @@ -166,3 +166,66 @@ ERROR XA102: XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was det XA END 'b'; XA ROLLBACK 'b'; DROP TABLE t1; +# +# Bug#11766752 59936: multiple xa assertions - transactional +# statement fuzzer +# +CREATE TABLE t1 (a INT) engine=InnoDB; +XA START 'a'; +INSERT INTO t1 VALUES (1); +SAVEPOINT savep; +ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state +XA END 'a'; +SELECT * FROM t1; +ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state +INSERT INTO t1 VALUES (2); +ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state +SAVEPOINT savep; +ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state +SET @a=(SELECT * FROM t1); +ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state +XA PREPARE 'a'; +SELECT * FROM t1; +ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the PREPARED state +INSERT INTO t1 VALUES (2); +ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the PREPARED state +SAVEPOINT savep; +ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the PREPARED state +SET @a=(SELECT * FROM t1); +ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the PREPARED state +UPDATE t1 SET a=1 WHERE a=2; +ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the PREPARED state +XA COMMIT 'a'; +SELECT * FROM t1; +a +1 +DROP TABLE t1; +# +# Bug#12352846 - TRANS_XA_START(THD*): +# ASSERTION THD->TRANSACTION.XID_STATE.XID.IS_NULL() +# FAILED +# +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (a INT); +START TRANSACTION; +INSERT INTO t1 VALUES (1); +# Connection con2 +XA START 'xid1'; +# Sending: +INSERT INTO t2 SELECT a FROM t1; +# Connection default +# Waiting until INSERT ... is blocked +DELETE FROM t1; +COMMIT; +# Connection con2 +# Reaping: INSERT INTO t2 SELECT a FROM t1 +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +XA COMMIT 'xid1'; +ERROR XA102: XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detected +XA START 'xid1'; +XA END 'xid1'; +XA PREPARE 'xid1'; +XA ROLLBACK 'xid1'; +# Connection default +DROP TABLE t1, t2; diff --git a/mysql-test/std_data/bug47205.frm b/mysql-test/std_data/bug47205.frm Binary files differnew file mode 100644 index 00000000000..6d53b221d28 --- /dev/null +++ b/mysql-test/std_data/bug47205.frm diff --git a/mysql-test/std_data/cluster_7022_table.MYD b/mysql-test/std_data/cluster_7022_table.MYD new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/mysql-test/std_data/cluster_7022_table.MYD diff --git a/mysql-test/std_data/cluster_7022_table.MYI b/mysql-test/std_data/cluster_7022_table.MYI Binary files differnew file mode 100644 index 00000000000..332b0e64797 --- /dev/null +++ b/mysql-test/std_data/cluster_7022_table.MYI diff --git a/mysql-test/std_data/cluster_7022_table.frm b/mysql-test/std_data/cluster_7022_table.frm Binary files differnew file mode 100644 index 00000000000..84714a1721a --- /dev/null +++ b/mysql-test/std_data/cluster_7022_table.frm diff --git a/mysql-test/suite/binlog/r/binlog_base64_flag.result b/mysql-test/suite/binlog/r/binlog_base64_flag.result index 7fb5e50a219..9a9f328f2b5 100644 --- a/mysql-test/suite/binlog/r/binlog_base64_flag.result +++ b/mysql-test/suite/binlog/r/binlog_base64_flag.result @@ -91,6 +91,9 @@ iONkSBcBAAAAKwAAAMQBAAAQABAAAAAAAAEAA//4AQAAAAMAMTIzAQAAAA== '; ERROR HY000: master may suffer from http://bugs.mysql.com/bug.php?id=37426 so slave stops; check error log on slave for more info drop table t1, char63_utf8, char128_utf8; +call mtr.add_suppression("Slave SQL.*master suffers from this bug: http:..bugs.mysql.com.bug.php.id=37426.* Error_code: 1105"); +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* Error_code: 1535"); +call mtr.add_suppression("Slave SQL.*Column 1 of table .test.char128_utf8. cannot be converted.* Error_code: 1677"); # # Bug #54393: crash and/or valgrind errors in # mysql_client_binlog_statement diff --git a/mysql-test/suite/binlog/r/binlog_bug23533.result b/mysql-test/suite/binlog/r/binlog_bug23533.result new file mode 100644 index 00000000000..07b124793d1 --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_bug23533.result @@ -0,0 +1,16 @@ +SET AUTOCOMMIT=0; +CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b TEXT, PRIMARY KEY(a)) ENGINE=InnoDB; +SELECT COUNT(*) FROM t1; +COUNT(*) +1000 +SET @saved_max_binlog_cache_size=@@max_binlog_cache_size; +SET GLOBAL max_binlog_cache_size=4096; +START TRANSACTION; +CREATE TABLE t2 SELECT * FROM t1; +ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again +COMMIT; +SHOW TABLES LIKE 't%'; +Tables_in_test (t%) +t1 +SET GLOBAL max_binlog_cache_size=@saved_max_binlog_cache_size; +DROP TABLE t1; diff --git a/mysql-test/suite/binlog/r/binlog_bug36391.result b/mysql-test/suite/binlog/r/binlog_bug36391.result new file mode 100644 index 00000000000..551bfb9924d --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_bug36391.result @@ -0,0 +1,10 @@ +CREATE TABLE t1(id INT); +SHOW TABLES; +Tables_in_test +t1 +FLUSH LOGS; +DROP TABLE t1; +SHOW TABLES; +Tables_in_test +t1 +DROP TABLE t1; diff --git a/mysql-test/suite/binlog/r/binlog_database.result b/mysql-test/suite/binlog/r/binlog_database.result index b6299f9a940..0eaed3c97d7 100644 --- a/mysql-test/suite/binlog/r/binlog_database.result +++ b/mysql-test/suite/binlog/r/binlog_database.result @@ -39,6 +39,28 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt1` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ FLUSH STATUS; +# +# Bug#11765416 58381: FAILED DROP DATABASE CAN BREAK STATEMENT +# BASED REPLICATION +# +DROP DATABASE IF EXISTS db1; +DROP TABLE IF EXISTS t3; +CREATE DATABASE db1; +CREATE TABLE db1.t1 (a INT); +CREATE TABLE db1.t2 (b INT, KEY(b)) engine=innodb; +CREATE TABLE t3 (a INT, KEY (a), FOREIGN KEY(a) REFERENCES db1.t2(b)) +engine=innodb; +RESET MASTER; +DROP DATABASE db1; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails +SHOW TABLES FROM db1; +Tables_in_db1 +t2 +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `db1`; drop table `t1` +DROP TABLE t3; +DROP DATABASE db1; set binlog_format=mixed; reset master; create database testing_1; @@ -80,6 +102,28 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt1` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ FLUSH STATUS; +# +# Bug#11765416 58381: FAILED DROP DATABASE CAN BREAK STATEMENT +# BASED REPLICATION +# +DROP DATABASE IF EXISTS db1; +DROP TABLE IF EXISTS t3; +CREATE DATABASE db1; +CREATE TABLE db1.t1 (a INT); +CREATE TABLE db1.t2 (b INT, KEY(b)) engine=innodb; +CREATE TABLE t3 (a INT, KEY (a), FOREIGN KEY(a) REFERENCES db1.t2(b)) +engine=innodb; +RESET MASTER; +DROP DATABASE db1; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails +SHOW TABLES FROM db1; +Tables_in_db1 +t2 +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `db1`; drop table `t1` +DROP TABLE t3; +DROP DATABASE db1; set binlog_format=row; reset master; create database testing_1; @@ -122,6 +166,28 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt1` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ FLUSH STATUS; +# +# Bug#11765416 58381: FAILED DROP DATABASE CAN BREAK STATEMENT +# BASED REPLICATION +# +DROP DATABASE IF EXISTS db1; +DROP TABLE IF EXISTS t3; +CREATE DATABASE db1; +CREATE TABLE db1.t1 (a INT); +CREATE TABLE db1.t2 (b INT, KEY(b)) engine=innodb; +CREATE TABLE t3 (a INT, KEY (a), FOREIGN KEY(a) REFERENCES db1.t2(b)) +engine=innodb; +RESET MASTER; +DROP DATABASE db1; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails +SHOW TABLES FROM db1; +Tables_in_db1 +t2 +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `db1`; drop table `t1` +DROP TABLE t3; +DROP DATABASE db1; show databases; Database information_schema diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result index abb02164d91..323d50d8f32 100644 --- a/mysql-test/suite/binlog/r/binlog_row_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result @@ -1374,6 +1374,7 @@ unique_checks OFF # INSERT INTO t1 VALUES(2) # foreign_key_checks=1 and unique_checks=1 # It should not change current session's variables, even error happens +call mtr.add_suppression("Slave SQL.*Could not execute Write_rows event on table test.t1; Duplicate entry .2. for key .PRIMARY., Error_code: 1062"); BINLOG ' dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE= dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA== diff --git a/mysql-test/suite/binlog/r/binlog_stm_binlog.result b/mysql-test/suite/binlog/r/binlog_stm_binlog.result index 5960952e22e..c67f69c738a 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result @@ -864,6 +864,7 @@ unique_checks OFF # INSERT INTO t1 VALUES(2) # foreign_key_checks=1 and unique_checks=1 # It should not change current session's variables, even error happens +call mtr.add_suppression("Slave SQL.*Could not execute Write_rows event on table test.t1; Duplicate entry .2. for key .PRIMARY., Error_code: 1062"); BINLOG ' dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE= dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA== diff --git a/mysql-test/suite/binlog/t/binlog_base64_flag.test b/mysql-test/suite/binlog/t/binlog_base64_flag.test index 3f1e4e98bec..2ec979aade0 100644 --- a/mysql-test/suite/binlog/t/binlog_base64_flag.test +++ b/mysql-test/suite/binlog/t/binlog_base64_flag.test @@ -151,6 +151,9 @@ iONkSBcBAAAAKwAAAMQBAAAQABAAAAAAAAEAA//4AQAAAAMAMTIzAQAAAA== drop table t1, char63_utf8, char128_utf8; +call mtr.add_suppression("Slave SQL.*master suffers from this bug: http:..bugs.mysql.com.bug.php.id=37426.* Error_code: 1105"); +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* Error_code: 1535"); +call mtr.add_suppression("Slave SQL.*Column 1 of table .test.char128_utf8. cannot be converted.* Error_code: 1677"); --echo # --echo # Bug #54393: crash and/or valgrind errors in diff --git a/mysql-test/suite/bugs/t/rpl_bug23533.test b/mysql-test/suite/binlog/t/binlog_bug23533.test index 337dddcef3d..fb2fc808b7b 100644 --- a/mysql-test/suite/bugs/t/rpl_bug23533.test +++ b/mysql-test/suite/binlog/t/binlog_bug23533.test @@ -4,15 +4,13 @@ ############################################################# --source include/have_innodb.inc +--source include/have_log_bin.inc --source include/have_binlog_format_row.inc ---source include/master-slave.inc SET AUTOCOMMIT=0; -SET GLOBAL max_binlog_cache_size=4096; -SHOW VARIABLES LIKE 'max_binlog_cache_size'; +# Create 1st table CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b TEXT, PRIMARY KEY(a)) ENGINE=InnoDB; - --disable_query_log let $i= 1000; while ($i) @@ -21,16 +19,19 @@ while ($i) dec $i; } --enable_query_log - SELECT COUNT(*) FROM t1; +# Set small value for max_binlog_cache_size +SET @saved_max_binlog_cache_size=@@max_binlog_cache_size; +SET GLOBAL max_binlog_cache_size=4096; + # Copied data from t1 into t2 large than max_binlog_cache_size START TRANSACTION; ---error 1534 +--error 1197 CREATE TABLE t2 SELECT * FROM t1; COMMIT; SHOW TABLES LIKE 't%'; - # 5.1 End of Test ---source include/rpl_end.inc +SET GLOBAL max_binlog_cache_size=@saved_max_binlog_cache_size; +DROP TABLE t1; diff --git a/mysql-test/suite/bugs/t/rpl_bug36391-master.opt b/mysql-test/suite/binlog/t/binlog_bug36391-master.opt index 56273241f14..56273241f14 100644 --- a/mysql-test/suite/bugs/t/rpl_bug36391-master.opt +++ b/mysql-test/suite/binlog/t/binlog_bug36391-master.opt diff --git a/mysql-test/suite/bugs/t/rpl_bug36391.test b/mysql-test/suite/binlog/t/binlog_bug36391.test index 3961082273d..64d91dfafd9 100644 --- a/mysql-test/suite/bugs/t/rpl_bug36391.test +++ b/mysql-test/suite/binlog/t/binlog_bug36391.test @@ -13,17 +13,18 @@ # # ---source include/master-slave.inc +--source include/have_log_bin.inc +--source include/have_binlog_format_mixed.inc -create table t1(id int); +CREATE TABLE t1(id INT); +let $binlog= query_get_value(SHOW MASTER STATUS, File, 1); +let $binlog_path= `SELECT CONCAT(@@DATADIR, '$binlog')`; +SHOW TABLES; +FLUSH LOGS; +DROP TABLE t1; -show tables; +--exec $MYSQL_BINLOG $binlog_path | $MYSQL test +SHOW TABLES; ---source include/show_master_status.inc - -flush logs; - ---exec $MYSQL_BINLOG $MYSQL_TEST_DIR/var/log/master-bin.000001 | $MYSQL test - -drop table t1; ---source include/rpl_end.inc +# Clean up +DROP TABLE t1; diff --git a/mysql-test/suite/binlog/t/binlog_index.test b/mysql-test/suite/binlog/t/binlog_index.test index b735574fdb9..086c0842b20 100644 --- a/mysql-test/suite/binlog/t/binlog_index.test +++ b/mysql-test/suite/binlog/t/binlog_index.test @@ -6,6 +6,8 @@ source include/not_embedded.inc; # Don't test this under valgrind, memory leaks will occur --source include/not_valgrind.inc source include/have_debug.inc; +# Avoid CrashReporter popup on Mac +--source include/not_crashrep.inc call mtr.add_suppression('Attempting backtrace'); call mtr.add_suppression('MSYQL_BIN_LOG::purge_logs failed to process registered files that would be purged.'); call mtr.add_suppression('MSYQL_BIN_LOG::open failed to sync the index file'); diff --git a/mysql-test/suite/binlog/t/disabled.def b/mysql-test/suite/binlog/t/disabled.def index a8485f185bc..d80a42c6e27 100644 --- a/mysql-test/suite/binlog/t/disabled.def +++ b/mysql-test/suite/binlog/t/disabled.def @@ -11,4 +11,3 @@ ############################################################################## binlog_truncate_innodb : BUG#57291 2010-10-20 anitha Originally disabled due to BUG#42643. Product bug fixed, but test changes needed binlog_spurious_ddl_errors : BUG#54195 2010-06-03 alik binlog_spurious_ddl_errors.test fails, thus disabled -binlog_row_failure_mixing_engines : BUG#58416 2010-11-23 ramil Fails on win x86 debug_max diff --git a/mysql-test/suite/bugs/combinations b/mysql-test/suite/bugs/combinations deleted file mode 100644 index 07042c2cbec..00000000000 --- a/mysql-test/suite/bugs/combinations +++ /dev/null @@ -1,8 +0,0 @@ -[row] -binlog-format=row - -[stmt] -binlog-format=statement - -[mix] -binlog-format=mixed diff --git a/mysql-test/suite/bugs/data/rpl_bug12691.dat b/mysql-test/suite/bugs/data/rpl_bug12691.dat deleted file mode 100644 index de980441c3a..00000000000 --- a/mysql-test/suite/bugs/data/rpl_bug12691.dat +++ /dev/null @@ -1,3 +0,0 @@ -a -b -c diff --git a/mysql-test/suite/bugs/r/bug57108.result b/mysql-test/suite/bugs/r/bug57108.result deleted file mode 100644 index ad60b07a1e3..00000000000 --- a/mysql-test/suite/bugs/r/bug57108.result +++ /dev/null @@ -1,5 +0,0 @@ -INSTALL PLUGIN example SONAME 'ha_example.so'; -SELECT @@global.connect_timeout AS connect_timeout, @@global.local_infile AS local_infile; -connect_timeout 4711 -local_infile 1 -UNINSTALL PLUGIN example; diff --git a/mysql-test/suite/bugs/r/rpl_bug12691.result b/mysql-test/suite/bugs/r/rpl_bug12691.result deleted file mode 100644 index 8feeb0effc3..00000000000 --- a/mysql-test/suite/bugs/r/rpl_bug12691.result +++ /dev/null @@ -1,33 +0,0 @@ -stop slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -reset master; -reset slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -start slave; - -**** On Master **** -CREATE TABLE t1 (b CHAR(10)); - -**** On Slave **** -STOP SLAVE; - -**** On Master **** -LOAD DATA INFILE FILENAME -SELECT COUNT(*) FROM t1; -COUNT(*) -3 -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 (b CHAR(10)) -master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# -master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/rpl_bug12691.dat' INTO TABLE `t1` FIELDS TERMINATED BY '|' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`b`) ;file_id=# - -**** On Slave **** -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; -START SLAVE; -SELECT COUNT(*) FROM t1; -COUNT(*) -0 - -**** On Master **** -DROP TABLE t1; diff --git a/mysql-test/suite/bugs/r/rpl_bug23533.result b/mysql-test/suite/bugs/r/rpl_bug23533.result deleted file mode 100644 index 1dda75a69b0..00000000000 --- a/mysql-test/suite/bugs/r/rpl_bug23533.result +++ /dev/null @@ -1,23 +0,0 @@ -stop slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -reset master; -reset slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -start slave; -DROP TABLE IF EXISTS t1,t2; -SET AUTOCOMMIT=0; -SET GLOBAL max_binlog_cache_size=4096; -SHOW VARIABLES LIKE 'max_binlog_cache_size'; -Variable_name Value -max_binlog_cache_size 4096 -CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b TEXT, PRIMARY KEY(a)) ENGINE=InnoDB; -SELECT COUNT(*) FROM t1; -COUNT(*) -1000 -START TRANSACTION; -CREATE TABLE t2 SELECT * FROM t1; -ERROR HY000: Writing one row to the row-based binary log failed -COMMIT; -SHOW TABLES LIKE 't%'; -Tables_in_test (t%) -t1 diff --git a/mysql-test/suite/bugs/r/rpl_bug31582.result b/mysql-test/suite/bugs/r/rpl_bug31582.result deleted file mode 100644 index 1f71fbf8fe7..00000000000 --- a/mysql-test/suite/bugs/r/rpl_bug31582.result +++ /dev/null @@ -1,16 +0,0 @@ -stop slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -reset master; -reset slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -start slave; -CREATE TABLE t1 (a VARCHAR(10) PRIMARY KEY) ENGINE=MyISAM; -INSERT INTO t1 VALUES ('a'); -UPDATE t1 SET a = 'MyISAM'; -SELECT * FROM t1 ORDER BY a; -a -MyISAM -SELECT * FROM t1 ORDER BY a; -a -MyISAM -DROP TABLE t1; diff --git a/mysql-test/suite/bugs/r/rpl_bug31583.result b/mysql-test/suite/bugs/r/rpl_bug31583.result deleted file mode 100644 index 74846607313..00000000000 --- a/mysql-test/suite/bugs/r/rpl_bug31583.result +++ /dev/null @@ -1,16 +0,0 @@ -stop slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -reset master; -reset slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -start slave; -CREATE TABLE t1 ( a INT, b INT DEFAULT -3 ); -INSERT INTO t1 VALUES (1, DEFAULT); -UPDATE t1 SET a = 3; -SELECT * FROM t1 ORDER BY a; -a b -3 -3 -SELECT * FROM t1 ORDER BY a; -a b -3 -3 -DROP TABLE t1; diff --git a/mysql-test/suite/bugs/r/rpl_bug33029.result b/mysql-test/suite/bugs/r/rpl_bug33029.result deleted file mode 100644 index d11ae1cc0be..00000000000 --- a/mysql-test/suite/bugs/r/rpl_bug33029.result +++ /dev/null @@ -1,15 +0,0 @@ -stop slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -reset master; -reset slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -start slave; -create table `t1` (`id` int not null auto_increment primary key); -create trigger `trg` before insert on `t1` for each row begin end; -set @@global.debug="+d,simulate_bug33029"; -stop slave; -start slave; -insert into `t1` values (); -select * from t1; -id -1 diff --git a/mysql-test/suite/bugs/r/rpl_bug36391.result b/mysql-test/suite/bugs/r/rpl_bug36391.result deleted file mode 100644 index 33175d89d30..00000000000 --- a/mysql-test/suite/bugs/r/rpl_bug36391.result +++ /dev/null @@ -1,18 +0,0 @@ -stop slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -reset master; -reset slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -start slave; -drop table if exists t1; -Warnings: -Note 1051 Unknown table 't1' -create table t1(id int); -show tables; -Tables_in_test -t1 -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB> -flush logs; -drop table t1; diff --git a/mysql-test/suite/bugs/r/rpl_bug37426.result b/mysql-test/suite/bugs/r/rpl_bug37426.result deleted file mode 100644 index 24dfd27ca01..00000000000 --- a/mysql-test/suite/bugs/r/rpl_bug37426.result +++ /dev/null @@ -1,17 +0,0 @@ -stop slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -reset master; -reset slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -start slave; -CREATE TABLE char128_utf8 ( -i1 INT NOT NULL, -c CHAR(128) CHARACTER SET utf8 NOT NULL, -i2 INT NOT NULL); -INSERT INTO char128_utf8 VALUES ( 1, "123", 1 ); -SELECT * FROM char128_utf8; -i1 c i2 -1 123 1 -SELECT * FROM char128_utf8; -i1 c i2 -1 123 1 diff --git a/mysql-test/suite/bugs/r/rpl_bug38205.result b/mysql-test/suite/bugs/r/rpl_bug38205.result deleted file mode 100644 index 8f1dee344fa..00000000000 --- a/mysql-test/suite/bugs/r/rpl_bug38205.result +++ /dev/null @@ -1,56 +0,0 @@ -stop slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -reset master; -reset slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -start slave; -create table t1i(n int primary key) engine=innodb; -create table t2m(n int primary key) engine=myisam; -begin; -insert into t1i values (1); -insert into t1i values (2); -insert into t1i values (3); -commit; -begin; -insert into t1i values (5); -begin; -insert into t1i values (4); -insert into t2m values (1); -update t1i set n = 5 where n = 4; -commit; -zero -0 -*** kill sql thread *** -rollback; -*** sql thread is *not* running: No *** -*** the prove: the killed slave has not finished the current transaction *** -three -3 -one -1 -zero -0 -delete from t2m; -start slave sql_thread; -delete from t1i; -delete from t2m; -begin; -insert into t1i values (5); -begin; -insert into t1i values (4); -update t1i set n = 5 where n = 4; -commit; -zero -0 -stop slave sql_thread; -rollback; -*** sql thread is *not* running: No *** -*** the prove: the stopped slave has rolled back the current transaction *** -zero -0 -zero -0 -one -1 -start slave sql_thread; -drop table t1i, t2m; diff --git a/mysql-test/suite/bugs/t/bug57108-master.opt b/mysql-test/suite/bugs/t/bug57108-master.opt deleted file mode 100644 index c2ab1c2ead6..00000000000 --- a/mysql-test/suite/bugs/t/bug57108-master.opt +++ /dev/null @@ -1,2 +0,0 @@ ---defaults-file=std_data/bug57108.cnf -$EXAMPLE_PLUGIN_OPT diff --git a/mysql-test/suite/bugs/t/bug57108.test b/mysql-test/suite/bugs/t/bug57108.test deleted file mode 100644 index 56acd7fe7bd..00000000000 --- a/mysql-test/suite/bugs/t/bug57108.test +++ /dev/null @@ -1,12 +0,0 @@ ---source include/not_windows_embedded.inc ---source include/have_example_plugin.inc - -# Test that we can install a plugin despite the fact that we have -# switched directory after starting the server and am using a relative -# --defaults-file. ---replace_regex /\.dll/.so/ -eval INSTALL PLUGIN example SONAME '$EXAMPLE_PLUGIN'; - ---query_vertical SELECT @@global.connect_timeout AS connect_timeout, @@global.local_infile AS local_infile - -UNINSTALL PLUGIN example; diff --git a/mysql-test/suite/bugs/t/rpl_bug12691.test b/mysql-test/suite/bugs/t/rpl_bug12691.test deleted file mode 100644 index 791cf126bfa..00000000000 --- a/mysql-test/suite/bugs/t/rpl_bug12691.test +++ /dev/null @@ -1,48 +0,0 @@ -# Bug#12691: Exec_master_log_pos corrupted with SQL_SLAVE_SKIP_COUNTER - ---source include/master-slave.inc ---source include/have_binlog_format_mixed_or_statement.inc - ---echo ---echo **** On Master **** -CREATE TABLE t1 (b CHAR(10)); ---echo ---echo **** On Slave **** ---sync_slave_with_master -STOP SLAVE; ---source include/wait_for_slave_to_stop.inc - ---connection master - ---echo ---echo **** On Master **** ---exec cp $MYSQL_TEST_DIR/suite/bugs/data/rpl_bug12691.dat $MYSQLTEST_VARDIR/tmp/ ---echo LOAD DATA INFILE FILENAME ---disable_query_log ---eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/rpl_bug12691.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ---enable_query_log ---remove_file $MYSQLTEST_VARDIR/tmp/rpl_bug12691.dat - -SELECT COUNT(*) FROM t1; - -source include/show_binlog_events.inc; - ---save_master_pos - ---connection slave ---echo ---echo **** On Slave **** -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; -START SLAVE; ---source include/wait_for_slave_to_start.inc ---sync_with_master - -SELECT COUNT(*) FROM t1; - -# Clean up ---connection master ---echo ---echo **** On Master **** -DROP TABLE t1; - ---source include/rpl_end.inc diff --git a/mysql-test/suite/bugs/t/rpl_bug31582.test b/mysql-test/suite/bugs/t/rpl_bug31582.test deleted file mode 100644 index 6bff8ef4172..00000000000 --- a/mysql-test/suite/bugs/t/rpl_bug31582.test +++ /dev/null @@ -1,25 +0,0 @@ - -# BUG#31582: 5.1-telco-6.1 -> 5.1.22. Slave crashes when reading -# UPDATE for VARCHAR - -# This is a problem for any update statement replicating from an old -# server to a new server. The bug consisted of a new slave trying to -# read two column bitmaps, but there is only one available in the old -# format. - -# This test case should be executed replicating from an old server to -# a new server, so make sure you have one handy. - -source include/master-slave.inc; - -CREATE TABLE t1 (a VARCHAR(10) PRIMARY KEY) ENGINE=MyISAM; -INSERT INTO t1 VALUES ('a'); -UPDATE t1 SET a = 'MyISAM'; -SELECT * FROM t1 ORDER BY a; -sync_slave_with_master; -SELECT * FROM t1 ORDER BY a; - -connection master; -DROP TABLE t1; - ---source include/rpl_end.inc diff --git a/mysql-test/suite/bugs/t/rpl_bug31583.test b/mysql-test/suite/bugs/t/rpl_bug31583.test deleted file mode 100644 index ee5b7698016..00000000000 --- a/mysql-test/suite/bugs/t/rpl_bug31583.test +++ /dev/null @@ -1,25 +0,0 @@ -# -# BUG#31583: 5.1-telco-6.1 -> 5.1.22. Slave returns Error in unknown event - -# This is a problem for any update statement replicating from an old -# server to a new server. The bug consisted of a new slave trying to -# read two column bitmaps, but there is only one available in the old -# format. - -# This test case should be executed replicating from an old server to -# a new server, so make sure you have one handy. - -source include/master-slave.inc; - -CREATE TABLE t1 ( a INT, b INT DEFAULT -3 ); - -INSERT INTO t1 VALUES (1, DEFAULT); -UPDATE t1 SET a = 3; -SELECT * FROM t1 ORDER BY a; -sync_slave_with_master; -SELECT * FROM t1 ORDER BY a; - -connection master; -DROP TABLE t1; - ---source include/rpl_end.inc diff --git a/mysql-test/suite/bugs/t/rpl_bug33029.test b/mysql-test/suite/bugs/t/rpl_bug33029.test deleted file mode 100644 index f5aad4de8df..00000000000 --- a/mysql-test/suite/bugs/t/rpl_bug33029.test +++ /dev/null @@ -1,26 +0,0 @@ -# -# Bug #36443 Server crashes when executing insert when insert trigger on table -# -# Emulating the former bug#33029 situation to see that there is no crash anymore. -# - - -source include/master-slave.inc; - -create table `t1` (`id` int not null auto_increment primary key); -create trigger `trg` before insert on `t1` for each row begin end; - -sync_slave_with_master; -set @@global.debug="+d,simulate_bug33029"; - -stop slave; -start slave; - -connection master; - -insert into `t1` values (); - -sync_slave_with_master; -select * from t1; - ---source include/rpl_end.inc diff --git a/mysql-test/suite/bugs/t/rpl_bug38205.test b/mysql-test/suite/bugs/t/rpl_bug38205.test deleted file mode 100644 index 550746719f4..00000000000 --- a/mysql-test/suite/bugs/t/rpl_bug38205.test +++ /dev/null @@ -1,166 +0,0 @@ -# -# Bug #38205 Row-based Replication (RBR) causes inconsistencies: HA_ERR_FOUND_DUPP_KEY -# Bug#319 if while a non-transactional slave is replicating a transaction possible problem -# -# Verifying the fact that STOP SLAVE in the middle of a group execution waits -# for the end of the group before the slave sql thread will stop. -# The patch refines STOP SLAVE to not interrupt a transaction or other type of -# the replication events group (the part I). -# Killing the sql thread continues to provide a "hard" stop (the part II). -# -# Non-deterministic tests -# - -source include/master-slave.inc; -source include/have_innodb.inc; - - -# -# Part II, killed sql slave leaves instantly -# - -# A. multi-statement transaction as the replication group - -connection master; - -create table t1i(n int primary key) engine=innodb; -create table t2m(n int primary key) engine=myisam; - -sync_slave_with_master; - -connection master; - -begin; -insert into t1i values (1); -insert into t1i values (2); -insert into t1i values (3); -commit; - -sync_slave_with_master; - -# -# todo: first challenge is to find out the SQL thread id -# the following is not fully reliable -# - -let $id=`SELECT id from information_schema.processlist where user like 'system user' and state like '%Has read all relay log%' or user like 'system user' and state like '%Reading event from the relay log%'`; -connection slave; -begin; -insert into t1i values (5); - -connection master; -let $pos0_master= query_get_value(SHOW MASTER STATUS, Position, 1); -begin; -insert into t1i values (4); -insert into t2m values (1); # non-ta update -update t1i set n = 5 where n = 4; # to block at. can't be played with killed -commit; -let $pos1_master= query_get_value(SHOW MASTER STATUS, Position, 1); - -connection slave; -# slave sql thread must be locked out by the conn `slave' explicit lock -let $pos0_slave= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1); ---disable_query_log -eval select $pos0_master - $pos0_slave as zero; ---enable_query_log - -connection slave1; - -let $count= 1; -let $table= t2m; -source include/wait_until_rows_count.inc; -# -# todo: may fail as said above -# ---echo *** kill sql thread *** ---disable_query_log -eval kill connection $id; ---enable_query_log - -connection slave; -rollback; # release the sql thread - -connection slave1; - -source include/wait_for_slave_sql_to_stop.inc; -let $sql_status= query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1); ---echo *** sql thread is *not* running: $sql_status *** -let $pos1_slave= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1); - -connection slave; ---echo *** the prove: the killed slave has not finished the current transaction *** - ---disable_query_log -select count(*) as three from t1i; -eval select $pos1_master > $pos1_slave as one; -eval select $pos1_slave - $pos0_slave as zero; ---enable_query_log - -delete from t2m; # remove the row to be able to replay -start slave sql_thread; - -# -# Part I: B The homogenous transaction remains interuptable in between -# - -connection master; -delete from t1i; -delete from t2m; - -sync_slave_with_master; -begin; -insert into t1i values (5); - -connection master; -let $pos0_master= query_get_value(SHOW MASTER STATUS, Position, 1); -begin; -insert into t1i values (4); -update t1i set n = 5 where n = 4; # to block at. not to be played -commit; -let $pos1_master= query_get_value(SHOW MASTER STATUS, Position, 1); - - -connection slave1; -# slave sql can't advance as must be locked by the conn `slave' trans -let $pos0_slave= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1); ---disable_query_log -eval select $pos0_master - $pos0_slave as zero; ---enable_query_log - -# -# the replicated trans is blocked by the slave's local. -# However, it's not easy to catch the exact moment when it happens. -# The test issues sleep which makes the test either non-deterministic or -# wasting too much time. -# ---sleep 3 - -send stop slave sql_thread; - -connection slave; -rollback; # release the sql thread - -connection slave1; -reap; -source include/wait_for_slave_sql_to_stop.inc; -let $sql_status= query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1); ---echo *** sql thread is *not* running: $sql_status *** - -let $pos1_slave= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1); - ---echo *** the prove: the stopped slave has rolled back the current transaction *** - ---disable_query_log -select count(*) as zero from t1i; -eval select $pos0_master - $pos0_slave as zero; -eval select $pos1_master > $pos0_slave as one; ---enable_query_log - -start slave sql_thread; - -# clean-up - -connection master; -drop table t1i, t2m; - ---source include/rpl_end.inc diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result b/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result index f19030834c8..fa8fb6c1eb2 100644 --- a/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result +++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result @@ -128,8 +128,6 @@ root@localhost db_storedproc_1 drop user 'user_1'@'localhost'; DROP PROCEDURE sp3; DROP FUNCTION fn1; -Warnings: -Warning 1403 There is no such grant defined for user 'user_1' on host 'localhost' on routine 'fn1' Testcase 3.1.6.4: ----------------- diff --git a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result index d02270a6b6f..511072237e0 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result @@ -15,11 +15,11 @@ def information_schema COLLATIONS IS_DEFAULT 4 NO varchar 3 9 NULL NULL utf8 ut def information_schema COLLATIONS SORTLEN 6 0 NO bigint NULL NULL 19 0 NULL NULL bigint(3) def information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) def information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) -def information_schema COLUMNS CHARACTER_MAXIMUM_LENGTH 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -def information_schema COLUMNS CHARACTER_OCTET_LENGTH 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +def information_schema COLUMNS CHARACTER_MAXIMUM_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +def information_schema COLUMNS CHARACTER_OCTET_LENGTH 10 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned def information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) def information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) -def information_schema COLUMNS COLUMN_COMMENT 19 NO varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) +def information_schema COLUMNS COLUMN_COMMENT 19 NO varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024) def information_schema COLUMNS COLUMN_DEFAULT 6 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext def information_schema COLUMNS COLUMN_KEY 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) def information_schema COLUMNS COLUMN_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) @@ -27,9 +27,9 @@ def information_schema COLUMNS COLUMN_TYPE 15 NULL NO longtext 4294967295 429496 def information_schema COLUMNS DATA_TYPE 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) def information_schema COLUMNS EXTRA 17 NO varchar 27 81 NULL NULL utf8 utf8_general_ci varchar(27) def information_schema COLUMNS IS_NULLABLE 7 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) -def information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -def information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -def information_schema COLUMNS ORDINAL_POSITION 5 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +def information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +def information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +def information_schema COLUMNS ORDINAL_POSITION 5 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned def information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) def information_schema COLUMNS TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) def information_schema COLUMNS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) @@ -71,14 +71,14 @@ def information_schema EVENTS SQL_MODE 12 NO varchar 8192 24576 NULL NULL utf8 def information_schema EVENTS STARTS 13 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime def information_schema EVENTS STATUS 15 NO varchar 18 54 NULL NULL utf8 utf8_general_ci varchar(18) def information_schema EVENTS TIME_ZONE 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -def information_schema FILES AUTOEXTEND_SIZE 19 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -def information_schema FILES AVG_ROW_LENGTH 28 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -def information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +def information_schema FILES AUTOEXTEND_SIZE 19 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +def information_schema FILES AVG_ROW_LENGTH 28 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +def information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned def information_schema FILES CHECK_TIME 35 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime def information_schema FILES CREATE_TIME 33 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime def information_schema FILES CREATION_TIME 20 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime -def information_schema FILES DATA_FREE 32 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -def information_schema FILES DATA_LENGTH 29 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +def information_schema FILES DATA_FREE 32 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +def information_schema FILES DATA_LENGTH 29 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned def information_schema FILES DELETED_ROWS 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) def information_schema FILES ENGINE 10 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) def information_schema FILES EXTENT_SIZE 16 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) @@ -88,27 +88,27 @@ def information_schema FILES FILE_NAME 2 NULL YES varchar 64 192 NULL NULL utf8 def information_schema FILES FILE_TYPE 3 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) def information_schema FILES FREE_EXTENTS 14 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) def information_schema FILES FULLTEXT_KEYS 11 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -def information_schema FILES INDEX_LENGTH 31 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -def information_schema FILES INITIAL_SIZE 17 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +def information_schema FILES INDEX_LENGTH 31 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +def information_schema FILES INITIAL_SIZE 17 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned def information_schema FILES LAST_ACCESS_TIME 22 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime def information_schema FILES LAST_UPDATE_TIME 21 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime def information_schema FILES LOGFILE_GROUP_NAME 8 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) def information_schema FILES LOGFILE_GROUP_NUMBER 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) -def information_schema FILES MAXIMUM_SIZE 18 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -def information_schema FILES MAX_DATA_LENGTH 30 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +def information_schema FILES MAXIMUM_SIZE 18 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +def information_schema FILES MAX_DATA_LENGTH 30 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned def information_schema FILES RECOVER_TIME 23 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) def information_schema FILES ROW_FORMAT 26 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10) def information_schema FILES STATUS 37 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) def information_schema FILES TABLESPACE_NAME 4 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) def information_schema FILES TABLE_CATALOG 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) def information_schema FILES TABLE_NAME 7 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -def information_schema FILES TABLE_ROWS 27 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +def information_schema FILES TABLE_ROWS 27 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned def information_schema FILES TABLE_SCHEMA 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) def information_schema FILES TOTAL_EXTENTS 15 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) def information_schema FILES TRANSACTION_COUNTER 24 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) def information_schema FILES UPDATE_COUNT 13 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) def information_schema FILES UPDATE_TIME 34 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime -def information_schema FILES VERSION 25 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +def information_schema FILES VERSION 25 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned def information_schema GLOBAL_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) def information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024) def information_schema GLOBAL_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) @@ -140,31 +140,32 @@ def information_schema PARAMETERS ROUTINE_TYPE 15 NO varchar 9 27 NULL NULL utf def information_schema PARAMETERS SPECIFIC_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) def information_schema PARAMETERS SPECIFIC_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) def information_schema PARAMETERS SPECIFIC_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -def information_schema PARTITIONS AVG_ROW_LENGTH 14 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -def information_schema PARTITIONS CHECKSUM 22 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +def information_schema PARTITIONS AVG_ROW_LENGTH 14 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +def information_schema PARTITIONS CHECKSUM 22 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned def information_schema PARTITIONS CHECK_TIME 21 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime def information_schema PARTITIONS CREATE_TIME 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime -def information_schema PARTITIONS DATA_FREE 18 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -def information_schema PARTITIONS DATA_LENGTH 15 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -def information_schema PARTITIONS INDEX_LENGTH 17 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -def information_schema PARTITIONS MAX_DATA_LENGTH 16 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +def information_schema PARTITIONS DATA_FREE 18 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +def information_schema PARTITIONS DATA_LENGTH 15 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +def information_schema PARTITIONS INDEX_LENGTH 17 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +def information_schema PARTITIONS MAX_DATA_LENGTH 16 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned def information_schema PARTITIONS NODEGROUP 24 NO varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12) def information_schema PARTITIONS PARTITION_COMMENT 23 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) def information_schema PARTITIONS PARTITION_DESCRIPTION 12 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext def information_schema PARTITIONS PARTITION_EXPRESSION 10 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext def information_schema PARTITIONS PARTITION_METHOD 8 NULL YES varchar 18 54 NULL NULL utf8 utf8_general_ci varchar(18) def information_schema PARTITIONS PARTITION_NAME 4 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -def information_schema PARTITIONS PARTITION_ORDINAL_POSITION 6 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +def information_schema PARTITIONS PARTITION_ORDINAL_POSITION 6 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned def information_schema PARTITIONS SUBPARTITION_EXPRESSION 11 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext def information_schema PARTITIONS SUBPARTITION_METHOD 9 NULL YES varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12) def information_schema PARTITIONS SUBPARTITION_NAME 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -def information_schema PARTITIONS SUBPARTITION_ORDINAL_POSITION 7 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +def information_schema PARTITIONS SUBPARTITION_ORDINAL_POSITION 7 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned def information_schema PARTITIONS TABLESPACE_NAME 25 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) def information_schema PARTITIONS TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) def information_schema PARTITIONS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -def information_schema PARTITIONS TABLE_ROWS 13 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +def information_schema PARTITIONS TABLE_ROWS 13 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned def information_schema PARTITIONS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) def information_schema PARTITIONS UPDATE_TIME 20 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime +def information_schema PLUGINS LOAD_OPTION 11 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) def information_schema PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) def information_schema PLUGINS PLUGIN_DESCRIPTION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext def information_schema PLUGINS PLUGIN_LIBRARY 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) @@ -242,6 +243,7 @@ def information_schema STATISTICS CARDINALITY 10 NULL YES bigint NULL NULL 19 0 def information_schema STATISTICS COLLATION 9 NULL YES varchar 1 3 NULL NULL utf8 utf8_general_ci varchar(1) def information_schema STATISTICS COLUMN_NAME 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) def information_schema STATISTICS COMMENT 15 NULL YES varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16) +def information_schema STATISTICS INDEX_COMMENT 16 NO varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024) def information_schema STATISTICS INDEX_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) def information_schema STATISTICS INDEX_SCHEMA 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) def information_schema STATISTICS INDEX_TYPE 14 NO varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16) @@ -253,33 +255,33 @@ def information_schema STATISTICS SUB_PART 11 NULL YES bigint NULL NULL 19 0 NUL def information_schema STATISTICS TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) def information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) def information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -def information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -def information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -def information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +def information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +def information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +def information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned def information_schema TABLES CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime def information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) def information_schema TABLES CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime -def information_schema TABLES DATA_FREE 13 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -def information_schema TABLES DATA_LENGTH 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +def information_schema TABLES DATA_FREE 13 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +def information_schema TABLES DATA_LENGTH 10 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned def information_schema TABLES ENGINE 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -def information_schema TABLES INDEX_LENGTH 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -def information_schema TABLES MAX_DATA_LENGTH 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +def information_schema TABLES INDEX_LENGTH 12 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +def information_schema TABLES MAX_DATA_LENGTH 11 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned def information_schema TABLES ROW_FORMAT 7 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10) def information_schema TABLES TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) def information_schema TABLES TABLE_COLLATION 18 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) -def information_schema TABLES TABLE_COMMENT 21 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) +def information_schema TABLES TABLE_COMMENT 21 NO varchar 2048 6144 NULL NULL utf8 utf8_general_ci varchar(2048) def information_schema TABLES TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -def information_schema TABLES TABLE_ROWS 8 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +def information_schema TABLES TABLE_ROWS 8 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned def information_schema TABLES TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) def information_schema TABLES TABLE_TYPE 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) def information_schema TABLES UPDATE_TIME 16 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime -def information_schema TABLES VERSION 6 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -def information_schema TABLESPACES AUTOEXTEND_SIZE 6 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +def information_schema TABLES VERSION 6 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +def information_schema TABLESPACES AUTOEXTEND_SIZE 6 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned def information_schema TABLESPACES ENGINE 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -def information_schema TABLESPACES EXTENT_SIZE 5 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +def information_schema TABLESPACES EXTENT_SIZE 5 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned def information_schema TABLESPACES LOGFILE_GROUP_NAME 4 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -def information_schema TABLESPACES MAXIMUM_SIZE 7 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -def information_schema TABLESPACES NODEGROUP_ID 8 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +def information_schema TABLESPACES MAXIMUM_SIZE 7 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +def information_schema TABLESPACES NODEGROUP_ID 8 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned def information_schema TABLESPACES TABLESPACE_COMMENT 9 NULL YES varchar 2048 6144 NULL NULL utf8 utf8_general_ci varchar(2048) def information_schema TABLESPACES TABLESPACE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) def information_schema TABLESPACES TABLESPACE_TYPE 3 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) @@ -419,7 +421,7 @@ NULL information_schema COLUMNS NUMERIC_SCALE bigint NULL NULL NULL NULL bigint( 3.0000 information_schema COLUMNS COLUMN_KEY varchar 3 9 utf8 utf8_general_ci varchar(3) 3.0000 information_schema COLUMNS EXTRA varchar 27 81 utf8 utf8_general_ci varchar(27) 3.0000 information_schema COLUMNS PRIVILEGES varchar 80 240 utf8 utf8_general_ci varchar(80) -3.0000 information_schema COLUMNS COLUMN_COMMENT varchar 255 765 utf8 utf8_general_ci varchar(255) +3.0000 information_schema COLUMNS COLUMN_COMMENT varchar 1024 3072 utf8 utf8_general_ci varchar(1024) 3.0000 information_schema COLUMN_PRIVILEGES GRANTEE varchar 81 243 utf8 utf8_general_ci varchar(81) 3.0000 information_schema COLUMN_PRIVILEGES TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512) 3.0000 information_schema COLUMN_PRIVILEGES TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64) @@ -561,6 +563,7 @@ NULL information_schema PARTITIONS CHECKSUM bigint NULL NULL NULL NULL bigint(21 3.0000 information_schema PLUGINS PLUGIN_AUTHOR varchar 64 192 utf8 utf8_general_ci varchar(64) 1.0000 information_schema PLUGINS PLUGIN_DESCRIPTION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext 3.0000 information_schema PLUGINS PLUGIN_LICENSE varchar 80 240 utf8 utf8_general_ci varchar(80) +3.0000 information_schema PLUGINS LOAD_OPTION varchar 64 192 utf8 utf8_general_ci varchar(64) NULL information_schema PROCESSLIST ID bigint NULL NULL NULL NULL bigint(4) 3.0000 information_schema PROCESSLIST USER varchar 16 48 utf8 utf8_general_ci varchar(16) 3.0000 information_schema PROCESSLIST HOST varchar 64 192 utf8 utf8_general_ci varchar(64) @@ -639,6 +642,7 @@ NULL information_schema STATISTICS SUB_PART bigint NULL NULL NULL NULL bigint(3) 3.0000 information_schema STATISTICS NULLABLE varchar 3 9 utf8 utf8_general_ci varchar(3) 3.0000 information_schema STATISTICS INDEX_TYPE varchar 16 48 utf8 utf8_general_ci varchar(16) 3.0000 information_schema STATISTICS COMMENT varchar 16 48 utf8 utf8_general_ci varchar(16) +3.0000 information_schema STATISTICS INDEX_COMMENT varchar 1024 3072 utf8 utf8_general_ci varchar(1024) 3.0000 information_schema TABLES TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512) 3.0000 information_schema TABLES TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64) 3.0000 information_schema TABLES TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) @@ -659,7 +663,7 @@ NULL information_schema TABLES CHECK_TIME datetime NULL NULL NULL NULL datetime 3.0000 information_schema TABLES TABLE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32) NULL information_schema TABLES CHECKSUM bigint NULL NULL NULL NULL bigint(21) unsigned 3.0000 information_schema TABLES CREATE_OPTIONS varchar 255 765 utf8 utf8_general_ci varchar(255) -3.0000 information_schema TABLES TABLE_COMMENT varchar 80 240 utf8 utf8_general_ci varchar(80) +3.0000 information_schema TABLES TABLE_COMMENT varchar 2048 6144 utf8 utf8_general_ci varchar(2048) 3.0000 information_schema TABLESPACES TABLESPACE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) 3.0000 information_schema TABLESPACES ENGINE varchar 64 192 utf8 utf8_general_ci varchar(64) 3.0000 information_schema TABLESPACES TABLESPACE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64) diff --git a/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result index 55f7ebf91ae..5c22a38c63c 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result @@ -479,9 +479,9 @@ def test tb1 f27 27 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zerof def test tb1 f28 28 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill def test tb1 f29 29 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) def test tb1 f3 3 NULL YES char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) -def test tb1 f30 30 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned -def test tb1 f31 31 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill -def test tb1 f32 32 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill +def test tb1 f30 30 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned +def test tb1 f31 31 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned zerofill +def test tb1 f32 32 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned zerofill def test tb1 f33 33 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) def test tb1 f34 34 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned def test tb1 f35 35 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill @@ -602,9 +602,9 @@ def test tb3 f143 26 99999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned def test tb3 f144 27 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill def test tb3 f145 28 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill def test tb3 f146 29 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) -def test tb3 f147 30 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned -def test tb3 f148 31 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill -def test tb3 f149 32 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill +def test tb3 f147 30 999999 NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned +def test tb3 f148 31 00000000000000999999 NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned zerofill +def test tb3 f149 32 00000000000000999999 NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned zerofill def test tb3 f150 33 1000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) def test tb3 f151 34 999 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned def test tb3 f152 35 0000001000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql.result b/mysql-test/suite/funcs_1/r/is_columns_mysql.result index c61a09084a8..95ffd62fbb8 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_mysql.result +++ b/mysql-test/suite/funcs_1/r/is_columns_mysql.result @@ -185,7 +185,7 @@ def mysql time_zone_transition_type Time_zone_id 1 NULL NO int NULL NULL 10 0 NU def mysql time_zone_transition_type Transition_type_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references def mysql user Alter_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references def mysql user Alter_routine_priv 28 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references -def mysql user authentication_string 42 NULL NO text 65535 65535 NULL NULL utf8 utf8_bin text select,insert,update,references +def mysql user authentication_string 42 NULL YES text 65535 65535 NULL NULL utf8 utf8_bin text select,insert,update,references def mysql user Create_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references def mysql user Create_routine_priv 27 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references def mysql user Create_tablespace_priv 32 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references @@ -207,7 +207,7 @@ def mysql user max_questions 37 0 NO int NULL NULL 10 0 NULL NULL int(11) unsign def mysql user max_updates 38 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references def mysql user max_user_connections 40 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references def mysql user Password 3 NO char 41 41 NULL NULL latin1 latin1_bin char(41) select,insert,update,references -def mysql user plugin 41 NO char 60 180 NULL NULL utf8 utf8_bin char(60) select,insert,update,references +def mysql user plugin 41 YES char 64 192 NULL NULL utf8 utf8_bin char(64) select,insert,update,references def mysql user Process_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references def mysql user References_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references def mysql user Reload_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references @@ -516,5 +516,5 @@ NULL mysql user max_questions int NULL NULL NULL NULL int(11) unsigned NULL mysql user max_updates int NULL NULL NULL NULL int(11) unsigned NULL mysql user max_connections int NULL NULL NULL NULL int(11) unsigned NULL mysql user max_user_connections int NULL NULL NULL NULL int(11) unsigned -3.0000 mysql user plugin char 60 180 utf8 utf8_bin char(60) +3.0000 mysql user plugin char 64 192 utf8 utf8_bin char(64) 1.0000 mysql user authentication_string text 65535 65535 utf8 utf8_bin text diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result index 7c52358258b..95b160ce745 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result @@ -97,13 +97,13 @@ def mysql host Select_priv 3 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum(' def mysql host Show_view_priv 16 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') def mysql host Trigger_priv 20 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') def mysql host Update_priv 5 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') -def mysql ndb_binlog_index deletes 6 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned -def mysql ndb_binlog_index epoch 3 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned PRI +def mysql ndb_binlog_index deletes 6 NULL NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned +def mysql ndb_binlog_index epoch 3 NULL NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned PRI def mysql ndb_binlog_index File 2 NULL NO varchar 255 255 NULL NULL latin1 latin1_swedish_ci varchar(255) -def mysql ndb_binlog_index inserts 4 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned -def mysql ndb_binlog_index Position 1 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned -def mysql ndb_binlog_index schemaops 7 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned -def mysql ndb_binlog_index updates 5 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned +def mysql ndb_binlog_index inserts 4 NULL NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned +def mysql ndb_binlog_index Position 1 NULL NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned +def mysql ndb_binlog_index schemaops 7 NULL NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned +def mysql ndb_binlog_index updates 5 NULL NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned def mysql plugin dl 2 NO varchar 128 384 NULL NULL utf8 utf8_general_ci varchar(128) def mysql plugin name 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) PRI def mysql proc body 11 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob @@ -134,6 +134,13 @@ def mysql procs_priv Routine_name 4 NO char 64 192 NULL NULL utf8 utf8_general_ def mysql procs_priv Routine_type 5 NULL NO enum 9 27 NULL NULL utf8 utf8_bin enum('FUNCTION','PROCEDURE') PRI def mysql procs_priv Timestamp 8 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP def mysql procs_priv User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI +def mysql proxies_priv Grantor 6 NO char 77 231 NULL NULL utf8 utf8_bin char(77) MUL +def mysql proxies_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI +def mysql proxies_priv Proxied_host 3 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI +def mysql proxies_priv Proxied_user 4 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI +def mysql proxies_priv Timestamp 7 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP +def mysql proxies_priv User 2 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI +def mysql proxies_priv With_grant 5 0 NO tinyint NULL NULL 3 0 NULL NULL tinyint(1) def mysql servers Db 3 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) def mysql servers Host 2 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) def mysql servers Owner 9 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) @@ -178,6 +185,7 @@ def mysql time_zone_transition_type Time_zone_id 1 NULL NO int NULL NULL 10 0 NU def mysql time_zone_transition_type Transition_type_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI def mysql user Alter_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') def mysql user Alter_routine_priv 28 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +def mysql user authentication_string 42 NULL YES text 65535 65535 NULL NULL utf8 utf8_bin text def mysql user Create_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') def mysql user Create_routine_priv 27 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') def mysql user Create_tablespace_priv 32 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') @@ -199,6 +207,7 @@ def mysql user max_questions 37 0 NO int NULL NULL 10 0 NULL NULL int(11) unsign def mysql user max_updates 38 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned def mysql user max_user_connections 40 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned def mysql user Password 3 NO char 41 41 NULL NULL latin1 latin1_bin char(41) +def mysql user plugin 41 YES char 64 192 NULL NULL utf8 utf8_bin char(64) def mysql user Process_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') def mysql user References_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') def mysql user Reload_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') @@ -418,6 +427,13 @@ NULL mysql proc modified timestamp NULL NULL NULL NULL timestamp 3.0000 mysql procs_priv Grantor char 77 231 utf8 utf8_bin char(77) 3.0000 mysql procs_priv Proc_priv set 27 81 utf8 utf8_general_ci set('Execute','Alter Routine','Grant') NULL mysql procs_priv Timestamp timestamp NULL NULL NULL NULL timestamp +3.0000 mysql proxies_priv Host char 60 180 utf8 utf8_bin char(60) +3.0000 mysql proxies_priv User char 16 48 utf8 utf8_bin char(16) +3.0000 mysql proxies_priv Proxied_host char 60 180 utf8 utf8_bin char(60) +3.0000 mysql proxies_priv Proxied_user char 16 48 utf8 utf8_bin char(16) +NULL mysql proxies_priv With_grant tinyint NULL NULL NULL NULL tinyint(1) +3.0000 mysql proxies_priv Grantor char 77 231 utf8 utf8_bin char(77) +NULL mysql proxies_priv Timestamp timestamp NULL NULL NULL NULL timestamp 3.0000 mysql servers Server_name char 64 192 utf8 utf8_general_ci char(64) 3.0000 mysql servers Host char 64 192 utf8 utf8_general_ci char(64) 3.0000 mysql servers Db char 64 192 utf8 utf8_general_ci char(64) @@ -500,3 +516,5 @@ NULL mysql user max_questions int NULL NULL NULL NULL int(11) unsigned NULL mysql user max_updates int NULL NULL NULL NULL int(11) unsigned NULL mysql user max_connections int NULL NULL NULL NULL int(11) unsigned NULL mysql user max_user_connections int NULL NULL NULL NULL int(11) unsigned +3.0000 mysql user plugin char 64 192 utf8 utf8_bin char(64) +1.0000 mysql user authentication_string text 65535 65535 utf8 utf8_bin text diff --git a/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result index ea28427d0f5..9137d70b88c 100644 --- a/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result @@ -6,108 +6,118 @@ GRANT SELECT ON db_datadict.* TO testuser1@localhost; SELECT * FROM information_schema.statistics WHERE table_schema = 'mysql' ORDER BY table_schema, table_name, index_name, seq_in_index, column_name; -TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT -def mysql columns_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE -def mysql columns_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE -def mysql columns_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE -def mysql columns_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE -def mysql columns_priv 0 mysql PRIMARY 5 Column_name A #CARD# NULL NULL BTREE -def mysql db 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE -def mysql db 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE -def mysql db 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE -def mysql db 1 mysql User 1 User A #CARD# NULL NULL BTREE -def mysql event 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE -def mysql event 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE -def mysql func 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE -def mysql help_category 0 mysql name 1 name A #CARD# NULL NULL BTREE -def mysql help_category 0 mysql PRIMARY 1 help_category_id A #CARD# NULL NULL BTREE -def mysql help_keyword 0 mysql name 1 name A #CARD# NULL NULL BTREE -def mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE -def mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE -def mysql help_relation 0 mysql PRIMARY 2 help_topic_id A #CARD# NULL NULL BTREE -def mysql help_topic 0 mysql name 1 name A #CARD# NULL NULL BTREE -def mysql help_topic 0 mysql PRIMARY 1 help_topic_id A #CARD# NULL NULL BTREE -def mysql host 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE -def mysql host 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE -def mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A #CARD# NULL NULL BTREE -def mysql plugin 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE -def mysql proc 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE -def mysql proc 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE -def mysql proc 0 mysql PRIMARY 3 type A #CARD# NULL NULL BTREE -def mysql procs_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE -def mysql procs_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE -def mysql procs_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE -def mysql procs_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE -def mysql procs_priv 0 mysql PRIMARY 4 Routine_name A #CARD# NULL NULL BTREE -def mysql procs_priv 0 mysql PRIMARY 5 Routine_type A #CARD# NULL NULL BTREE -def mysql servers 0 mysql PRIMARY 1 Server_name A #CARD# NULL NULL BTREE -def mysql tables_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE -def mysql tables_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE -def mysql tables_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE -def mysql tables_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE -def mysql tables_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE -def mysql time_zone 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE -def mysql time_zone_leap_second 0 mysql PRIMARY 1 Transition_time A #CARD# NULL NULL BTREE -def mysql time_zone_name 0 mysql PRIMARY 1 Name A #CARD# NULL NULL BTREE -def mysql time_zone_transition 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE -def mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A #CARD# NULL NULL BTREE -def mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE -def mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A #CARD# NULL NULL BTREE -def mysql user 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE -def mysql user 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT INDEX_COMMENT +def mysql columns_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE +def mysql columns_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE +def mysql columns_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE +def mysql columns_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE +def mysql columns_priv 0 mysql PRIMARY 5 Column_name A #CARD# NULL NULL BTREE +def mysql db 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE +def mysql db 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE +def mysql db 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE +def mysql db 1 mysql User 1 User A #CARD# NULL NULL BTREE +def mysql event 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE +def mysql event 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE +def mysql func 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE +def mysql help_category 0 mysql name 1 name A #CARD# NULL NULL BTREE +def mysql help_category 0 mysql PRIMARY 1 help_category_id A #CARD# NULL NULL BTREE +def mysql help_keyword 0 mysql name 1 name A #CARD# NULL NULL BTREE +def mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE +def mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE +def mysql help_relation 0 mysql PRIMARY 2 help_topic_id A #CARD# NULL NULL BTREE +def mysql help_topic 0 mysql name 1 name A #CARD# NULL NULL BTREE +def mysql help_topic 0 mysql PRIMARY 1 help_topic_id A #CARD# NULL NULL BTREE +def mysql host 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE +def mysql host 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE +def mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A #CARD# NULL NULL BTREE +def mysql plugin 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE +def mysql proc 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE +def mysql proc 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE +def mysql proc 0 mysql PRIMARY 3 type A #CARD# NULL NULL BTREE +def mysql procs_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE +def mysql procs_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE +def mysql procs_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE +def mysql procs_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE +def mysql procs_priv 0 mysql PRIMARY 4 Routine_name A #CARD# NULL NULL BTREE +def mysql procs_priv 0 mysql PRIMARY 5 Routine_type A #CARD# NULL NULL BTREE +def mysql proxies_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE +def mysql proxies_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE +def mysql proxies_priv 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE +def mysql proxies_priv 0 mysql PRIMARY 3 Proxied_host A #CARD# NULL NULL BTREE +def mysql proxies_priv 0 mysql PRIMARY 4 Proxied_user A #CARD# NULL NULL BTREE +def mysql servers 0 mysql PRIMARY 1 Server_name A #CARD# NULL NULL BTREE +def mysql tables_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE +def mysql tables_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE +def mysql tables_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE +def mysql tables_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE +def mysql tables_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE +def mysql time_zone 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE +def mysql time_zone_leap_second 0 mysql PRIMARY 1 Transition_time A #CARD# NULL NULL BTREE +def mysql time_zone_name 0 mysql PRIMARY 1 Name A #CARD# NULL NULL BTREE +def mysql time_zone_transition 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE +def mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A #CARD# NULL NULL BTREE +def mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE +def mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A #CARD# NULL NULL BTREE +def mysql user 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE +def mysql user 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE # Establish connection testuser1 (user=testuser1) SELECT * FROM information_schema.statistics WHERE table_schema = 'mysql' ORDER BY table_schema, table_name, index_name, seq_in_index, column_name; -TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT -def mysql columns_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE -def mysql columns_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE -def mysql columns_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE -def mysql columns_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE -def mysql columns_priv 0 mysql PRIMARY 5 Column_name A #CARD# NULL NULL BTREE -def mysql db 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE -def mysql db 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE -def mysql db 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE -def mysql db 1 mysql User 1 User A #CARD# NULL NULL BTREE -def mysql event 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE -def mysql event 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE -def mysql func 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE -def mysql help_category 0 mysql name 1 name A #CARD# NULL NULL BTREE -def mysql help_category 0 mysql PRIMARY 1 help_category_id A #CARD# NULL NULL BTREE -def mysql help_keyword 0 mysql name 1 name A #CARD# NULL NULL BTREE -def mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE -def mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE -def mysql help_relation 0 mysql PRIMARY 2 help_topic_id A #CARD# NULL NULL BTREE -def mysql help_topic 0 mysql name 1 name A #CARD# NULL NULL BTREE -def mysql help_topic 0 mysql PRIMARY 1 help_topic_id A #CARD# NULL NULL BTREE -def mysql host 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE -def mysql host 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE -def mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A #CARD# NULL NULL BTREE -def mysql plugin 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE -def mysql proc 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE -def mysql proc 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE -def mysql proc 0 mysql PRIMARY 3 type A #CARD# NULL NULL BTREE -def mysql procs_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE -def mysql procs_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE -def mysql procs_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE -def mysql procs_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE -def mysql procs_priv 0 mysql PRIMARY 4 Routine_name A #CARD# NULL NULL BTREE -def mysql procs_priv 0 mysql PRIMARY 5 Routine_type A #CARD# NULL NULL BTREE -def mysql servers 0 mysql PRIMARY 1 Server_name A #CARD# NULL NULL BTREE -def mysql tables_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE -def mysql tables_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE -def mysql tables_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE -def mysql tables_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE -def mysql tables_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE -def mysql time_zone 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE -def mysql time_zone_leap_second 0 mysql PRIMARY 1 Transition_time A #CARD# NULL NULL BTREE -def mysql time_zone_name 0 mysql PRIMARY 1 Name A #CARD# NULL NULL BTREE -def mysql time_zone_transition 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE -def mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A #CARD# NULL NULL BTREE -def mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE -def mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A #CARD# NULL NULL BTREE -def mysql user 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE -def mysql user 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT INDEX_COMMENT +def mysql columns_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE +def mysql columns_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE +def mysql columns_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE +def mysql columns_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE +def mysql columns_priv 0 mysql PRIMARY 5 Column_name A #CARD# NULL NULL BTREE +def mysql db 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE +def mysql db 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE +def mysql db 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE +def mysql db 1 mysql User 1 User A #CARD# NULL NULL BTREE +def mysql event 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE +def mysql event 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE +def mysql func 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE +def mysql help_category 0 mysql name 1 name A #CARD# NULL NULL BTREE +def mysql help_category 0 mysql PRIMARY 1 help_category_id A #CARD# NULL NULL BTREE +def mysql help_keyword 0 mysql name 1 name A #CARD# NULL NULL BTREE +def mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE +def mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE +def mysql help_relation 0 mysql PRIMARY 2 help_topic_id A #CARD# NULL NULL BTREE +def mysql help_topic 0 mysql name 1 name A #CARD# NULL NULL BTREE +def mysql help_topic 0 mysql PRIMARY 1 help_topic_id A #CARD# NULL NULL BTREE +def mysql host 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE +def mysql host 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE +def mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A #CARD# NULL NULL BTREE +def mysql plugin 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE +def mysql proc 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE +def mysql proc 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE +def mysql proc 0 mysql PRIMARY 3 type A #CARD# NULL NULL BTREE +def mysql procs_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE +def mysql procs_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE +def mysql procs_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE +def mysql procs_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE +def mysql procs_priv 0 mysql PRIMARY 4 Routine_name A #CARD# NULL NULL BTREE +def mysql procs_priv 0 mysql PRIMARY 5 Routine_type A #CARD# NULL NULL BTREE +def mysql proxies_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE +def mysql proxies_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE +def mysql proxies_priv 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE +def mysql proxies_priv 0 mysql PRIMARY 3 Proxied_host A #CARD# NULL NULL BTREE +def mysql proxies_priv 0 mysql PRIMARY 4 Proxied_user A #CARD# NULL NULL BTREE +def mysql servers 0 mysql PRIMARY 1 Server_name A #CARD# NULL NULL BTREE +def mysql tables_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE +def mysql tables_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE +def mysql tables_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE +def mysql tables_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE +def mysql tables_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE +def mysql time_zone 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE +def mysql time_zone_leap_second 0 mysql PRIMARY 1 Transition_time A #CARD# NULL NULL BTREE +def mysql time_zone_name 0 mysql PRIMARY 1 Name A #CARD# NULL NULL BTREE +def mysql time_zone_transition 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE +def mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A #CARD# NULL NULL BTREE +def mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE +def mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A #CARD# NULL NULL BTREE +def mysql user 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE +def mysql user 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE # Switch to connection default and close connection testuser1 DROP USER testuser1@localhost; DROP DATABASE db_datadict; diff --git a/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result index e0ea412e83a..307357cdd2b 100644 --- a/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result @@ -23,6 +23,7 @@ def mysql PRIMARY mysql ndb_binlog_index PRIMARY KEY def mysql PRIMARY mysql plugin PRIMARY KEY def mysql PRIMARY mysql proc PRIMARY KEY def mysql PRIMARY mysql procs_priv PRIMARY KEY +def mysql PRIMARY mysql proxies_priv PRIMARY KEY def mysql PRIMARY mysql servers PRIMARY KEY def mysql PRIMARY mysql tables_priv PRIMARY KEY def mysql PRIMARY mysql time_zone PRIMARY KEY @@ -52,6 +53,7 @@ def mysql PRIMARY mysql ndb_binlog_index PRIMARY KEY def mysql PRIMARY mysql plugin PRIMARY KEY def mysql PRIMARY mysql proc PRIMARY KEY def mysql PRIMARY mysql procs_priv PRIMARY KEY +def mysql PRIMARY mysql proxies_priv PRIMARY KEY def mysql PRIMARY mysql servers PRIMARY KEY def mysql PRIMARY mysql tables_priv PRIMARY KEY def mysql PRIMARY mysql time_zone PRIMARY KEY diff --git a/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result index ba30f6415bb..3ace567e727 100644 --- a/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result @@ -336,6 +336,29 @@ user_comment Procedure privileges Separator ----------------------------------------------------- TABLE_CATALOG def TABLE_SCHEMA mysql +TABLE_NAME proxies_priv +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_bin +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment User proxy privileges +Separator ----------------------------------------------------- +TABLE_CATALOG def +TABLE_SCHEMA mysql TABLE_NAME servers TABLE_TYPE BASE TABLE ENGINE MyISAM @@ -881,6 +904,29 @@ user_comment Procedure privileges Separator ----------------------------------------------------- TABLE_CATALOG def TABLE_SCHEMA mysql +TABLE_NAME proxies_priv +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_bin +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment User proxy privileges +Separator ----------------------------------------------------- +TABLE_CATALOG def +TABLE_SCHEMA mysql TABLE_NAME servers TABLE_TYPE BASE TABLE ENGINE MyISAM diff --git a/mysql-test/suite/funcs_1/r/is_user_privileges.result b/mysql-test/suite/funcs_1/r/is_user_privileges.result index 1ec1ffc4ce1..b269da53a3d 100644 --- a/mysql-test/suite/funcs_1/r/is_user_privileges.result +++ b/mysql-test/suite/funcs_1/r/is_user_privileges.result @@ -128,7 +128,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser2 Password @@ -170,7 +170,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser3 Password @@ -212,7 +212,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL # # Add GRANT OPTION db_datadict.* to testuser1; GRANT UPDATE ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION; @@ -278,7 +278,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser2 Password @@ -320,7 +320,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser3 Password @@ -362,7 +362,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL # Establish connection testuser1 (user=testuser1) SELECT * FROM information_schema.user_privileges WHERE grantee LIKE '''testuser%''' @@ -414,7 +414,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser2 Password @@ -456,7 +456,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser3 Password @@ -498,7 +498,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL SHOW GRANTS; Grants for testuser1@localhost GRANT USAGE ON *.* TO 'testuser1'@'localhost' @@ -572,7 +572,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser2 Password @@ -614,7 +614,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser3 Password @@ -656,7 +656,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL GRANT SELECT ON *.* TO 'testuser1'@'localhost' WITH GRANT OPTION; # # Here <SELECT YES> is shown correctly for testuser1; @@ -722,7 +722,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser2 Password @@ -764,7 +764,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser3 Password @@ -806,7 +806,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL # Switch to connection testuser1 SELECT * FROM information_schema.user_privileges WHERE grantee LIKE '''testuser%''' @@ -858,7 +858,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser2 Password @@ -900,7 +900,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser3 Password @@ -942,7 +942,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL SHOW GRANTS; Grants for testuser1@localhost GRANT SELECT ON *.* TO 'testuser1'@'localhost' WITH GRANT OPTION @@ -1046,7 +1046,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser2 Password @@ -1088,7 +1088,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser3 Password @@ -1130,7 +1130,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL # Switch to connection testuser1 SELECT * FROM information_schema.user_privileges WHERE grantee LIKE '''testuser%''' @@ -1229,7 +1229,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser2 Password @@ -1271,7 +1271,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser3 Password @@ -1313,7 +1313,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL # Switch to connection testuser1 SELECT * FROM information_schema.user_privileges WHERE grantee LIKE '''testuser%''' @@ -1365,7 +1365,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser2 Password @@ -1407,7 +1407,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser3 Password @@ -1449,7 +1449,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL SHOW GRANTS; Grants for testuser1@localhost GRANT USAGE ON *.* TO 'testuser1'@'localhost' @@ -1508,7 +1508,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser2 Password @@ -1550,7 +1550,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser3 Password @@ -1592,7 +1592,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL SHOW GRANTS; Grants for testuser1@localhost GRANT USAGE ON *.* TO 'testuser1'@'localhost' @@ -1666,7 +1666,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser2 Password @@ -1708,7 +1708,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser3 Password @@ -1750,7 +1750,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL # Switch to connection testuser1 SELECT * FROM information_schema.user_privileges WHERE grantee LIKE '''testuser%''' diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc_06.result b/mysql-test/suite/funcs_1/r/memory_storedproc_06.result index 0a117c830ee..f08165b21f8 100644 --- a/mysql-test/suite/funcs_1/r/memory_storedproc_06.result +++ b/mysql-test/suite/funcs_1/r/memory_storedproc_06.result @@ -129,8 +129,6 @@ root@localhost db_storedproc_1 drop user 'user_1'@'localhost'; DROP PROCEDURE sp3; DROP FUNCTION fn1; -Warnings: -Warning 1403 There is no such grant defined for user 'user_1' on host 'localhost' on routine 'fn1' Testcase 3.1.6.4: ----------------- diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result b/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result index 0a117c830ee..f08165b21f8 100644 --- a/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result +++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result @@ -129,8 +129,6 @@ root@localhost db_storedproc_1 drop user 'user_1'@'localhost'; DROP PROCEDURE sp3; DROP FUNCTION fn1; -Warnings: -Warning 1403 There is no such grant defined for user 'user_1' on host 'localhost' on routine 'fn1' Testcase 3.1.6.4: ----------------- diff --git a/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc b/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc index 0695a0724d8..3e5ca055ae1 100644 --- a/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc +++ b/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc @@ -149,10 +149,6 @@ USE db_storedproc_1; drop user 'user_1'@'localhost'; DROP PROCEDURE sp3; -# This drop function shouldn't generated a warning as the -# privileges should have been removed when the user was -# dropped. Reported as Bug#36544 DROP USER does not remove -# stored function privileges DROP FUNCTION fn1; diff --git a/mysql-test/suite/innodb/r/innodb_bug60196.result b/mysql-test/suite/innodb/r/innodb_bug60196.result new file mode 100755 index 00000000000..85707f81a28 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug60196.result @@ -0,0 +1,73 @@ +CREATE TABLE Bug_60196_FK1 (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE Bug_60196_FK2 (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE Bug_60196 ( +FK1_Key INT NOT NULL, +FK2_Key INT NOT NULL, +PRIMARY KEY (FK2_Key, FK1_Key), +KEY FK1_Key (FK1_Key), +KEY FK2_Key (FK2_Key), +CONSTRAINT FK_FK1 FOREIGN KEY (FK1_Key) +REFERENCES Bug_60196_FK1 (Primary_Key) +ON DELETE CASCADE +ON UPDATE CASCADE, +CONSTRAINT FK_FK2 FOREIGN KEY (FK2_Key) +REFERENCES Bug_60196_FK2 (Primary_Key) +ON DELETE CASCADE +ON UPDATE CASCADE +) ENGINE=InnoDB; +INSERT INTO Bug_60196_FK1 VALUES (1), (2), (3), (4), (5); +INSERT INTO Bug_60196_FK2 VALUES (1), (2), (3), (4), (5); +INSERT INTO Bug_60196 VALUES (1, 1); +INSERT INTO Bug_60196 VALUES (1, 2); +INSERT INTO Bug_60196 VALUES (1, 3); +INSERT INTO Bug_60196 VALUES (1, 99); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`bug_60196`, CONSTRAINT `FK_FK2` FOREIGN KEY (`FK2_Key`) REFERENCES `Bug_60196_FK2` (`Primary_Key`) ON DELETE CASCADE ON UPDATE CASCADE) +INSERT INTO Bug_60196 VALUES (99, 1); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`bug_60196`, CONSTRAINT `FK_FK1` FOREIGN KEY (`FK1_Key`) REFERENCES `Bug_60196_FK1` (`Primary_Key`) ON DELETE CASCADE ON UPDATE CASCADE) +SELECT * FROM bug_60196_FK1; +Primary_Key +1 +2 +3 +4 +5 +SELECT * FROM bug_60196_FK2; +Primary_Key +1 +2 +3 +4 +5 +SELECT * FROM bug_60196; +FK1_Key FK2_Key +1 1 +1 2 +1 3 +# Stop server +# Restart server. +# +# Try to insert more to the example table with foreign keys. +# Bug60196 causes the foreign key file not to be found after +# the resstart above. +# +SELECT * FROM Bug_60196; +FK1_Key FK2_Key +1 1 +1 2 +1 3 +INSERT INTO Bug_60196 VALUES (2, 1); +INSERT INTO Bug_60196 VALUES (2, 2); +INSERT INTO Bug_60196 VALUES (2, 3); +SELECT * FROM Bug_60196; +FK1_Key FK2_Key +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 + +# Clean up. +DROP TABLE Bug_60196; +DROP TABLE Bug_60196_FK1; +DROP TABLE Bug_60196_FK2; diff --git a/mysql-test/suite/innodb/t/innodb_bug53756.test b/mysql-test/suite/innodb/t/innodb_bug53756.test index 67a95371821..ae23e9d41a3 100644 --- a/mysql-test/suite/innodb/t/innodb_bug53756.test +++ b/mysql-test/suite/innodb/t/innodb_bug53756.test @@ -17,6 +17,9 @@ # This test case needs InnoDB. -- source include/have_innodb.inc +# Avoid CrashReporter popup on Mac +--source include/not_crashrep.inc + # # Precautionary clean up. # diff --git a/mysql-test/suite/innodb/t/innodb_bug60196-master.opt b/mysql-test/suite/innodb/t/innodb_bug60196-master.opt new file mode 100755 index 00000000000..c0a1981fa7c --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug60196-master.opt @@ -0,0 +1 @@ +--lower-case-table-names=2
diff --git a/mysql-test/suite/innodb/t/innodb_bug60196.test b/mysql-test/suite/innodb/t/innodb_bug60196.test new file mode 100755 index 00000000000..47c646a5a75 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug60196.test @@ -0,0 +1,87 @@ +# Bug#60196 - Setting lowercase_table_names to 2 on Windows causing +# Foreign Key problems after an engine is restarted. + +# This test case needs InnoDB, a lowercase file system, +# lower-case-table-names=2, and cannot use the embedded server +# because it restarts the server. +--source include/not_embedded.inc +--source include/have_lowercase2.inc +--source include/have_case_insensitive_file_system.inc +--source include/have_innodb.inc + +# +# Create test data. +# +CREATE TABLE Bug_60196_FK1 (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE Bug_60196_FK2 (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE Bug_60196 ( + FK1_Key INT NOT NULL, + FK2_Key INT NOT NULL, + PRIMARY KEY (FK2_Key, FK1_Key), + KEY FK1_Key (FK1_Key), + KEY FK2_Key (FK2_Key), + CONSTRAINT FK_FK1 FOREIGN KEY (FK1_Key) + REFERENCES Bug_60196_FK1 (Primary_Key) + ON DELETE CASCADE + ON UPDATE CASCADE, + CONSTRAINT FK_FK2 FOREIGN KEY (FK2_Key) + REFERENCES Bug_60196_FK2 (Primary_Key) + ON DELETE CASCADE + ON UPDATE CASCADE +) ENGINE=InnoDB; +INSERT INTO Bug_60196_FK1 VALUES (1), (2), (3), (4), (5); +INSERT INTO Bug_60196_FK2 VALUES (1), (2), (3), (4), (5); +INSERT INTO Bug_60196 VALUES (1, 1); +INSERT INTO Bug_60196 VALUES (1, 2); +INSERT INTO Bug_60196 VALUES (1, 3); +--error ER_NO_REFERENCED_ROW_2 +INSERT INTO Bug_60196 VALUES (1, 99); +--error ER_NO_REFERENCED_ROW_2 +INSERT INTO Bug_60196 VALUES (99, 1); + +SELECT * FROM bug_60196_FK1; +SELECT * FROM bug_60196_FK2; +SELECT * FROM bug_60196; + +--echo # Stop server + +# Write file to make mysql-test-run.pl wait for the server to stop +-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +# Send a shutdown request to the server +-- shutdown_server 10 + +# Call script that will poll the server waiting for it to disapear +-- source include/wait_until_disconnected.inc + +--echo # Restart server. + +# Write file to make mysql-test-run.pl start up the server again +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +# Turn on reconnect +--enable_reconnect + +# Call script that will poll the server waiting for it to be back online again +--source include/wait_until_connected_again.inc + +# Turn off reconnect again +--disable_reconnect + +--echo # +--echo # Try to insert more to the example table with foreign keys. +--echo # Bug60196 causes the foreign key file not to be found after +--echo # the resstart above. +--echo # +SELECT * FROM Bug_60196; +INSERT INTO Bug_60196 VALUES (2, 1); +INSERT INTO Bug_60196 VALUES (2, 2); +INSERT INTO Bug_60196 VALUES (2, 3); +SELECT * FROM Bug_60196; + +--echo +--echo # Clean up. +DROP TABLE Bug_60196; +DROP TABLE Bug_60196_FK1; +DROP TABLE Bug_60196_FK2; + diff --git a/mysql-test/suite/large_tests/r/rpl_slave_net_timeout.result b/mysql-test/suite/large_tests/r/rpl_slave_net_timeout.result index 81de6e228e0..4dcc2e6295f 100644 --- a/mysql-test/suite/large_tests/r/rpl_slave_net_timeout.result +++ b/mysql-test/suite/large_tests/r/rpl_slave_net_timeout.result @@ -1,25 +1,20 @@ -stop slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -reset master; -reset slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -start slave; +include/master-slave.inc +[connection master] set @save_general_log = @@global.general_log; set @save_log_output = @@global.log_output; set @save_slave_net_timeout = @@global.slave_net_timeout; set @@global.general_log = ON; set @@global.log_output = 'table,file'; include/stop_slave.inc -set @@global.slave_net_timeout = @@global.net_read_timeout * 2; change master to master_host = '127.0.0.1',master_port = MASTER_PORT, master_user = 'root', master_heartbeat_period = 0; +set @@global.slave_net_timeout = @@global.net_read_timeout * 2; include/start_slave.inc include/stop_slave.inc select event_time from (select event_time from mysql.general_log as t_1 where command_type like 'Connect' order by event_time desc limit 2) as t_2 order by event_time desc limit 1 into @ts_last; select event_time from (select event_time from mysql.general_log as t_1 where command_type like 'Connect' order by event_time desc limit 2) as t_2 order by event_time asc limit 1 into @ts_prev; -select @result as 'Must be 1'; -Must be 1 -1 +include/assert.inc [time between last reconnection and the reconnection before that should be >= slave_net_timeout] set @@global.general_log = @save_general_log; set @@global.log_output = @save_log_output; set @@global.slave_net_timeout = @save_slave_net_timeout; +include/rpl_end.inc diff --git a/mysql-test/suite/large_tests/t/rpl_slave_net_timeout.test b/mysql-test/suite/large_tests/t/rpl_slave_net_timeout.test index bfe7f712a20..238146cdaaa 100644 --- a/mysql-test/suite/large_tests/t/rpl_slave_net_timeout.test +++ b/mysql-test/suite/large_tests/t/rpl_slave_net_timeout.test @@ -21,11 +21,6 @@ set @@global.log_output = 'table,file'; connection slave; --source include/stop_slave.inc ---disable_warnings -set @@global.slave_net_timeout = @@global.net_read_timeout * 2; ---enable_warnings -let $idle_time=`select @@global.slave_net_timeout * 2`; - # # if heartbeat is disabled then reconnecting to the idle master # should happen with `slave_net_timeout' period. @@ -42,6 +37,9 @@ let $idle_time=`select @@global.slave_net_timeout * 2`; eval change master to master_host = '127.0.0.1',master_port = $MASTER_MYPORT, master_user = 'root', master_heartbeat_period = 0; +set @@global.slave_net_timeout = @@global.net_read_timeout * 2; +let $idle_time=`select @@global.slave_net_timeout * 2`; + let $slave_net_timeout = `select @@global.slave_net_timeout`; --source include/start_slave.inc @@ -64,11 +62,9 @@ connection master; select event_time from (select event_time from mysql.general_log as t_1 where command_type like 'Connect' order by event_time desc limit 2) as t_2 order by event_time desc limit 1 into @ts_last; select event_time from (select event_time from mysql.general_log as t_1 where command_type like 'Connect' order by event_time desc limit 2) as t_2 order by event_time asc limit 1 into @ts_prev; ---disable_query_log -eval select time_to_sec(@ts_last) - $slave_net_timeout >= time_to_sec(@ts_prev) into @result; ---enable_query_log - -select @result as 'Must be 1'; +--let $assert_cond= time_to_sec(@ts_last) - time_to_sec(@ts_prev) >= $slave_net_timeout +--let $assert_text= time between last reconnection and the reconnection before that should be >= slave_net_timeout +--source include/assert.inc # cleanup @@ -79,4 +75,5 @@ set @@global.log_output = @save_log_output; connection slave; set @@global.slave_net_timeout = @save_slave_net_timeout; +--let $rpl_only_running_threads= 1 --source include/rpl_end.inc diff --git a/mysql-test/suite/perfschema/r/relaylog.result b/mysql-test/suite/perfschema/r/relaylog.result new file mode 100644 index 00000000000..e2f8270b1f0 --- /dev/null +++ b/mysql-test/suite/perfschema/r/relaylog.result @@ -0,0 +1,169 @@ +include/master-slave.inc +[connection master] +drop table if exists test.t1; +reset master; +create table test.t1(a int); +drop table test.t1; +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Query # # use `test`; create table test.t1(a int) +slave-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +"============ Performance schema on master ============" +select +substring(file_name, locate("master-", file_name)) as FILE_NAME, +EVENT_NAME, +if (count_read > 0, "MANY", "NONE") as COUNT_READ, +if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, +if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, +if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE +from performance_schema.file_summary_by_instance +where file_name like "%master-%" order by file_name; +FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +master-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY +master-bin.index wait/io/file/sql/binlog_index NONE MANY NONE MANY +select * from performance_schema.file_summary_by_instance +where file_name like "%slave-%" order by file_name; +FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +"Expect a master binlog + binlog_index" +select +substring(file_name, locate("master-", file_name)) as FILE_NAME, +EVENT_NAME, +if (count_read > 0, "MANY", "NONE") as COUNT_READ, +if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, +if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, +if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE +from performance_schema.file_summary_by_instance +where event_name like "%binlog%" order by file_name; +FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +master-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY +master-bin.index wait/io/file/sql/binlog_index NONE MANY NONE MANY +select +EVENT_NAME, +if (count_read > 0, "MANY", "NONE") as COUNT_READ, +if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, +if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, +if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE +from performance_schema.file_summary_by_event_name +where event_name like "%binlog%" order by event_name; +EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +wait/io/file/sql/binlog MANY MANY MANY MANY +wait/io/file/sql/binlog_index NONE MANY NONE MANY +select +EVENT_NAME, +if (count_star > 0, "MANY", "NONE") as COUNT_STAR +from performance_schema.events_waits_summary_global_by_event_name +where event_name like "%MYSQL_BIN_LOG%" order by event_name; +EVENT_NAME COUNT_STAR +wait/synch/cond/sql/MYSQL_BIN_LOG::COND_prep_xids NONE +wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond MANY +wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index MANY +wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_prep_xids NONE +"Expect no slave relay log" +select * from performance_schema.file_summary_by_instance +where event_name like "%relaylog%" order by file_name; +FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +select * from performance_schema.file_summary_by_event_name +where event_name like "%relaylog%" order by event_name; +EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +wait/io/file/sql/relaylog 0 0 0 0 +wait/io/file/sql/relaylog_index 0 0 0 0 +select * from performance_schema.events_waits_summary_global_by_event_name +where event_name like "%MYSQL_RELAY_LOG%" order by event_name; +EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT +wait/synch/cond/sql/MYSQL_RELAY_LOG::update_cond 0 0 0 0 0 +wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index 0 0 0 0 0 +"============ Performance schema on slave ============" +select * from performance_schema.file_summary_by_instance +where file_name like "%master-%" order by file_name; +FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +select +substring(file_name, locate("slave-", file_name)) as FILE_NAME, +EVENT_NAME, +if (count_read > 0, "MANY", "NONE") as COUNT_READ, +if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, +if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, +if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE +from performance_schema.file_summary_by_instance +where file_name like "%slave-%" + and (file_name not like "%slave-relay-bin.0%" + or file_name like "%slave-relay-bin.000001" + or file_name like "%slave-relay-bin.000002") +order by file_name; +FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +slave-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY +slave-bin.index wait/io/file/sql/binlog_index NONE MANY NONE MANY +slave-relay-bin.000001 wait/io/file/sql/relaylog MANY MANY MANY MANY +slave-relay-bin.000002 wait/io/file/sql/relaylog MANY MANY MANY MANY +slave-relay-bin.index wait/io/file/sql/relaylog_index MANY MANY MANY MANY +"Expect a slave binlog + binlog_index" +select +substring(file_name, locate("slave-", file_name)) as FILE_NAME, +EVENT_NAME, +if (count_read > 0, "MANY", "NONE") as COUNT_READ, +if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, +if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, +if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE +from performance_schema.file_summary_by_instance +where event_name like "%binlog%" order by file_name; +FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +slave-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY +slave-bin.index wait/io/file/sql/binlog_index NONE MANY NONE MANY +select +EVENT_NAME, +if (count_read > 0, "MANY", "NONE") as COUNT_READ, +if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, +if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, +if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE +from performance_schema.file_summary_by_event_name +where event_name like "%binlog%" order by event_name; +EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +wait/io/file/sql/binlog MANY MANY MANY MANY +wait/io/file/sql/binlog_index NONE MANY NONE MANY +select +EVENT_NAME, +if (count_star > 0, "MANY", "NONE") as COUNT_STAR +from performance_schema.events_waits_summary_global_by_event_name +where event_name like "%MYSQL_BIN_LOG%" order by event_name; +EVENT_NAME COUNT_STAR +wait/synch/cond/sql/MYSQL_BIN_LOG::COND_prep_xids NONE +wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond NONE +wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index MANY +wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_prep_xids NONE +"Expect a slave relay log" +select +substring(file_name, locate("slave-", file_name)) as FILE_NAME, +EVENT_NAME, +if (count_read > 0, "MANY", "NONE") as COUNT_READ, +if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, +if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, +if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE +from performance_schema.file_summary_by_instance +where event_name like "%relaylog%" + and (file_name not like "%slave-relay-bin.0%" + or file_name like "%slave-relay-bin.000001" + or file_name like "%slave-relay-bin.000002") +order by file_name; +FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +slave-relay-bin.000001 wait/io/file/sql/relaylog MANY MANY MANY MANY +slave-relay-bin.000002 wait/io/file/sql/relaylog MANY MANY MANY MANY +slave-relay-bin.index wait/io/file/sql/relaylog_index MANY MANY MANY MANY +select +EVENT_NAME, +if (count_read > 0, "MANY", "NONE") as COUNT_READ, +if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, +if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, +if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE +from performance_schema.file_summary_by_event_name +where event_name like "%relaylog%" order by event_name; +EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +wait/io/file/sql/relaylog MANY MANY MANY MANY +wait/io/file/sql/relaylog_index MANY MANY MANY MANY +select +EVENT_NAME, +if (count_star > 0, "MANY", "NONE") as COUNT_STAR +from performance_schema.events_waits_summary_global_by_event_name +where event_name like "%MYSQL_RELAY_LOG%" order by event_name; +EVENT_NAME COUNT_STAR +wait/synch/cond/sql/MYSQL_RELAY_LOG::update_cond MANY +wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index MANY +include/stop_slave.inc diff --git a/mysql-test/suite/perfschema/t/relaylog.test b/mysql-test/suite/perfschema/t/relaylog.test new file mode 100644 index 00000000000..68ba57dd502 --- /dev/null +++ b/mysql-test/suite/perfschema/t/relaylog.test @@ -0,0 +1,179 @@ +# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/have_log_bin.inc +--source include/not_embedded.inc +--source include/have_perfschema.inc +--source include/master-slave.inc + +--disable_warnings +drop table if exists test.t1; +--sync_slave_with_master +reset master; +--enable_warnings + +create table test.t1(a int); +drop table test.t1; + +--source include/show_binlog_events.inc + +# Notes +# +# The point of this test is to make sure code is properly instrumented, +# where instruments have the proper key (binlog or relaylog), +# it is not to dive into statistics for each instruments. +# Different test execution sequence in different platforms do make the +# results vary, making the test results very sensitive to changes. +# To ensure robustness: +# - log file rotation is limited to file .000001 and .000002 +# - statistics are normalized to "NONE" or "MANY" +# + +connection master; +-- echo "============ Performance schema on master ============" + +select + substring(file_name, locate("master-", file_name)) as FILE_NAME, + EVENT_NAME, + if (count_read > 0, "MANY", "NONE") as COUNT_READ, + if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, + if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, + if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE + from performance_schema.file_summary_by_instance + where file_name like "%master-%" order by file_name; + +select * from performance_schema.file_summary_by_instance + where file_name like "%slave-%" order by file_name; + +-- echo "Expect a master binlog + binlog_index" + +select + substring(file_name, locate("master-", file_name)) as FILE_NAME, + EVENT_NAME, + if (count_read > 0, "MANY", "NONE") as COUNT_READ, + if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, + if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, + if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE + from performance_schema.file_summary_by_instance + where event_name like "%binlog%" order by file_name; + +select + EVENT_NAME, + if (count_read > 0, "MANY", "NONE") as COUNT_READ, + if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, + if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, + if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE + from performance_schema.file_summary_by_event_name + where event_name like "%binlog%" order by event_name; + +select + EVENT_NAME, + if (count_star > 0, "MANY", "NONE") as COUNT_STAR + from performance_schema.events_waits_summary_global_by_event_name + where event_name like "%MYSQL_BIN_LOG%" order by event_name; + +-- echo "Expect no slave relay log" + +select * from performance_schema.file_summary_by_instance + where event_name like "%relaylog%" order by file_name; + +select * from performance_schema.file_summary_by_event_name + where event_name like "%relaylog%" order by event_name; + +select * from performance_schema.events_waits_summary_global_by_event_name + where event_name like "%MYSQL_RELAY_LOG%" order by event_name; + +sync_slave_with_master; +-- echo "============ Performance schema on slave ============" + +select * from performance_schema.file_summary_by_instance + where file_name like "%master-%" order by file_name; + +select + substring(file_name, locate("slave-", file_name)) as FILE_NAME, + EVENT_NAME, + if (count_read > 0, "MANY", "NONE") as COUNT_READ, + if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, + if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, + if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE + from performance_schema.file_summary_by_instance + where file_name like "%slave-%" + and (file_name not like "%slave-relay-bin.0%" + or file_name like "%slave-relay-bin.000001" + or file_name like "%slave-relay-bin.000002") + order by file_name; + +-- echo "Expect a slave binlog + binlog_index" + +select + substring(file_name, locate("slave-", file_name)) as FILE_NAME, + EVENT_NAME, + if (count_read > 0, "MANY", "NONE") as COUNT_READ, + if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, + if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, + if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE + from performance_schema.file_summary_by_instance + where event_name like "%binlog%" order by file_name; + +select + EVENT_NAME, + if (count_read > 0, "MANY", "NONE") as COUNT_READ, + if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, + if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, + if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE + from performance_schema.file_summary_by_event_name + where event_name like "%binlog%" order by event_name; + +select + EVENT_NAME, + if (count_star > 0, "MANY", "NONE") as COUNT_STAR + from performance_schema.events_waits_summary_global_by_event_name + where event_name like "%MYSQL_BIN_LOG%" order by event_name; + +-- echo "Expect a slave relay log" + +select + substring(file_name, locate("slave-", file_name)) as FILE_NAME, + EVENT_NAME, + if (count_read > 0, "MANY", "NONE") as COUNT_READ, + if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, + if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, + if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE + from performance_schema.file_summary_by_instance + where event_name like "%relaylog%" + and (file_name not like "%slave-relay-bin.0%" + or file_name like "%slave-relay-bin.000001" + or file_name like "%slave-relay-bin.000002") + order by file_name; + +select + EVENT_NAME, + if (count_read > 0, "MANY", "NONE") as COUNT_READ, + if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, + if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, + if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE + from performance_schema.file_summary_by_event_name + where event_name like "%relaylog%" order by event_name; + +select + EVENT_NAME, + if (count_star > 0, "MANY", "NONE") as COUNT_STAR + from performance_schema.events_waits_summary_global_by_event_name + where event_name like "%MYSQL_RELAY_LOG%" order by event_name; + +--source include/stop_slave.inc + diff --git a/mysql-test/suite/rpl/r/rpl_binlog_corruption.result b/mysql-test/suite/rpl/r/rpl_binlog_corruption.result index 4f1eca42e1a..a2a065e0a4f 100644 --- a/mysql-test/suite/rpl/r/rpl_binlog_corruption.result +++ b/mysql-test/suite/rpl/r/rpl_binlog_corruption.result @@ -1,6 +1,7 @@ include/master-slave.inc [connection master] call mtr.add_suppression('Found invalid event in binary log'); +call mtr.add_suppression('Slave SQL.*Relay log read failure: Could not parse relay log event entry.* 1594'); ==== Initialize ==== include/stop_slave.inc RESET SLAVE; diff --git a/mysql-test/suite/rpl/r/rpl_bug33931.result b/mysql-test/suite/rpl/r/rpl_bug33931.result index d27308db1d5..ce8b6b169c7 100644 --- a/mysql-test/suite/rpl/r/rpl_bug33931.result +++ b/mysql-test/suite/rpl/r/rpl_bug33931.result @@ -1,6 +1,7 @@ include/master-slave.inc [connection master] call mtr.add_suppression("Failed during slave I/O thread initialization"); +call mtr.add_suppression("Slave SQL.*Failed during slave thread initialization.* 1593"); include/stop_slave.inc reset slave; SET GLOBAL debug="d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init"; diff --git a/mysql-test/suite/rpl/r/rpl_bug37426.result b/mysql-test/suite/rpl/r/rpl_bug37426.result new file mode 100644 index 00000000000..bf96255c7b4 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_bug37426.result @@ -0,0 +1,12 @@ +include/master-slave.inc +[connection master] +CREATE TABLE char128_utf8 (i1 INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, i2 INT NOT NULL); +INSERT INTO char128_utf8 VALUES ( 1, "123", 1 ); +SELECT * FROM char128_utf8; +i1 c i2 +1 123 1 +SELECT * FROM char128_utf8; +i1 c i2 +1 123 1 +DROP TABLE char128_utf8; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result index 6981e549918..f9c5b48e227 100644 --- a/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result +++ b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result @@ -5,6 +5,7 @@ include/rpl_init.inc [topology=1->2->3->4->1] CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=MyISAM; CREATE TABLE t2 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=InnoDB; include/rpl_sync.inc +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); *** Testing schema A->B->C->D->A *** @@ -46,6 +47,7 @@ SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; include/start_slave.inc INSERT INTO t1 VALUES(6,'C',2); INSERT INTO t1(b,c) VALUES('B',2); +call mtr.add_suppression("Slave SQL.*Duplicate entry .6. for key .PRIMARY.* Error_code: 1062"); include/wait_for_slave_sql_error.inc [errno=1062] INSERT INTO t1(b,c) VALUES('A',2); INSERT INTO t1(b,c) VALUES('D',2); diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result index e6be72ccbef..c63ba401085 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result @@ -1,6 +1,7 @@ include/master-slave.inc [connection master] call mtr.add_suppression("Slave: Unknown table 't6' Error_code: 1051"); +call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]*. cannot be converted from type.* Error_code: 1677"); **** Diff Table Def Start **** *** On Slave *** STOP SLAVE; @@ -461,6 +462,9 @@ c4 BLOB, c5 CHAR(5)) ENGINE='InnoDB'; RESET MASTER; *** Start Slave *** START SLAVE; +call mtr.add_suppression("Error .Unknown table .t6.. on query.* Error_code: 1051"); +call mtr.add_suppression("Error .Duplicate column name .c6.. on query.* Error_code: 1060"); +call mtr.add_suppression("Table definition on master and slave does not match: Column . ...e mismatch.* Error_code: 1535"); *** Master Data Insert *** set @b1 = 'b1b1b1b1'; set @b1 = concat(@b1,@b1); diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result index b064aad9c05..4e483da72e4 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result @@ -1,6 +1,7 @@ include/master-slave.inc [connection master] call mtr.add_suppression("Slave: Unknown table 't6' Error_code: 1051"); +call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]*. cannot be converted from type.* Error_code: 1677"); **** Diff Table Def Start **** *** On Slave *** STOP SLAVE; @@ -461,6 +462,9 @@ c4 BLOB, c5 CHAR(5)) ENGINE='MyISAM'; RESET MASTER; *** Start Slave *** START SLAVE; +call mtr.add_suppression("Error .Unknown table .t6.. on query.* Error_code: 1051"); +call mtr.add_suppression("Error .Duplicate column name .c6.. on query.* Error_code: 1060"); +call mtr.add_suppression("Table definition on master and slave does not match: Column . ...e mismatch.* Error_code: 1535"); *** Master Data Insert *** set @b1 = 'b1b1b1b1'; set @b1 = concat(@b1,@b1); diff --git a/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result b/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result index 4eaf61e5f9e..c88dcee9dbc 100644 --- a/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result +++ b/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result @@ -42,6 +42,7 @@ UPDATE t4 LEFT JOIN (t1, t2, t5) ON (t1.id=t4.id and t2.id=t4.id and t5.id=t4.id UPDATE t4 LEFT JOIN (t1, t6, t7) ON (t4.id=t1.id and t4.id=t6.id and t4.id=t7.id) SET a=0, d=0, f=0, g=0 where t4.id=1; UPDATE t7 LEFT JOIN (t4, t1, t2) ON (t7.id=t4.id and t7.id=t1.id and t7.id=t2.id) SET a=0, b=0, d=0, g=0 where t7.id=1; UPDATE t7 LEFT JOIN (t8, t4, t1) ON (t7.id=t8.id and t7.id=t4.id and t7.id=t1.id) SET a=0, d=0, g=0, h=0 where t7.id=1; +call mtr.add_suppression("Slave SQL.*Error .Table .test.t[47]. doesn.t exist. on query.* Error_code: 1146"); UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0 where t1.id=1; include/wait_for_slave_sql_error_and_skip.inc [errno=1146] Last_SQL_Error = 'Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0 where t1.id=1'' diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result index ef901476784..93faf37053a 100644 --- a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result +++ b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result @@ -206,6 +206,8 @@ Heartbeat event received CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10), c LONGTEXT); INSERT INTO t1 VALUES (1, 'on slave', NULL); INSERT INTO t1 VALUES (1, 'on master', NULL); +call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.. on query.* Error_code: 1062"); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); Heartbeat events are received while sql thread stopped (1 means 'yes'): 1 include/stop_slave.inc DROP TABLE t1; diff --git a/mysql-test/suite/rpl/r/rpl_idempotency.result b/mysql-test/suite/rpl/r/rpl_idempotency.result index 95b79926234..07c6db416b4 100644 --- a/mysql-test/suite/rpl/r/rpl_idempotency.result +++ b/mysql-test/suite/rpl/r/rpl_idempotency.result @@ -1,8 +1,9 @@ include/master-slave.inc [connection master] -call mtr.add_suppression("Slave: Can't find record in 't.' Error_code: 1032"); -call mtr.add_suppression("Slave: Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451"); -call mtr.add_suppression("Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452"); +call mtr.add_suppression("Slave SQL.*Can.t find record in .t[12].* Error_code: 1032"); +call mtr.add_suppression("Slave SQL.*Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451"); +call mtr.add_suppression("Slave SQL.*Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452"); +call mtr.add_suppression("Slave SQL.*Could not execute Write_rows event on table test.* Duplicate entry .1. for key .PRIMARY.* Error_code: 1062"); CREATE TABLE t1 (a INT PRIMARY KEY); CREATE TABLE t2 (a INT); INSERT INTO t1 VALUES (-1),(-2),(-3); diff --git a/mysql-test/suite/rpl/r/rpl_ignore_table.result b/mysql-test/suite/rpl/r/rpl_ignore_table.result index e3f0416a9f9..b92f97e24ee 100644 --- a/mysql-test/suite/rpl/r/rpl_ignore_table.result +++ b/mysql-test/suite/rpl/r/rpl_ignore_table.result @@ -30,7 +30,6 @@ Warnings: Warning 1364 Field 'ssl_cipher' doesn't have a default value Warning 1364 Field 'x509_issuer' doesn't have a default value Warning 1364 Field 'x509_subject' doesn't have a default value -Warning 1364 Field 'authentication_string' doesn't have a default value GRANT SELECT ON *.* TO mysqltest6@localhost; GRANT INSERT ON *.* TO mysqltest6@localhost; GRANT INSERT ON test.* TO mysqltest6@localhost; @@ -113,6 +112,7 @@ show grants for mysqltest4@localhost; Grants for mysqltest4@localhost GRANT USAGE ON *.* TO 'mysqltest4'@'localhost' IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7' set global slave_exec_mode='IDEMPOTENT'; +call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table mysql.* Error_code: 1032"); drop table t1, mysqltest2.t2; drop table t4; drop database mysqltest2; diff --git a/mysql-test/suite/rpl/r/rpl_incident.result b/mysql-test/suite/rpl/r/rpl_incident.result index b54d7d400f7..d528fb3297a 100644 --- a/mysql-test/suite/rpl/r/rpl_incident.result +++ b/mysql-test/suite/rpl/r/rpl_incident.result @@ -15,6 +15,7 @@ a 2 3 4 +call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master.* 1590"); include/wait_for_slave_sql_error.inc [errno=1590] Last_SQL_Error = 'The incident LOST_EVENTS occured on the master. Message: <none>' **** On Slave **** diff --git a/mysql-test/suite/rpl/r/rpl_init_slave_errors.result b/mysql-test/suite/rpl/r/rpl_init_slave_errors.result index 46bc66cbb65..a185afc5af2 100644 --- a/mysql-test/suite/rpl/r/rpl_init_slave_errors.result +++ b/mysql-test/suite/rpl/r/rpl_init_slave_errors.result @@ -6,7 +6,7 @@ SET GLOBAL debug= "d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on start slave; include/wait_for_slave_sql_error.inc [errno=1593] Last_SQL_Error = 'Failed during slave thread initialization' -call mtr.add_suppression("Failed during slave I/O thread initialization"); +call mtr.add_suppression("Failed during slave.* thread initialization"); SET GLOBAL debug= ""; reset slave; SET GLOBAL init_slave= "garbage"; diff --git a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result index 2e6919ef813..43f5c082dea 100644 --- a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result +++ b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result @@ -7,6 +7,7 @@ SELECT * FROM t1; a b 1 10 2 2 +call mtr.add_suppression("Slave SQL.*suffer.*http:..bugs.mysql.com.bug.php.id=24432"); include/wait_for_slave_sql_error.inc [errno=1105] Last_SQL_Error = 'Error 'master may suffer from http://bugs.mysql.com/bug.php?id=24432 so slave stops; check error log on slave for more info' on query. Default database: 'test'. Query: 'INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10'' SELECT * FROM t1; diff --git a/mysql-test/suite/rpl/r/rpl_loaddata.result b/mysql-test/suite/rpl/r/rpl_loaddata.result index 41c36414c75..621f3a1ddf5 100644 --- a/mysql-test/suite/rpl/r/rpl_loaddata.result +++ b/mysql-test/suite/rpl/r/rpl_loaddata.result @@ -27,6 +27,8 @@ drop table t3; create table t1(a int, b int, unique(b)); insert into t1 values(1,10); load data infile '../../std_data/rpl_loaddata.dat' into table t1; +call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* Error_code: 1062"); +call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.*error code=1062.*Error on slave:.*Error_code: 0"); include/wait_for_slave_sql_error_and_skip.inc [errno=1062] include/check_slave_no_error.inc set sql_log_bin=0; diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result index a81813de19f..b13e2ced183 100644 --- a/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result +++ b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result @@ -3,6 +3,7 @@ include/master-slave.inc CREATE TABLE t1 (a INT, b INT); INSERT INTO t1 VALUES (1,10); LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE t1; +call mtr.add_suppression("Slave SQL.*Fatal error: Not enough memory, Error_code: 1593"); include/wait_for_slave_sql_error_and_skip.inc [errno=1593] Last_SQL_Error = 'Fatal error: Not enough memory' DROP TABLE t1; diff --git a/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result index fb4d1e1ba44..14ed79680f1 100644 --- a/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result +++ b/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result @@ -131,6 +131,7 @@ include/start_slave.inc CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*"); CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*"); CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*"); +CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master. Message: error writing to the binary log"); TRUNCATE t1; SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE; SET GLOBAL binlog_cache_size= ORIGINAL_VALUE; diff --git a/mysql-test/suite/rpl/r/rpl_packet.result b/mysql-test/suite/rpl/r/rpl_packet.result index 9239a718504..6190f458367 100644 --- a/mysql-test/suite/rpl/r/rpl_packet.result +++ b/mysql-test/suite/rpl/r/rpl_packet.result @@ -49,6 +49,8 @@ SET @max_allowed_packet_2= @@session.max_allowed_packet; ==== clean up ==== DROP TABLE t1; SET @@global.max_allowed_packet= 1024; +Warnings: +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' SET @@global.net_buffer_length= 1024; DROP TABLE t1; RESET SLAVE; diff --git a/mysql-test/suite/rpl/r/rpl_rotate_logs.result b/mysql-test/suite/rpl/r/rpl_rotate_logs.result index d8d28108330..ebc75ce9e6e 100644 --- a/mysql-test/suite/rpl/r/rpl_rotate_logs.result +++ b/mysql-test/suite/rpl/r/rpl_rotate_logs.result @@ -37,6 +37,7 @@ drop table temp_table, t3; insert into t2 values(1234); set insert_id=1234; insert into t2 values(NULL); +call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .1234. for key .PRIMARY.. on query.* Error_code: 1062"); include/wait_for_slave_sql_error_and_skip.inc [errno=1062] purge master logs to 'master-bin.000002'; show master logs; diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result index 27f017a71ab..9f973bbe80e 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result @@ -65,6 +65,7 @@ DROP TABLE t1; include/rpl_reset.inc **** On Slave **** SET GLOBAL QUERY_CACHE_SIZE=0; +call mtr.add_suppression("Slave SQL.*Could not execute Update_rows event on table test.t1.* Error_code: 1032"); **** On Master **** CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1),(2),(3); diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result index a067193025f..c864850a238 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result @@ -478,6 +478,9 @@ INSERT INTO t2 VALUES (1, "", 1); INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2); include/diff_tables.inc [master:t2, slave:t2] SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* Error_code: 1535"); +call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table test.t1.* Error_code: 1032"); +call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t.. cannot be converted from type.*, Error_code: 1677"); include/rpl_reset.inc [expecting slave to replicate correctly] INSERT INTO t4 VALUES (1, "", 1); diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result index 5bcce4f1af7..0e00695500c 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result @@ -481,6 +481,9 @@ INSERT INTO t2 VALUES (1, "", 1); INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2); include/diff_tables.inc [master:t2, slave:t2] SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* Error_code: 1535"); +call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table test.t1.* Error_code: 1032"); +call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t.. cannot be converted from type.*, Error_code: 1677"); include/rpl_reset.inc [expecting slave to replicate correctly] INSERT INTO t4 VALUES (1, "", 1); diff --git a/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result index 1b682d0b025..077199a0c93 100644 --- a/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result +++ b/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result @@ -132,6 +132,7 @@ include/start_slave.inc CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*"); CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*"); CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*"); +CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master. Message: error writing to the binary log"); TRUNCATE t1; SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE; SET GLOBAL binlog_cache_size= ORIGINAL_VALUE; diff --git a/mysql-test/suite/rpl/r/rpl_row_colSize.result b/mysql-test/suite/rpl/r/rpl_row_colSize.result index c41a5bb79e8..487cddc2051 100644 --- a/mysql-test/suite/rpl/r/rpl_row_colSize.result +++ b/mysql-test/suite/rpl/r/rpl_row_colSize.result @@ -265,6 +265,8 @@ STOP SLAVE; RESET SLAVE; RESET MASTER; START SLAVE; +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 0 ...e mismatch.* Error_code: 1535"); +call mtr.add_suppression("Slave SQL.*Column 0 of table .test.t1. cannot be converted from type.* Error_code: 1677"); *** Cleanup *** DROP TABLE IF EXISTS t1; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_conflicts.result b/mysql-test/suite/rpl/r/rpl_row_conflicts.result index 5481cbae77d..b42ff0c3b17 100644 --- a/mysql-test/suite/rpl/r/rpl_row_conflicts.result +++ b/mysql-test/suite/rpl/r/rpl_row_conflicts.result @@ -23,6 +23,7 @@ a include/wait_for_slave_sql_error.inc [errno=1062] Last_SQL_Error (expected "duplicate key" error) Could not execute Write_rows event on table test.t1; Duplicate entry '1' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log master-bin.000001, end_log_pos END_LOG_POS +call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.* Error_code: 1062"); SELECT * FROM t1; a 1 @@ -49,6 +50,7 @@ SELECT * FROM t1; a [on slave] ---- Wait until slave stops with an error ---- +call mtr.add_suppression("Slave SQL.*Can.t find record in .t1., Error_code: 1032"); include/wait_for_slave_sql_error.inc [errno=1032] Last_SQL_Error (expected "duplicate key" error) Could not execute Delete_rows event on table test.t1; Can't find record in 't1', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log master-bin.000001, end_log_pos END_LOG_POS diff --git a/mysql-test/suite/rpl/r/rpl_row_idempotency.result b/mysql-test/suite/rpl/r/rpl_row_idempotency.result index faf07e323d9..20afcd0a393 100644 --- a/mysql-test/suite/rpl/r/rpl_row_idempotency.result +++ b/mysql-test/suite/rpl/r/rpl_row_idempotency.result @@ -1,8 +1,9 @@ include/master-slave.inc [connection master] -call mtr.add_suppression("Slave: Can't find record in 't.' Error_code: 1032"); -call mtr.add_suppression("Slave: Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451"); -call mtr.add_suppression("Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452"); +call mtr.add_suppression("Can.t find record in .t[12].* Error_code: 1032"); +call mtr.add_suppression("Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451"); +call mtr.add_suppression("Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452"); +call mtr.add_suppression("Duplicate entry .1. for key .PRIMARY.* Error_code: 1062"); set @old_slave_exec_mode= @@global.slave_exec_mode; set @@global.slave_exec_mode= IDEMPOTENT; create table ti1 (b int primary key) engine = innodb; diff --git a/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result b/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result index 148840cc8c5..fa565c4061c 100644 --- a/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result +++ b/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result @@ -10,6 +10,7 @@ DROP TABLE t1; INSERT INTO t1 VALUES (1); ==== Verify error on slave ==== [on slave] +call mtr.add_suppression("Slave SQL.*Error executing row event: .Table .test.t1. doesn.t exist., Error_code: 1146"); include/wait_for_slave_sql_error.inc [errno=1146] ==== Clean up ==== include/stop_slave_io.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result b/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result index d9ebb52493b..523564a222e 100644 --- a/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result @@ -25,4 +25,10 @@ INSERT INTO t1(c1) VALUES (NULL); UPDATE t1 SET c1= 0; include/diff_tables.inc [master:t1, slave:t1] DROP TABLE t1; +include/rpl_reset.inc +CREATE TABLE t1 (c1 int(11) NOT NULL, c2 int(11) NOT NULL, c3 int(11) DEFAULT '-1') ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES (1,2,NULL); +UPDATE t1 SET c1=1, c2=2, c3=-1 WHERE c1=1 AND c2=2 AND ISNULL(c3); +include/diff_tables.inc [master:test.t1, slave:test.t1] +DROP TABLE t1; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result b/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result index e9ffcc927be..4dc7c0bc7a3 100644 --- a/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result @@ -1,5 +1,14 @@ include/master-slave.inc [connection master] +## coverage purposes - Field_bits +## 1 X bit + 2 Null bits + 5 bits => last_null_bit_pos==0 +include/rpl_reset.inc +CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bit(5)) ENGINE=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO t1(c1,c2) VALUES (10, b'1'); +INSERT INTO t1(c1,c2) VALUES (NULL, b'1'); +UPDATE t1 SET c1= 0; +include/diff_tables.inc [master:t1, slave:t1] +DROP TABLE t1; ## case #1 - last_null_bit_pos==0 in record_compare without X bit include/rpl_reset.inc CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 varchar(1) DEFAULT '', c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0, c8 bigint(20) DEFAULT 0) ENGINE=MyISAM DEFAULT CHARSET=latin1; @@ -25,13 +34,10 @@ INSERT INTO t1(c1) VALUES (NULL); UPDATE t1 SET c1= 0; include/diff_tables.inc [master:t1, slave:t1] DROP TABLE t1; -## coverage purposes - Field_bits -## 1 X bit + 2 Null bits + 5 bits => last_null_bit_pos==0 include/rpl_reset.inc -CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bit(5)) ENGINE=MyISAM DEFAULT CHARSET=latin1; -INSERT INTO t1(c1,c2) VALUES (10, b'1'); -INSERT INTO t1(c1,c2) VALUES (NULL, b'1'); -UPDATE t1 SET c1= 0; -include/diff_tables.inc [master:t1, slave:t1] +CREATE TABLE t1 (c1 int(11) NOT NULL, c2 int(11) NOT NULL, c3 int(11) DEFAULT '-1') ENGINE=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES (1,2,NULL); +UPDATE t1 SET c1=1, c2=2, c3=-1 WHERE c1=1 AND c2=2 AND ISNULL(c3); +include/diff_tables.inc [master:test.t1, slave:test.t1] DROP TABLE t1; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result index 45aff587a9a..49dccfc5d73 100644 --- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result +++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result @@ -117,6 +117,8 @@ a include/check_slave_is_running.inc INSERT INTO t9 VALUES (4); INSERT INTO t4 VALUES (4); +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column [012] type mismatch.* Error_code: 1535"); +call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]. cannot be converted from type.* Error_code: 1677"); include/wait_for_slave_sql_error_and_skip.inc [errno=1677] Last_SQL_Error = 'Column 0 of table 'test.t4' cannot be converted from type 'int' to type 'float'' INSERT INTO t9 VALUES (5); diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result index d8b513818dc..9c1e2740c03 100644 --- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result +++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result @@ -117,6 +117,8 @@ a include/check_slave_is_running.inc INSERT INTO t9 VALUES (4); INSERT INTO t4 VALUES (4); +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column [012] type mismatch.* Error_code: 1535"); +call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]. cannot be converted from type.* Error_code: 1677"); include/wait_for_slave_sql_error_and_skip.inc [errno=1677] Last_SQL_Error = 'Column 0 of table 'test.t4' cannot be converted from type 'int' to type 'float'' INSERT INTO t9 VALUES (5); diff --git a/mysql-test/suite/rpl/r/rpl_skip_error.result b/mysql-test/suite/rpl/r/rpl_skip_error.result index d46338fd5b0..f5675b5e25f 100644 --- a/mysql-test/suite/rpl/r/rpl_skip_error.result +++ b/mysql-test/suite/rpl/r/rpl_skip_error.result @@ -56,6 +56,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SET SQL_LOG_BIN=1; +call mtr.add_suppression("Slave SQL.*Could not execute .*te_rows event on table test.t.; Duplicate entry.* Error_code: 1062"); CREATE TABLE t1(id INT NOT NULL PRIMARY KEY, data INT) Engine=InnoDB; SHOW CREATE TABLE t1; Table Create Table diff --git a/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result b/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result index 25deb65fa0f..4c3b08589d9 100644 --- a/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result +++ b/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result @@ -29,6 +29,7 @@ a b SELECT * FROM t3 ORDER BY a; a b 1 ZZ +call mtr.add_suppression("Slave SQL.*Table .test.t3. doesn.t exist.* Error_code: 1146"); include/wait_for_slave_sql_error.inc [errno=1146] SHOW TABLES LIKE 't%'; Tables_in_test (t%) diff --git a/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result b/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result index a7d745251d1..e08c066d226 100644 --- a/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result +++ b/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result @@ -1,17 +1,21 @@ include/master-slave.inc [connection master] +SET @@GLOBAL.DEBUG = '+d,remove_slave_load_file_before_write'; create table t1(a int not null auto_increment, b int, primary key(a)) engine=innodb; start transaction; insert into t1(b) values (1); insert into t1(b) values (2); load data infile '../../std_data/rpl_loaddata.dat' into table t1; commit; -include/wait_for_slave_sql_to_stop.inc +include/wait_for_slave_sql_error.inc [errno=29, 13] drop table t1; include/sync_slave_io_with_master.inc include/stop_slave_io.inc RESET SLAVE; drop table t1; call mtr.add_suppression("Slave: Can't get stat of .*"); +call mtr.add_suppression("Slave SQL: Error .Can.t get stat of.* Error_code: 13"); call mtr.add_suppression("Slave: File.* not found.*"); +call mtr.add_suppression("Slave SQL: Error .File.* not found.* Error_code: 29"); +SET @@GLOBAL.DEBUG = ''; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result b/mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result index 8cd6218dcdc..262404ff6f9 100644 --- a/mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result +++ b/mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result @@ -1,6 +1,7 @@ include/master-slave.inc [connection master] START SLAVE; +call mtr.add_suppression("Slave SQL.*Unable to use slave.s temporary directory.* Error_code: 12"); include/wait_for_slave_sql_error.inc [errno=12] include/stop_slave_io.inc RESET SLAVE; diff --git a/mysql-test/suite/rpl/r/rpl_slow_query_log.result b/mysql-test/suite/rpl/r/rpl_slow_query_log.result index 668a99ffe1b..79b83b4ceb9 100644 --- a/mysql-test/suite/rpl/r/rpl_slow_query_log.result +++ b/mysql-test/suite/rpl/r/rpl_slow_query_log.result @@ -1,6 +1,7 @@ include/master-slave.inc [connection master] CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); include/stop_slave.inc SET @old_log_output= @@log_output; SET GLOBAL log_output= 'TABLE'; diff --git a/mysql-test/suite/rpl/r/rpl_stm_000001.result b/mysql-test/suite/rpl/r/rpl_stm_000001.result index eb421d1adc4..9493013a283 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_000001.result +++ b/mysql-test/suite/rpl/r/rpl_stm_000001.result @@ -62,7 +62,6 @@ Warnings: Warning 1364 Field 'ssl_cipher' doesn't have a default value Warning 1364 Field 'x509_issuer' doesn't have a default value Warning 1364 Field 'x509_subject' doesn't have a default value -Warning 1364 Field 'authentication_string' doesn't have a default value select select_priv,user from mysql.user where user = _binary'blafasel2'; select_priv user N blafasel2 diff --git a/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result b/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result index 0e83f1dfb67..d4a14adc6b8 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result +++ b/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result @@ -8,6 +8,7 @@ insert into t1 values(1),(2); ERROR 23000: Duplicate entry '2' for key 'a' drop table t1; include/wait_for_slave_sql_to_stop.inc +call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.* error code=1062.*Error on slave:.* Error_code: 0"); Error: "Query caused different errors on master and slave. Error on master: message (format)='Duplicate entry '%-.192s' for key %d' error code=1062 ; Error on slave: actual message='no error', error code=0. Default database: 'test'. Query: 'insert into t1 values(1),(2)'" (expected different error codes on master and slave) Errno: "0" (expected 0) drop table t1; diff --git a/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result index fb4d1e1ba44..14ed79680f1 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result +++ b/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result @@ -131,6 +131,7 @@ include/start_slave.inc CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*"); CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*"); CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*"); +CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master. Message: error writing to the binary log"); TRUNCATE t1; SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE; SET GLOBAL binlog_cache_size= ORIGINAL_VALUE; diff --git a/mysql-test/suite/rpl/r/rpl_stm_conflicts.result b/mysql-test/suite/rpl/r/rpl_stm_conflicts.result index 62161901289..e30429540fb 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_conflicts.result +++ b/mysql-test/suite/rpl/r/rpl_stm_conflicts.result @@ -18,6 +18,7 @@ a include/wait_for_slave_sql_error.inc [errno=1062] Last_SQL_Error (expected "duplicate key" error) Error 'Duplicate entry '1' for key 'PRIMARY'' on query. Default database: 'test'. Query: 'INSERT INTO t1 VALUES (1)' +call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.* Error_code: 1062"); SELECT * FROM t1; a 1 diff --git a/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result b/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result index b84bc33abef..feedc3d8281 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result +++ b/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result @@ -43,6 +43,8 @@ drop table t3; create table t1(a int, b int, unique(b)); insert into t1 values(1,10); load data CONCURRENT infile '../../std_data/rpl_loaddata.dat' into table t1; +call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* Error_code: 1062"); +call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.*error code=1062.*Error on slave:.*Error_code: 0"); include/wait_for_slave_sql_error_and_skip.inc [errno=1062] include/check_slave_no_error.inc set sql_log_bin=0; diff --git a/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result b/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result index d4c687c36eb..57206873e2f 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result +++ b/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result @@ -70,5 +70,6 @@ include/start_slave.inc # Clean up DROP TABLE t1; SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit; +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result b/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result index 48e866cd2ad..0b3233437aa 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result +++ b/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result @@ -11,6 +11,8 @@ insert into tm set a=null; Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. commit; +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); +call mtr.add_suppression("Slave SQL.*Slave SQL Thread stopped with incomplete event group having non-transactional changes"); include/wait_for_slave_sql_to_stop.inc SELECT "NO" AS Last_SQL_Error, @check as `true`; Last_SQL_Error true @@ -34,9 +36,9 @@ Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. commit; include/wait_for_slave_sql_to_stop.inc -SELECT "Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`; +SELECT "Fatal error: ... Slave SQL Thread stopped with incomplete event group having non-transactional changes. If the group consists solely of row-based events, you can try to restart the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`; Last_SQL_Error true -Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details). 1 +Fatal error: ... Slave SQL Thread stopped with incomplete event group having non-transactional changes. If the group consists solely of row-based events, you can try to restart the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details). 1 select count(*) as one from tm; one 1 @@ -51,9 +53,9 @@ set @@global.debug="+d,stop_slave_middle_group"; set @@global.debug="+d,incomplete_group_in_relay_log"; update tm as t1, ti as t2 set t1.a=t1.a * 2, t2.a=t2.a * 2; include/wait_for_slave_sql_to_stop.inc -SELECT "Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`; +SELECT "Fatal error: ... Slave SQL Thread stopped with incomplete event group having non-transactional changes. If the group consists solely of row-based events, you can try to restart the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`; Last_SQL_Error true -Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details). 1 +Fatal error: ... Slave SQL Thread stopped with incomplete event group having non-transactional changes. If the group consists solely of row-based events, you can try to restart the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details). 1 select max(a) as two from tm; two 2 diff --git a/mysql-test/suite/rpl/r/rpl_stop_slave.result b/mysql-test/suite/rpl/r/rpl_stop_slave.result index 527a942900c..588d9bbabf5 100644 --- a/mysql-test/suite/rpl/r/rpl_stop_slave.result +++ b/mysql-test/suite/rpl/r/rpl_stop_slave.result @@ -75,6 +75,7 @@ include/wait_for_slave_sql_to_start.inc # Test end SET GLOBAL debug= '$debug_save'; include/restart_slave.inc +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); [connection master] DROP TABLE t1, t2; @@ -92,6 +93,7 @@ DROP TABLE t1, t2; CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB; CREATE TABLE t2 (c1 INT) ENGINE=MyISAM; INSERT INTO t1 VALUES(1, 1); +[connection master] SET GLOBAL debug= 'd,dump_thread_wait_before_send_xid'; [connection slave] include/restart_slave.inc diff --git a/mysql-test/suite/rpl/r/rpl_temporary_errors.result b/mysql-test/suite/rpl/r/rpl_temporary_errors.result index 947adee492b..4a9a8e1dad4 100644 --- a/mysql-test/suite/rpl/r/rpl_temporary_errors.result +++ b/mysql-test/suite/rpl/r/rpl_temporary_errors.result @@ -36,6 +36,7 @@ a b 3 3 4 4 include/check_slave_is_running.inc +call mtr.add_suppression("Slave SQL.*Could not execute Update_rows event on table test.t1"); **** On Master **** DROP TABLE t1; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_typeconv.result b/mysql-test/suite/rpl/r/rpl_typeconv.result index e27df2ea1db..0d2f3cb26f7 100644 --- a/mysql-test/suite/rpl/r/rpl_typeconv.result +++ b/mysql-test/suite/rpl/r/rpl_typeconv.result @@ -534,6 +534,7 @@ BIT(6) BIT(5) ALL_LOSSY,ALL_NON_LOSSY <Correct value> BIT(5) BIT(12) ALL_LOSSY,ALL_NON_LOSSY <Correct value> BIT(12) BIT(5) ALL_LOSSY,ALL_NON_LOSSY <Correct value> DROP TABLE type_conversions; +call mtr.add_suppression("Slave SQL.*Column 0 of table .test.t1. cannot be converted from type.* Error_code: 1677"); DROP TABLE t1; set global slave_type_conversions = @saved_slave_type_conversions; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_binlog_corruption.test b/mysql-test/suite/rpl/t/rpl_binlog_corruption.test index 2c9ec02764c..6717bda0fa7 100644 --- a/mysql-test/suite/rpl/t/rpl_binlog_corruption.test +++ b/mysql-test/suite/rpl/t/rpl_binlog_corruption.test @@ -22,7 +22,7 @@ source include/have_debug.inc; --connection slave call mtr.add_suppression('Found invalid event in binary log'); - +call mtr.add_suppression('Slave SQL.*Relay log read failure: Could not parse relay log event entry.* 1594'); # # BUG#40482: server/mysqlbinlog crashes when reading invalid Incident_log_event diff --git a/mysql-test/suite/rpl/t/rpl_bug33931.test b/mysql-test/suite/rpl/t/rpl_bug33931.test index a3314b3f89e..5cc2da4a001 100644 --- a/mysql-test/suite/rpl/t/rpl_bug33931.test +++ b/mysql-test/suite/rpl/t/rpl_bug33931.test @@ -9,6 +9,7 @@ connection slave; # Add suppression for expected warnings in slaves error log call mtr.add_suppression("Failed during slave I/O thread initialization"); +call mtr.add_suppression("Slave SQL.*Failed during slave thread initialization.* 1593"); --source include/stop_slave.inc reset slave; diff --git a/mysql-test/suite/bugs/t/rpl_bug37426.test b/mysql-test/suite/rpl/t/rpl_bug37426.test index 4c7729ab837..d0a60524fef 100644 --- a/mysql-test/suite/bugs/t/rpl_bug37426.test +++ b/mysql-test/suite/rpl/t/rpl_bug37426.test @@ -7,15 +7,16 @@ source include/master-slave.inc; source include/have_binlog_format_row.inc; connection master; -CREATE TABLE char128_utf8 ( - i1 INT NOT NULL, - c CHAR(128) CHARACTER SET utf8 NOT NULL, - i2 INT NOT NULL); - +CREATE TABLE char128_utf8 (i1 INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, i2 INT NOT NULL); INSERT INTO char128_utf8 VALUES ( 1, "123", 1 ); SELECT * FROM char128_utf8; sync_slave_with_master; SELECT * FROM char128_utf8; + +# Clean up +connection master; +DROP TABLE char128_utf8; +sync_slave_with_master; --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test index 750f399ce99..7d4b538c8a6 100644 --- a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test +++ b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test @@ -30,6 +30,7 @@ CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, CREATE TABLE t2 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=InnoDB; --source include/rpl_sync.inc --connection server_4 +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); --echo # @@ -85,6 +86,7 @@ INSERT INTO t1(b,c) VALUES('B',2); # Wait while C will stop. --connection server_3 # 1062 = ER_DUP_ENTRY +call mtr.add_suppression("Slave SQL.*Duplicate entry .6. for key .PRIMARY.* Error_code: 1062"); --let $slave_sql_errno= 1062 --source include/wait_for_slave_sql_error.inc --connection server_1 diff --git a/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test b/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test index 8e1c9eb98b2..13c66f9f64b 100644 --- a/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test +++ b/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test @@ -122,6 +122,8 @@ UPDATE t7 LEFT JOIN (t8, t4, t1) ON (t7.id=t8.id and t7.id=t4.id and t7.id=t1.id # if any of the above statement are not ignored, it would cause error # and stop slave sql thread. sync_slave_with_master; +connection slave; +call mtr.add_suppression("Slave SQL.*Error .Table .test.t[47]. doesn.t exist. on query.* Error_code: 1146"); connection master; # Parameters for include/wait_for_slave_sql_error_and_skip.inc: diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test index a89a1847bc6..b9a170c5bc1 100644 --- a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test +++ b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test @@ -319,6 +319,8 @@ INSERT INTO t1 VALUES (1, 'on slave', NULL); --connection master INSERT INTO t1 VALUES (1, 'on master', NULL); --connection slave +call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.. on query.* Error_code: 1062"); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); let $slave_errno= ER_DUP_ENTRY --source include/wait_for_slave_sql_error.inc let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1); diff --git a/mysql-test/suite/rpl/t/rpl_idempotency.test b/mysql-test/suite/rpl/t/rpl_idempotency.test index f4a78a8c069..c229711e005 100644 --- a/mysql-test/suite/rpl/t/rpl_idempotency.test +++ b/mysql-test/suite/rpl/t/rpl_idempotency.test @@ -4,9 +4,10 @@ source include/master-slave.inc; # Add suppression for expected warning(s) in slaves error log -call mtr.add_suppression("Slave: Can't find record in 't.' Error_code: 1032"); -call mtr.add_suppression("Slave: Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451"); -call mtr.add_suppression("Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452"); +call mtr.add_suppression("Slave SQL.*Can.t find record in .t[12].* Error_code: 1032"); +call mtr.add_suppression("Slave SQL.*Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451"); +call mtr.add_suppression("Slave SQL.*Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452"); +call mtr.add_suppression("Slave SQL.*Could not execute Write_rows event on table test.* Duplicate entry .1. for key .PRIMARY.* Error_code: 1062"); connection master; CREATE TABLE t1 (a INT PRIMARY KEY); diff --git a/mysql-test/suite/rpl/t/rpl_ignore_table.test b/mysql-test/suite/rpl/t/rpl_ignore_table.test index 9d74a40bef1..4c0659daebf 100644 --- a/mysql-test/suite/rpl/t/rpl_ignore_table.test +++ b/mysql-test/suite/rpl/t/rpl_ignore_table.test @@ -125,6 +125,7 @@ show grants for mysqltest4@localhost; # where mysqltest1 does not exist on slave, # to succeed on slave the mode is temporarily changed set global slave_exec_mode='IDEMPOTENT'; +call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table mysql.* Error_code: 1032"); connection master; drop table t1, mysqltest2.t2; diff --git a/mysql-test/suite/rpl/t/rpl_incident.test b/mysql-test/suite/rpl/t/rpl_incident.test index b65441c7d50..d6034009f4f 100644 --- a/mysql-test/suite/rpl/t/rpl_incident.test +++ b/mysql-test/suite/rpl/t/rpl_incident.test @@ -15,6 +15,7 @@ SELECT * FROM t1; connection slave; # Wait until SQL thread stops with error LOST_EVENT on master +call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master.* 1590"); let $slave_sql_errno= 1590; let $show_slave_sql_error= 1; source include/wait_for_slave_sql_error.inc; diff --git a/mysql-test/suite/rpl/t/rpl_init_slave_errors.test b/mysql-test/suite/rpl/t/rpl_init_slave_errors.test index cf72de18e13..4dab13856d4 100644 --- a/mysql-test/suite/rpl/t/rpl_init_slave_errors.test +++ b/mysql-test/suite/rpl/t/rpl_init_slave_errors.test @@ -58,7 +58,7 @@ start slave; --let $show_slave_sql_error= 1 --source include/wait_for_slave_sql_error.inc -call mtr.add_suppression("Failed during slave I/O thread initialization"); +call mtr.add_suppression("Failed during slave.* thread initialization"); SET GLOBAL debug= ""; diff --git a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test index b942c29094a..f4b854eff87 100644 --- a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test +++ b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test @@ -30,6 +30,7 @@ connection slave; #1105 = ER_UNKNOWN_ERROR --let $slave_sql_errno= 1105 --let $show_slave_sql_error= 1 +call mtr.add_suppression("Slave SQL.*suffer.*http:..bugs.mysql.com.bug.php.id=24432"); --source include/wait_for_slave_sql_error.inc # show that it was not replicated SELECT * FROM t1; diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test b/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test index ecbaddb6995..be099c1b6c4 100644 --- a/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test +++ b/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test @@ -15,6 +15,7 @@ connection master; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE t1; connection slave; +call mtr.add_suppression("Slave SQL.*Fatal error: Not enough memory, Error_code: 1593"); let $slave_sql_errno= 1593; let $show_slave_sql_error= 1; source include/wait_for_slave_sql_error_and_skip.inc; diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_map-master.opt b/mysql-test/suite/rpl/t/rpl_loaddata_map-master.opt index 831680eb5ef..5fdeb855110 100644 --- a/mysql-test/suite/rpl/t/rpl_loaddata_map-master.opt +++ b/mysql-test/suite/rpl/t/rpl_loaddata_map-master.opt @@ -1 +1 @@ ---read_buffer_size=12K --max_allowed_packet=8K +--read_buffer_size=12K --max_allowed_packet=8K --net-buffer-length=8K diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_map-slave.opt b/mysql-test/suite/rpl/t/rpl_loaddata_map-slave.opt index 95f55bcf7d8..7d404fae240 100644 --- a/mysql-test/suite/rpl/t/rpl_loaddata_map-slave.opt +++ b/mysql-test/suite/rpl/t/rpl_loaddata_map-slave.opt @@ -1 +1 @@ ---max_allowed_packet=8K +--max_allowed_packet=8K --net-buffer-length=8K diff --git a/mysql-test/suite/rpl/t/rpl_rotate_logs.test b/mysql-test/suite/rpl/t/rpl_rotate_logs.test index 42fe8dcae17..a1b4f367812 100644 --- a/mysql-test/suite/rpl/t/rpl_rotate_logs.test +++ b/mysql-test/suite/rpl/t/rpl_rotate_logs.test @@ -94,6 +94,7 @@ set insert_id=1234; insert into t2 values(NULL); connection slave; # 1062 = ER_DUP_ENTRY +call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .1234. for key .PRIMARY.. on query.* Error_code: 1062"); --let $slave_sql_errno= 1062 --source include/wait_for_slave_sql_error_and_skip.inc diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test index 8264e8de0e7..b1b77c6f0cc 100644 --- a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test +++ b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test @@ -63,6 +63,7 @@ DROP TABLE t1; --echo **** On Slave **** connection slave; SET GLOBAL QUERY_CACHE_SIZE=0; +call mtr.add_suppression("Slave SQL.*Could not execute Update_rows event on table test.t1.* Error_code: 1032"); --echo **** On Master **** connection master; diff --git a/mysql-test/suite/rpl/t/rpl_row_colSize.test b/mysql-test/suite/rpl/t/rpl_row_colSize.test index 04434517518..0701c44edd3 100644 --- a/mysql-test/suite/rpl/t/rpl_row_colSize.test +++ b/mysql-test/suite/rpl/t/rpl_row_colSize.test @@ -160,6 +160,10 @@ let $test_table_slave = CREATE TABLE t1 (a TINYBLOB); let $test_insert = INSERT INTO t1 VALUES ('This is a test.'); source include/test_fieldsize.inc; +connection slave; +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 0 ...e mismatch.* Error_code: 1535"); +call mtr.add_suppression("Slave SQL.*Column 0 of table .test.t1. cannot be converted from type.* Error_code: 1677"); + --echo *** Cleanup *** connection master; DROP TABLE IF EXISTS t1; diff --git a/mysql-test/suite/rpl/t/rpl_row_idempotency.test b/mysql-test/suite/rpl/t/rpl_row_idempotency.test index 3e846b30242..7f48d6503c1 100644 --- a/mysql-test/suite/rpl/t/rpl_row_idempotency.test +++ b/mysql-test/suite/rpl/t/rpl_row_idempotency.test @@ -9,10 +9,10 @@ connection slave; source include/have_innodb.inc; # Add suppression for expected warning(s) in slaves error log -call mtr.add_suppression("Slave: Can't find record in 't.' Error_code: 1032"); -call mtr.add_suppression("Slave: Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451"); -call mtr.add_suppression("Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452"); - +call mtr.add_suppression("Can.t find record in .t[12].* Error_code: 1032"); +call mtr.add_suppression("Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451"); +call mtr.add_suppression("Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452"); +call mtr.add_suppression("Duplicate entry .1. for key .PRIMARY.* Error_code: 1062"); # bug#31609 Not all RBR slave errors reported as errors # bug#31552 Replication breaks when deleting rows from out-of-sync table diff --git a/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test b/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test index b695428dd38..22fd65ecaf3 100644 --- a/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test +++ b/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test @@ -30,6 +30,7 @@ INSERT INTO t1 VALUES (1); connection slave; # slave should have stopped because can't find table t1 # 1146 = ER_NO_SUCH_TABLE +call mtr.add_suppression("Slave SQL.*Error executing row event: .Table .test.t1. doesn.t exist., Error_code: 1146"); --let $slave_sql_errno= 1146 --source include/wait_for_slave_sql_error.inc diff --git a/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test b/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test index e40cd615ca6..f96603f69ed 100644 --- a/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test +++ b/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test @@ -1,12 +1,11 @@ -- source include/have_binlog_format_row.inc -- source include/master-slave.inc +-- let $engine= MyISAM # # BUG#52868 Wrong handling of NULL value during update, replication out of sync # --- let $engine= MyISAM --- source extra/rpl_tests/rpl_record_compare.test -- echo ## coverage purposes - Field_bits -- echo ## 1 X bit + 2 Null bits + 5 bits => last_null_bit_pos==0 @@ -28,4 +27,7 @@ UPDATE t1 SET c1= 0; -- connection master DROP TABLE t1; -- sync_slave_with_master + +-- source extra/rpl_tests/rpl_record_compare.test + --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync.test b/mysql-test/suite/rpl/t/rpl_semi_sync.test index a57ebc236a1..228757496f3 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync.test +++ b/mysql-test/suite/rpl/t/rpl_semi_sync.test @@ -15,6 +15,7 @@ call mtr.add_suppression("Unsafe statement written to the binary log using state connection slave; call mtr.add_suppression("Master server does not support semi-sync"); call mtr.add_suppression("Semi-sync slave .* reply"); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); enable_query_log; connection master; diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_event.test b/mysql-test/suite/rpl/t/rpl_semi_sync_event.test index 68e52c4a028..cd73a84d569 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync_event.test +++ b/mysql-test/suite/rpl/t/rpl_semi_sync_event.test @@ -15,6 +15,7 @@ call mtr.add_suppression("Unsafe statement written to the binary log using state connection slave; call mtr.add_suppression("Master server does not support semi-sync"); call mtr.add_suppression("Semi-sync slave .* reply"); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); enable_query_log; connection master; diff --git a/mysql-test/suite/rpl/t/rpl_skip_error.test b/mysql-test/suite/rpl/t/rpl_skip_error.test index 2853c95b212..82d6e61a2cd 100644 --- a/mysql-test/suite/rpl/t/rpl_skip_error.test +++ b/mysql-test/suite/rpl/t/rpl_skip_error.test @@ -102,6 +102,8 @@ SET SQL_LOG_BIN=1; connection slave; +call mtr.add_suppression("Slave SQL.*Could not execute .*te_rows event on table test.t.; Duplicate entry.* Error_code: 1062"); + CREATE TABLE t1(id INT NOT NULL PRIMARY KEY, data INT) Engine=InnoDB; SHOW CREATE TABLE t1; diff --git a/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test b/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test index 70ebba0047b..4fdc1268b80 100644 --- a/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test +++ b/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test @@ -63,6 +63,7 @@ SELECT * FROM t3 ORDER BY a; --connection slave # 1146 = ER_NO_SUCH_TABLE +call mtr.add_suppression("Slave SQL.*Table .test.t3. doesn.t exist.* Error_code: 1146"); --let $slave_sql_errno= 1146 --source include/wait_for_slave_sql_error.inc SHOW TABLES LIKE 't%'; diff --git a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile-slave.opt b/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile-slave.opt deleted file mode 100644 index 51e410f911f..00000000000 --- a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile-slave.opt +++ /dev/null @@ -1 +0,0 @@ ---loose-debug=d,remove_slave_load_file_before_write diff --git a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test b/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test index 41709c87f40..36327e2354a 100644 --- a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test +++ b/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test @@ -1,12 +1,21 @@ -########################################################################## +# ==== Purpose ==== +# # This test verifies if the slave fails gracefully when the temporary -# file used to load data is removed while it is about to be used it. +# file used to load data is removed while it is about to be used. # Similar errors are caught if the temporary directory is removed. # +# ==== Implementation ==== +# # Steps: +# 0 - Set debug variable remove_slave_load_file_before_write. This +# causes the slave to remove the file. # 1 - Creates a table and populates it through "LOAD DATA INFILE". # 2 - Catches error. -########################################################################## +# +# ==== References ==== +# +# BUG#42861: Assigning invalid directories to --slave-load-tmpdir crashes the slave +# BUG#11872422: rpl_slave_load_remove_tmpfile fails sporadically in pb2 --source include/have_binlog_format_statement.inc --source include/have_innodb.inc @@ -18,6 +27,11 @@ ########################################################################## # Loading data ########################################################################## + +connection slave; +--let $old_debug= `SELECT @@GLOBAL.DEBUG` +SET @@GLOBAL.DEBUG = '+d,remove_slave_load_file_before_write'; + connection master; create table t1(a int not null auto_increment, b int, primary key(a)) engine=innodb; @@ -32,19 +46,14 @@ commit; # Catch Error ########################################################################## connection slave; -source include/wait_for_slave_sql_to_stop.inc; ---let $error= query_get_value(SHOW SLAVE STATUS, Last_Errno, 1) # windows and linux different error numbers here: # Windows: # - Last_Errno 29 (File not found) # Unix like OS: # - Last_Errno 13 (Can't stat file) ---let $assertion= `SELECT $error=29 OR $error=13` -if (!$assertion) -{ - --echo UNEXPECTED ERROR NUMBER: $error -} +--let $slave_sql_errno= 29, 13 +--source include/wait_for_slave_sql_error.inc ########################################################################## # Clean up @@ -60,7 +69,12 @@ RESET SLAVE; drop table t1; call mtr.add_suppression("Slave: Can't get stat of .*"); +call mtr.add_suppression("Slave SQL: Error .Can.t get stat of.* Error_code: 13"); call mtr.add_suppression("Slave: File.* not found.*"); +call mtr.add_suppression("Slave SQL: Error .File.* not found.* Error_code: 29"); --let $rpl_only_running_threads= 1 + +eval SET @@GLOBAL.DEBUG = '$old_debug'; + --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test b/mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test index 0481581998c..b99c71b1ca0 100644 --- a/mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test +++ b/mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test @@ -11,6 +11,7 @@ --connection slave START SLAVE; # Why 12??? +call mtr.add_suppression("Slave SQL.*Unable to use slave.s temporary directory.* Error_code: 12"); --let $slave_sql_errno= 12 source include/wait_for_slave_sql_error.inc; diff --git a/mysql-test/suite/rpl/t/rpl_slow_query_log.test b/mysql-test/suite/rpl/t/rpl_slow_query_log.test index e980aab7787..faf037a9dff 100644 --- a/mysql-test/suite/rpl/t/rpl_slow_query_log.test +++ b/mysql-test/suite/rpl/t/rpl_slow_query_log.test @@ -29,7 +29,7 @@ source include/master-slave.inc; source include/have_binlog_format_statement.inc; CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); - +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); # Prepare slave for different long_query_time we need to stop the slave # and restart it as long_query_time variable is dynamic and, after diff --git a/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test b/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test index d08bc2f246a..ada080e9071 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test +++ b/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test @@ -19,6 +19,7 @@ SET @@session.binlog_direct_non_transactional_updates= FALSE; # clean up --connection slave SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit; +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); --connection master SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit; diff --git a/mysql-test/suite/rpl/t/rpl_stop_slave.test b/mysql-test/suite/rpl/t/rpl_stop_slave.test index ace11cc1467..296b002dbb7 100644 --- a/mysql-test/suite/rpl/t/rpl_stop_slave.test +++ b/mysql-test/suite/rpl/t/rpl_stop_slave.test @@ -47,6 +47,10 @@ source extra/rpl_tests/rpl_stop_slave.test; SET GLOBAL debug= '$debug_save'; source include/restart_slave_sql.inc; +connection slave; +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); +connection master; + --source include/rpl_connection_master.inc DROP TABLE t1, t2; @@ -67,11 +71,13 @@ CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB; CREATE TABLE t2 (c1 INT) ENGINE=MyISAM; INSERT INTO t1 VALUES(1, 1); +sync_slave_with_master; + +--source include/rpl_connection_master.inc + let $debug_save= `SELECT @@GLOBAL.debug`; SET GLOBAL debug= 'd,dump_thread_wait_before_send_xid'; -sync_slave_with_master; - --source include/rpl_connection_slave.inc source include/restart_slave_sql.inc; diff --git a/mysql-test/suite/rpl/t/rpl_sync.test b/mysql-test/suite/rpl/t/rpl_sync.test index 639214f9d93..e1750be0ff6 100644 --- a/mysql-test/suite/rpl/t/rpl_sync.test +++ b/mysql-test/suite/rpl/t/rpl_sync.test @@ -31,6 +31,7 @@ --source include/not_valgrind.inc --source include/have_debug.inc --source include/have_innodb.inc +--source include/not_crashrep.inc call mtr.add_suppression('Attempting backtrace'); call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001"); diff --git a/mysql-test/suite/rpl/t/rpl_temporary_errors.test b/mysql-test/suite/rpl/t/rpl_temporary_errors.test index 46c5817c9a3..07b23e10847 100644 --- a/mysql-test/suite/rpl/t/rpl_temporary_errors.test +++ b/mysql-test/suite/rpl/t/rpl_temporary_errors.test @@ -27,6 +27,9 @@ SHOW STATUS LIKE 'Slave_retried_transactions'; SELECT * FROM t1; source include/check_slave_is_running.inc; +connection slave; +call mtr.add_suppression("Slave SQL.*Could not execute Update_rows event on table test.t1"); + --echo **** On Master **** connection master; DROP TABLE t1; diff --git a/mysql-test/suite/rpl/t/rpl_typeconv.test b/mysql-test/suite/rpl/t/rpl_typeconv.test index c15207addf9..efe3dc15353 100644 --- a/mysql-test/suite/rpl/t/rpl_typeconv.test +++ b/mysql-test/suite/rpl/t/rpl_typeconv.test @@ -61,6 +61,8 @@ SELECT RPAD(Source, 15, ' ') AS Source_Type, enable_query_log; DROP TABLE type_conversions; +call mtr.add_suppression("Slave SQL.*Column 0 of table .test.t1. cannot be converted from type.* Error_code: 1677"); + connection master; DROP TABLE t1; sync_slave_with_master; diff --git a/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result b/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result index 32048a7cfb0..ffa43415bd3 100644 --- a/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result +++ b/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result @@ -7,6 +7,7 @@ SET @@global.max_allowed_packet = DEFAULT; SET @@global.max_allowed_packet = 1000; Warnings: Warning 1292 Truncated incorrect max_allowed_packet value: '1000' +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' SET @@global.max_allowed_packet = DEFAULT; SELECT @@global.max_allowed_packet; @@global.max_allowed_packet @@ -25,12 +26,15 @@ SELECT @@global.max_allowed_packet = 1048576; 1 '#--------------------FN_DYNVARS_070_03-------------------------#' SET @@global.max_allowed_packet = 1024; +Warnings: +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' SELECT @@global.max_allowed_packet; @@global.max_allowed_packet 1024 SET @@global.max_allowed_packet = 1025; Warnings: Warning 1292 Truncated incorrect max_allowed_packet value: '1025' +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' SELECT @@global.max_allowed_packet; @@global.max_allowed_packet 1024 @@ -74,18 +78,21 @@ SELECT @@session.max_allowed_packet; SET @@global.max_allowed_packet = 0; Warnings: Warning 1292 Truncated incorrect max_allowed_packet value: '0' +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' SELECT @@global.max_allowed_packet; @@global.max_allowed_packet 1024 SET @@global.max_allowed_packet = -1024; Warnings: Warning 1292 Truncated incorrect max_allowed_packet value: '-1024' +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' SELECT @@global.max_allowed_packet; @@global.max_allowed_packet 1024 SET @@global.max_allowed_packet = 1023; Warnings: Warning 1292 Truncated incorrect max_allowed_packet value: '1023' +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' SELECT @@global.max_allowed_packet; @@global.max_allowed_packet 1024 @@ -148,17 +155,21 @@ WHERE VARIABLE_NAME='max_allowed_packet'; SET @@global.max_allowed_packet = TRUE; Warnings: Warning 1292 Truncated incorrect max_allowed_packet value: '1' +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' SELECT @@global.max_allowed_packet; @@global.max_allowed_packet 1024 SET @@global.max_allowed_packet = FALSE; Warnings: Warning 1292 Truncated incorrect max_allowed_packet value: '0' +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' SELECT @@global.max_allowed_packet; @@global.max_allowed_packet 1024 '#---------------------FN_DYNVARS_070_09----------------------#' SET @@global.max_allowed_packet = 2048; +Warnings: +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' SELECT @@max_allowed_packet = @@global.max_allowed_packet; @@max_allowed_packet = @@global.max_allowed_packet 0 diff --git a/mysql-test/suite/sys_vars/r/max_allowed_packet_func.result b/mysql-test/suite/sys_vars/r/max_allowed_packet_func.result index 0d682b65aea..1e20776973c 100644 --- a/mysql-test/suite/sys_vars/r/max_allowed_packet_func.result +++ b/mysql-test/suite/sys_vars/r/max_allowed_packet_func.result @@ -23,6 +23,8 @@ SELECT @@session.net_buffer_length; '#--------------------FN_DYNVARS_070_02-------------------------#' ## Setting value of max_allowed packet and net_buffer_length to 1024 ## SET @@global.max_allowed_packet = 1024; +Warnings: +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' SET @@global.net_buffer_length = 1024; SELECT @@global.max_allowed_packet; @@global.max_allowed_packet diff --git a/mysql-test/suite/sys_vars/r/max_long_data_size_basic.result b/mysql-test/suite/sys_vars/r/max_long_data_size_basic.result new file mode 100644 index 00000000000..679a0d3611f --- /dev/null +++ b/mysql-test/suite/sys_vars/r/max_long_data_size_basic.result @@ -0,0 +1,14 @@ +select @@global.max_long_data_size=20; +@@global.max_long_data_size=20 +0 +select @@session.max_long_data_size; +ERROR HY000: Variable 'max_long_data_size' is a GLOBAL variable +SELECT @@global.max_long_data_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='max_long_data_size'; +@@global.max_long_data_size = VARIABLE_VALUE +1 +set global max_long_data_size=1; +ERROR HY000: Variable 'max_long_data_size' is a read only variable +set session max_long_data_size=1; +ERROR HY000: Variable 'max_long_data_size' is a read only variable diff --git a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result index acc8cd699f8..dfd776c9970 100644 --- a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result +++ b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result @@ -60,6 +60,13 @@ set session optimizer_switch="index_merge"; ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'index_merge' set session optimizer_switch="foobar"; ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'foobar' +# +# Bug#59894 set optimizer_switch to e or d causes invalid +# memory writes/valgrind warnings + +set global optimizer_switch = 'd'; +set global optimizer_switch = 'e'; +ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'e' SET @@global.optimizer_switch = @start_global_value; SELECT @@global.optimizer_switch; @@global.optimizer_switch diff --git a/mysql-test/suite/sys_vars/t/max_long_data_size_basic.test b/mysql-test/suite/sys_vars/t/max_long_data_size_basic.test new file mode 100644 index 00000000000..eefa61bd4b7 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/max_long_data_size_basic.test @@ -0,0 +1,17 @@ +select @@global.max_long_data_size=20; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.max_long_data_size; + +# Show that value of the variable matches the value in the GLOBAL I_S table +SELECT @@global.max_long_data_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='max_long_data_size'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global max_long_data_size=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session max_long_data_size=1; + diff --git a/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test b/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test index 4267b3726aa..df1a3511fa1 100644 --- a/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test +++ b/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test @@ -46,5 +46,13 @@ set session optimizer_switch="index_merge"; --error ER_WRONG_VALUE_FOR_VAR set session optimizer_switch="foobar"; +--echo # +--echo # Bug#59894 set optimizer_switch to e or d causes invalid +--echo # memory writes/valgrind warnings +--echo +set global optimizer_switch = 'd'; # means default +--error ER_WRONG_VALUE_FOR_VAR +set global optimizer_switch = 'e'; + SET @@global.optimizer_switch = @start_global_value; SELECT @@global.optimizer_switch; diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 5d71eead642..38d0d08808a 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -1159,3 +1159,20 @@ CREATE TABLE db1.t1 (bar TINYTEXT, KEY (bar(100))); ALTER TABLE db1.t1 ADD baz INT; DROP DATABASE db1; + + +--echo # +--echo # Bug#11938039 RE-EXECUTION OF FRM-ONLY ALTER TABLE WITH RENAME +--echo # CLAUSE FAILS OR ABORTS SERVER. +--echo # +--disable_warnings +drop table if exists t1; +--enable_warnings +create table t1 (a int); +prepare stmt1 from 'alter table t1 alter column a set default 1, rename to t2'; +execute stmt1; +rename table t2 to t1; +--echo # The below statement should succeed and not emit error or abort server. +execute stmt1; +deallocate prepare stmt1; +drop table t2; diff --git a/mysql-test/t/archive_plugin.test b/mysql-test/t/archive_plugin.test index 567a0a58ce7..7d9b0ea065f 100644 --- a/mysql-test/t/archive_plugin.test +++ b/mysql-test/t/archive_plugin.test @@ -20,6 +20,14 @@ CREATE TABLE t1(a int) ENGINE=ARCHIVE; DROP TABLE t1; +# This dummy statement is required for --ps-protocol mode. +# The thing is that last prepared statement is "cached" in mysqltest.cc +# (unless "reconnect" is enabled, and that's not the case here). +# This statement forces mysqltest.cc to close prepared "DROP TABLE t1". +# Otherwise, the plugin can not be uninstalled because there is an active +# prepared statement using it. +SELECT 1; + UNINSTALL PLUGIN archive; --error ER_SP_DOES_NOT_EXIST diff --git a/mysql-test/t/blackhole_plugin.test b/mysql-test/t/blackhole_plugin.test index 1de5b2d0499..448104bed2b 100644 --- a/mysql-test/t/blackhole_plugin.test +++ b/mysql-test/t/blackhole_plugin.test @@ -20,6 +20,14 @@ CREATE TABLE t1(a int) ENGINE=BLACKHOLE; DROP TABLE t1; +# This dummy statement is required for --ps-protocol mode. +# The thing is that last prepared statement is "cached" in mysqltest.cc +# (unless "reconnect" is enabled, and that's not the case here). +# This statement forces mysqltest.cc to close prepared "DROP TABLE t1". +# Otherwise, the plugin can not be uninstalled because there is an active +# prepared statement using it. +SELECT 1; + UNINSTALL PLUGIN blackhole; --error ER_SP_DOES_NOT_EXIST UNINSTALL PLUGIN blackhole; diff --git a/mysql-test/t/bootstrap.test b/mysql-test/t/bootstrap.test index e98afb81ff1..5b432653e45 100644 --- a/mysql-test/t/bootstrap.test +++ b/mysql-test/t/bootstrap.test @@ -49,3 +49,15 @@ remove_file $MYSQLTEST_VARDIR/tmp/long_query.sql; set global max_allowed_packet=@my_max_allowed_packet; drop table t1; +--echo End of 5.1 tests + +--echo # +--echo # Bug #11766306: 59393: HAVE_INNODB=YES WHEN MYSQLD +--echo # STARTED WITH --SKIP-INNODB +--echo # + +# need the --skip-innodb option present for the test to succeed +SHOW VARIABLES LIKE 'have_innodb'; +SELECT SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb'; + +--echo End of 5.5 tests diff --git a/mysql-test/t/crash_commit_before.test b/mysql-test/t/crash_commit_before.test index e3dba58d4df..6e36d2345e1 100644 --- a/mysql-test/t/crash_commit_before.test +++ b/mysql-test/t/crash_commit_before.test @@ -1,6 +1,8 @@ -- source include/not_embedded.inc # Don't test this under valgrind, memory leaks will occur --source include/not_valgrind.inc +# Avoid CrashReporter popup on Mac +--source include/not_crashrep.inc # Binary must be compiled with debug for crash to occur --source include/have_debug.inc diff --git a/mysql-test/t/ctype_latin1.test b/mysql-test/t/ctype_latin1.test index b8aae2eae40..5d1acf107d7 100644 --- a/mysql-test/t/ctype_latin1.test +++ b/mysql-test/t/ctype_latin1.test @@ -144,5 +144,20 @@ SELECT '' LIKE '' ESCAPE EXPORT_SET(1, 1, 1, 1, ''); --source include/ctype_numconv.inc --echo # +--echo # Bug#11764503 (Bug#57341) Query in EXPLAIN EXTENDED shows wrong characters +--echo # +# Test latin1 client erroneously started with --default-character-set=utf8 +# EXPLAIN output should still be pretty readable. +# We're using 'ó' (\xC3\xB3) as a magic sequence: +# - it's "LATIN CAPITAL LETTER A WITH TILDE ABOVE + SUPERSCRIPT 3" in latin1 +# - it's "LATIN SMALL LETTER O WITH ACUTE ABOVE" in utf8. +SET NAMES utf8; +EXPLAIN EXTENDED SELECT 'abcdó', _latin1'abcdó', _utf8'abcdó'; +# Test normal latin1 +SET NAMES latin1; +EXPLAIN EXTENDED SELECT 'abcdó', _latin1'abcdó', _utf8'abcdó'; + + +--echo # --echo # End of 5.5 tests --echo # diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 2aea21afe68..a519a417192 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -1550,6 +1550,16 @@ SELECT COUNT(*) FROM t1, t1 t2 GROUP BY INSERT('', t2.a, t1.a, (@@global.max_binlog_size)); DROP TABLE t1; +--echo # +--echo # Bug#11764503 (Bug#57341) Query in EXPLAIN EXTENDED shows wrong characters +--echo # +# Emulate utf8 client erroneously started with --default-character-set=latin1, +# as in the bug report. EXPLAIN output should still be pretty readable +SET NAMES latin1; +EXPLAIN EXTENDED SELECT 'abcdÃÂÃÄÅ', _latin1'abcdÃÂÃÄÅ', _utf8'abcdÃÂÃÄÅ' AS u; +# Test normal utf8 +SET NAMES utf8; +EXPLAIN EXTENDED SELECT 'abcdÃÂÃÄÅ', _latin1'abcdÃÂÃÄÅ', _utf8'abcdÃÂÃÄÅ'; --echo # --echo # End of 5.5 tests diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 985493481e9..063bbb9ce4b 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -16,3 +16,4 @@ read_many_rows_innodb : Bug#37635 2010-11-15 mattiasj report already exists sum_distinct-big : Bug#56927 2010-11-15 mattiasj was not tested alter_table-big : Bug#37248 2010-11-15 mattiasj was not tested create-big : Bug#37248 2010-11-15 mattiasj was not tested +archive-big : Bug#11817185 2011-03-10 Anitha Disabled since this leads to timeout on Solaris Sparc diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test index 8d9959f1b0a..9432e64e032 100644 --- a/mysql-test/t/events_bugs.test +++ b/mysql-test/t/events_bugs.test @@ -1221,6 +1221,21 @@ SELECT event_name, originator FROM INFORMATION_SCHEMA.EVENTS; DROP EVENT ev1; SET GLOBAL server_id = @old_server_id; +# +# Bug#11751148: show events shows events in other schema +# + +CREATE DATABASE event_test12; +USE event_test12; +CREATE EVENT ev1 ON SCHEDULE EVERY 1 DAY DO SELECT 1; +CREATE DATABASE event_test1; +USE event_test1; +# Following show events should not show ev1 +SHOW EVENTS; +DROP DATABASE event_test1; +DROP DATABASE event_test12; + + ########################################################################### # # End of tests diff --git a/mysql-test/t/file_contents.test b/mysql-test/t/file_contents.test index 2a112e14495..33cd65fb2b4 100644 --- a/mysql-test/t/file_contents.test +++ b/mysql-test/t/file_contents.test @@ -10,9 +10,10 @@ --perl print "\nChecking 'INFO_SRC' and 'INFO_BIN'\n"; -$dir_docs = $ENV{'MYSQL_BINDIR'}; -if($dir_docs =~ m|/usr/|) { +$dir_bin = $ENV{'MYSQL_BINDIR'}; +if ($dir_bin =~ m|/usr/|) { # RPM package + $dir_docs = $dir_bin; $dir_docs =~ s|/lib|/share/doc|; if(-d "$dir_docs/packages/MySQL-server") { # SuSE @@ -21,8 +22,19 @@ if($dir_docs =~ m|/usr/|) { # RedHat: version number in directory name $dir_docs = glob "$dir_docs/MySQL-server*"; } +} elsif ($dir_bin =~ m|/usr$|) { + # RPM build during development + $dir_docs = "$dir_bin/share/doc"; + if(-d "$dir_docs/packages/MySQL-server") { + # SuSE + $dir_docs = "$dir_docs/packages/MySQL-server"; + } else { + # RedHat: version number in directory name + $dir_docs = glob "$dir_docs/MySQL-server*"; + } } else { # tar.gz package, Windows, or developer work (in BZR) + $dir_docs = $dir_bin; $dir_docs =~ s|/lib||; if(-d "$dir_docs/docs") { $dir_docs = "$dir_docs/docs"; # package @@ -32,7 +44,7 @@ if($dir_docs =~ m|/usr/|) { } $found_version = "No line 'MySQL source #.#.#'"; $found_revision = "No line 'revision-id: .....'"; -open(I_SRC,"<","$dir_docs/INFO_SRC") or print "Cannot open 'INFO_SRC' in '$dir_docs'\n"; +open(I_SRC,"<","$dir_docs/INFO_SRC") or print "Cannot open 'INFO_SRC' in '$dir_docs' (starting from bindir '$dir_bin')\n"; while(defined ($line = <I_SRC>)) { if ($line =~ m|^MySQL source \d\.\d\.\d+|) {$found_version = "Found MySQL version number";} if ($line =~ m|^revision-id: .*@.*-2\d{13}-\w+$|) {$found_revision = "Found BZR revision id";} @@ -41,7 +53,7 @@ close I_SRC; print "INFO_SRC: $found_version / $found_revision\n"; $found_compiler = "No line about compiler information"; $found_features = "No line 'Feature flags'"; -open(I_BIN,"<","$dir_docs/INFO_BIN") or print "Cannot open 'INFO_BIN' in '$dir_docs'\n"; +open(I_BIN,"<","$dir_docs/INFO_BIN") or print "Cannot open 'INFO_BIN' in '$dir_docs' (starting from bindir '$dir_bin')\n"; while(defined ($line = <I_BIN>)) { # "generator" on Windows, "flags" on Unix: if (($line =~ m| Compiler / generator used: |) || diff --git a/mysql-test/t/flush.test b/mysql-test/t/flush.test index 944c9c43019..52ee6d2cf87 100644 --- a/mysql-test/t/flush.test +++ b/mysql-test/t/flush.test @@ -644,3 +644,27 @@ disconnect con2; --source include/wait_until_disconnected.inc connection default; drop tables t1, t2; + + +--echo # +--echo # Bug#57649 FLUSH TABLES under FLUSH TABLES <list> WITH READ LOCK leads +--echo # to assert failure. +--echo # + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE t1 (a INT); +FLUSH TABLES t1 WITH READ LOCK; + +# All these triggered the assertion +--error ER_TABLE_NOT_LOCKED_FOR_WRITE +FLUSH TABLES; +--error ER_TABLE_NOT_LOCKED_FOR_WRITE +CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a= 1; +--error ER_TABLE_NOT_LOCKED_FOR_WRITE +ALTER TABLE t1 COMMENT 'test'; + +UNLOCK TABLES; +DROP TABLE t1; diff --git a/mysql-test/t/flush_read_lock.test b/mysql-test/t/flush_read_lock.test index dbb1dd7cb49..9da93dd40a1 100644 --- a/mysql-test/t/flush_read_lock.test +++ b/mysql-test/t/flush_read_lock.test @@ -557,6 +557,8 @@ let $cleanup_stmt= ; --source include/check_ftwrl_compatible.inc deallocate prepare stmt1; +call mtr.add_suppression("Slave SQL.*Can.t execute the query because you have a conflicting read lock., Error_code: 1223"); + --echo # --echo # 9.2.b) EXECUTE for statement which is incompatible with FTWRL --echo # should be also incompatible. diff --git a/mysql-test/t/func_analyse.test b/mysql-test/t/func_analyse.test index 05f739bfd69..c77967a0cc9 100644 --- a/mysql-test/t/func_analyse.test +++ b/mysql-test/t/func_analyse.test @@ -1,6 +1,7 @@ # # Test of procedure analyse # +-- source include/have_innodb.inc --disable_warnings drop table if exists t1,t2; @@ -133,3 +134,26 @@ DROP TABLE t1; --echo End of 5.0 tests + +--echo # +--echo # Bug#11765202: Dbug_violation_helper::~Dbug_violation_helper(): Assertion `!_entered' failed. +--echo # + +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a VARCHAR(2) CHARSET UTF8 NOT NULL); +INSERT INTO t1 VALUES ('e'),('e'),('e-'); +SELECT * FROM t1 PROCEDURE ANALYSE(); +DROP TABLE t1; + +--echo # +--echo # Bug#11756242 48137: PROCEDURE ANALYSE() LEAKS MEMORY WHEN RETURNING NULL +--echo # + +CREATE TABLE t1(f1 INT) ENGINE=MYISAM; +CREATE TABLE t2(f2 INT) ENGINE=INNODB; +INSERT INTO t2 VALUES (1); +SELECT DISTINCTROW f1 FROM t1 NATURAL RIGHT OUTER JOIN t2 PROCEDURE ANALYSE(); +SELECT * FROM t2 LIMIT 1 PROCEDURE ANALYSE(); +DROP TABLE t1, t2; + +--echo End of 5.1 tests diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test index a0527f70b25..e8309d68830 100644 --- a/mysql-test/t/func_group.test +++ b/mysql-test/t/func_group.test @@ -1117,6 +1117,28 @@ SELECT RELEASE_LOCK('aaaaaaaaaaaaaaaaa'); --enable_result_log + +--echo # +--echo # Bug #11766094 - 59132: MIN() AND MAX() REMOVE UNSIGNEDNESS +--echo # + +CREATE TABLE t1 (a BIGINT UNSIGNED); +INSERT INTO t1 VALUES (18446668621106209655); +SELECT MAX(LENGTH(a)), LENGTH(MAX(a)), MIN(a), MAX(a), CONCAT(MIN(a)), CONCAT(MAX(a)) FROM t1; +DROP TABLE t1; + +--echo # +--echo # Bug #11766270 59343: YEAR(4): INCORRECT RESULT AND VALGRIND WARNINGS WITH MIN/MAX, UNION +--echo # + +CREATE TABLE t1(f1 YEAR(4)); +INSERT INTO t1 VALUES (0000),(2001); +--enable_metadata +(SELECT MAX(f1) FROM t1) UNION (SELECT MAX(f1) FROM t1); +--disable_metadata +DROP TABLE t1; + + --echo # --echo End of 5.1 tests diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test index 6efeb2866e6..08469b37967 100644 --- a/mysql-test/t/func_in.test +++ b/mysql-test/t/func_in.test @@ -555,5 +555,11 @@ SELECT CASE a WHEN a THEN a END FROM t1 GROUP BY a WITH ROLLUP; DROP TABLE t1; --echo # +--echo # Bug #11766212 59270: NOT IN (YEAR( ... ), ... ) PRODUCES MANY VALGRIND WARNINGS +--echo # + +SELECT 1 IN (YEAR(FROM_UNIXTIME(NULL)) ,1); + +--echo # --echo End of 5.1 tests diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test index e56b9c7d20d..687d96f8804 100644 --- a/mysql-test/t/func_math.test +++ b/mysql-test/t/func_math.test @@ -345,6 +345,15 @@ CREATE TABLE t1 SELECT CAST((CASE(('')) WHEN (CONVERT(1, CHAR(1))) THEN (('' / 1 SHOW CREATE TABLE t1; DROP TABLE t1; +--echo # +--echo # Bug#11764994 57900: CREATE TABLE .. SELECT ASSERTS SCALE >= 0 && PRECISION > 0 && SCALE <= PR +--echo # + +CREATE TABLE t1 SELECT CEIL(LINESTRINGFROMWKB(1) DIV NULL); +DROP TABLE t1; +CREATE TABLE t1 SELECT FLOOR(LINESTRINGFROMWKB(1) DIV NULL); +DROP TABLE t1; + --echo End of 5.1 tests --echo # @@ -500,3 +509,8 @@ SELECT ((@a:=@b:=1.0) div (@b:=@a:=get_format(datetime, 'usa'))); --echo # Bug #59498 div function broken in mysql-trunk --echo # SELECT 1 div null; + +--echo # +--echo # Bug #11792200 - DIVIDING LARGE NUMBERS CAUSES STACK CORRUPTIONS +--echo # +select (1.175494351E-37 div 1.7976931348623157E+308); diff --git a/mysql-test/t/func_set.test b/mysql-test/t/func_set.test index 294efa8caf1..3531864c860 100644 --- a/mysql-test/t/func_set.test +++ b/mysql-test/t/func_set.test @@ -97,3 +97,25 @@ SELECT CONVERT( a USING latin1 ) FROM t1; SELECT CONVERT( a USING latin1 ) FROM t2; DROP TABLE t1, t2; + +--echo # +--echo # BUG#59405: FIND_IN_SET won't work normaly after upgrade from 5.1 to 5.5 +--echo # + +CREATE TABLE t1(days set('1','2','3','4','5','6','7')); +INSERT INTO t1 VALUES('1,2,3,4,5,6,7'), (NULL), ('1,2,3,4,5,6,7'); + +--echo +SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), days); +SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), days) IS UNKNOWN; +SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), NULL); +SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), NULL) IS UNKNOWN; +SELECT * FROM t1 WHERE FIND_IN_SET(7, days); +SELECT * FROM t1 WHERE FIND_IN_SET(8, days); +SELECT * FROM t1 WHERE FIND_IN_SET(NULL, days); +SELECT * FROM t1 WHERE FIND_IN_SET(NULL, days) IS UNKNOWN; +SELECT * FROM t1 WHERE FIND_IN_SET(NULL, NULL); +SELECT * FROM t1 WHERE FIND_IN_SET(NULL, NULL) IS UNKNOWN; + +--echo +DROP TABLE t1; diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index f53d90cef96..96a73a454c3 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -862,6 +862,38 @@ INSERT INTO t1 VALUES (''),(''); SELECT COUNT(*) FROM t1 GROUP BY TIME_TO_SEC(a); DROP TABLE t1; +--echo # +--echo # Bug#11766112 59151:UNINITIALIZED VALUES IN EXTRACT_DATE_TIME WITH STR_TO_DATE(SPACE(..) ... +--echo # + +SELECT STR_TO_DATE(SPACE(2),'1'); + +--echo # +--echo # Bug#11765216 58154: UNINITIALIZED VARIABLE FORMAT IN STR_TO_DATE FUNCTION +--echo # + +SET GLOBAL SQL_MODE=''; +DO STR_TO_DATE((''), FROM_DAYS(@@GLOBAL.SQL_MODE)); +SET GLOBAL SQL_MODE=DEFAULT; + +--echo # +--echo # Bug#11766087 59125: VALGRIND UNINITIALISED VALUE WARNING IN ULL2DEC, LONGLONG2DECIMAL +--echo # + +SELECT FORMAT(YEAR(STR_TO_DATE('',GET_FORMAT(TIME,''))),1); + +--echo # +--echo # Bug#11766126 59166: ANOTHER DATETIME VALGRIND UNINITIALIZED WARNING +--echo # + +SELECT CAST((MONTH(FROM_UNIXTIME(@@GLOBAL.SQL_MODE))) AS BINARY(1025)); + +--echo # +--echo # Bug#11766124 59164: VALGRIND: UNINITIALIZED VALUE IN NUMBER_TO_DATETIME +--echo # + +SELECT ADDDATE(MONTH(FROM_UNIXTIME(NULL)),INTERVAL 1 HOUR); + --echo End of 5.1 tests --echo # @@ -888,4 +920,12 @@ SELECT MONTHNAME(0), MONTHNAME(0) IS NULL, MONTHNAME(0) + 1; SET storage_engine=NULL; --echo # +--echo # Bug #59686 crash in String::copy() with time data type +--echo # +SELECT min(timestampadd(month, 1>'', from_days('%Z'))); + +create table t1(a time); +insert into t1 values ('00:00:00'),('00:01:00'); +select 1 from t1 where 1 < some (select cast(a as datetime) from t1); +drop table t1; diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index 845b976c031..1e1cb6c24dc 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -1396,6 +1396,183 @@ DROP USER testuser@localhost; use test; --echo + +--echo # +--echo # Test for bug #36544 "DROP USER does not remove stored function +--echo # privileges". +--echo # +create database mysqltest1; +create function mysqltest1.f1() returns int return 0; +create procedure mysqltest1.p1() begin end; +--echo # +--echo # 1) Check that DROP USER properly removes privileges on both +--echo # stored procedures and functions. +--echo # +create user mysqluser1@localhost; +grant execute on function mysqltest1.f1 to mysqluser1@localhost; +grant execute on procedure mysqltest1.p1 to mysqluser1@localhost; + +--echo # Quick test that granted privileges are properly reflected +--echo # in privilege tables and in in-memory structures. +show grants for mysqluser1@localhost; +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost'; +--echo # +--echo # Create connection 'bug_36544_con1' as 'mysqluser1@localhost'. +--connect (bug36544_con1,localhost,mysqluser1,,) +call mysqltest1.p1(); +select mysqltest1.f1(); + +--echo # +--echo # Switch to connection 'default'. +--connection default +drop user mysqluser1@localhost; + +--echo # +--echo # Test that dropping of user is properly reflected in +--echo # both privilege tables and in in-memory structures. +--echo # +--echo # Switch to connection 'bug36544_con1'. +--connection bug36544_con1 +--echo # The connection cold be alive but should not be able to +--echo # access to any of the stored routines. +--error ER_PROCACCESS_DENIED_ERROR +call mysqltest1.p1(); +--error ER_PROCACCESS_DENIED_ERROR +select mysqltest1.f1(); +--disconnect bug36544_con1 + +--echo # +--echo # Switch to connection 'default'. +--connection default +--echo # +--echo # Now create user with the same name and check that he +--echo # has not inherited privileges. +create user mysqluser1@localhost; +show grants for mysqluser1@localhost; +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost'; +--echo # +--echo # Create connection 'bug_36544_con2' as 'mysqluser1@localhost'. +--connect (bug36544_con2,localhost,mysqluser1,,) +--echo # Newly created user should not be able to access any of the routines. +--error ER_PROCACCESS_DENIED_ERROR +call mysqltest1.p1(); +--error ER_PROCACCESS_DENIED_ERROR +select mysqltest1.f1(); +--echo # +--echo # Switch to connection 'default'. +--connection default + +--echo # +--echo # 2) Check that RENAME USER properly updates privileges on both +--echo # stored procedures and functions. +--echo # +grant execute on function mysqltest1.f1 to mysqluser1@localhost; +grant execute on procedure mysqltest1.p1 to mysqluser1@localhost; +--echo # +--echo # Create one more user to make in-memory hashes non-trivial. +--echo # User names 'mysqluser11' and 'mysqluser10' were selected +--echo # to trigger bug discovered during code inspection. +create user mysqluser11@localhost; +grant execute on function mysqltest1.f1 to mysqluser11@localhost; +grant execute on procedure mysqltest1.p1 to mysqluser11@localhost; +--echo # Also create a couple of tables to test for another bug +--echo # discovered during code inspection (again table names were +--echo # chosen especially to trigger the bug). +create table mysqltest1.t11 (i int); +create table mysqltest1.t22 (i int); +grant select on mysqltest1.t22 to mysqluser1@localhost; +grant select on mysqltest1.t11 to mysqluser1@localhost; + +--echo # Quick test that granted privileges are properly reflected +--echo # in privilege tables and in in-memory structures. +show grants for mysqluser1@localhost; +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost'; +select db, table_name, table_priv from mysql.tables_priv where user='mysqluser1' and host='localhost'; +--echo # +--echo # Switch to connection 'bug36544_con2'. +--connection bug36544_con2 +call mysqltest1.p1(); +select mysqltest1.f1(); +select * from mysqltest1.t11; +select * from mysqltest1.t22; + +--echo # +--echo # Switch to connection 'default'. +--connection default +rename user mysqluser1@localhost to mysqluser10@localhost; + +--echo # +--echo # Test that there are no privileges left for mysqluser1. +--echo # +--echo # Switch to connection 'bug36544_con2'. +--connection bug36544_con2 +--echo # The connection cold be alive but should not be able to +--echo # access to any of the stored routines or tables. +--error ER_PROCACCESS_DENIED_ERROR +call mysqltest1.p1(); +--error ER_PROCACCESS_DENIED_ERROR +select mysqltest1.f1(); +--error ER_TABLEACCESS_DENIED_ERROR +select * from mysqltest1.t11; +--error ER_TABLEACCESS_DENIED_ERROR +select * from mysqltest1.t22; +--disconnect bug36544_con2 + +--echo # +--echo # Switch to connection 'default'. +--connection default +--echo # +--echo # Now create user with the old name and check that he +--echo # has not inherited privileges. +create user mysqluser1@localhost; +show grants for mysqluser1@localhost; +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost'; +select db, table_name, table_priv from mysql.tables_priv where user='mysqluser1' and host='localhost'; +--echo # +--echo # Create connection 'bug_36544_con3' as 'mysqluser1@localhost'. +--connect (bug36544_con3,localhost,mysqluser1,,) +--echo # Newly created user should not be able to access to any of the +--echo # stored routines or tables. +--error ER_PROCACCESS_DENIED_ERROR +call mysqltest1.p1(); +--error ER_PROCACCESS_DENIED_ERROR +select mysqltest1.f1(); +--error ER_TABLEACCESS_DENIED_ERROR +select * from mysqltest1.t11; +--error ER_TABLEACCESS_DENIED_ERROR +select * from mysqltest1.t22; +--disconnect bug36544_con3 + +--echo # +--echo # Switch to connection 'default'. +--connection default +--echo # +--echo # Now check that privileges became associated with a new user +--echo # name - mysqluser10. +--echo # +show grants for mysqluser10@localhost; +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser10' and host='localhost'; +select db, table_name, table_priv from mysql.tables_priv where user='mysqluser10' and host='localhost'; +--echo # +--echo # Create connection 'bug_36544_con4' as 'mysqluser10@localhost'. +--connect (bug36544_con4,localhost,mysqluser10,,) +call mysqltest1.p1(); +select mysqltest1.f1(); +select * from mysqltest1.t11; +select * from mysqltest1.t22; +--disconnect bug36544_con4 + +--echo # +--echo # Switch to connection 'default'. +--connection default +--echo # +--echo # Clean-up. +drop user mysqluser1@localhost; +drop user mysqluser10@localhost; +drop user mysqluser11@localhost; +drop database mysqltest1; + + --echo End of 5.0 tests # diff --git a/mysql-test/t/innodb_mysql_lock.test b/mysql-test/t/innodb_mysql_lock.test index 975444a44b1..f1dc0d52484 100644 --- a/mysql-test/t/innodb_mysql_lock.test +++ b/mysql-test/t/innodb_mysql_lock.test @@ -279,6 +279,38 @@ disconnect con2; disconnect con3; +--echo # +--echo # Bug#11815600 [ERROR] INNODB COULD NOT FIND INDEX PRIMARY +--echo # KEY NO 0 FOR TABLE IN ERROR LOG +--echo # + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--connect (con1,localhost,root) + +--echo # Connection default +connection default; +CREATE TABLE t1 (id INT PRIMARY KEY, value INT) ENGINE = InnoDB; +INSERT INTO t1 VALUES (1, 12345); +START TRANSACTION; +SELECT * FROM t1; + +--echo # Connection con1 +--connection con1 +SET lock_wait_timeout=1; +--error ER_LOCK_WAIT_TIMEOUT +ALTER TABLE t1 ADD INDEX idx(value); + +--echo # Connection default +--connection default +SELECT * FROM t1; +COMMIT; +DROP TABLE t1; +disconnect con1; + + # Check that all connections opened by test cases in this file are really # gone so execution of other tests won't be affected by their presence. --source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/innodb_mysql_sync.test b/mysql-test/t/innodb_mysql_sync.test index a8925306c70..13c854d6b61 100644 --- a/mysql-test/t/innodb_mysql_sync.test +++ b/mysql-test/t/innodb_mysql_sync.test @@ -152,132 +152,133 @@ disconnect con1; --echo # that implement add_index --echo # ---disable_warnings -DROP DATABASE IF EXISTS db1; -DROP TABLE IF EXISTS t1; ---enable_warnings - -connect(con1,localhost,root); -connect(con2,localhost,root); - ---echo # Test 1: Secondary index, should not block reads (original test case). - ---echo # Connection default -connection default; -CREATE DATABASE db1; -CREATE TABLE db1.t1(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, value INT) engine=innodb; -INSERT INTO db1.t1(value) VALUES (1), (2); -SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; ---echo # Sending: ---send ALTER TABLE db1.t1 ADD INDEX(value) - ---echo # Connection con1 -connection con1; -SET DEBUG_SYNC= "now WAIT_FOR manage"; -# Neither of these two statements should be blocked -USE db1; -SELECT * FROM t1; -SET DEBUG_SYNC= "now SIGNAL query"; - ---echo # Connection default -connection default; ---echo # Reaping: ALTER TABLE db1.t1 ADD INDEX(value) ---reap -DROP DATABASE db1; - ---echo # Test 2: Primary index (implicit), should block reads. - -CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL) engine=innodb; -SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; ---echo # Sending: ---send ALTER TABLE t1 ADD UNIQUE INDEX(a) - ---echo # Connection con1 -connection con1; -SET DEBUG_SYNC= "now WAIT_FOR manage"; -USE test; ---echo # Sending: ---send SELECT * FROM t1 - ---echo # Connection con2 -connection con2; ---echo # Waiting for SELECT to be blocked by the metadata lock on t1 -let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist - WHERE state= 'Waiting for table metadata lock' - AND info='SELECT * FROM t1'; ---source include/wait_condition.inc -SET DEBUG_SYNC= "now SIGNAL query"; - ---echo # Connection default -connection default; ---echo # Reaping: ALTER TABLE t1 ADD UNIQUE INDEX(a) ---reap - ---echo # Connection con1 -connection con1; ---echo # Reaping: SELECT * FROM t1 ---reap - ---echo # Test 3: Primary index (explicit), should block reads. - ---echo # Connection default -connection default; -ALTER TABLE t1 DROP INDEX a; -SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; ---echo # Sending: ---send ALTER TABLE t1 ADD PRIMARY KEY (a) - ---echo # Connection con1 -connection con1; -SET DEBUG_SYNC= "now WAIT_FOR manage"; ---echo # Sending: ---send SELECT * FROM t1 - ---echo # Connection con2 -connection con2; ---echo # Waiting for SELECT to be blocked by the metadata lock on t1 -let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist - WHERE state= 'Waiting for table metadata lock' - AND info='SELECT * FROM t1'; ---source include/wait_condition.inc -SET DEBUG_SYNC= "now SIGNAL query"; - ---echo # Connection default -connection default; ---echo # Reaping: ALTER TABLE t1 ADD PRIMARY KEY (a) ---reap - ---echo # Connection con1 -connection con1; ---echo # Reaping: SELECT * FROM t1 ---reap - ---echo # Test 4: Secondary unique index, should not block reads. -# This requires HA_INPLACE_ADD_UNIQUE_INDEX_NO_WRITE to be supported -# by InnoDB. Adding this flag currently introduces a regression so -# this test is disabled until the regression has been fixed. +--echo # +--echo # DISABLED due to Bug#11815600 +--echo # ---echo # Connection default -connection default; +#--disable_warnings +#DROP DATABASE IF EXISTS db1; +#DROP TABLE IF EXISTS t1; +#--enable_warnings +# +#connect(con1,localhost,root); +#connect(con2,localhost,root); +# +#--echo # Test 1: Secondary index, should not block reads (original test case). +# +#--echo # Connection default +#connection default; +#CREATE DATABASE db1; +#CREATE TABLE db1.t1(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, value INT) engine=innodb; +#INSERT INTO db1.t1(value) VALUES (1), (2); +#SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; +#--echo # Sending: +#--send ALTER TABLE db1.t1 ADD INDEX(value) +# +#--echo # Connection con1 +#connection con1; +#SET DEBUG_SYNC= "now WAIT_FOR manage"; +# # Neither of these two statements should be blocked +#USE db1; +#SELECT * FROM t1; +#SET DEBUG_SYNC= "now SIGNAL query"; +# +#--echo # Connection default +#connection default; +#--echo # Reaping: ALTER TABLE db1.t1 ADD INDEX(value) +#--reap +#DROP DATABASE db1; +# +#--echo # Test 2: Primary index (implicit), should block reads. +# +#CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL) engine=innodb; +#SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; +#--echo # Sending: +#--send ALTER TABLE t1 ADD UNIQUE INDEX(a) +# +#--echo # Connection con1 +#connection con1; +#SET DEBUG_SYNC= "now WAIT_FOR manage"; +#USE test; +#--echo # Sending: +#--send SELECT * FROM t1 +# +#--echo # Connection con2 +#connection con2; +#--echo # Waiting for SELECT to be blocked by the metadata lock on t1 +#let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist +# WHERE state= 'Waiting for table metadata lock' +# AND info='SELECT * FROM t1'; +#--source include/wait_condition.inc +#SET DEBUG_SYNC= "now SIGNAL query"; +# +#--echo # Connection default +#connection default; +#--echo # Reaping: ALTER TABLE t1 ADD UNIQUE INDEX(a) +#--reap +# +#--echo # Connection con1 +#connection con1; +#--echo # Reaping: SELECT * FROM t1 +#--reap +# +#--echo # Test 3: Primary index (explicit), should block reads. +# +#--echo # Connection default +#connection default; +#ALTER TABLE t1 DROP INDEX a; +#SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; +#--echo # Sending: +#--send ALTER TABLE t1 ADD PRIMARY KEY (a) +# +#--echo # Connection con1 +#connection con1; +#SET DEBUG_SYNC= "now WAIT_FOR manage"; +#--echo # Sending: +#--send SELECT * FROM t1 +# +#--echo # Connection con2 +#connection con2; +#--echo # Waiting for SELECT to be blocked by the metadata lock on t1 +#let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist +# WHERE state= 'Waiting for table metadata lock' +# AND info='SELECT * FROM t1'; +#--source include/wait_condition.inc +#SET DEBUG_SYNC= "now SIGNAL query"; +# +#--echo # Connection default +#connection default; +#--echo # Reaping: ALTER TABLE t1 ADD PRIMARY KEY (a) +#--reap +# +#--echo # Connection con1 +#connection con1; +#--echo # Reaping: SELECT * FROM t1 +#--reap +# +#--echo # Test 4: Secondary unique index, should not block reads. +# +#--echo # Connection default +#connection default; #SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; #--echo # Sending: #--send ALTER TABLE t1 ADD UNIQUE (b) - +# #--echo # Connection con1 #connection con1; #SET DEBUG_SYNC= "now WAIT_FOR manage"; #SELECT * FROM t1; #SET DEBUG_SYNC= "now SIGNAL query"; - +# #--echo # Connection default #connection default; #--echo # Reaping: ALTER TABLE t1 ADD UNIQUE (b) #--reap - -disconnect con1; -disconnect con2; -SET DEBUG_SYNC= "RESET"; -DROP TABLE t1; +# +#disconnect con1; +#disconnect con2; +#SET DEBUG_SYNC= "RESET"; +#DROP TABLE t1; # Check that all connections opened by test cases in this file are really diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test index 06054d1990d..8e5cba01d28 100644 --- a/mysql-test/t/loaddata.test +++ b/mysql-test/t/loaddata.test @@ -601,5 +601,18 @@ DROP TABLE t1; let $MYSQLD_DATADIR= `select @@datadir`; remove_file $MYSQLD_DATADIR/test/tmpp2.txt; +--echo # +--echo # Bug#11765139 58069: LOAD DATA INFILE: VALGRIND REPORTS INVALID MEMORY READS AND WRITES WITH U +--echo # + +CREATE TABLE t1(f1 INT); +EVAL SELECT 0xE1BB30 INTO OUTFILE 't1.dat'; +--disable_warnings +LOAD DATA INFILE 't1.dat' IGNORE INTO TABLE t1 CHARACTER SET utf8; +--enable_warnings + +DROP TABLE t1; +let $MYSQLD_DATADIR= `select @@datadir`; +remove_file $MYSQLD_DATADIR/test/t1.dat; --echo End of 5.1 tests diff --git a/mysql-test/t/lowercase_table2.test b/mysql-test/t/lowercase_table2.test index d8aa4e97fb3..30433d15be4 100644 --- a/mysql-test/t/lowercase_table2.test +++ b/mysql-test/t/lowercase_table2.test @@ -151,6 +151,41 @@ where TABLE_SCHEMA ='mysqltest_LC2'; use test; drop database mysqltest_LC2; + +--echo # +--echo # Bug #11758687: 50924: object names not resolved correctly +--echo # on lctn2 systems +--echo # + +CREATE DATABASE BUP_XPFM_COMPAT_DB2; + +CREATE TABLE BUP_XPFM_COMPAT_DB2.TABLE2 (c13 INT) DEFAULT CHARSET latin1; +CREATE TABLE BUP_XPFM_COMPAT_DB2.table1 (c13 INT) DEFAULT CHARSET latin1; +CREATE TABLE bup_xpfm_compat_db2.table3 (c13 INT) DEFAULT CHARSET latin1; + +delimiter |; +# +CREATE TRIGGER BUP_XPFM_COMPAT_DB2.trigger1 AFTER INSERT + ON BUP_XPFM_COMPAT_DB2.table1 FOR EACH ROW + update BUP_XPFM_COMPAT_DB2.table1 set c13=12; +| +CREATE TRIGGER BUP_XPFM_COMPAT_DB2.TRIGGER2 AFTER INSERT + ON BUP_XPFM_COMPAT_DB2.TABLE2 FOR EACH ROW + update BUP_XPFM_COMPAT_DB2.table1 set c13=12; +| +CREATE TRIGGER BUP_XPFM_COMPAT_DB2.TrigGer3 AFTER INSERT + ON BUP_XPFM_COMPAT_DB2.TaBle3 FOR EACH ROW + update BUP_XPFM_COMPAT_DB2.table1 set c13=12; +| +delimiter ;| + +SELECT trigger_schema, trigger_name, event_object_table FROM +INFORMATION_SCHEMA.TRIGGERS + WHERE trigger_schema COLLATE utf8_bin = 'BUP_XPFM_COMPAT_DB2' + ORDER BY trigger_schema, trigger_name; + +DROP DATABASE BUP_XPFM_COMPAT_DB2; + --echo # End of 5.1 tests diff --git a/mysql-test/t/myisam_crash_before_flush_keys.test b/mysql-test/t/myisam_crash_before_flush_keys.test index 0b0491098cd..a9f36f40d10 100644 --- a/mysql-test/t/myisam_crash_before_flush_keys.test +++ b/mysql-test/t/myisam_crash_before_flush_keys.test @@ -10,6 +10,8 @@ call mtr.add_suppression("Got an error from thread_id=.*ha_myisam.cc:"); call mtr.add_suppression("MySQL thread id .*, query id .* localhost.*root Checking table"); +# Avoid CrashReporter popup on Mac +--source include/not_crashrep.inc let $MYSQLD_DATADIR= `select @@datadir`; SET GLOBAL delay_key_write=ALL; diff --git a/mysql-test/t/mysql_client_test-master.opt b/mysql-test/t/mysql_client_test-master.opt index 4c683f7f0a2..3dfaf15666f 100644 --- a/mysql-test/t/mysql_client_test-master.opt +++ b/mysql-test/t/mysql_client_test-master.opt @@ -1 +1,4 @@ ---log=$MYSQLTEST_VARDIR/log/master.log --log-output=FILE,TABLE +--log=$MYSQLTEST_VARDIR/log/master.log +--log-output=FILE,TABLE +$PLUGIN_AUTH_OPT +$PLUGIN_AUTH_LOAD diff --git a/mysql-test/t/mysql_client_test.test b/mysql-test/t/mysql_client_test.test index 2c19671d11b..529d60517c0 100644 --- a/mysql-test/t/mysql_client_test.test +++ b/mysql-test/t/mysql_client_test.test @@ -1,5 +1,7 @@ # This test should work in embedded server after we fix mysqltest -- source include/not_embedded.inc +# need to have the dynamic loading turned on for the client plugin tests +--source include/have_plugin_auth.inc SET @old_general_log= @@global.general_log; SET @old_slow_query_log= @@global.slow_query_log; @@ -12,7 +14,7 @@ SET @old_slow_query_log= @@global.slow_query_log; # var/log/mysql_client_test.trace --exec echo "$MYSQL_CLIENT_TEST" > $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1 ---exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M >> $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1 +--exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M $PLUGIN_AUTH_CLIENT_OPT >> $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1 # End of 4.1 tests echo ok; diff --git a/mysql-test/t/mysqladmin.test b/mysql-test/t/mysqladmin.test index c3bfc585289..4811c5fdbc6 100644 --- a/mysql-test/t/mysqladmin.test +++ b/mysql-test/t/mysqladmin.test @@ -45,3 +45,17 @@ remove_file $MYSQLTEST_VARDIR/tmp/bug10608.cnf; --cat_file $MYSQLTEST_VARDIR/tmp/mysqladmin.tmp --remove_file $MYSQLTEST_VARDIR/tmp/mysqladmin.tmp + +--echo # +--echo # BUG#11766184 - 59234: cmdline clients crash --defaults-extra-file +--echo # with no .cnf or .ini extension. +--echo # + +--echo # Creating an empty file 'cnf_file' +--write_file $MYSQLTEST_VARDIR/tmp/cnf_file +EOF + +--echo # Using --defaults-extra-file option with 'cnf_file'. +--exec $MYSQLADMIN --defaults-extra-file=$MYSQLTEST_VARDIR/tmp/cnf_file -uroot -S $MASTER_MYSOCK -P $MASTER_MYPORT ping 2>&1 + +--remove_file $MYSQLTEST_VARDIR/tmp/cnf_file diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index 714cfbbaa9b..f64d8b502ae 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -527,3 +527,23 @@ exec $MYSQL_BINLOG $MYSQLD_DATADIR/$master_binlog | $MYSQL test 2>&1; let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1); source include/show_binlog_events.inc; +# +# BUG#11766427 BUG#59530: Filter by server id in mysqlbinlog fails +# This test checks that the format description log event is not +# filtered out by the --server-id option. +# +RESET MASTER; +USE test; +CREATE TABLE t1 (a INT); +--let $old_server_id= `SELECT @@GLOBAL.SERVER_ID` +SET GLOBAL SERVER_ID = 2; +DROP TABLE t1; +--let $master_binlog= query_get_value(SHOW MASTER STATUS, File, 1) +FLUSH LOGS; +# The following should only create t1, not drop it. +--exec $MYSQL_BINLOG --server-id=1 $MYSQLD_DATADIR/$master_binlog | $MYSQL +SHOW TABLES IN test; +# The following should only drop t1, not create it. +--exec $MYSQL_BINLOG --server-id=2 $MYSQLD_DATADIR/$master_binlog | $MYSQL +SHOW TABLES IN test; +eval SET GLOBAL SERVER_ID = $old_server_id; diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test index dd113cb4e74..8f93ac7b864 100644 --- a/mysql-test/t/mysqlcheck.test +++ b/mysql-test/t/mysqlcheck.test @@ -2,6 +2,8 @@ # Embedded server doesn't support external clients --source include/not_embedded.inc +--source include/have_innodb.inc + # check that CSV engine was compiled in, as the result of the test # depends on the presence of the log tables (which are CSV-based). --source include/have_csv.inc @@ -34,7 +36,7 @@ drop database if exists client_test_db; # # Bug #16502: mysqlcheck tries to check views # -create table t1 (a int); +create table t1 (a int) engine=myisam; create view v1 as select * from t1; --replace_result 'Table is already up to date' OK --exec $MYSQL_CHECK --analyze --databases test @@ -48,8 +50,8 @@ drop table t1; # # Bug #30654: mysqlcheck fails during upgrade of tables whose names include backticks # -create table `t``1`(a int); -create table `t 1`(a int); +create table `t``1`(a int) engine=myisam; +create table `t 1`(a int) engine=myisam; --replace_result 'Table is already up to date' OK --exec $MYSQL_CHECK --databases test drop table `t``1`, `t 1`; @@ -59,7 +61,7 @@ drop table `t``1`, `t 1`; # create database d_bug25347; use d_bug25347; -create table t_bug25347 (a int); +create table t_bug25347 (a int) engine=myisam; create view v_bug25347 as select * from t_bug25347; insert into t_bug25347 values (1),(2),(3); flush tables; @@ -91,8 +93,8 @@ drop view v1; # Bug#37527: mysqlcheck fails to report entire database # when frm file corruption # -CREATE TABLE t1(a INT); -CREATE TABLE t2(a INT); +CREATE TABLE t1(a INT) engine=myisam; +CREATE TABLE t2(a INT) engine=myisam; # backup then null t1.frm --copy_file $MYSQLD_DATADIR/test/t1.frm $MYSQLD_DATADIR/test/t1.frm.bak --remove_file $MYSQLD_DATADIR/test/t1.frm @@ -112,7 +114,7 @@ DROP TABLE t1, t2; # # Bug #30679: 5.1 name encoding not performed for views during upgrade # -create table t1(a int); +create table t1(a int) engine=myisam; create view v1 as select * from t1; show tables; let $MYSQLD_DATADIR= `select @@datadir`; @@ -131,7 +133,7 @@ drop table t1; # triggers # SET NAMES utf8; -CREATE TABLE `#mysql50#@` (a INT); +CREATE TABLE `#mysql50#@` (a INT) engine=myisam; SHOW TABLES; SET NAMES DEFAULT; --echo mysqlcheck --fix-table-names --databases test @@ -140,7 +142,7 @@ SET NAMES utf8; SHOW TABLES; DROP TABLE `@`; -CREATE TABLE `Ñ` (a INT); +CREATE TABLE `Ñ` (a INT) engine=myisam; SET NAMES DEFAULT; --echo mysqlcheck --default-character-set="latin1" --databases test # Error returned depends on platform, replace it with "Table doesn't exist" @@ -154,8 +156,8 @@ SET NAMES DEFAULT; CREATE DATABASE `#mysql50#a@b`; USE `#mysql50#a@b`; -CREATE TABLE `#mysql50#c@d` (a INT); -CREATE TABLE t1 (a INT); +CREATE TABLE `#mysql50#c@d` (a INT) engine=myisam; +CREATE TABLE t1 (a INT) engine=myisam; # Create 5.0 like triggers let $MYSQLTEST_VARDIR= `select @@datadir`; @@ -207,12 +209,12 @@ USE test; drop table if exists `#mysql50#t1-1`; --enable_warnings -create table `#mysql50#t1-1` (a int); +create table `#mysql50#t1-1` (a int) engine=myisam; --exec $MYSQL_CHECK --all-in-1 --fix-table-names --databases test show tables like 't1-1'; drop table `t1-1`; -create table `#mysql50#t1-1` (a int); +create table `#mysql50#t1-1` (a int) engine=myisam; --exec $MYSQL_CHECK --all-in-1 --fix-table-names test "#mysql50#t1-1" show tables like 't1-1'; drop table `t1-1`; @@ -229,3 +231,83 @@ drop table `t1-1`; --error 1 --exec $MYSQL_CHECK -aoc test "#mysql50#t1-1" + +--echo # +--echo # Bug#11755431 47205: MAP 'REPAIR TABLE' TO RECREATE +ANALYZE FOR +--echo # ENGINES NOT SUPPORTING NATIVE +--echo # + +--disable_warnings +DROP TABLE IF EXISTS bug47205; +--enable_warnings + +--echo # +--echo # Test 1: Check that ALTER TABLE ... rebuilds the table + +CREATE TABLE bug47205(a VARCHAR(20) PRIMARY KEY) + DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci engine=innodb; + +INSERT INTO bug47205 VALUES ("foobar"); +FLUSH TABLE bug47205; + +--echo # Replace the FRM with a 5.0 FRM that will require upgrade +let $MYSQLD_DATADIR= `select @@datadir`; +--remove_file $MYSQLD_DATADIR/test/bug47205.frm +--copy_file std_data/bug47205.frm $MYSQLD_DATADIR/test/bug47205.frm + +--echo # Should indicate that ALTER TABLE ... FORCE is needed +CHECK TABLE bug47205 FOR UPGRADE; + +--echo # ALTER TABLE ... FORCE should rebuild the table +--echo # and therefore output "affected rows: 1" +--enable_info +ALTER TABLE bug47205 FORCE; +--disable_info + +--echo # Table should now be ok +CHECK TABLE bug47205 FOR UPGRADE; + +DROP TABLE bug47205; + +--echo # +--echo # Test 2: InnoDB - REPAIR not supported + +CREATE TABLE bug47205(a VARCHAR(20) PRIMARY KEY) + DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci engine=innodb; + +FLUSH TABLE bug47205; + +--echo # Replace the FRM with a 5.0 FRM that will require upgrade +let $MYSQLD_DATADIR= `select @@datadir`; +--remove_file $MYSQLD_DATADIR/test/bug47205.frm +--copy_file std_data/bug47205.frm $MYSQLD_DATADIR/test/bug47205.frm + +--echo # Should indicate that ALTER TABLE .. FORCE is needed +CHECK TABLE bug47205 FOR UPGRADE; + +--echo # Running mysqlcheck to check and upgrade +--exec $MYSQL_CHECK --check-upgrade --auto-repair test + +--echo # Table should now be ok +CHECK TABLE bug47205 FOR UPGRADE; + +DROP TABLE bug47205; + +--echo # +--echo # Test 3: MyISAM - REPAIR supported + +--echo # Use an old FRM that will require upgrade +--copy_file std_data/bug36055.frm $MYSQLD_DATADIR/test/bug47205.frm +--copy_file std_data/bug36055.MYD $MYSQLD_DATADIR/test/bug47205.MYD +--copy_file std_data/bug36055.MYI $MYSQLD_DATADIR/test/bug47205.MYI + +--echo # Should indicate that REPAIR TABLE is needed +CHECK TABLE bug47205 FOR UPGRADE; + +--echo # Running mysqlcheck to check and upgrade +--exec $MYSQL_CHECK --check-upgrade --auto-repair test + +--echo # Table should now be ok +CHECK TABLE bug47205 FOR UPGRADE; + +DROP TABLE bug47205; diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 44245eb9d44..09648faca94 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -2198,10 +2198,22 @@ ALTER DATABASE `test-database` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; --exec $MYSQL_DUMP --quote-names --compact test-database DROP DATABASE `test-database`; +# Switching back to test database. +USE `test`; --echo # --echo # End of 5.1 tests --echo # +--echo # +--echo # Verify that two modes can be given in --compatible; +--echo # and are reflected in SET SQL_MODE in the mysqldump output. +--echo # Also verify that a prefix of the mode's name is enough. +--echo # +CREATE TABLE t1 (a INT); +# no_t = no_table_options; no_f = no_field_options +--exec $MYSQL_DUMP --compatible=no_t,no_f --skip-comments test +DROP TABLE t1; + # Wait till we reached the initial number of concurrent sessions --source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/mysqlslap.test b/mysql-test/t/mysqlslap.test index 28042f62fe6..757d2813483 100644 --- a/mysql-test/t/mysqlslap.test +++ b/mysql-test/t/mysqlslap.test @@ -53,3 +53,18 @@ CREATE PROCEDURE p1() SELECT 1; --exec $MYSQL_SLAP --create-schema=test --delimiter=";" --query="CALL p1; SELECT 1;" --silent 2>&1 DROP PROCEDURE p1; + + +--echo # +--echo # Bug #11765157 - 58090: mysqlslap drops schema specified in +--echo # create_schema if auto-generate-sql also set. +--echo # + +--exec $MYSQL_SLAP --silent --create-schema=bug58090 --concurrency=5 --iterations=20 --auto-generate-sql +--echo # 'bug58090' database should not be present. +SHOW DATABASES; +--exec $MYSQL_SLAP --silent --create-schema=bug58090 --no-drop --auto-generate-sql +--echo # 'bug58090' database should be present. +SHOW DATABASES; +DROP DATABASE bug58090; + diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test index 5998d6269fb..726dfa154b8 100644 --- a/mysql-test/t/order_by.test +++ b/mysql-test/t/order_by.test @@ -847,8 +847,7 @@ CALL mtr.add_suppression("Out of sort memory"); --error ER_OUT_OF_SORTMEMORY select * from t1 order by b; drop table t1; - - +call mtr.add_suppression("Out of sort memory; increase server sort buffer size"); --echo # --echo # Bug #39844: Query Crash Mysql Server 5.0.67 --echo # diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index f2e8cbb2da2..7fb5f434b83 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -15,6 +15,49 @@ drop table if exists t1, t2; --enable_warnings --echo # +--echo # Bug#59297: Can't find record in 'tablename' on update inner join +--echo # + +CREATE TABLE t1 ( +a char(2) NOT NULL, +b char(2) NOT NULL, +c int(10) unsigned NOT NULL, +d varchar(255) DEFAULT NULL, +e varchar(1000) DEFAULT NULL, +PRIMARY KEY (a, b, c), +KEY (a), +KEY (a, b) +) +/*!50100 PARTITION BY KEY (a) +PARTITIONS 20 */; + +INSERT INTO t1 (a, b, c, d, e) VALUES +('07', '03', 343, '1', '07_03_343'), +('01', '04', 343, '2', '01_04_343'), +('01', '06', 343, '3', '01_06_343'), +('01', '07', 343, '4', '01_07_343'), +('01', '08', 343, '5', '01_08_343'), +('01', '09', 343, '6', '01_09_343'), +('03', '03', 343, '7', '03_03_343'), +('03', '06', 343, '8', '03_06_343'), +('03', '07', 343, '9', '03_07_343'), +('04', '03', 343, '10', '04_03_343'), +('04', '06', 343, '11', '04_06_343'), +('05', '03', 343, '12', '05_03_343'), +('11', '03', 343, '13', '11_03_343'), +('11', '04', 343, '14', '11_04_343') +; + +UPDATE t1 AS A, +(SELECT '03' AS a, '06' AS b, 343 AS c, 'last' AS d) AS B +SET A.e = B.d +WHERE A.a = '03' +AND A.b = '06' +AND A.c = 343; + +DROP TABLE t1; + +--echo # --echo # Bug#57778: failed primary key add to partitioned innodb table --echo # inconsistent and crashes --echo # diff --git a/mysql-test/t/partition_error.test b/mysql-test/t/partition_error.test index 61b14b81fca..536935420a4 100644 --- a/mysql-test/t/partition_error.test +++ b/mysql-test/t/partition_error.test @@ -741,65 +741,9 @@ DROP TABLE t1; CREATE TABLE t1 (c TIMESTAMP) PARTITION BY HASH (c) PARTITIONS 4; +--echo # Moved to partition_myisam, since it was MyISAM specific --echo # Added test with existing TIMESTAMP partitioning (when it was allowed). -CREATE TABLE t1 (a TIMESTAMP) -PARTITION BY HASH (UNIX_TIMESTAMP(a)); -INSERT INTO t1 VALUES ('2000-01-02 03:04:05'); ---sorted_result -SELECT * FROM t1; -FLUSH TABLES; ---echo # replacing t1.frm with TO_DAYS(a) which was allowed earlier. ---remove_file $MYSQLD_DATADIR/test/t1.frm ---copy_file std_data/parts/t1TIMESTAMP.frm $MYSQLD_DATADIR/test/t1.frm ---echo # Disable warnings, since the result would differ when running with ---echo # --ps-protocol (only for the 'SELECT * FROM t1' statement). ---disable_warnings ---sorted_result -SELECT * FROM t1; ---enable_warnings -SHOW CREATE TABLE t1; -INSERT INTO t1 VALUES ('2001-02-03 04:05:06'); ---sorted_result -SELECT * FROM t1; -ALTER TABLE t1 ADD PARTITION PARTITIONS 2; ---error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR -ALTER TABLE t1 -PARTITION BY RANGE (TO_DAYS(a)) -(PARTITION p0 VALUES LESS THAN (10000), - PARTITION p1 VALUES LESS THAN (MAXVALUE)); -SHOW CREATE TABLE t1; -CREATE TABLE t2 LIKE t1; -SHOW CREATE TABLE t2; -DROP TABLE t2; -CREATE TABLE t2 SELECT * FROM t1; -DROP TABLE t2; -ALTER TABLE t1 PARTITION BY HASH (UNIX_TIMESTAMP(a)); -SHOW CREATE TABLE t1; -ALTER TABLE t1 ADD PARTITION PARTITIONS 2; -SHOW CREATE TABLE t1; ---sorted_result -SELECT * FROM t1; -DROP TABLE t1; - ---echo # ---echo # Bug#49161: Out of memory; restart server and try again (needed 2 bytes) ---echo # -CREATE TABLE t1 (a INT) PARTITION BY HASH (a); -FLUSH TABLES; ---remove_file $MYSQLD_DATADIR/test/t1.par ---replace_result $MYSQLD_DATADIR ./ -CHECK TABLE t1; ---error ER_FAILED_READ_FROM_PAR_FILE -SELECT * FROM t1; ---echo # Note that it is currently impossible to drop a partitioned table ---echo # without the .par file ---error ER_BAD_TABLE_ERROR -DROP TABLE t1; ---remove_file $MYSQLD_DATADIR/test/t1.frm ---remove_file $MYSQLD_DATADIR/test/t1#P#p0.MYI ---remove_file $MYSQLD_DATADIR/test/t1#P#p0.MYD - --echo # --echo # Bug#49477: Assertion `0' failed in ha_partition.cc:5530 --echo # with temporary table and partitions @@ -820,6 +764,7 @@ SUBPARTITION BY HASH(TO_DAYS(purchased)) (PARTITION p0 VALUES LESS THAN MAXVALUE DATA DIRECTORY = '/tmp/not-existing' INDEX DIRECTORY = '/tmp/not-existing'); +--replace_result MyISAM <curr_engine> InnoDB <curr_engine> SHOW CREATE TABLE t1; DROP TABLE t1; CREATE TABLE t1 (id INT, purchased DATE) @@ -830,6 +775,7 @@ SUBPARTITION BY HASH(TO_DAYS(purchased)) SUBPARTITIONS 2 DATA DIRECTORY = '/tmp/not-existing' INDEX DIRECTORY = '/tmp/not-existing', SUBPARTITION sp1)); +--replace_result MyISAM <curr_engine> InnoDB <curr_engine> SHOW CREATE TABLE t1; DROP TABLE t1; CREATE TABLE t1 (id INT, purchased DATE) @@ -837,34 +783,11 @@ PARTITION BY RANGE(YEAR(purchased)) (PARTITION p0 VALUES LESS THAN MAXVALUE DATA DIRECTORY = '/tmp/not-existing' INDEX DIRECTORY = '/tmp/not-existing'); +--replace_result MyISAM <curr_engine> InnoDB <curr_engine> SHOW CREATE TABLE t1; DROP TABLE t1; SET @@sql_mode= @org_mode; ---echo # ---echo # Bug#50392: insert_id is not reset for partitioned tables ---echo # 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; ---error ER_DUP_ENTRY -INSERT INTO t1 VALUES (NULL), (NULL), (NULL); -SHOW CREATE TABLE t1; -INSERT INTO t1 VALUES (NULL); -SELECT * FROM t1; -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; ---error ER_DUP_ENTRY -INSERT INTO t1 VALUES (NULL), (NULL), (NULL); -SHOW CREATE TABLE t1; -INSERT INTO t1 VALUES (NULL); -SELECT * FROM t1; -DROP TABLE t1; - # # Bug#38719: Partitioning returns a different error code for a # duplicate key error @@ -879,24 +802,6 @@ INSERT INTO t1 VALUES (1),(1); DROP TABLE t1; # -# Bug#31931: Mix of handlers error message -# ---error ER_MIX_HANDLER_ERROR -CREATE TABLE t1 (a INT) -PARTITION BY HASH (a) -( PARTITION p0 ENGINE=MyISAM, - PARTITION p1); ---error ER_MIX_HANDLER_ERROR -CREATE TABLE t1 (a INT) -PARTITION BY LIST (a) -SUBPARTITION BY HASH (a) -( PARTITION p0 VALUES IN (0) -( SUBPARTITION s0, SUBPARTITION s1 ENGINE=MyISAM, SUBPARTITION s2), - PARTITION p1 VALUES IN (1) -( SUBPARTITION s3 ENGINE=MyISAM, SUBPARTITION s4, SUBPARTITION s5 ENGINE=MyISAM)); - - -# # Bug 29368: # Incorrect error, 1467, for syntax error when creating partition --error ER_PARTITION_REQUIRES_VALUES_ERROR @@ -912,7 +817,7 @@ PARTITION BY RANGE (a) # # Partition by key stand-alone error # ---error 1064 +--error ER_PARSE_ERROR partition by list (a) partitions 3 (partition x1 values in (1,2,9,4) tablespace ts1, @@ -949,7 +854,7 @@ partitions 3 # # Partition by key, partition function not allowed # ---error 1064 +--error ER_PARSE_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -964,7 +869,7 @@ partitions 3 # # Partition by key, no partition name # ---error 1064 +--error ER_PARSE_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -995,7 +900,7 @@ select load_file('$MYSQLD_DATADIR/test/t1.par'); # # Partition by hash, invalid field in function # ---error 1054 +--error ER_BAD_FIELD_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -1025,7 +930,7 @@ partitions 3 # # Partition by key specified 3 partitions but only defined 2 => error # ---error 1064 +--error ER_PARSE_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -1038,7 +943,7 @@ partitions 3 # # Partition by hash, random function # ---error 1064 +--error ER_PARSE_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -1051,7 +956,7 @@ partitions 2 # # Partition by range, random function # ---error 1064 +--error ER_PARSE_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -1064,7 +969,7 @@ partitions 2 # # Partition by list, random function # ---error 1064 +--error ER_PARSE_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -1200,7 +1105,7 @@ select load_file('$MYSQLD_DATADIR/test/t1.par'); # # Subpartition by hash, no partitions defined, wrong subpartition function # ---error 1064 +--error ER_PARSE_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -1227,7 +1132,7 @@ select load_file('$MYSQLD_DATADIR/test/t1.par'); # # Subpartition by hash, no partitions defined, wrong subpartition function # ---error 1064 +--error ER_PARSE_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -1268,7 +1173,7 @@ subpartition by hash (3+4); # # Subpartition by hash, no partitions defined, wrong subpartition function # ---error 1054 +--error ER_BAD_FIELD_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -1294,7 +1199,7 @@ select load_file('$MYSQLD_DATADIR/test/t1.par'); # # Partition by range, invalid field in function # ---error 1054 +--error ER_BAD_FIELD_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -1448,7 +1353,7 @@ partitions 2 # # Subpartition by hash, wrong number of subpartitions # ---error 1064 +--error ER_PARSE_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -1468,7 +1373,7 @@ subpartitions 3 # # Subpartition by hash, wrong number of subpartitions # ---error 1064 +--error ER_PARSE_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -1488,7 +1393,7 @@ subpartition by hash (a+b) # # Subpartition by list => error # ---error 1064 +--error ER_PARSE_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -1507,7 +1412,7 @@ subpartition by list (a+b) # # Subpartition by list => error # ---error 1064 +--error ER_PARSE_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -1551,7 +1456,7 @@ partitions 2 # # Partition by list, invalid field in function # ---error 1054 +--error ER_BAD_FIELD_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -1635,7 +1540,7 @@ partitions 2 # # Partition by list, missing parenthesis # ---error 1064 +--error ER_PARSE_ERROR CREATE TABLE t1 ( a int not null, b int not null, @@ -1649,7 +1554,7 @@ partitions 2 # # Bug #13439: Crash when LESS THAN (non-literal) # ---error 1054 +--error ER_BAD_FIELD_ERROR CREATE TABLE t1 (a int) PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (x1)); @@ -1676,13 +1581,13 @@ partition by range (ascii(v)) (partition p0 values less than (10)); #drop table t1; --- error 1064 +-- error ER_PARSE_ERROR create table t1 (a int) partition by hash (rand(a)); --- error 1064 +-- error ER_PARSE_ERROR create table t1 (a int) partition by hash(CURTIME() + a); --- error 1064 +-- error ER_PARSE_ERROR create table t1 (a int) partition by hash (NOW()+a); -- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED diff --git a/mysql-test/t/partition_myisam.test b/mysql-test/t/partition_myisam.test new file mode 100644 index 00000000000..37d4a071fb9 --- /dev/null +++ b/mysql-test/t/partition_myisam.test @@ -0,0 +1,173 @@ +-- source include/have_partition.inc + +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +--enable_warnings + +# These tests is only useful when running on MyISAM, +# due to DATA/INDEX directory, non transactional behavior, tests with MyISAM +# files etc. + +let $MYSQLD_DATADIR= `SELECT @@datadir`; + + +--echo # +--echo # Bug#50036: Inconsistent errors when using TIMESTAMP +--echo # columns/expressions + +--echo # Added test with existing TIMESTAMP partitioning (when it was allowed). +CREATE TABLE t1 (a TIMESTAMP) +ENGINE = MyISAM +PARTITION BY HASH (UNIX_TIMESTAMP(a)); +INSERT INTO t1 VALUES ('2000-01-02 03:04:05'); +--sorted_result +SELECT * FROM t1; +FLUSH TABLES; +--echo # replacing t1.frm with TO_DAYS(a) which was allowed earlier. +--remove_file $MYSQLD_DATADIR/test/t1.frm +--copy_file std_data/parts/t1TIMESTAMP.frm $MYSQLD_DATADIR/test/t1.frm +--echo # Disable warnings, since the result would differ when running with +--echo # --ps-protocol (only for the 'SELECT * FROM t1' statement). +--disable_warnings +--sorted_result +SELECT * FROM t1; +--enable_warnings +--replace_result MyISAM <curr_engine> InnoDB <curr_engine> +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES ('2001-02-03 04:05:06'); +--sorted_result +SELECT * FROM t1; +ALTER TABLE t1 ADD PARTITION PARTITIONS 2; +--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR +ALTER TABLE t1 +PARTITION BY RANGE (TO_DAYS(a)) +(PARTITION p0 VALUES LESS THAN (10000), + PARTITION p1 VALUES LESS THAN (MAXVALUE)); +SHOW CREATE TABLE t1; +CREATE TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; +DROP TABLE t2; +CREATE TABLE t2 SELECT * FROM t1; +DROP TABLE t2; +ALTER TABLE t1 PARTITION BY HASH (UNIX_TIMESTAMP(a)); +SHOW CREATE TABLE t1; +ALTER TABLE t1 ADD PARTITION PARTITIONS 2; +SHOW CREATE TABLE t1; +--sorted_result +SELECT * FROM t1; +DROP TABLE t1; + + +--echo # +--echo # Bug#31931: Mix of handlers error message +--echo # +--error ER_MIX_HANDLER_ERROR +CREATE TABLE t1 (a INT) +PARTITION BY HASH (a) +( PARTITION p0 ENGINE=MyISAM, + PARTITION p1); +--error ER_MIX_HANDLER_ERROR +CREATE TABLE t1 (a INT) +PARTITION BY LIST (a) +SUBPARTITION BY HASH (a) +( PARTITION p0 VALUES IN (0) +( SUBPARTITION s0, SUBPARTITION s1 ENGINE=MyISAM, SUBPARTITION s2), + PARTITION p1 VALUES IN (1) +( SUBPARTITION s3 ENGINE=MyISAM, SUBPARTITION s4, SUBPARTITION s5 ENGINE=MyISAM)); + +--echo # +--echo # Bug#49161: Out of memory; restart server and try again (needed 2 bytes) +--echo # +CREATE TABLE t1 (a INT) +ENGINE = MyISAM +PARTITION BY HASH (a); +FLUSH TABLES; +--remove_file $MYSQLD_DATADIR/test/t1.par +--replace_result $MYSQLD_DATADIR ./ +CHECK TABLE t1; +--error ER_FAILED_READ_FROM_PAR_FILE +SELECT * FROM t1; +--echo # Note that it is currently impossible to drop a partitioned table +--echo # without the .par file +--error ER_BAD_TABLE_ERROR +DROP TABLE t1; +--remove_file $MYSQLD_DATADIR/test/t1.frm +--remove_file $MYSQLD_DATADIR/test/t1#P#p0.MYI +--remove_file $MYSQLD_DATADIR/test/t1#P#p0.MYD + +--echo # +--echo # Bug#50392: insert_id is not reset for partitioned tables +--echo # auto_increment on duplicate entry +CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) +ENGINE = MyISAM; +SET INSERT_ID= 13; +INSERT INTO t1 VALUES (NULL); +SET INSERT_ID= 12; +--echo # For transactional engines, 12 will not be inserted, since the failing +--echo # statement is rolled back. +--error ER_DUP_ENTRY +INSERT INTO t1 VALUES (NULL), (NULL), (NULL); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (NULL); +--echo # NOTE: 12 exists only in non transactional engines! +SELECT * FROM t1; +DROP TABLE t1; +CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) +ENGINE = MyISAM +PARTITION BY KEY(a); +SET INSERT_ID= 13; +INSERT INTO t1 VALUES (NULL); +SET INSERT_ID= 12; +--error ER_DUP_ENTRY +INSERT INTO t1 VALUES (NULL), (NULL), (NULL); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (NULL); +SELECT * FROM t1; +DROP TABLE t1; +# +# Bug#30102: rename table does corrupt tables with partition files on failure +# +--echo # Bug#30102 test +CREATE TABLE t1 (a INT) +ENGINE = MyISAM +PARTITION BY RANGE (a) +(PARTITION p0 VALUES LESS THAN (6), + PARTITION `p1....................` VALUES LESS THAN (9), + PARTITION p2 VALUES LESS THAN MAXVALUE); +# partition p1 is 't1#P#p1' + @002e * 20 = 107 characters + file ending +# total path lenght of './test/t1#P#p1@002e@002e<...>@002e.MY[ID]' is 118 chars +--echo # List of files in database `test`, all original t1-files here +--list_files $MYSQLD_DATADIR/test t1* +INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +--echo # Renaming to a file name where the first partition is 250 chars +--echo # and the second partition is 350 chars +# 7,7 avoids the error message, which is not deterministic. +--error 7,7 +RENAME TABLE t1 TO `t2_new..............................................end`; +# 1234567890123456789012345678901234567890123456 +--echo # List of files in database `test`, should not be any t2-files here +--list_files $MYSQLD_DATADIR/test t2* +--echo # List of files in database `test`, should be all t1-files here +--list_files $MYSQLD_DATADIR/test t1* +--sorted_result +SELECT * FROM t1; +--echo # List of files in database `test`, should be all t1-files here +--list_files $MYSQLD_DATADIR/test t1* +--echo # Renaming to a file name where the first partition is 156 chars +--echo # and the second partition is 256 chars +# 7,7 avoids the error message, which is not deterministic. +--error 7,7 +RENAME TABLE t1 TO `t2_............................_end`; +# 1234567890123456789012345678 +# 7 + 4 + 5 + 28 * 5 = 16 + 140 = 156 +--echo # List of files in database `test`, should not be any t2-files here +--list_files $MYSQLD_DATADIR/test t2* +--echo # List of files in database `test`, should be all t1-files here +--list_files $MYSQLD_DATADIR/test t1* +--sorted_result +SELECT * FROM t1; +DROP TABLE t1; +--echo # Should not be any files left here +--list_files $MYSQLD_DATADIR/test t1* +--list_files $MYSQLD_DATADIR/test t2* +--echo # End of bug#30102 test. diff --git a/mysql-test/t/partition_not_embedded.test b/mysql-test/t/partition_not_embedded.test deleted file mode 100644 index 5c512085a9e..00000000000 --- a/mysql-test/t/partition_not_embedded.test +++ /dev/null @@ -1,53 +0,0 @@ --- source include/have_partition.inc --- source include/not_embedded.inc ---disable_warnings -DROP TABLE IF EXISTS t1, t2; ---enable_warnings -let $MYSQLD_DATADIR= `SELECT @@datadir`; - -# -# Bug#30102: rename table does corrupt tables with partition files on failure -# ---echo # Bug#30102 test -CREATE TABLE t1 (a INT) -PARTITION BY RANGE (a) -(PARTITION p0 VALUES LESS THAN (6), - PARTITION `p1....................` VALUES LESS THAN (9), - PARTITION p2 VALUES LESS THAN MAXVALUE); -# partition p1 is 't1#P#p1' + @002e * 20 = 107 characters + file ending -# total path lenght of './test/t1#P#p1@002e@002e<...>@002e.MY[ID]' is 118 chars ---echo # List of files in database `test`, all original t1-files here ---list_files $MYSQLD_DATADIR/test t1* -INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); ---echo # Renaming to a file name where the first partition is 250 chars ---echo # and the second partition is 350 chars -# 7,7 avoids the error message, which is not deterministic. ---error 7,7 -RENAME TABLE t1 TO `t2_new..............................................end`; -# 1234567890123456789012345678901234567890123456 ---echo # List of files in database `test`, should not be any t2-files here ---list_files $MYSQLD_DATADIR/test t2* ---echo # List of files in database `test`, should be all t1-files here ---list_files $MYSQLD_DATADIR/test t1* ---sorted_result -SELECT * FROM t1; ---echo # List of files in database `test`, should be all t1-files here ---list_files $MYSQLD_DATADIR/test t1* ---echo # Renaming to a file name where the first partition is 156 chars ---echo # and the second partition is 256 chars -# 7,7 avoids the error message, which is not deterministic. ---error 7,7 -RENAME TABLE t1 TO `t2_............................_end`; -# 1234567890123456789012345678 -# 7 + 4 + 5 + 28 * 5 = 16 + 140 = 156 ---echo # List of files in database `test`, should not be any t2-files here ---list_files $MYSQLD_DATADIR/test t2* ---echo # List of files in database `test`, should be all t1-files here ---list_files $MYSQLD_DATADIR/test t1* ---sorted_result -SELECT * FROM t1; -DROP TABLE t1; ---echo # Should not be any files left here ---list_files $MYSQLD_DATADIR/test t1* ---list_files $MYSQLD_DATADIR/test t2* ---echo # End of bug#30102 test. diff --git a/mysql-test/t/partition_symlink.test b/mysql-test/t/partition_symlink.test index 4147d2c6e89..5fdde8e0abc 100644 --- a/mysql-test/t/partition_symlink.test +++ b/mysql-test/t/partition_symlink.test @@ -1,5 +1,6 @@ # Test that must have symlink. eg. using DATA/INDEX DIR # (DATA/INDEX DIR requires symlinks) +# This test is only useful for MyISAM, since no other engine supports DATA DIR -- source include/have_partition.inc -- source include/have_symlink.inc # remove the not_windows line after fixing bug#33687 @@ -33,13 +34,14 @@ DROP DATABASE IF EXISTS mysqltest2; CREATE USER mysqltest_1@localhost; CREATE DATABASE mysqltest2; USE mysqltest2; - CREATE TABLE t1 (a INT); + CREATE TABLE t1 (a INT) ENGINE = MyISAM; INSERT INTO t1 VALUES (0); connect(con1,localhost,mysqltest_1,,); -- echo # user mysqltest_1: USE test; -- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval CREATE TABLE t1 (a INT) + ENGINE = MyISAM PARTITION BY LIST (a) ( PARTITION p0 VALUES IN (0) DATA DIRECTORY '$MYSQLTEST_VARDIR/tmp' @@ -82,6 +84,7 @@ connection default; USE mysqltest2; -- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval CREATE TABLE t1 (a INT) + ENGINE = MyISAM PARTITION BY LIST (a) ( PARTITION p0 VALUES IN (0) DATA DIRECTORY '$MYSQLTEST_VARDIR/tmp' @@ -96,6 +99,7 @@ connection con1; -- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -- error 1,1 eval CREATE TABLE t1 (a INT) + ENGINE = MyISAM PARTITION BY LIST (a) ( PARTITION p0 VALUES IN (0) DATA DIRECTORY '$MYSQLTEST_VARDIR/tmp' @@ -107,6 +111,7 @@ connection con1; -- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -- error 1,1 eval CREATE TABLE t1 (a INT) + ENGINE = MyISAM PARTITION BY LIST (a) ( PARTITION p0 VALUES IN (0) DATA DIRECTORY '$MYSQLTEST_VARDIR/tmp' @@ -128,6 +133,7 @@ connection default; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval create table t2 (i int ) +ENGINE = MyISAM partition by range (i) ( partition p01 values less than (1000) @@ -139,6 +145,7 @@ set @org_mode=@@sql_mode; set @@sql_mode='NO_DIR_IN_CREATE'; select @@sql_mode; create table t1 (i int ) +ENGINE = MyISAM partition by range (i) ( partition p01 values less than (1000) @@ -157,6 +164,7 @@ set @@sql_mode=@org_mode; # Added ER_WRONG_TABLE_NAME and reported bug#39045 -- error ER_WRONG_ARGUMENTS, ER_WRONG_TABLE_NAME create table t1 (a int) +ENGINE = MyISAM partition by key (a) (partition p0 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data'); @@ -167,6 +175,7 @@ partition by key (a) # Added ER_WRONG_TABLE_NAME and reported bug#39045 --error ER_WRONG_ARGUMENTS, ER_WRONG_TABLE_NAME create table t1 (a int) +ENGINE = MyISAM partition by key (a) (partition p0, partition p1 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data'); diff --git a/mysql-test/t/plugin_auth.test b/mysql-test/t/plugin_auth.test index 753593efc94..a81cf4e4783 100644 --- a/mysql-test/t/plugin_auth.test +++ b/mysql-test/t/plugin_auth.test @@ -433,4 +433,83 @@ connection default; disconnect cleartext_con; DROP USER uplain@localhost; +--echo # +--echo # Bug #59038 : mysql.user.authentication_string column +--echo # causes configuration wizard to fail + +INSERT INTO mysql.user( + Host, + User, + Password, + Select_priv, + Insert_priv, + Update_priv, + Delete_priv, + Create_priv, + Drop_priv, + Reload_priv, + Shutdown_priv, + Process_priv, + File_priv, + Grant_priv, + References_priv, + Index_priv, + Alter_priv, + Show_db_priv, + Super_priv, + Create_tmp_table_priv, + Lock_tables_priv, + Execute_priv, + Repl_slave_priv, + Repl_client_priv, + /*!50001 + Create_view_priv, + Show_view_priv, + Create_routine_priv, + Alter_routine_priv, + Create_user_priv, + */ + ssl_type, + ssl_cipher, + x509_issuer, + x509_subject, + max_questions, + max_updates, + max_connections) +VALUES ( + 'localhost', + 'inserttest', '', + 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', + 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', + /*!50001 'Y', 'Y', 'Y', 'Y', 'Y', */'', '', '', '', '0', '0', '0'); +FLUSH PRIVILEGES; +DROP USER inserttest@localhost; +SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE + COLUMN_NAME IN ('authentication_string', 'plugin') AND + TABLE_NAME='user' AND + TABLE_SCHEMA='mysql' +ORDER BY COLUMN_NAME; + + +--echo # +--echo # Bug #11936829: diff. between mysql.user (authentication_string) +--echo # in fresh and upgraded 5.5.11 +--echo # + +SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS + WHERE TABLE_SCHEMA= 'mysql' AND TABLE_NAME= 'user' AND + COLUMN_NAME IN ('plugin', 'authentication_string') + ORDER BY COLUMN_NAME; +ALTER TABLE mysql.user MODIFY plugin char(64) DEFAULT '' NOT NULL; +ALTER TABLE mysql.user MODIFY authentication_string TEXT NOT NULL; + +--echo Run mysql_upgrade on a 5.5.10 external authentication column layout +--exec $MYSQL_UPGRADE --skip-verbose --force 2>&1 + +SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS + WHERE TABLE_SCHEMA= 'mysql' AND TABLE_NAME= 'user' AND + COLUMN_NAME IN ('plugin', 'authentication_string') + ORDER BY COLUMN_NAME; + + --echo End of 5.5 tests diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index eaef1cf3000..e00bd785789 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -3344,7 +3344,21 @@ connection default; DROP TABLE t1; disconnect con1; +--echo +--echo # +--echo # Bug#56115: invalid memory reads when PS selecting from +--echo # information_schema tables +--echo # Bug#58701: crash in Field::make_field, cursor-protocol +--echo # +--echo # NOTE: MTR should be run both with --ps-protocol and --cursor-protocol. +--echo # +--echo + +SELECT * +FROM (SELECT 1 UNION SELECT 2) t; + + --echo # ---echo # End of 6.0 tests. +--echo # End of 5.5 tests. ########################################################################### diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index a334a5f7791..bc5ac8ac63f 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -1082,6 +1082,7 @@ DROP DATABASE `ä`; # --error ER_NO_SUCH_TABLE,ER_FILE_NOT_FOUND show columns from `#mysql50#????????`; +call mtr.add_suppression("Can.t find file: '.\\\\test\\\\\\?{8}.frm'"); # # SHOW CREATE TRIGGER test. diff --git a/mysql-test/t/sp-destruct.test b/mysql-test/t/sp-destruct.test index b4aa9ea1959..6766b496db7 100644 --- a/mysql-test/t/sp-destruct.test +++ b/mysql-test/t/sp-destruct.test @@ -14,6 +14,7 @@ # Supress warnings written to the log file call mtr.add_suppression("Column count of mysql.proc is wrong. Expected 20, found 19. The table is probably corrupted"); +call mtr.add_suppression("Stored routine .test...bug14233_[123].: invalid value in column mysql.proc"); # Backup proc table let $MYSQLD_DATADIR= `select @@datadir`; diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 11edeaf9811..1ed11c50ba8 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -8713,4 +8713,45 @@ call p1(3, 2); drop table t1; drop procedure p1; +--echo +--echo # -- +--echo # -- Bug 11765684 - 58674: SP-cache does not detect changes in +--echo # -- pre-locking list caused by triggers +--echo # --- + +--disable_warnings +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +DROP TABLE IF EXISTS t3; +DROP PROCEDURE IF EXISTS p1; +--enable_warnings + +CREATE TABLE t1(a INT); +CREATE TABLE t2(a INT); +CREATE TABLE t3(a INT); + +CREATE PROCEDURE p1() + INSERT INTO t1(a) VALUES (1); + +--echo +CREATE TRIGGER t1_ai AFTER INSERT ON t1 + FOR EACH ROW + INSERT INTO t2(a) VALUES (new.a); + +--echo +CALL p1(); + +--echo +CREATE TRIGGER t1_bi BEFORE INSERT ON t1 + FOR EACH ROW + INSERT INTO t3(a) VALUES (new.a); + +--echo +CALL p1(); + +--echo +DROP TABLE t1, t2, t3; +DROP PROCEDURE p1; +--echo + --echo # End of 5.5 test diff --git a/mysql-test/t/ssl_cipher-master.opt b/mysql-test/t/ssl_cipher-master.opt new file mode 100644 index 00000000000..9525c238c40 --- /dev/null +++ b/mysql-test/t/ssl_cipher-master.opt @@ -0,0 +1 @@ +--ssl-cipher=AES128-SHA diff --git a/mysql-test/t/ssl_cipher.test b/mysql-test/t/ssl_cipher.test new file mode 100644 index 00000000000..5346968175c --- /dev/null +++ b/mysql-test/t/ssl_cipher.test @@ -0,0 +1,23 @@ +# Turn on ssl between the client and server +# and run a number of tests + +--echo # +--echo # BUG#11760210 - SSL_CIPHER_LIST NOT SET OR RETURNED FOR "SHOW STATUS LIKE 'SSL_CIPHER_LIST'" +--echo # + +-- source include/have_ssl.inc + +# Save the initial number of concurrent sessions +--source include/count_sessions.inc + +connect (ssl_con,localhost,root,,,,,SSL); + +# Check Cipher Name and Cipher List +SHOW STATUS LIKE 'Ssl_cipher'; +SHOW STATUS LIKE 'Ssl_cipher_list'; + +connection default; +disconnect ssl_con; + +# Wait till all disconnects are completed +--source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index f60ee247ba7..e910ea09fb2 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -3997,6 +3997,28 @@ DROP TABLE t1,t1s,t2s; --echo End of 5.1 tests --echo # +--echo # Bug #11765713 58705: +--echo # OPTIMIZER LET ENGINE DEPEND ON UNINITIALIZED VALUES +--echo # CREATED BY OPT_SUM_QUERY +--echo # + +CREATE TABLE t1(a INT NOT NULL, KEY (a)); +INSERT INTO t1 VALUES (0), (1); + +--error ER_SUBQUERY_NO_1_ROW +SELECT 1 as foo FROM t1 WHERE a < SOME + (SELECT a FROM t1 WHERE a <=> + (SELECT a FROM t1) + ); + +SELECT 1 as foo FROM t1 WHERE a < SOME + (SELECT a FROM t1 WHERE a <=> + (SELECT a FROM t1 where a is null) + ); + +DROP TABLE t1; + +--echo # --echo # Bug #57704: Cleanup code dies with void TABLE::set_keyread(bool): --echo # Assertion `file' failed. --echo # diff --git a/mysql-test/t/subselect_innodb.test b/mysql-test/t/subselect_innodb.test index 573fe0c1810..73491417e0c 100644 --- a/mysql-test/t/subselect_innodb.test +++ b/mysql-test/t/subselect_innodb.test @@ -238,3 +238,12 @@ call p1(); call p1(); drop procedure p1; drop tables t1,t2,t3; + +--echo # +--echo # Bug#60085 crash in Item::save_in_field() with time data type +--echo # + +CREATE TABLE t1(a date, b int, unique(b), unique(a), key(b)) engine=innodb; +INSERT INTO t1 VALUES ('2011-05-13', 0); +SELECT * FROM t1 WHERE b < (SELECT CAST(a as date) FROM t1 GROUP BY a); +DROP TABLE t1; diff --git a/mysql-test/t/tablespace.test b/mysql-test/t/tablespace.test new file mode 100644 index 00000000000..9f3cf6255ac --- /dev/null +++ b/mysql-test/t/tablespace.test @@ -0,0 +1,122 @@ +# +# BUG#60111 storage type for table not saved in .frm +# + +# +# Check that the table options for TABLESPACE and STORAGE +# are printed in SHOW CREATE TABLE +# + +# TABLESPACE only +CREATE TABLE t1(a int) TABLESPACE ts ENGINE=MyISAM; +SHOW CREATE TABLE t1; +DROP TABLE t1; + +# TABLESPACE + STORAGE DISK +CREATE TABLE t1(a int) TABLESPACE ts STORAGE DISK ENGINE=MyISAM; +SHOW CREATE TABLE t1; +DROP TABLE t1; + +# TABLESPACE + STORAGE MEMORY +CREATE TABLE t1(a int) TABLESPACE ts STORAGE MEMORY ENGINE=MyISAM; +SHOW CREATE TABLE t1; +DROP TABLE t1; + +# STORAGE MEMORY only +CREATE TABLE t1(a int) STORAGE MEMORY ENGINE=MyISAM; +SHOW CREATE TABLE t1; +DROP TABLE t1; + +# STORAGE DISK only +CREATE TABLE t1(a int) STORAGE DISK ENGINE=MyISAM; +SHOW CREATE TABLE t1; +DROP TABLE t1; + +# +# Check that the table options for TABLESPACE and STORAGE +# are kept in an ALTER +# + +# TABLESPACE only +CREATE TABLE t1(a int) TABLESPACE ts ENGINE=MyISAM; +ALTER TABLE t1 ADD COLUMN b int; +SHOW CREATE TABLE t1; +DROP TABLE t1; + +# TABLESPACE and STORAGE DISK +CREATE TABLE t1(a int) TABLESPACE ts STORAGE DISK ENGINE=MyISAM; +ALTER TABLE t1 ADD COLUMN b int; +SHOW CREATE TABLE t1; +DROP TABLE t1; + +# +# Check that the table options for TABLESPACE and STORAGE +# can be changed with an ALTER +# + +# TABLESPACE only +CREATE TABLE t1(a int) ENGINE=MyISAM; + +ALTER TABLE t1 TABLESPACE ts; +SHOW CREATE TABLE t1; + +ALTER TABLE t1 TABLESPACE ts2; +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +# STORAGE only +CREATE TABLE t1(a int) ENGINE=MyISAM; + +ALTER TABLE t1 STORAGE MEMORY; +SHOW CREATE TABLE t1; + +ALTER TABLE t1 STORAGE DISK; +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +# TABLESPACE and STORAGE +CREATE TABLE t1(a int) ENGINE=MyISAM; + +ALTER TABLE t1 STORAGE MEMORY TABLESPACE ts; +SHOW CREATE TABLE t1; + +ALTER TABLE t1 STORAGE DISK TABLESPACE ts2; +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +# +# Check that it's possible to read a .frm fle created +# by MySQL Cluster 7.0(which introduced the new "format +# section) with this statement: +# +# CREATE TABLE cluster_7022_table +# ( +# a int primary key, +# b int, +# c int STORAGE DISK, +# d int STORAGE MEMORY NOT NULL, +# e int COLUMN_FORMAT DYNAMIC, +# f int COLUMN_FORMAT FIXED, +# g int COLUMN_FORMAT DEFAULT, +# h int STORAGE DISK COLUMN_FORMAT DYNAMIC NOT NULL, +# i int STORAGE MEMORY COLUMN_FORMAT DYNAMIC, +# j int STORAGE DISK COLUMN_FORMAT FIXED, +# k int STORAGE MEMORY COLUMN_FORMAT FIXED +# ) STORAGE DISK TABLESPACE the_tablespacename ENGINE=MyISAM; +# +# NOTE! The column level properties will not yet show up +# in SHOW CREATE TABLE of MySQL Server(although they are +# visible in .trace file) +# + +let $MYSQLD_DATADIR= `SELECT @@datadir`; +copy_file std_data/cluster_7022_table.frm $MYSQLD_DATADIR/test/t1.frm; +copy_file std_data/cluster_7022_table.MYD $MYSQLD_DATADIR/test/t1.MYD; +copy_file std_data/cluster_7022_table.MYI $MYSQLD_DATADIR/test/t1.MYI; + +SHOW CREATE TABLE t1; + +DROP TABLE t1; diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test index 3e4c3660f88..e5039c3ea23 100644 --- a/mysql-test/t/trigger.test +++ b/mysql-test/t/trigger.test @@ -998,10 +998,6 @@ call p1(); drop trigger t1_bi; create trigger t1_bi after insert on t1 for each row insert into t3 values (new.id); execute stmt1; -# Until we implement proper mechanism for invalidation of SP statements -# invoked whenever a table used in SP changes, this statement will fail with -# 'Table ... does not exist' error. ---error ER_NO_SUCH_TABLE call p1(); deallocate prepare stmt1; drop procedure p1; diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test index 6dec86dacab..9a21d8b370d 100644 --- a/mysql-test/t/type_date.test +++ b/mysql-test/t/type_date.test @@ -266,6 +266,18 @@ SELECT * FROM t1 JOIN v1 ON addtime( t1.the_date, t1.the_time ) = DROP TABLE t1; DROP VIEW v1; +--echo # +--echo # Bug#59685 crash in String::length with date types +--echo # + +CREATE TABLE t1(a DATE, b YEAR, KEY(a)); +INSERT INTO t1 VALUES ('2011-01-01',2011); + +SELECT b = (SELECT CONVERT(a, DATE) FROM t1 GROUP BY a) FROM t1; +SELECT b = CONVERT((SELECT CONVERT(a, DATE) FROM t1 GROUP BY a), DATE) FROM t1; + +DROP TABLE t1; + --echo End of 5.1 tests --echo # diff --git a/mysql-test/t/variables-notembedded.test b/mysql-test/t/variables-notembedded.test index 7cc068c68c7..b440cfa47b0 100644 --- a/mysql-test/t/variables-notembedded.test +++ b/mysql-test/t/variables-notembedded.test @@ -109,3 +109,30 @@ SET @@session.slave_skip_errors= 7; --error ER_INCORRECT_GLOBAL_LOCAL_VAR SET @@global.slave_skip_errors= 7; # + +--echo # +--echo # Bug #11766769 : 59959: SMALL VALUES OF --MAX-ALLOWED-PACKET +--echo # ARE NOT BEING HONORED +--echo # + +CREATE TABLE t1 (a MEDIUMTEXT); + +SET GLOBAL max_allowed_packet=2048; +SET GLOBAL net_buffer_length=4096; +CONNECT (con1,localhost,root,,test); +SHOW SESSION VARIABLES LIKE 'max_allowed_packet'; +SHOW SESSION VARIABLES LIKE 'net_buffer_length'; +--disable_query_log +--error ER_NET_PACKET_TOO_LARGE +INSERT INTO t1 VALUES ('123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); +--enable_query_log + +CONNECTION default; +DISCONNECT con1; +SELECT LENGTH(a) FROM t1; + +SET GLOBAL max_allowed_packet=default; +SET GLOBAL net_buffer_length=default; +DROP TABLE t1; + +--echo End of 5.1 tests diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 2b20bbdc13b..ddf1170de93 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -1281,12 +1281,31 @@ SET @@global.max_join_size=0; SET @@global.key_buffer_size=0; SET @@global.key_cache_block_size=0; +# +# Bug#56976: added new start-up parameter +# +select @@max_long_data_size; + +--echo # +--echo # Bug#11766424 59527: DECIMAL_BIN_SIZE: ASSERTION `SCALE >= 0 && PRECISION > 0 && SCALE <= PRE +--echo # + +CREATE TABLE t1(f1 DECIMAL(1,1) UNSIGNED); +INSERT INTO t1 VALUES (0.2),(0.1); +SELECT 1 FROM t1 GROUP BY @a:= (SELECT ROUND(f1) FROM t1 WHERE @a=f1); +DROP TABLE t1; + +CREATE TABLE t1 AS SELECT @a:= CAST(1 AS UNSIGNED) AS a; +SHOW CREATE TABLE t1; +DROP TABLE t1; + # cleanup SET @@global.max_binlog_cache_size=DEFAULT; SET @@global.max_join_size=DEFAULT; SET @@global.key_buffer_size=@kbs; SET @@global.key_cache_block_size=@kcbs; + --echo End of 5.1 tests ########################################################################### diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index c82443e792f..39985bec339 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -3979,6 +3979,18 @@ DROP TABLE t1; CREATE VIEW v1 AS SELECT 1 IN (1 LIKE 2,0) AS f; DROP VIEW v1; +--echo # +--echo # Bug 11829681 - 60295: ERROR 1356 ON VIEW THAT EXECUTES FINE AS A QUERY +--echo # + +CREATE TABLE t1 (a INT); +CREATE VIEW v1 AS SELECT s.* FROM t1 s, t1 b HAVING a; + +SELECT * FROM v1; + +DROP VIEW v1; +DROP TABLE t1; + --echo # ----------------------------------------------------------------- --echo # -- End of 5.1 tests. --echo # ----------------------------------------------------------------- diff --git a/mysql-test/t/warnings.test b/mysql-test/t/warnings.test index 98e1db62d84..5569776904f 100644 --- a/mysql-test/t/warnings.test +++ b/mysql-test/t/warnings.test @@ -228,3 +228,43 @@ DROP TABLE t1; SHOW ERRORS; --echo End of 5.0 tests + +# +# Bug#55847: SHOW WARNINGS returns empty result set when SQLEXCEPTION is active +# + +--echo +--echo -- Bug#55847 +--echo + +--disable_warnings +DROP TABLE IF EXISTS t1; +DROP FUNCTION IF EXISTS f1; +--enable_warnings + +CREATE TABLE t1(a INT UNIQUE); + +delimiter |; + +CREATE FUNCTION f1(x INT) RETURNS INT +BEGIN + INSERT INTO t1 VALUES(x); + INSERT INTO t1 VALUES(x); + RETURN x; +END| + +delimiter ;| + +--echo + +--error ER_DUP_ENTRY +SHOW TABLES WHERE f1(11) = 11; + +--echo + +SHOW WARNINGS; + +--echo + +DROP TABLE t1; +DROP FUNCTION f1; diff --git a/mysql-test/t/xa.test b/mysql-test/t/xa.test index 47ea4981314..8ce9ce52960 100644 --- a/mysql-test/t/xa.test +++ b/mysql-test/t/xa.test @@ -3,6 +3,8 @@ # -- source include/have_innodb.inc +--source include/not_embedded.inc + # Save the initial number of concurrent sessions --source include/count_sessions.inc @@ -287,6 +289,98 @@ DROP TABLE t1; disconnect con1; +--echo # +--echo # Bug#11766752 59936: multiple xa assertions - transactional +--echo # statement fuzzer +--echo # + +CREATE TABLE t1 (a INT) engine=InnoDB; +XA START 'a'; +INSERT INTO t1 VALUES (1); + +--error ER_XAER_RMFAIL +SAVEPOINT savep; + +XA END 'a'; +--error ER_XAER_RMFAIL +SELECT * FROM t1; +--error ER_XAER_RMFAIL +INSERT INTO t1 VALUES (2); +--error ER_XAER_RMFAIL +SAVEPOINT savep; +--error ER_XAER_RMFAIL +SET @a=(SELECT * FROM t1); + +XA PREPARE 'a'; +--error ER_XAER_RMFAIL +SELECT * FROM t1; # used to cause InnoDB assert +--error ER_XAER_RMFAIL +INSERT INTO t1 VALUES (2); # used to cause InnoDB assert +--error ER_XAER_RMFAIL +SAVEPOINT savep; +--error ER_XAER_RMFAIL +SET @a=(SELECT * FROM t1); # used to cause InnoDB assert +--error ER_XAER_RMFAIL +UPDATE t1 SET a=1 WHERE a=2; + +XA COMMIT 'a'; +SELECT * FROM t1; +DROP TABLE t1; + + +--echo # +--echo # Bug#12352846 - TRANS_XA_START(THD*): +--echo # ASSERTION THD->TRANSACTION.XID_STATE.XID.IS_NULL() +--echo # FAILED +--echo # + +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +--enable_warnings + +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (a INT); + +START TRANSACTION; +INSERT INTO t1 VALUES (1); + +--echo # Connection con2 +--connect (con2,localhost,root) +XA START 'xid1'; +--echo # Sending: +--send INSERT INTO t2 SELECT a FROM t1 + +--echo # Connection default +--connection default +let $wait_condition= + SELECT COUNT(*) = 1 FROM information_schema.processlist + WHERE state = "Sending data" + AND info = "INSERT INTO t2 SELECT a FROM t1"; +--echo # Waiting until INSERT ... is blocked +--source include/wait_condition.inc +DELETE FROM t1; +COMMIT; + +--echo # Connection con2 +--connection con2 +--echo # Reaping: INSERT INTO t2 SELECT a FROM t1 +--error ER_LOCK_DEADLOCK +--reap +--error ER_XA_RBDEADLOCK +XA COMMIT 'xid1'; +# This caused the assert to be triggered +XA START 'xid1'; + +XA END 'xid1'; +XA PREPARE 'xid1'; +XA ROLLBACK 'xid1'; + +--echo # Connection default +connection default; +DROP TABLE t1, t2; +disconnect con2; + + # Wait till all disconnects are completed --source include/wait_until_count_sessions.inc diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt index 49a2e4f6728..f81d69ec169 100644 --- a/mysys/CMakeLists.txt +++ b/mysys/CMakeLists.txt @@ -23,8 +23,8 @@ SET(MYSYS_SOURCES array.c charset-def.c charset.c checksum.c default.c mf_tempfile.c mf_unixpath.c mf_wcomp.c mulalloc.c my_access.c my_aes.c my_alloc.c my_bit.c my_bitmap.c my_chsize.c my_compress.c my_copy.c my_create.c my_delete.c - my_div.c my_error.c my_file.c my_fopen.c my_fstream.c my_gethostbyname.c - my_gethwaddr.c my_getopt.c my_getsystime.c my_getwd.c my_handler.c my_init.c + my_div.c my_error.c my_file.c my_fopen.c my_fstream.c + my_gethwaddr.c my_getopt.c my_getsystime.c my_getwd.c my_compare.c my_init.c my_lib.c my_lock.c my_malloc.c my_mess.c my_mkdir.c my_mmap.c my_once.c my_open.c my_pread.c my_pthread.c my_quick.c my_read.c my_redel.c my_rename.c my_seek.c my_sleep.c @@ -64,11 +64,6 @@ IF(HAVE_MLOCK) SET(MYSYS_SOURCES ${MYSYS_SOURCES} my_lockmem.c) ENDIF() -IF(UNIX) - # some workarounds - SET(MYSYS_SOURCES ${MYSYS_SOURCES} my_port.c) -ENDIF() - ADD_CONVENIENCE_LIBRARY(mysys ${MYSYS_SOURCES}) TARGET_LINK_LIBRARIES(mysys dbug strings ${ZLIB_LIBRARY} ${LIBNSL} ${LIBM} ${LIBRT}) diff --git a/mysys/default.c b/mysys/default.c index 9a4b990f003..fe070f42748 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc +/* Copyright (c) 2000, 2011, 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 @@ -140,7 +140,7 @@ static int search_default_file_with_ext(Process_option_func func, - Unix: /etc/ - Unix: /etc/mysql/ - Unix: --sysconfdir=<path> (compile-time option) - - ALL: getenv(DEFAULT_HOME_ENV) + - ALL: getenv("MYSQL_HOME") - ALL: --defaults-extra-file=<path> (run-time option) - Unix: ~/ @@ -376,7 +376,7 @@ static int handle_default_option(void *in_ctx, const char *group_name, if (!option) return 0; - if (find_type((char *)group_name, ctx->group, 3)) + if (find_type((char *)group_name, ctx->group, FIND_TYPE_NO_PREFIX)) { if (!(tmp= alloc_root(ctx->alloc, strlen(option) + 1))) return 1; @@ -1232,7 +1232,7 @@ static const char **init_default_directories(MEM_ROOT *alloc) #endif - if ((env= getenv(STRINGIFY_ARG(DEFAULT_HOME_ENV)))) + if ((env= getenv("MYSQL_HOME"))) errors += add_directory(alloc, env, dirs); /* Placeholder for --defaults-extra-file=<path> */ diff --git a/mysys/my_handler.c b/mysys/my_compare.c index bd1e313d066..21de0347516 100644 --- a/mysys/my_handler.c +++ b/mysys/my_compare.c @@ -1,28 +1,24 @@ -/* Copyright (C) 2002-2006 MySQL AB - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; version 2 - of the License. - - This library 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 - Library General Public License for more details. +/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA */ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include <my_global.h> #include <m_ctype.h> #include <my_base.h> -#include <my_handler.h> +#include <my_compare.h> #include <my_sys.h> -#include "my_handler_errors.h" - #define CMP_NUM(a,b) (((a) < (b)) ? -1 : ((a) == (b)) ? 0 : 1) int ha_compare_text(CHARSET_INFO *charset_info, uchar *a, uint a_length, @@ -478,127 +474,3 @@ end: } /* ha_key_cmp */ -/* - Find the first NULL value in index-suffix values tuple - - SYNOPSIS - ha_find_null() - keyseg Array of keyparts for key suffix - a Key suffix value tuple - - DESCRIPTION - Find the first NULL value in index-suffix values tuple. - - TODO - Consider optimizing this function or its use so we don't search for - NULL values in completely NOT NULL index suffixes. - - RETURN - First key part that has NULL as value in values tuple, or the last key - part (with keyseg->type==HA_TYPE_END) if values tuple doesn't contain - NULLs. -*/ - -HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, uchar *a) -{ - for (; (enum ha_base_keytype) keyseg->type != HA_KEYTYPE_END; keyseg++) - { - uchar *end; - if (keyseg->null_bit) - { - if (!*a++) - return keyseg; - } - end= a+ keyseg->length; - - switch ((enum ha_base_keytype) keyseg->type) { - case HA_KEYTYPE_TEXT: - case HA_KEYTYPE_BINARY: - case HA_KEYTYPE_BIT: - if (keyseg->flag & HA_SPACE_PACK) - { - int a_length; - get_key_length(a_length, a); - a += a_length; - break; - } - else - a= end; - break; - case HA_KEYTYPE_VARTEXT1: - case HA_KEYTYPE_VARTEXT2: - case HA_KEYTYPE_VARBINARY1: - case HA_KEYTYPE_VARBINARY2: - { - int a_length; - get_key_length(a_length, a); - a+= a_length; - break; - } - case HA_KEYTYPE_NUM: - if (keyseg->flag & HA_SPACE_PACK) - { - int alength= *a++; - end= a+alength; - } - a= end; - break; - case HA_KEYTYPE_INT8: - case HA_KEYTYPE_SHORT_INT: - case HA_KEYTYPE_USHORT_INT: - case HA_KEYTYPE_LONG_INT: - case HA_KEYTYPE_ULONG_INT: - case HA_KEYTYPE_INT24: - case HA_KEYTYPE_UINT24: -#ifdef HAVE_LONG_LONG - case HA_KEYTYPE_LONGLONG: - case HA_KEYTYPE_ULONGLONG: -#endif - case HA_KEYTYPE_FLOAT: - case HA_KEYTYPE_DOUBLE: - a= end; - break; - case HA_KEYTYPE_END: /* purecov: inspected */ - /* keep compiler happy */ - DBUG_ASSERT(0); - break; - } - } - return keyseg; -} - - - -/* - Register handler error messages for usage with my_error() - - NOTES - This is safe to call multiple times as my_error_register() - will ignore calls to register already registered error numbers. -*/ - -static const char **get_handler_error_messages() -{ - return handler_error_messages; -} - -void my_handler_error_register(void) -{ - /* - If you got compilation error here about compile_time_assert array, check - that every HA_ERR_xxx constant has a corresponding error message in - handler_error_messages[] list (check mysys/ma_handler_errors.h and - include/my_base.h). - */ - compile_time_assert(HA_ERR_FIRST + array_elements(handler_error_messages) == - HA_ERR_LAST + 1); - my_error_register(get_handler_error_messages, HA_ERR_FIRST, - HA_ERR_FIRST+ array_elements(handler_error_messages)-1); -} - - -void my_handler_error_unregister(void) -{ - my_error_unregister(HA_ERR_FIRST, - HA_ERR_FIRST+ array_elements(handler_error_messages)-1); -} diff --git a/mysys/my_gethostbyname.c b/mysys/my_gethostbyname.c deleted file mode 100644 index 28ecec13ef2..00000000000 --- a/mysys/my_gethostbyname.c +++ /dev/null @@ -1,111 +0,0 @@ -/* Copyright (C) 2002, 2004 MySQL AB, 2008-2009 Sun Microsystems, Inc - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; version 2 - of the License. - - This library 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA */ - -/* Thread safe version of gethostbyname_r() */ - -#include "mysys_priv.h" -#if !defined(__WIN__) -#include <netdb.h> -#endif -#include <my_net.h> - -/* This file is not needed if my_gethostbyname_r is a macro */ -#if !defined(my_gethostbyname_r) - -/* - Emulate SOLARIS style calls, not because it's better, but just to make the - usage of getbostbyname_r simpler. -*/ - -#if defined(HAVE_GETHOSTBYNAME_R) - -#if defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) - -struct hostent *my_gethostbyname_r(const char *name, - struct hostent *result, char *buffer, - int buflen, int *h_errnop) -{ - struct hostent *hp; - DBUG_ASSERT((size_t) buflen >= sizeof(*result)); - if (gethostbyname_r(name,result, buffer, (size_t) buflen, &hp, h_errnop)) - return 0; - return hp; -} - -#elif defined(HAVE_GETHOSTBYNAME_R_RETURN_INT) - -struct hostent *my_gethostbyname_r(const char *name, - struct hostent *result, char *buffer, - int buflen, int *h_errnop) -{ - if (gethostbyname_r(name,result,(struct hostent_data *) buffer) == -1) - { - *h_errnop= errno; - return 0; - } - return result; -} - -#else - -/* gethostbyname_r with similar interface as gethostbyname() */ - -struct hostent *my_gethostbyname_r(const char *name, - struct hostent *result, char *buffer, - int buflen, int *h_errnop) -{ - struct hostent *hp; - DBUG_ASSERT(buflen >= sizeof(struct hostent_data)); - hp= gethostbyname_r(name,result,(struct hostent_data *) buffer); - *h_errnop= errno; - return hp; -} -#endif /* GLIBC2_STYLE_GETHOSTBYNAME_R */ - -#else /* !HAVE_GETHOSTBYNAME_R */ - -extern mysql_mutex_t LOCK_gethostbyname_r; - -/* - No gethostbyname_r() function exists. - In this case we have to keep a mutex over the call to ensure that no - other thread is going to reuse the internal memory. - - The user is responsible to call my_gethostbyname_r_free() when he - is finished with the structure. -*/ - -struct hostent *my_gethostbyname_r(const char *name, - struct hostent *res __attribute__((unused)), - char *buffer __attribute__((unused)), - int buflen __attribute__((unused)), - int *h_errnop) -{ - struct hostent *hp; - mysql_mutex_lock(&LOCK_gethostbyname_r); - hp= gethostbyname(name); - *h_errnop= h_errno; - return hp; -} - -void my_gethostbyname_r_free() -{ - mysql_mutex_unlock(&LOCK_gethostbyname_r); -} - -#endif /* !HAVE_GETHOSTBYNAME_R */ -#endif /* !my_gethostbyname_r */ diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c index 6f7ed070ccf..ac4ae46eab5 100644 --- a/mysys/my_getopt.c +++ b/mysys/my_getopt.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc +/* Copyright (c) 2002, 2011, 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 @@ -695,7 +695,7 @@ static int setval(const struct my_option *opts, void *value, char *argument, break; case GET_ENUM: { - int type= find_type(argument, opts->typelib, 2); + int type= find_type(argument, opts->typelib, FIND_TYPE_BASIC); if (type == 0) { /* diff --git a/mysys/my_handler_errors.h b/mysys/my_handler_errors.h index e4e62f47fed..2d192d7a35f 100644 --- a/mysys/my_handler_errors.h +++ b/mysys/my_handler_errors.h @@ -68,4 +68,8 @@ static const char *handler_error_messages[]= "Too many active concurrent transactions" }; +extern void my_handler_error_register(void); +extern void my_handler_error_unregister(void); + + #endif /* MYSYS_MY_HANDLER_ERRORS_INCLUDED */ diff --git a/mysys/my_init.c b/mysys/my_init.c index 4963ce9b577..4056464b6fb 100644 --- a/mysys/my_init.c +++ b/mysys/my_init.c @@ -467,10 +467,6 @@ PSI_mutex_key key_my_file_info_mutex; PSI_mutex_key key_LOCK_localtime_r; #endif /* !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) */ -#ifndef HAVE_GETHOSTBYNAME_R -PSI_mutex_key key_LOCK_gethostbyname_r; -#endif /* HAVE_GETHOSTBYNAME_R */ - PSI_mutex_key key_BITMAP_mutex, key_IO_CACHE_append_buffer_lock, key_IO_CACHE_SHARE_mutex, key_KEY_CACHE_cache_lock, key_LOCK_alarm, key_my_thread_var_mutex, key_THR_LOCK_charset, key_THR_LOCK_heap, @@ -487,9 +483,6 @@ static PSI_mutex_info all_mysys_mutexes[]= #if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) { &key_LOCK_localtime_r, "LOCK_localtime_r", PSI_FLAG_GLOBAL}, #endif /* !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) */ -#ifndef HAVE_GETHOSTBYNAME_R - { &key_LOCK_gethostbyname_r, "LOCK_gethostbyname_r", PSI_FLAG_GLOBAL}, -#endif /* HAVE_GETHOSTBYNAME_R */ { &key_BITMAP_mutex, "BITMAP::mutex", 0}, { &key_IO_CACHE_append_buffer_lock, "IO_CACHE::append_buffer_lock", 0}, { &key_IO_CACHE_SHARE_mutex, "IO_CACHE::SHARE_mutex", 0}, diff --git a/mysys/my_port.c b/mysys/my_port.c deleted file mode 100644 index 9ad333421ca..00000000000 --- a/mysys/my_port.c +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright (C) 2002 MySQL AB - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; version 2 - of the License. - - This library 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA */ - -/* - Small functions to make code portable -*/ - -#include "mysys_priv.h" - -#ifdef _AIX - -/* - On AIX, at least with gcc 3.1, the expression - '(double) (ulonglong) var' doesn't always work for big unsigned - integers like '18446744073709551615'. The end result is that the - high bit is simply dropped. (probably bug in gcc optimizations) - Handling the conversion in a sub function seems to work. -*/ - - - -double my_ulonglong2double(unsigned long long nr) -{ - return (double) nr; -} -#endif /* _AIX */ diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c index 28f6412ed5b..b30d99565fa 100644 --- a/mysys/my_thr_init.c +++ b/mysys/my_thr_init.c @@ -34,9 +34,6 @@ uint my_thread_end_wait_time= 5; #if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) mysql_mutex_t LOCK_localtime_r; #endif -#ifndef HAVE_GETHOSTBYNAME_R -mysql_mutex_t LOCK_gethostbyname_r; -#endif #ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP pthread_mutexattr_t my_fast_mutexattr; #endif @@ -222,10 +219,6 @@ my_bool my_thread_global_init(void) #if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) mysql_mutex_init(key_LOCK_localtime_r, &LOCK_localtime_r, MY_MUTEX_INIT_SLOW); #endif -#ifndef HAVE_GETHOSTBYNAME_R - mysql_mutex_init(key_LOCK_gethostbyname_r, - &LOCK_gethostbyname_r, MY_MUTEX_INIT_SLOW); -#endif #ifdef _MSC_VER install_sigabrt_handler(); @@ -289,9 +282,6 @@ void my_thread_global_end(void) #if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) mysql_mutex_destroy(&LOCK_localtime_r); #endif -#ifndef HAVE_GETHOSTBYNAME_R - mysql_mutex_destroy(&LOCK_gethostbyname_r); -#endif my_thread_global_init_done= 0; } diff --git a/mysys/mysys_priv.h b/mysys/mysys_priv.h index e760ea808b7..5188b909863 100644 --- a/mysys/mysys_priv.h +++ b/mysys/mysys_priv.h @@ -36,10 +36,6 @@ extern PSI_mutex_key key_my_file_info_mutex; extern PSI_mutex_key key_LOCK_localtime_r; #endif /* !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) */ -#ifndef HAVE_GETHOSTBYNAME_R -extern PSI_mutex_key key_LOCK_gethostbyname_r; -#endif /* HAVE_GETHOSTBYNAME_R */ - extern PSI_mutex_key key_BITMAP_mutex, key_IO_CACHE_append_buffer_lock, key_IO_CACHE_SHARE_mutex, key_KEY_CACHE_cache_lock, key_LOCK_alarm, key_my_thread_var_mutex, key_THR_LOCK_charset, key_THR_LOCK_heap, diff --git a/mysys/typelib.c b/mysys/typelib.c index 7681ff581ac..c0d37e26ecf 100644 --- a/mysys/typelib.c +++ b/mysys/typelib.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, 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 @@ -27,7 +27,7 @@ int find_type_or_exit(const char *x, TYPELIB *typelib, const char *option) int res; const char **ptr; - if ((res= find_type((char *) x, typelib, 2)) <= 0) + if ((res= find_type((char *) x, typelib, FIND_TYPE_BASIC)) <= 0) { ptr= typelib->type_names; if (!*x) @@ -48,16 +48,13 @@ int find_type_or_exit(const char *x, TYPELIB *typelib, const char *option) Search after a string in a list of strings. Endspace in x is not compared. @param x String to find - @param lib TYPELIB (struct of pointer to values + count) - @param full_name bitmap of what to do - If & 1 accept only whole names - If & 2 don't expand if half field - If & 4 allow #number# as type - If & 8 use ',' as string terminator - - @note - If part, uniq field is found and full_name == 0 then x is expanded - to full field. + @param typelib TYPELIB (struct of pointer to values + count) + @param flags flags to tune behaviour: a combination of + FIND_TYPE_NO_PREFIX + FIND_TYPE_ALLOW_NUMBER + FIND_TYPE_COMMA_TERM. + FIND_TYPE_NO_OVERWRITE can be passed but is + superfluous (is always implicitely on). @retval -1 Too many matching values @@ -68,15 +65,17 @@ int find_type_or_exit(const char *x, TYPELIB *typelib, const char *option) */ -int find_type(char *x, const TYPELIB *typelib, uint full_name) +int find_type(const char *x, const TYPELIB *typelib, uint flags) { int find,pos; int UNINIT_VAR(findpos); /* guarded by find */ - reg1 char * i; - reg2 const char *j; + const char *i; + const char *j; DBUG_ENTER("find_type"); DBUG_PRINT("enter",("x: '%s' lib: 0x%lx", x, (long) typelib)); + DBUG_ASSERT(!(flags & ~(FIND_TYPE_NO_PREFIX | FIND_TYPE_ALLOW_NUMBER | + FIND_TYPE_NO_OVERWRITE | FIND_TYPE_COMMA_TERM))); if (!typelib->count) { DBUG_PRINT("exit",("no count")); @@ -86,24 +85,26 @@ int find_type(char *x, const TYPELIB *typelib, uint full_name) for (pos=0 ; (j=typelib->type_names[pos]) ; pos++) { for (i=x ; - *i && (!(full_name & 8) || !is_field_separator(*i)) && + *i && (!(flags & FIND_TYPE_COMMA_TERM) || !is_field_separator(*i)) && my_toupper(&my_charset_latin1,*i) == my_toupper(&my_charset_latin1,*j) ; i++, j++) ; if (! *j) { while (*i == ' ') i++; /* skip_end_space */ - if (! *i || ((full_name & 8) && is_field_separator(*i))) + if (! *i || ((flags & FIND_TYPE_COMMA_TERM) && is_field_separator(*i))) DBUG_RETURN(pos+1); } - if ((!*i && (!(full_name & 8) || !is_field_separator(*i))) && - (!*j || !(full_name & 1))) + if ((!*i && + (!(flags & FIND_TYPE_COMMA_TERM) || !is_field_separator(*i))) && + (!*j || !(flags & FIND_TYPE_NO_PREFIX))) { find++; findpos=pos; } } - if (find == 0 && (full_name & 4) && x[0] == '#' && strend(x)[-1] == '#' && + if (find == 0 && (flags & FIND_TYPE_ALLOW_NUMBER) && x[0] == '#' && + strend(x)[-1] == '#' && (findpos=atoi(x+1)-1) >= 0 && (uint) findpos < typelib->count) find=1; else if (find == 0 || ! x[0]) @@ -111,13 +112,11 @@ int find_type(char *x, const TYPELIB *typelib, uint full_name) DBUG_PRINT("exit",("Couldn't find type")); DBUG_RETURN(0); } - else if (find != 1 || (full_name & 1)) + else if (find != 1 || (flags & FIND_TYPE_NO_PREFIX)) { DBUG_PRINT("exit",("Too many possybilities")); DBUG_RETURN(-1); } - if (!(full_name & 2)) - (void) strmov(x,typelib->type_names[findpos]); DBUG_RETURN(findpos+1); } /* find_type */ @@ -192,7 +191,7 @@ my_ulonglong find_typeset(char *x, TYPELIB *lib, int *err) x++; if (x[0] && x[1]) /* skip separator if found */ x++; - if ((find= find_type(i, lib, 2 | 8) - 1) < 0) + if ((find= find_type(i, lib, FIND_TYPE_COMMA_TERM) - 1) < 0) DBUG_RETURN(0); result|= (ULL(1) << find); } @@ -276,7 +275,7 @@ static TYPELIB on_off_default_typelib= {array_elements(on_off_default_names)-1, static uint parse_name(const TYPELIB *lib, const char **strpos, const char *end) { const char *pos= *strpos; - uint find= find_type((char*)pos, lib, 8); + uint find= find_type(pos, lib, FIND_TYPE_COMMA_TERM); for (; pos != end && *pos != '=' && *pos !=',' ; pos++); *strpos= pos; return find; diff --git a/plugin/auth/auth_socket.c b/plugin/auth/auth_socket.c index b8ae00b6949..0fec4e85ce5 100644 --- a/plugin/auth/auth_socket.c +++ b/plugin/auth/auth_socket.c @@ -17,7 +17,7 @@ /** @file - socket_peercred authentication plugin. + auth_socket authentication plugin. Authentication is successful if the connection is done via a unix socket and the owner of the client process matches the user name that was used when diff --git a/plugin/fulltext/plugin_example.c b/plugin/fulltext/plugin_example.c index 70022da2cc4..c51fbc04ecd 100644 --- a/plugin/fulltext/plugin_example.c +++ b/plugin/fulltext/plugin_example.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 MySQL AB +/* Copyright (c) 2006, 2011, 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 @@ -259,7 +259,7 @@ mysql_declare_plugin(ftexample) MYSQL_FTPARSER_PLUGIN, /* type */ &simple_parser_descriptor, /* descriptor */ "simple_parser", /* name */ - "MySQL AB", /* author */ + "Oracle Corp", /* author */ "Simple Full-Text Parser", /* description */ PLUGIN_LICENSE_GPL, simple_parser_plugin_init, /* init function (when loaded) */ diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 70e1d4fcdce..547803fe34f 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -28,7 +28,7 @@ set @had_db_table= @@warning_count != 0; CREATE TABLE IF NOT EXISTS host ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges'; -CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tablespace_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, max_user_connections int(11) unsigned DEFAULT 0 NOT NULL, plugin char(60) DEFAULT '' NOT NULL, authentication_string TEXT NOT NULL, PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; +CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tablespace_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, max_user_connections int(11) unsigned DEFAULT 0 NOT NULL, plugin char(64) DEFAULT '', authentication_string TEXT, PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; -- Remember for later if user table already existed set @had_user_table= @@warning_count != 0; diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index 362464d5b60..7e6ffb466a9 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -640,8 +640,9 @@ DROP PREPARE stmt; drop procedure mysql.die; -ALTER TABLE user ADD plugin char(60) DEFAULT '' NOT NULL, ADD authentication_string TEXT NOT NULL; -ALTER TABLE user MODIFY plugin char(60) DEFAULT '' NOT NULL; +ALTER TABLE user ADD plugin char(64) DEFAULT '', ADD authentication_string TEXT; +ALTER TABLE user MODIFY plugin char(64) DEFAULT ''; +ALTER TABLE user MODIFY authentication_string TEXT; -- Need to pre-fill mysql.proxies_priv with access for root even when upgrading from -- older versions diff --git a/sql-common/client.c b/sql-common/client.c index 0ff03f6609b..90d07f3e409 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB +/* Copyright (c) 2000, 2011, 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 @@ -1145,10 +1145,10 @@ enum option_id { OPT_ssl_key, OPT_ssl_cert, OPT_ssl_ca, OPT_ssl_capath, OPT_character_sets_dir, OPT_default_character_set, OPT_interactive_timeout, OPT_connect_timeout, OPT_local_infile, OPT_disable_local_infile, - OPT_replication_probe, OPT_enable_reads_from_master, OPT_repl_parse_query, OPT_ssl_cipher, OPT_max_allowed_packet, OPT_protocol, OPT_shared_memory_base_name, OPT_multi_results, OPT_multi_statements, OPT_multi_queries, OPT_secure_auth, OPT_report_data_truncation, OPT_plugin_dir, OPT_default_auth, + OPT_keep_this_one_last }; static TYPELIB option_types={array_elements(default_options)-1, @@ -1198,6 +1198,9 @@ void mysql_read_default_options(struct st_mysql_options *options, DBUG_ENTER("mysql_read_default_options"); DBUG_PRINT("enter",("file: %s group: %s",filename,group ? group :"NULL")); + compile_time_assert(OPT_keep_this_one_last == + array_elements(default_options)); + argc=1; argv=argv_buff; argv_buff[0]= (char*) "client"; groups[0]= (char*) "client"; groups[1]= (char*) group; groups[2]=0; @@ -1222,7 +1225,7 @@ void mysql_read_default_options(struct st_mysql_options *options, /* Change all '_' in variable name to '-' */ for (end= *option ; *(end= strcend(end,'_')) ; ) *end= '-'; - switch (find_type(*option+2,&option_types,2)) { + switch (find_type(*option + 2, &option_types, FIND_TYPE_BASIC)) { case OPT_port: if (opt_arg) options->port=atoi(opt_arg); @@ -1338,8 +1341,8 @@ void mysql_read_default_options(struct st_mysql_options *options, options->max_allowed_packet= atoi(opt_arg); break; case OPT_protocol: - if ((options->protocol= find_type(opt_arg, - &sql_protocol_typelib,0)) <= 0) + if ((options->protocol= find_type(opt_arg, &sql_protocol_typelib, + FIND_TYPE_BASIC)) <= 0) { fprintf(stderr, "Unknown option to protocol: %s\n", opt_arg); exit(1); diff --git a/sql-common/client_plugin.c b/sql-common/client_plugin.c index 6b4cca8aeea..47409e34d9a 100644 --- a/sql-common/client_plugin.c +++ b/sql-common/client_plugin.c @@ -163,6 +163,7 @@ add_plugin(MYSQL *mysql, struct st_mysql_client_plugin *plugin, void *dlhandle, p->next= plugin_list[plugin->type]; plugin_list[plugin->type]= p; + net_clear_error(&mysql->net); return plugin; diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc index 053558aa0c3..3a25324db52 100644 --- a/sql/event_db_repository.cc +++ b/sql/event_db_repository.cc @@ -433,7 +433,7 @@ Event_db_repository::index_read_for_db_for_i_s(THD *thd, TABLE *schema_table, key_copy(key_buf, event_table->record[0], key_info, key_len); if (!(ret= event_table->file->index_read_map(event_table->record[0], key_buf, (key_part_map)1, - HA_READ_PREFIX))) + HA_READ_KEY_EXACT))) { DBUG_PRINT("info",("Found rows. Let's retrieve them. ret=%d", ret)); do diff --git a/sql/field.cc b/sql/field.cc index 01c4459c06c..7ffc399718c 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -5382,6 +5382,7 @@ double Field_year::val_real(void) longlong Field_year::val_int(void) { ASSERT_COLUMN_MARKED_FOR_READ; + DBUG_ASSERT(field_length == 2 || field_length == 4); int tmp= (int) ptr[0]; if (field_length != 4) tmp%=100; // Return last 2 char @@ -5394,6 +5395,7 @@ longlong Field_year::val_int(void) String *Field_year::val_str(String *val_buffer, String *val_ptr __attribute__((unused))) { + DBUG_ASSERT(field_length < 5); val_buffer->alloc(5); val_buffer->length(field_length); char *to=(char*) val_buffer->ptr(); diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 74f5e116ccf..59b904aceac 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -4448,6 +4448,8 @@ int ha_partition::index_read_idx_map(uchar *buf, uint index, break; } } + if (part <= m_part_spec.end_part) + m_last_part= part; } else { @@ -6390,7 +6392,14 @@ void ha_partition::print_error(int error, myf errflag) { /* In case m_file has not been initialized, like in bug#42438 */ if (m_file) + { + if (m_last_part >= m_tot_parts) + { + DBUG_ASSERT(0); + m_last_part= 0; + } m_file[m_last_part]->print_error(error, errflag); + } else handler::print_error(error, errflag); } diff --git a/sql/handler.cc b/sql/handler.cc index 9ca1f3a20f8..fefc0553c88 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -3214,9 +3214,13 @@ int handler::ha_repair(THD* thd, HA_CHECK_OPT* check_opt) mark_trx_read_write(); - if ((result= repair(thd, check_opt))) - return result; - return update_frm_version(table); + result= repair(thd, check_opt); + DBUG_ASSERT(result == HA_ADMIN_NOT_IMPLEMENTED || + ha_table_flags() & HA_CAN_REPAIR); + + if (result == HA_ADMIN_OK) + result= update_frm_version(table); + return result; } diff --git a/sql/handler.h b/sql/handler.h index 3cd4acee80d..911f7516e98 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -29,7 +29,7 @@ #include "sql_cache.h" #include "structs.h" /* SHOW_COMP_OPTION */ -#include <my_handler.h> +#include <my_compare.h> #include <ft_global.h> #include <keycache.h> @@ -153,6 +153,12 @@ ordered. */ #define HA_DUPLICATE_KEY_NOT_IN_ORDER (LL(1) << 36) +/* + Engine supports REPAIR TABLE. Used by CHECK TABLE FOR UPGRADE if an + incompatible table is detected. If this flag is set, CHECK TABLE FOR UPGRADE + will report ER_TABLE_NEEDS_UPGRADE, otherwise ER_TABLE_NEED_REBUILD. +*/ +#define HA_CAN_REPAIR (LL(1) << 37) /* Set of all binlog flags. Currently only contain the capabilities @@ -2010,7 +2016,10 @@ private: upon the table. */ virtual int repair(THD* thd, HA_CHECK_OPT* check_opt) - { return HA_ADMIN_NOT_IMPLEMENTED; } + { + DBUG_ASSERT(!(ha_table_flags() & HA_CAN_REPAIR)); + return HA_ADMIN_NOT_IMPLEMENTED; + } virtual void start_bulk_insert(ha_rows rows) {} virtual int end_bulk_insert() { return 0; } virtual int index_read(uchar * buf, const uchar * key, uint key_len, diff --git a/sql/hostname.cc b/sql/hostname.cc index 5311d9ada73..d34df68587c 100644 --- a/sql/hostname.cc +++ b/sql/hostname.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc +/* Copyright (c) 2000, 2011, 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 @@ -366,41 +366,35 @@ bool ip_to_hostname(struct sockaddr_storage *ip_storage, err_code= vio_getnameinfo(ip, hostname_buffer, NI_MAXHOST, NULL, 0, NI_NAMEREQD); - if (err_code == EAI_NONAME) + if (err_code) { - /* - There is no reverse address mapping for the IP address. A host name - can not be resolved. - */ + // NOTE: gai_strerror() returns a string ending by a dot. - DBUG_PRINT("error", ("IP address '%s' could not be resolved: " - "no reverse address mapping.", - (const char *) ip_key)); + DBUG_PRINT("error", ("IP address '%s' could not be resolved: %s", + (const char *) ip_key, + (const char *) gai_strerror(err_code))); - sql_print_warning("IP address '%s' could not be resolved: " - "no reverse address mapping.", - (const char *) ip_key); + sql_print_warning("IP address '%s' could not be resolved: %s", + (const char *) ip_key, + (const char *) gai_strerror(err_code)); - err_status= add_hostname(ip_key, NULL); + if (vio_is_no_name_error(err_code)) + { + /* + The no-name error means that there is no reverse address mapping + for the IP address. A host name can not be resolved. - *hostname= NULL; - *connect_errors= 0; /* New IP added to the cache. */ + If it is not the no-name error, we should not cache the hostname + (or rather its absence), because the failure might be transient. + */ - DBUG_RETURN(err_status); - } - else if (err_code) - { - DBUG_PRINT("error", ("IP address '%s' could not be resolved: " - "getnameinfo() returned %d.", - (const char *) ip_key, - (int) err_code)); + add_hostname(ip_key, NULL); - sql_print_warning("IP address '%s' could not be resolved: " - "getnameinfo() returned error (code: %d).", - (const char *) ip_key, - (int) err_code); + *hostname= NULL; + *connect_errors= 0; /* New IP added to the cache. */ + } - DBUG_RETURN(TRUE); + DBUG_RETURN(FALSE); } DBUG_PRINT("info", ("IP '%s' resolved to '%s'.", diff --git a/sql/item.cc b/sql/item.cc index c7787d65c22..af3917c09c1 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -997,8 +997,12 @@ bool Item::get_date(MYSQL_TIME *ltime,uint fuzzydate) } else { - longlong value= val_int(); int was_cut; + longlong value= val_int(); + + if (null_value) + goto err; + if (number_to_datetime(value, ltime, fuzzydate, &was_cut) == LL(-1)) { char buff[22], *end; @@ -1059,7 +1063,9 @@ int Item::save_in_field_no_warnings(Field *field, bool no_conversions) ulonglong sql_mode= thd->variables.sql_mode; thd->variables.sql_mode&= ~(MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE); thd->count_cuted_fields= CHECK_FIELD_IGNORE; + res= save_in_field(field, no_conversions); + thd->count_cuted_fields= tmp; dbug_tmp_restore_column_map(table->write_set, old_map); thd->variables.sql_mode= sql_mode; @@ -1740,7 +1746,8 @@ bool agg_item_collations(DTCollation &c, const char *fname, } /* If all arguments where numbers, reset to @@collation_connection */ - if (c.derivation == DERIVATION_NUMERIC) + if (flags & MY_COLL_ALLOW_NUMERIC_CONV && + c.derivation == DERIVATION_NUMERIC) c.set(Item::default_charset(), DERIVATION_COERCIBLE, MY_REPERTOIRE_NUMERIC); return FALSE; @@ -2514,7 +2521,9 @@ my_decimal *Item_float::val_decimal(my_decimal *decimal_value) void Item_string::print(String *str, enum_query_type query_type) { - if (query_type == QT_ORDINARY && is_cs_specified()) + const bool print_introducer= + !(query_type & QT_WITHOUT_INTRODUCERS) && is_cs_specified(); + if (print_introducer) { str->append('_'); str->append(collation.collation->csname); @@ -2522,27 +2531,52 @@ void Item_string::print(String *str, enum_query_type query_type) str->append('\''); - if (query_type == QT_ORDINARY || - my_charset_same(str_value.charset(), system_charset_info)) - { - str_value.print(str); - } - else + if (query_type & QT_TO_SYSTEM_CHARSET) { - THD *thd= current_thd; - LEX_STRING utf8_lex_str; + if (print_introducer) + { + /* + Because we wrote an introducer, we must print str_value in its + charset, and the resulting bytes must not be changed until they + reach the end client. + But the caller is asking for system_charset_info, and may later + convert into character_set_results. That means two conversions: we + must ensure that they don't change our printed bytes. + So we print str_value in the least common denominator of the three + charsets involved: ASCII. Non-ASCII characters are printed as \xFF + sequences (which is ASCII too). This way, our bytes will not be + changed. + */ + ErrConvString tmp(str_value.ptr(), str_value.length(), &my_charset_bin); + str->append(tmp.ptr()); + } + else + { + if (my_charset_same(str_value.charset(), system_charset_info)) + str_value.print(str); // already in system_charset_info + else // need to convert + { + THD *thd= current_thd; + LEX_STRING utf8_lex_str; - thd->convert_string(&utf8_lex_str, - system_charset_info, - str_value.c_ptr_safe(), - str_value.length(), - str_value.charset()); + thd->convert_string(&utf8_lex_str, + system_charset_info, + str_value.c_ptr_safe(), + str_value.length(), + str_value.charset()); - String utf8_str(utf8_lex_str.str, - utf8_lex_str.length, - system_charset_info); + String utf8_str(utf8_lex_str.str, + utf8_lex_str.length, + system_charset_info); - utf8_str.print(str); + utf8_str.print(str); + } + } + } + else + { + // Caller wants a result in the charset of str_value. + str_value.print(str); } str->append('\''); @@ -2858,6 +2892,16 @@ bool Item_param::set_longdata(const char *str, ulong length) (here), and first have to concatenate all pieces together, write query to the binary log and only then perform conversion. */ + if (str_value.length() + length > max_long_data_size) + { + my_message(ER_UNKNOWN_ERROR, + "Parameter of prepared statement which is set through " + "mysql_send_long_data() is longer than " + "'max_long_data_size' bytes", + MYF(0)); + DBUG_RETURN(true); + } + if (str_value.append(str, length, &my_charset_bin)) DBUG_RETURN(TRUE); state= LONG_DATA_VALUE; @@ -6436,7 +6480,7 @@ void Item_ref::print(String *str, enum_query_type query_type) { THD *thd= current_thd; append_identifier(thd, str, (*ref)->real_item()->name, - (*ref)->real_item()->name_length); + strlen((*ref)->real_item()->name)); } else (*ref)->print(str, query_type); @@ -7429,7 +7473,7 @@ String *Item_cache_int::val_str(String *str) DBUG_ASSERT(fixed == 1); if (!has_value()) return NULL; - str->set(value, default_charset()); + str->set_int(value, unsigned_flag, default_charset()); return str; } @@ -7462,16 +7506,43 @@ longlong Item_cache_int::val_int() bool Item_cache_datetime::cache_value_int() { if (!example) - return FALSE; + return false; - value_cached= TRUE; + value_cached= true; // Mark cached string value obsolete - str_value_cached= FALSE; - /* Assume here that the underlying item will do correct conversion.*/ - int_value= example->val_int_result(); + str_value_cached= false; + + MYSQL_TIME ltime; + const bool eval_error= + (field_type() == MYSQL_TYPE_TIME) ? + example->get_time(<ime) : + example->get_date(<ime, TIME_FUZZY_DATE); + + if (eval_error) + int_value= 0; + else + { + switch(field_type()) + { + case MYSQL_TYPE_DATETIME: + case MYSQL_TYPE_TIMESTAMP: + int_value= TIME_to_ulonglong_datetime(<ime); + break; + case MYSQL_TYPE_TIME: + int_value= TIME_to_ulonglong_time(<ime); + break; + default: + int_value= TIME_to_ulonglong_date(<ime); + break; + } + if (ltime.neg) + int_value= -int_value; + } + null_value= example->null_value; unsigned_flag= example->unsigned_flag; - return TRUE; + + return true; } diff --git a/sql/item.h b/sql/item.h index fc203f03e79..96b8c9eb2e4 100644 --- a/sql/item.h +++ b/sql/item.h @@ -53,6 +53,8 @@ char_to_byte_length_safe(uint32 char_length_arg, uint32 mbmaxlen_arg) (i.e. constant). MY_COLL_ALLOW_CONV - allow any kind of conversion (combination of the above two) + MY_COLL_ALLOW_NUMERIC_CONV - if all items were numbers, convert to + @@character_set_connection MY_COLL_DISALLOW_NONE - don't allow return DERIVATION_NONE (e.g. when aggregating for comparison) MY_COLL_CMP_CONV - combination of MY_COLL_ALLOW_CONV @@ -62,6 +64,7 @@ char_to_byte_length_safe(uint32 char_length_arg, uint32 mbmaxlen_arg) #define MY_COLL_ALLOW_SUPERSET_CONV 1 #define MY_COLL_ALLOW_COERCIBLE_CONV 2 #define MY_COLL_DISALLOW_NONE 4 +#define MY_COLL_ALLOW_NUMERIC_CONV 8 #define MY_COLL_ALLOW_CONV (MY_COLL_ALLOW_SUPERSET_CONV | MY_COLL_ALLOW_COERCIBLE_CONV) #define MY_COLL_CMP_CONV (MY_COLL_ALLOW_CONV | MY_COLL_DISALLOW_NONE) @@ -548,6 +551,10 @@ public: */ Item *next; uint32 max_length; /* Maximum length, in bytes */ + /* + TODO: convert name and name_length fields into String to keep them in sync + (see bug #11829681/60295 etc). + */ uint name_length; /* Length of name */ int8 marker; uint8 decimals; @@ -1557,7 +1564,8 @@ agg_item_charsets_for_string_result(DTCollation &c, const char *name, int item_sep= 1) { uint flags= MY_COLL_ALLOW_SUPERSET_CONV | - MY_COLL_ALLOW_COERCIBLE_CONV; + MY_COLL_ALLOW_COERCIBLE_CONV | + MY_COLL_ALLOW_NUMERIC_CONV; return agg_item_charsets(c, name, items, nitems, flags, item_sep); } inline bool @@ -1570,6 +1578,19 @@ agg_item_charsets_for_comparison(DTCollation &c, const char *name, MY_COLL_DISALLOW_NONE; return agg_item_charsets(c, name, items, nitems, flags, item_sep); } +inline bool +agg_item_charsets_for_string_result_with_comparison(DTCollation &c, + const char *name, + Item **items, uint nitems, + int item_sep= 1) +{ + uint flags= MY_COLL_ALLOW_SUPERSET_CONV | + MY_COLL_ALLOW_COERCIBLE_CONV | + MY_COLL_ALLOW_NUMERIC_CONV | + MY_COLL_DISALLOW_NONE; + return agg_item_charsets(c, name, items, nitems, flags, item_sep); +} + class Item_num: public Item_basic_constant { @@ -3449,7 +3470,7 @@ class Item_cache_datetime: public Item_cache { protected: String str_value; - ulonglong int_value; + longlong int_value; bool str_value_cached; public: Item_cache_datetime(enum_field_types field_type_arg): diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 68c63285693..cf5da5313d9 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -4069,13 +4069,11 @@ void Item_func_in::fix_length_and_dec() uint j=0; for (uint i=1 ; i < arg_count ; i++) { - if (!args[i]->null_value) // Skip NULL values - { - array->set(j,args[i]); - j++; - } - else - have_null= 1; + array->set(j,args[i]); + if (!args[i]->null_value) // Skip NULL values + j++; + else + have_null= 1; } if ((array->used_count= j)) array->sort(); diff --git a/sql/item_func.cc b/sql/item_func.cc index a149bb7f955..3fca22e0aaa 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -507,7 +507,10 @@ bool Item_func::is_expensive_processor(uchar *arg) my_decimal *Item_func::val_decimal(my_decimal *decimal_value) { DBUG_ASSERT(fixed); - int2my_decimal(E_DEC_FATAL_ERROR, val_int(), unsigned_flag, decimal_value); + longlong nr= val_int(); + if (null_value) + return 0; /* purecov: inspected */ + int2my_decimal(E_DEC_FATAL_ERROR, nr, unsigned_flag, decimal_value); return decimal_value; } @@ -2090,9 +2093,10 @@ void Item_func_integer::fix_length_and_dec() void Item_func_int_val::fix_num_length_and_dec() { - max_length= args[0]->max_length - (args[0]->decimals ? - args[0]->decimals + 1 : - 0) + 2; + ulonglong tmp_max_length= (ulonglong ) args[0]->max_length - + (args[0]->decimals ? args[0]->decimals + 1 : 0) + 2; + max_length= tmp_max_length > (ulonglong) 4294967295U ? + (uint32) 4294967295U : (uint32) tmp_max_length; uint tmp= float_length(decimals); set_if_smaller(max_length,tmp); decimals= 0; @@ -2535,7 +2539,8 @@ void Item_func_min_max::fix_length_and_dec() } if (cmp_type == STRING_RESULT) { - agg_arg_charsets_for_comparison(collation, args, arg_count); + agg_arg_charsets_for_string_result_with_comparison(collation, + args, arg_count); if (datetime_found) { thd= current_thd; @@ -3005,6 +3010,8 @@ void Item_func_find_in_set::fix_length_and_dec() String *find=args[0]->val_str(&value); if (find) { + // find is not NULL pointer so args[0] is not a null-value + DBUG_ASSERT(!args[0]->null_value); enum_value= find_type(((Field_enum*) field)->typelib,find->ptr(), find->length(), 0); enum_bit=0; @@ -3023,11 +3030,22 @@ longlong Item_func_find_in_set::val_int() DBUG_ASSERT(fixed == 1); if (enum_value) { - ulonglong tmp=(ulonglong) args[1]->val_int(); - if (!(null_value=args[1]->null_value || args[0]->null_value)) + // enum_value is set iff args[0]->const_item() in fix_length_and_dec(). + DBUG_ASSERT(args[0]->const_item()); + + ulonglong tmp= (ulonglong) args[1]->val_int(); + null_value= args[1]->null_value; + /* + No need to check args[0]->null_value since enum_value is set iff + args[0] is a non-null const item. Note: no DBUG_ASSERT on + args[0]->null_value here because args[0] may have been replaced + by an Item_cache on which val_int() has not been called. See + BUG#11766317 + */ + if (!null_value) { if (tmp & enum_bit) - return enum_value; + return enum_value; } return 0L; } @@ -4254,6 +4272,7 @@ Item_func_set_user_var::fix_length_and_dec() fix_length_and_charset(args[0]->max_char_length(), args[0]->collation.collation); } + unsigned_flag= args[0]->unsigned_flag; } diff --git a/sql/item_func.h b/sql/item_func.h index e60effc352c..9198b092539 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -165,6 +165,11 @@ public: { return agg_item_charsets(c, func_name(), items, nitems, flags, item_sep); } + /* + Aggregate arguments for string result, e.g: CONCAT(a,b) + - convert to @@character_set_connection if all arguments are numbers + - allow DERIVATION_NONE + */ bool agg_arg_charsets_for_string_result(DTCollation &c, Item **items, uint nitems, int item_sep= 1) @@ -172,6 +177,11 @@ public: return agg_item_charsets_for_string_result(c, func_name(), items, nitems, item_sep); } + /* + Aggregate arguments for comparison, e.g: a=b, a LIKE b, a RLIKE b + - don't convert to @@character_set_connection if all arguments are numbers + - don't allow DERIVATION_NONE + */ bool agg_arg_charsets_for_comparison(DTCollation &c, Item **items, uint nitems, int item_sep= 1) @@ -179,6 +189,21 @@ public: return agg_item_charsets_for_comparison(c, func_name(), items, nitems, item_sep); } + /* + Aggregate arguments for string result, when some comparison + is involved internally, e.g: REPLACE(a,b,c) + - convert to @@character_set_connection if all arguments are numbers + - disallow DERIVATION_NONE + */ + bool agg_arg_charsets_for_string_result_with_comparison(DTCollation &c, + Item **items, + uint nitems, + int item_sep= 1) + { + return agg_item_charsets_for_string_result_with_comparison(c, func_name(), + items, nitems, + item_sep); + } bool walk(Item_processor processor, bool walk_subquery, uchar *arg); Item *transform(Item_transformer transformer, uchar *arg); Item* compile(Item_analyzer analyzer, uchar **arg_p, diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index ad18d5dabbe..e5c47c110f4 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1168,7 +1168,7 @@ void Item_func_replace::fix_length_and_dec() char_length+= max_substrs * (uint) diff; } - if (agg_arg_charsets_for_comparison(collation, args, 3)) + if (agg_arg_charsets_for_string_result_with_comparison(collation, args, 3)) return; fix_char_length_ulonglong(char_length); } @@ -1458,7 +1458,7 @@ void Item_func_substr::fix_length_and_dec() void Item_func_substr_index::fix_length_and_dec() { - if (agg_arg_charsets_for_comparison(collation, args, 2)) + if (agg_arg_charsets_for_string_result_with_comparison(collation, args, 2)) return; fix_char_length(args[0]->max_char_length()); } @@ -1797,7 +1797,8 @@ void Item_func_trim::fix_length_and_dec() { // Handle character set for args[1] and args[0]. // Note that we pass args[1] as the first item, and args[0] as the second. - if (agg_arg_charsets_for_comparison(collation, &args[1], 2, -1)) + if (agg_arg_charsets_for_string_result_with_comparison(collation, + &args[1], 2, -1)) return; } fix_char_length(args[0]->max_char_length()); diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 6b54a088112..118bae7342f 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -256,30 +256,31 @@ bool Item_subselect::walk(Item_processor processor, bool walk_subquery, bool Item_subselect::exec() { - int res; + DBUG_ENTER("Item_subselect::exec"); /* Do not execute subselect in case of a fatal error or if the query has been killed. */ if (thd->is_error() || thd->killed) - return 1; + DBUG_RETURN(true); DBUG_ASSERT(!thd->lex->context_analysis_only); /* Simulate a failure in sub-query execution. Used to test e.g. out of memory or query being killed conditions. */ - DBUG_EXECUTE_IF("subselect_exec_fail", return 1;); + DBUG_EXECUTE_IF("subselect_exec_fail", DBUG_RETURN(true);); - res= engine->exec(); + bool res= engine->exec(); if (engine_changed) { engine_changed= 0; - return exec(); + res= exec(); + DBUG_RETURN(res); } - return (res); + DBUG_RETURN(res); } Item::Type Item_subselect::type() const diff --git a/sql/item_sum.cc b/sql/item_sum.cc index adfa1ea66f0..f20ad141378 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -1145,17 +1145,13 @@ Item_sum_hybrid::fix_fields(THD *thd, Item **ref) switch (hybrid_type= item->result_type()) { case INT_RESULT: - max_length= 20; - break; case DECIMAL_RESULT: + case STRING_RESULT: max_length= item->max_length; break; case REAL_RESULT: max_length= float_length(decimals); break; - case STRING_RESULT: - max_length= item->max_length; - break; case ROW_RESULT: default: DBUG_ASSERT(0); @@ -1903,7 +1899,10 @@ double Item_sum_hybrid::val_real() DBUG_ASSERT(fixed == 1); if (null_value) return 0.0; - return value->val_real(); + double retval= value->val_real(); + if ((null_value= value->null_value)) + DBUG_ASSERT(retval == 0.0); + return retval; } longlong Item_sum_hybrid::val_int() @@ -1911,7 +1910,10 @@ longlong Item_sum_hybrid::val_int() DBUG_ASSERT(fixed == 1); if (null_value) return 0; - return value->val_int(); + longlong retval= value->val_int(); + if ((null_value= value->null_value)) + DBUG_ASSERT(retval == 0); + return retval; } @@ -1920,7 +1922,10 @@ my_decimal *Item_sum_hybrid::val_decimal(my_decimal *val) DBUG_ASSERT(fixed == 1); if (null_value) return 0; - return value->val_decimal(val); + my_decimal *retval= value->val_decimal(val); + if ((null_value= value->null_value)) + DBUG_ASSERT(retval == NULL); + return retval; } @@ -1930,7 +1935,10 @@ Item_sum_hybrid::val_str(String *str) DBUG_ASSERT(fixed == 1); if (null_value) return 0; - return value->val_str(str); + String *retval= value->val_str(str); + if ((null_value= value->null_value)) + DBUG_ASSERT(retval == NULL); + return retval; } diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 99467b7c3fc..c2363409269 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -315,8 +315,8 @@ static bool extract_date_time(DATE_TIME_FORMAT *format, for (; ptr != end && val != val_end; ptr++) { /* Skip pre-space between each argument */ - while (val != val_end && my_isspace(cs, *val)) - val++; + if ((val+= cs->cset->scan(cs, val, val_end, MY_SEQ_SPACES)) >= val_end) + break; if (*ptr == '%' && ptr+1 != end) { @@ -3405,6 +3405,7 @@ void Item_func_str_to_date::fix_length_and_dec() { maybe_null= 1; decimals=0; + cached_format_type= DATE_TIME; cached_field_type= MYSQL_TYPE_DATETIME; max_length= MAX_DATETIME_FULL_WIDTH*MY_CHARSET_BIN_MB_MAXLEN; cached_timestamp_type= MYSQL_TIMESTAMP_NONE; diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index 92e24d75111..ca1624c9082 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -144,8 +144,11 @@ public: { DBUG_ASSERT(fixed == 1); return (double) Item_func_month::val_int(); } String *val_str(String *str) { - str->set(val_int(), collation.collation); - return null_value ? 0 : str; + longlong nr= val_int(); + if (null_value) + return 0; + str->set(nr, collation.collation); + return str; } const char *func_name() const { return "month"; } enum Item_result result_type () const { return INT_RESULT; } diff --git a/sql/log.cc b/sql/log.cc index 36501b4a007..bb5b37baa69 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -2861,11 +2861,9 @@ void MYSQL_BIN_LOG::init(bool no_auto_events_arg, ulong max_size_arg) void MYSQL_BIN_LOG::init_pthread_objects() { - DBUG_ASSERT(inited == 0); - inited= 1; - mysql_mutex_init(key_LOG_LOCK_log, &LOCK_log, MY_MUTEX_INIT_SLOW); - mysql_mutex_init(key_BINLOG_LOCK_index, &LOCK_index, MY_MUTEX_INIT_SLOW); - mysql_cond_init(key_BINLOG_update_cond, &update_cond, 0); + MYSQL_LOG::init_pthread_objects(); + mysql_mutex_init(m_key_LOCK_index, &LOCK_index, MY_MUTEX_INIT_SLOW); + mysql_cond_init(m_key_update_cond, &update_cond, 0); } @@ -2888,7 +2886,7 @@ bool MYSQL_BIN_LOG::open_index_file(const char *index_file_name_arg, } fn_format(index_file_name, index_file_name_arg, mysql_data_home, ".index", opt); - if ((index_file_nr= mysql_file_open(key_file_binlog_index, + if ((index_file_nr= mysql_file_open(m_key_file_log_index, index_file_name, O_RDWR | O_CREAT | O_BINARY, MYF(MY_WME))) < 0 || @@ -3004,7 +3002,7 @@ bool MYSQL_BIN_LOG::open(const char *log_name, /* open the main log file */ if (MYSQL_LOG::open( #ifdef HAVE_PSI_INTERFACE - key_file_binlog, + m_key_file_log, #endif log_name, log_type_arg, new_name, io_cache_type_arg)) { @@ -3874,7 +3872,7 @@ int MYSQL_BIN_LOG::purge_index_entry(THD *thd, ulonglong *decrease_log_space, /* Get rid of the trailing '\n' */ log_info.log_file_name[length-1]= 0; - if (!mysql_file_stat(key_file_binlog, log_info.log_file_name, &s, MYF(0))) + if (!mysql_file_stat(m_key_file_log, log_info.log_file_name, &s, MYF(0))) { if (my_errno == ENOENT) { @@ -4049,7 +4047,7 @@ int MYSQL_BIN_LOG::purge_logs_before_date(time_t purge_time) !is_active(log_info.log_file_name) && !log_in_use(log_info.log_file_name)) { - if (!mysql_file_stat(key_file_binlog, + if (!mysql_file_stat(m_key_file_log, log_info.log_file_name, &stat_area, MYF(0))) { if (my_errno == ENOENT) diff --git a/sql/log.h b/sql/log.h index d287da0dcd1..5d6c5b00012 100644 --- a/sql/log.h +++ b/sql/log.h @@ -274,6 +274,16 @@ private: class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG { private: +#ifdef HAVE_PSI_INTERFACE + /** The instrumentation key to use for @ LOCK_index. */ + PSI_mutex_key m_key_LOCK_index; + /** The instrumentation key to use for @ update_cond. */ + PSI_cond_key m_key_update_cond; + /** The instrumentation key to use for opening the log file. */ + PSI_file_key m_key_file_log; + /** The instrumentation key to use for opening the log index file. */ + PSI_file_key m_key_file_log_index; +#endif /* LOCK_log and LOCK_index are inited by init_pthread_objects() */ mysql_mutex_t LOCK_index; mysql_mutex_t LOCK_prep_xids; @@ -362,6 +372,19 @@ public: on exit() - but only during the correct shutdown process */ +#ifdef HAVE_PSI_INTERFACE + void set_psi_keys(PSI_mutex_key key_LOCK_index, + PSI_cond_key key_update_cond, + PSI_file_key key_file_log, + PSI_file_key key_file_log_index) + { + m_key_LOCK_index= key_LOCK_index; + m_key_update_cond= key_update_cond; + m_key_file_log= key_file_log; + m_key_file_log_index= key_file_log_index; + } +#endif + int open(const char *opt_name); void close(); int log_xid(THD *thd, my_xid xid); diff --git a/sql/log_event.cc b/sql/log_event.cc index b9da915ba96..39b4791ff3d 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -9052,7 +9052,19 @@ static bool record_compare(TABLE *table) } } - if (table->s->blob_fields + table->s->varchar_fields == 0) + /** + Compare full record only if: + - there are no blob fields (otherwise we would also need + to compare blobs contents as well); + - there are no varchar fields (otherwise we would also need + to compare varchar contents as well); + - there are no null fields, otherwise NULLed fields + contents (i.e., the don't care bytes) may show arbitrary + values, depending on how each engine handles internally. + */ + if ((table->s->blob_fields + + table->s->varchar_fields + + table->s->null_fields) == 0) { result= cmp_record(table,record[1]); goto record_compare_exit; @@ -9067,13 +9079,22 @@ static bool record_compare(TABLE *table) goto record_compare_exit; } - /* Compare updated fields */ + /* Compare fields */ for (Field **ptr=table->field ; *ptr ; ptr++) { - if ((*ptr)->cmp_binary_offset(table->s->rec_buff_length)) + + /** + We only compare field contents that are not null. + NULL fields (i.e., their null bits) were compared + earlier. + */ + if (!(*(ptr))->is_null()) { - result= TRUE; - goto record_compare_exit; + if ((*ptr)->cmp_binary_offset(table->s->rec_buff_length)) + { + result= TRUE; + goto record_compare_exit; + } } } diff --git a/sql/mdl.h b/sql/mdl.h index 4a9397fe215..e0934cb732b 100644 --- a/sql/mdl.h +++ b/sql/mdl.h @@ -286,21 +286,6 @@ private: }; - -/** - Hook class which via its methods specifies which members - of T should be used for participating in MDL lists. -*/ - -template <typename T, T* T::*next, T** T::*prev> -struct I_P_List_adapter -{ - static inline T **next_ptr(T *el) { return &(el->*next); } - - static inline T ***prev_ptr(T *el) { return &(el->*prev); } -}; - - /** A pending metadata lock request. diff --git a/sql/my_decimal.h b/sql/my_decimal.h index e2f5c95dac2..f3fd39f5721 100644 --- a/sql/my_decimal.h +++ b/sql/my_decimal.h @@ -178,7 +178,7 @@ void max_my_decimal(my_decimal *to, int precision, int frac) { DBUG_ASSERT((precision <= DECIMAL_MAX_PRECISION)&& (frac <= DECIMAL_MAX_SCALE)); - max_decimal(precision, frac, (decimal_t*) to); + max_decimal(precision, frac, to); } inline void max_internal_decimal(my_decimal *to) @@ -277,14 +277,19 @@ inline int binary2my_decimal(uint mask, const uchar *bin, my_decimal *d, int prec, int scale) { - return check_result(mask, bin2decimal(bin, (decimal_t*) d, prec, scale)); + return check_result(mask, bin2decimal(bin, d, prec, scale)); } inline int my_decimal_set_zero(my_decimal *d) { - decimal_make_zero(((decimal_t*) d)); + /* + We need the up-cast here, since my_decimal has sign() member functions, + which conflicts with decimal_t::size + (and decimal_make_zero is a macro, rather than a funcion). + */ + decimal_make_zero(static_cast<decimal_t*>(d)); return 0; } @@ -292,7 +297,7 @@ int my_decimal_set_zero(my_decimal *d) inline bool my_decimal_is_zero(const my_decimal *decimal_value) { - return decimal_is_zero((decimal_t*) decimal_value); + return decimal_is_zero(decimal_value); } @@ -300,7 +305,7 @@ inline int my_decimal_round(uint mask, const my_decimal *from, int scale, bool truncate, my_decimal *to) { - return check_result(mask, decimal_round((decimal_t*) from, to, scale, + return check_result(mask, decimal_round(from, to, scale, (truncate ? TRUNCATE : HALF_UP))); } @@ -308,14 +313,14 @@ int my_decimal_round(uint mask, const my_decimal *from, int scale, inline int my_decimal_floor(uint mask, const my_decimal *from, my_decimal *to) { - return check_result(mask, decimal_round((decimal_t*) from, to, 0, FLOOR)); + return check_result(mask, decimal_round(from, to, 0, FLOOR)); } inline int my_decimal_ceiling(uint mask, const my_decimal *from, my_decimal *to) { - return check_result(mask, decimal_round((decimal_t*) from, to, 0, CEILING)); + return check_result(mask, decimal_round(from, to, 0, CEILING)); } @@ -337,7 +342,7 @@ int my_decimal2int(uint mask, const my_decimal *d, my_bool unsigned_flag, { my_decimal rounded; /* decimal_round can return only E_DEC_TRUNCATED */ - decimal_round((decimal_t*)d, &rounded, 0, HALF_UP); + decimal_round(d, &rounded, 0, HALF_UP); return check_result(mask, (unsigned_flag ? decimal2ulonglong(&rounded, (ulonglong *)l) : decimal2longlong(&rounded, l))); @@ -348,15 +353,14 @@ inline int my_decimal2double(uint, const my_decimal *d, double *result) { /* No need to call check_result as this will always succeed */ - return decimal2double((decimal_t*) d, result); + return decimal2double(d, result); } inline int str2my_decimal(uint mask, const char *str, my_decimal *d, char **end) { - return check_result_and_overflow(mask, string2decimal(str,(decimal_t*)d,end), - d); + return check_result_and_overflow(mask, string2decimal(str, d, end), d); } @@ -379,7 +383,7 @@ my_decimal *date2my_decimal(MYSQL_TIME *ltime, my_decimal *dec); inline int double2my_decimal(uint mask, double val, my_decimal *d) { - return check_result_and_overflow(mask, double2decimal(val, (decimal_t*)d), d); + return check_result_and_overflow(mask, double2decimal(val, d), d); } @@ -409,7 +413,7 @@ int my_decimal_add(uint mask, my_decimal *res, const my_decimal *a, const my_decimal *b) { return check_result_and_overflow(mask, - decimal_add((decimal_t*)a,(decimal_t*)b,res), + decimal_add(a, b, res), res); } @@ -419,7 +423,7 @@ int my_decimal_sub(uint mask, my_decimal *res, const my_decimal *a, const my_decimal *b) { return check_result_and_overflow(mask, - decimal_sub((decimal_t*)a,(decimal_t*)b,res), + decimal_sub(a, b, res), res); } @@ -429,7 +433,7 @@ int my_decimal_mul(uint mask, my_decimal *res, const my_decimal *a, const my_decimal *b) { return check_result_and_overflow(mask, - decimal_mul((decimal_t*)a,(decimal_t*)b,res), + decimal_mul(a, b, res), res); } @@ -439,8 +443,7 @@ int my_decimal_div(uint mask, my_decimal *res, const my_decimal *a, const my_decimal *b, int div_scale_inc) { return check_result_and_overflow(mask, - decimal_div((decimal_t*)a,(decimal_t*)b,res, - div_scale_inc), + decimal_div(a, b, res, div_scale_inc), res); } @@ -450,7 +453,7 @@ int my_decimal_mod(uint mask, my_decimal *res, const my_decimal *a, const my_decimal *b) { return check_result_and_overflow(mask, - decimal_mod((decimal_t*)a,(decimal_t*)b,res), + decimal_mod(a, b, res), res); } @@ -462,14 +465,14 @@ int my_decimal_mod(uint mask, my_decimal *res, const my_decimal *a, inline int my_decimal_cmp(const my_decimal *a, const my_decimal *b) { - return decimal_cmp((decimal_t*) a, (decimal_t*) b); + return decimal_cmp(a, b); } inline int my_decimal_intg(const my_decimal *a) { - return decimal_intg((decimal_t*) a); + return decimal_intg(a); } diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 3c06832e9a6..f078c703a1a 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -245,11 +245,7 @@ inline void setup_fpu() #define MYSQL_KILL_SIGNAL SIGTERM -#ifdef HAVE_GLIBC2_STYLE_GETHOSTBYNAME_R -#include <sys/types.h> -#else #include <my_pthread.h> // For thr_setconcurency() -#endif #ifdef SOLARIS extern "C" int gethostname(char *name, int namelen); @@ -324,6 +320,7 @@ static PSI_rwlock_key key_rwlock_openssl; /* the default log output is log tables */ static bool lower_case_table_names_used= 0; +static bool max_long_data_size_used= false; static bool volatile select_thread_in_use, signal_thread_in_use; /* See Bug#56666 and Bug#56760 */; volatile bool ready_to_exit; @@ -479,6 +476,11 @@ ulong binlog_cache_use= 0, binlog_cache_disk_use= 0; ulong binlog_stmt_cache_use= 0, binlog_stmt_cache_disk_use= 0; MYSQL_PLUGIN_IMPORT ulong max_connections; ulong max_connect_errors; +/* + Maximum length of parameter value which can be set through + mysql_send_long_data() call. +*/ +ulong max_long_data_size; /** Limit of the total number of prepared statements in the server. Is necessary to protect the server against out-of-memory attacks. @@ -3126,6 +3128,18 @@ static int init_common_variables() */ global_system_variables.time_zone= my_tz_SYSTEM; +#ifdef HAVE_PSI_INTERFACE + /* + Complete the mysql_bin_log initialization. + Instrumentation keys are known only after the performance schema initialization, + and can not be set in the MYSQL_BIN_LOG constructor (called before main()). + */ + mysql_bin_log.set_psi_keys(key_BINLOG_LOCK_index, + key_BINLOG_update_cond, + key_file_binlog, + key_file_binlog_index); +#endif + /* Init mutexes for the global MYSQL_BIN_LOG objects. As safe_mutex depends on what MY_INIT() does, we can't init the mutexes of @@ -4645,10 +4659,15 @@ int mysqld_main(int argc, char **argv) #if defined(__WIN__) && !defined(EMBEDDED_LIBRARY) int mysql_service(void *p) { + if (my_thread_init()) + return 1; + if (use_opt_args) win_main(opt_argc, opt_argv); else win_main(Service.my_argc, Service.my_argv); + + my_thread_end(); return 0; } @@ -7152,6 +7171,10 @@ mysqld_get_one_option(int optid, if (argument == NULL) /* no argument */ log_error_file_ptr= const_cast<char*>(""); break; + case OPT_MAX_LONG_DATA_SIZE: + max_long_data_size_used= true; + WARN_DEPRECATED(NULL, 5, 6, "--max_long_data_size", "'--max_allowed_packet'"); + break; } return 0; } @@ -7264,6 +7287,14 @@ static int get_options(int *argc_ptr, char ***argv_ptr) opt_log_slow_slave_statements) && !opt_slow_log) sql_print_warning("options --log-slow-admin-statements, --log-queries-not-using-indexes and --log-slow-slave-statements have no effect if --log_slow_queries is not set"); + if (global_system_variables.net_buffer_length > + global_system_variables.max_allowed_packet) + { + sql_print_warning("net_buffer_length (%lu) is set to be larger " + "than max_allowed_packet (%lu). Please rectify.", + global_system_variables.net_buffer_length, + global_system_variables.max_allowed_packet); + } if (log_error_file_ptr != disabled_my_option) opt_error_log= 1; @@ -7378,6 +7409,13 @@ static int get_options(int *argc_ptr, char ***argv_ptr) opt_readonly= read_only; + /* + If max_long_data_size is not specified explicitly use + value of max_allowed_packet. + */ + if (!max_long_data_size_used) + max_long_data_size= global_system_variables.max_allowed_packet; + return 0; } @@ -7710,6 +7748,7 @@ PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_prep_xids, key_structure_guard_mutex, key_TABLE_SHARE_LOCK_ha_data, key_LOCK_error_messages, key_LOG_INFO_lock, key_LOCK_thread_count, key_PARTITION_LOCK_auto_inc; +PSI_mutex_key key_RELAYLOG_LOCK_index; static PSI_mutex_info all_server_mutexes[]= { @@ -7726,6 +7765,7 @@ static PSI_mutex_info all_server_mutexes[]= { &key_BINLOG_LOCK_index, "MYSQL_BIN_LOG::LOCK_index", 0}, { &key_BINLOG_LOCK_prep_xids, "MYSQL_BIN_LOG::LOCK_prep_xids", 0}, + { &key_RELAYLOG_LOCK_index, "MYSQL_RELAY_LOG::LOCK_index", 0}, { &key_delayed_insert_mutex, "Delayed_insert::mutex", 0}, { &key_hash_filo_lock, "hash_filo::lock", 0}, { &key_LOCK_active_mi, "LOCK_active_mi", PSI_FLAG_GLOBAL}, @@ -7793,6 +7833,7 @@ PSI_cond_key key_BINLOG_COND_prep_xids, key_BINLOG_update_cond, key_relay_log_info_start_cond, key_relay_log_info_stop_cond, key_TABLE_SHARE_cond, key_user_level_lock_cond, key_COND_thread_count, key_COND_thread_cache, key_COND_flush_thread_cache; +PSI_cond_key key_RELAYLOG_update_cond; static PSI_cond_info all_server_conds[]= { @@ -7806,6 +7847,7 @@ static PSI_cond_info all_server_conds[]= #endif /* HAVE_MMAP */ { &key_BINLOG_COND_prep_xids, "MYSQL_BIN_LOG::COND_prep_xids", 0}, { &key_BINLOG_update_cond, "MYSQL_BIN_LOG::update_cond", 0}, + { &key_RELAYLOG_update_cond, "MYSQL_RELAY_LOG::update_cond", 0}, { &key_COND_cache_status_changed, "Query_cache::COND_cache_status_changed", 0}, { &key_COND_manager, "COND_manager", PSI_FLAG_GLOBAL}, { &key_COND_rpl_status, "COND_rpl_status", PSI_FLAG_GLOBAL}, @@ -7871,6 +7913,7 @@ PSI_file_key key_file_binlog, key_file_binlog_index, key_file_casetest, key_file_pid, key_file_relay_log_info, key_file_send_file, key_file_tclog, key_file_trg, key_file_trn, key_file_init; PSI_file_key key_file_query_log, key_file_slow_log; +PSI_file_key key_file_relaylog, key_file_relaylog_index; static PSI_file_info all_server_files[]= { @@ -7879,6 +7922,8 @@ static PSI_file_info all_server_files[]= #endif /* HAVE_MMAP */ { &key_file_binlog, "binlog", 0}, { &key_file_binlog_index, "binlog_index", 0}, + { &key_file_relaylog, "relaylog", 0}, + { &key_file_relaylog_index, "relaylog_index", 0}, { &key_file_casetest, "casetest", 0}, { &key_file_dbopt, "dbopt", 0}, { &key_file_des_key_file, "des_key_file", 0}, diff --git a/sql/mysqld.h b/sql/mysqld.h index 3fd60c511e8..8e58e7534b2 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -126,6 +126,7 @@ extern char *default_storage_engine; extern bool opt_endinfo, using_udf_functions; extern my_bool locked_in_memory; extern bool opt_using_transactions; +extern ulong max_long_data_size; extern ulong current_pid; extern ulong expire_logs_days; extern my_bool relay_log_recovery; @@ -241,6 +242,7 @@ extern PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_prep_xids, key_relay_log_info_log_space_lock, key_relay_log_info_run_lock, key_structure_guard_mutex, key_TABLE_SHARE_LOCK_ha_data, key_LOCK_error_messages, key_LOCK_thread_count, key_PARTITION_LOCK_auto_inc; +extern PSI_mutex_key key_RELAYLOG_LOCK_index; extern PSI_rwlock_key key_rwlock_LOCK_grant, key_rwlock_LOCK_logger, key_rwlock_LOCK_sys_init_connect, key_rwlock_LOCK_sys_init_slave, @@ -260,6 +262,7 @@ extern PSI_cond_key key_BINLOG_COND_prep_xids, key_BINLOG_update_cond, key_relay_log_info_start_cond, key_relay_log_info_stop_cond, key_TABLE_SHARE_cond, key_user_level_lock_cond, key_COND_thread_count, key_COND_thread_cache, key_COND_flush_thread_cache; +extern PSI_cond_key key_RELAYLOG_update_cond; extern PSI_thread_key key_thread_bootstrap, key_thread_delayed_insert, key_thread_handle_manager, key_thread_kill_server, key_thread_main, @@ -279,6 +282,7 @@ extern PSI_file_key key_file_binlog, key_file_binlog_index, key_file_casetest, key_file_pid, key_file_relay_log_info, key_file_send_file, key_file_tclog, key_file_trg, key_file_trn, key_file_init; extern PSI_file_key key_file_query_log, key_file_slow_log; +extern PSI_file_key key_file_relaylog, key_file_relaylog_index; void init_server_psi_keys(); #endif /* HAVE_PSI_INTERFACE */ @@ -396,21 +400,22 @@ enum options_mysqld OPT_UPDATE_LOG, OPT_WANT_CORE, OPT_ENGINE_CONDITION_PUSHDOWN, - OPT_LOG_ERROR + OPT_LOG_ERROR, + OPT_MAX_LONG_DATA_SIZE }; /** - Query type constants. - - QT_ORDINARY -- ordinary SQL query. - QT_IS -- SQL query to be shown in INFORMATION_SCHEMA (in utf8 and without - character set introducers). + Query type constants (usable as bitmap flags). */ enum enum_query_type { - QT_ORDINARY, - QT_IS + /// Nothing specific, ordinary SQL query. + QT_ORDINARY= 0, + /// In utf8. + QT_TO_SYSTEM_CHARSET= (1 << 0), + /// Without character set introducers. + QT_WITHOUT_INTRODUCERS= (1 << 1) }; /* query_id */ diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc index a2f8b9c4447..6b8cdfaca60 100644 --- a/sql/opt_sum.cc +++ b/sql/opt_sum.cc @@ -212,6 +212,7 @@ static int get_index_max_value(TABLE *table, TABLE_REF *ref, uint range_fl) /** Substitutes constants for some COUNT(), MIN() and MAX() functions. + @param thd thread handler @param tables list of leaves of join table tree @param all_fields All fields to be returned @param conds WHERE clause @@ -229,9 +230,12 @@ static int get_index_max_value(TABLE *table, TABLE_REF *ref, uint range_fl) HA_ERR_KEY_NOT_FOUND on impossible conditions @retval HA_ERR_... if a deadlock or a lock wait timeout happens, for example + @retval + ER_... e.g. ER_SUBQUERY_NO_1_ROW */ -int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds) +int opt_sum_query(THD *thd, + TABLE_LIST *tables, List<Item> &all_fields, COND *conds) { List_iterator_fast<Item> it(all_fields); int const_result= 1; @@ -243,6 +247,8 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds) Item *item; int error; + DBUG_ENTER("opt_sum_query"); + if (conds) where_tables= conds->used_tables(); @@ -270,7 +276,7 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds) WHERE t2.field IS NULL; */ if (tl->table->map & where_tables) - return 0; + DBUG_RETURN(0); } else used_tables|= tl->table->map; @@ -297,7 +303,7 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds) if(error) { tl->table->file->print_error(error, MYF(ME_FATALERROR)); - return error; + DBUG_RETURN(error); } count*= tl->table->file->stats.records; } @@ -390,10 +396,10 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds) if (error) { if (error == HA_ERR_KEY_NOT_FOUND || error == HA_ERR_END_OF_FILE) - return HA_ERR_KEY_NOT_FOUND; // No rows matching WHERE + DBUG_RETURN(HA_ERR_KEY_NOT_FOUND); // No rows matching WHERE /* HA_ERR_LOCK_DEADLOCK or some other error */ table->file->print_error(error, MYF(0)); - return(error); + DBUG_RETURN(error); } removed_tables|= table->map; } @@ -442,6 +448,10 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds) const_result= 0; } } + + if (thd->is_error()) + DBUG_RETURN(thd->stmt_da->sql_errno()); + /* If we have a where clause, we can only ignore searching in the tables if MIN/MAX optimisation replaced all used tables @@ -451,7 +461,7 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds) */ if (removed_tables && used_tables != removed_tables) const_result= 0; // We didn't remove all tables - return const_result; + DBUG_RETURN(const_result); } @@ -737,6 +747,12 @@ static bool matching_cond(bool max_fl, TABLE_REF *ref, KEY *keyinfo, if (is_null || (is_null_safe_eq && args[1]->is_null())) { + /* + If we have a non-nullable index, we cannot use it, + since set_null will be ignored, and we will compare uninitialized data. + */ + if (!part->field->real_maybe_null()) + DBUG_RETURN(false); part->field->set_null(); *key_ptr= (uchar) 1; } @@ -807,8 +823,9 @@ static bool matching_cond(bool max_fl, TABLE_REF *ref, KEY *keyinfo, @param[out] prefix_len Length of prefix for the search range @note - This function may set table->key_read to 1, which must be reset after - index is used! (This can only happen when function returns 1) + This function may set field->table->key_read to true, + which must be reset after index is used! + (This can only happen when function returns 1) @retval 0 Index can not be used to optimize MIN(field)/MAX(field) @@ -823,7 +840,9 @@ static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref, uint *range_fl, uint *prefix_len) { if (!(field->flags & PART_KEY_FLAG)) - return 0; // Not key field + return false; // Not key field + + DBUG_ENTER("find_key_for_maxmin"); TABLE *table= field->table; uint idx= 0; @@ -848,7 +867,7 @@ static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref, part++, jdx++, key_part_to_use= (key_part_to_use << 1) | 1) { if (!(table->file->index_flags(idx, jdx, 0) & HA_READ_ORDER)) - return 0; + DBUG_RETURN(false); /* Check whether the index component is partial */ Field *part_field= table->field[part->fieldnr-1]; @@ -897,12 +916,12 @@ static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref, */ if (field->part_of_key.is_set(idx)) table->set_keyread(TRUE); - return 1; + DBUG_RETURN(true); } } } } - return 0; + DBUG_RETURN(false); } diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index df20690d8d8..9a5c7521752 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -56,6 +56,13 @@ Relay_log_info::Relay_log_info(bool is_slave_recovery) { DBUG_ENTER("Relay_log_info::Relay_log_info"); +#ifdef HAVE_PSI_INTERFACE + relay_log.set_psi_keys(key_RELAYLOG_LOCK_index, + key_RELAYLOG_update_cond, + key_file_relaylog, + key_file_relaylog_index); +#endif + group_relay_log_name[0]= event_relay_log_name[0]= group_master_log_name[0]= 0; until_log_name[0]= ign_master_log_name_end[0]= 0; @@ -358,7 +365,7 @@ static inline int add_relay_log(Relay_log_info* rli,LOG_INFO* linfo) { MY_STAT s; DBUG_ENTER("add_relay_log"); - if (!mysql_file_stat(key_file_binlog, + if (!mysql_file_stat(key_file_relaylog, linfo->log_file_name, &s, MYF(0))) { sql_print_error("log %s listed in the index, but failed to stat", diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index 998e88704d8..6898028df70 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -6397,3 +6397,11 @@ ER_STMT_CACHE_FULL ER_MULTI_UPDATE_KEY_CONFLICT eng "Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'." + +# When translating this error message make sure to include "ALTER TABLE" in the +# message as mysqlcheck parses the error message looking for ALTER TABLE. +ER_TABLE_NEEDS_REBUILD + eng "Table rebuild required. Please do \"ALTER TABLE `%-.32s` FORCE\" or dump/reload to fix it!" + +WARN_OPTION_BELOW_LIMIT + eng "The value of '%s' should be no less than the value of '%s'" diff --git a/sql/slave.cc b/sql/slave.cc index a96ee505fe9..c676c89b369 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -903,18 +903,18 @@ static bool sql_slave_killed(THD* thd, Relay_log_info* rli) && rli->is_in_group()) { char msg_stopped[]= - "... The slave SQL is stopped, leaving the current group " - "of events unfinished with a non-transaction table changed. " - "If the group consists solely of Row-based events, you can try " - "restarting the slave with --slave-exec-mode=IDEMPOTENT, which " + "... Slave SQL Thread stopped with incomplete event group " + "having non-transactional changes. " + "If the group consists solely of row-based events, you can try " + "to restart the slave with --slave-exec-mode=IDEMPOTENT, which " "ignores duplicate key, key not found, and similar errors (see " "documentation for details)."; if (rli->abort_slave) { - DBUG_PRINT("info", ("Slave SQL thread is being stopped in the middle of" - " a group having updated a non-trans table, giving" - " it some grace period")); + DBUG_PRINT("info", ("Request to stop slave SQL Thread received while " + "applying a group that has non-transactional " + "changes; waiting for completion of the group ... ")); /* Slave sql thread shutdown in face of unfinished group modified @@ -938,9 +938,9 @@ static bool sql_slave_killed(THD* thd, Relay_log_info* rli) if (ret == 0) { rli->report(WARNING_LEVEL, 0, - "slave SQL thread is being stopped in the middle " - "of applying of a group having updated a non-transaction " - "table; waiting for the group completion ... "); + "Request to stop slave SQL Thread received while " + "applying a group that has non-transactional " + "changes; waiting for completion of the group ... "); } else { diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 000d5582be4..5841091a976 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -1,4 +1,4 @@ -/* Copyright 2002-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +/* Copyright (c) 2002, 2011, 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 @@ -11,7 +11,7 @@ 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 */ + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */ #include "sql_priv.h" @@ -1217,7 +1217,8 @@ sp_head::execute(THD *thd, bool merge_da_on_success) String old_packet; Reprepare_observer *save_reprepare_observer= thd->m_reprepare_observer; Object_creation_ctx *saved_creation_ctx; - Warning_info *saved_warning_info, warning_info(thd->warning_info->warn_id()); + Warning_info *saved_warning_info; + Warning_info warning_info(thd->warning_info->warn_id(), false); /* Just reporting a stack overrun error diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 9c57b3c102d..a269d5a1eef 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc +/* Copyright (c) 2000, 2011, 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 @@ -2402,8 +2402,10 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, { table->field[next_field]->store(combo.plugin.str, combo.plugin.length, system_charset_info); + table->field[next_field]->set_notnull(); table->field[next_field + 1]->store(combo.auth.str, combo.auth.length, system_charset_info); + table->field[next_field + 1]->set_notnull(); } else { @@ -5982,18 +5984,15 @@ static int handle_grant_table(TABLE_LIST *tables, uint table_no, bool drop, } -/* +/** Handle an in-memory privilege structure. - SYNOPSIS - handle_grant_struct() - struct_no The number of the structure to handle (0..3). - drop If user_from is to be dropped. - user_from The the user to be searched/dropped/renamed. - user_to The new name for the user if to be renamed, - NULL otherwise. + @param struct_no The number of the structure to handle (0..5). + @param drop If user_from is to be dropped. + @param user_from The the user to be searched/dropped/renamed. + @param user_to The new name for the user if to be renamed, NULL otherwise. - DESCRIPTION + @note Scan through all elements in an in-memory grant structure and apply the requested operation. Delete from grant structure if drop is true. @@ -6003,12 +6002,13 @@ static int handle_grant_table(TABLE_LIST *tables, uint table_no, bool drop, 0 acl_users 1 acl_dbs 2 column_priv_hash - 3 procs_priv_hash + 3 proc_priv_hash + 4 func_priv_hash + 5 acl_proxy_users - RETURN - > 0 At least one element matched. - 0 OK, but no element matched. - -1 Wrong arguments to function + @retval > 0 At least one element matched. + @retval 0 OK, but no element matched. + @retval -1 Wrong arguments to function. */ static int handle_grant_struct(uint struct_no, bool drop, @@ -6023,6 +6023,7 @@ static int handle_grant_struct(uint struct_no, bool drop, ACL_DB *acl_db= NULL; ACL_PROXY_USER *acl_proxy_user= NULL; GRANT_NAME *grant_name= NULL; + HASH *grant_name_hash= NULL; DBUG_ENTER("handle_grant_struct"); DBUG_PRINT("info",("scan struct: %u search: '%s'@'%s'", struct_no, user_from->user.str, user_from->host.str)); @@ -6042,9 +6043,15 @@ static int handle_grant_struct(uint struct_no, bool drop, break; case 2: elements= column_priv_hash.records; + grant_name_hash= &column_priv_hash; break; case 3: elements= proc_priv_hash.records; + grant_name_hash= &proc_priv_hash; + break; + case 4: + elements= func_priv_hash.records; + grant_name_hash= &func_priv_hash; break; case 5: elements= acl_proxy_users.elements; @@ -6077,21 +6084,19 @@ static int handle_grant_struct(uint struct_no, bool drop, break; case 2: - grant_name= (GRANT_NAME*) my_hash_element(&column_priv_hash, idx); - user= grant_name->user; - host= grant_name->host.hostname; - break; - case 3: - grant_name= (GRANT_NAME*) my_hash_element(&proc_priv_hash, idx); + case 4: + grant_name= (GRANT_NAME*) my_hash_element(grant_name_hash, idx); user= grant_name->user; host= grant_name->host.hostname; break; + case 5: acl_proxy_user= dynamic_element(&acl_proxy_users, idx, ACL_PROXY_USER*); user= acl_proxy_user->get_user(); host= acl_proxy_user->get_host(); break; + default: MY_ASSERT_UNREACHABLE(); } @@ -6121,11 +6126,9 @@ static int handle_grant_struct(uint struct_no, bool drop, break; case 2: - my_hash_delete(&column_priv_hash, (uchar*) grant_name); - break; - case 3: - my_hash_delete(&proc_priv_hash, (uchar*) grant_name); + case 4: + my_hash_delete(grant_name_hash, (uchar*) grant_name); break; case 5: @@ -6134,6 +6137,19 @@ static int handle_grant_struct(uint struct_no, bool drop, } elements--; + /* + - If we are iterating through an array then we just have moved all + elements after the current element one position closer to its head. + This means that we have to take another look at the element at + current position as it is a new element from the array's tail. + - If we are iterating through a hash the current element was replaced + with one of elements from the tail. So we also have to take a look + at the new element in current position. + Note that in our HASH implementation hash_delete() won't move any + elements with position after current one to position before the + current (i.e. from the tail to the head), so it is safe to continue + iteration without re-starting. + */ idx--; } else if ( user_to ) @@ -6151,22 +6167,41 @@ static int handle_grant_struct(uint struct_no, bool drop, case 2: case 3: - /* - Update the grant structure with the new user name and - host name - */ - grant_name->set_user_details(user_to->host.str, grant_name->db, - user_to->user.str, grant_name->tname, - TRUE); - - /* - Since username is part of the hash key, when the user name - is renamed, the hash key is changed. Update the hash to - ensure that the position matches the new hash key value - */ - my_hash_update(&column_priv_hash, (uchar*) grant_name, - (uchar*) grant_name->hash_key, grant_name->key_length); - break; + case 4: + { + /* + Save old hash key and its length to be able properly update + element position in hash. + */ + char *old_key= grant_name->hash_key; + size_t old_key_length= grant_name->key_length; + + /* + Update the grant structure with the new user name and host name. + */ + grant_name->set_user_details(user_to->host.str, grant_name->db, + user_to->user.str, grant_name->tname, + TRUE); + + /* + Since username is part of the hash key, when the user name + is renamed, the hash key is changed. Update the hash to + ensure that the position matches the new hash key value + */ + my_hash_update(grant_name_hash, (uchar*) grant_name, (uchar*) old_key, + old_key_length); + /* + hash_update() operation could have moved element from the tail + of the hash to the current position. So we need to take a look + at the element in current position once again. + Thanks to the fact that hash_update() for our HASH implementation + won't move any elements from the tail of the hash to the positions + before the current one (a.k.a. head) it is safe to continue + iteration without restarting. + */ + idx--; + break; + } case 5: acl_proxy_user->set_user (&mem, user_to->user.str); @@ -6258,7 +6293,7 @@ static int handle_grant_data(TABLE_LIST *tables, bool drop, } } - /* Handle procedures table. */ + /* Handle stored routines table. */ if ((found= handle_grant_table(tables, 4, drop, user_from, user_to)) < 0) { /* Handle of table failed, don't touch in-memory array. */ @@ -6275,6 +6310,15 @@ static int handle_grant_data(TABLE_LIST *tables, bool drop, if (! drop && ! user_to) goto end; } + /* Handle funcs array. */ + if (((handle_grant_struct(4, drop, user_from, user_to) && ! result) || + found) && ! result) + { + result= 1; /* At least one record/element found. */ + /* If search is requested, we do not need to search further. */ + if (! drop && ! user_to) + goto end; + } } /* Handle tables table. */ diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc index eb6853751ee..575991211e6 100644 --- a/sql/sql_admin.cc +++ b/sql/sql_admin.cc @@ -263,7 +263,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, const char *operator_name, thr_lock_type lock_type, bool open_for_modify, - bool no_warnings_for_error, + bool repair_table_use_frm, uint extra_open_options, int (*prepare_func)(THD *, TABLE_LIST *, HA_CHECK_OPT *), @@ -331,18 +331,43 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, lex->query_tables= table; lex->query_tables_last= &table->next_global; lex->query_tables_own_last= 0; - /* - Under locked tables, we know that the table can be opened, - so any errors opening the table are logical errors. - In these cases it makes sense to report them. - */ - if (!thd->locked_tables_mode) - thd->no_warnings_for_error= no_warnings_for_error; + if (view_operator_func == NULL) table->required_type=FRMTYPE_TABLE; - open_error= open_and_lock_tables(thd, table, TRUE, 0); - thd->no_warnings_for_error= 0; + if (!thd->locked_tables_mode && repair_table_use_frm) + { + /* + If we're not under LOCK TABLES and we're executing REPAIR TABLE + USE_FRM, we need to ignore errors from open_and_lock_tables(). + REPAIR TABLE USE_FRM is a heavy weapon used when a table is + critically damaged, so open_and_lock_tables() will most likely + report errors. Those errors are not interesting for the user + because it's already known that the table is badly damaged. + */ + + Warning_info wi(thd->query_id, false); + Warning_info *wi_saved= thd->warning_info; + + thd->warning_info= &wi; + + open_error= open_and_lock_tables(thd, table, TRUE, 0); + + thd->warning_info= wi_saved; + } + else + { + /* + It's assumed that even if it is REPAIR TABLE USE_FRM, the table + can be opened if we're under LOCK TABLES (otherwise LOCK TABLES + would fail). Thus, the only errors we could have from + open_and_lock_tables() are logical ones, like incorrect locking + mode. It does make sense for the user to see such errors. + */ + + open_error= open_and_lock_tables(thd, table, TRUE, 0); + } + table->next_global= save_next_global; table->next_local= save_next_local; thd->open_options&= ~extra_open_options; @@ -771,8 +796,12 @@ send_result_message: size_t length; protocol->store(STRING_WITH_LEN("error"), system_charset_info); - length=my_snprintf(buf, sizeof(buf), ER(ER_TABLE_NEEDS_UPGRADE), - table->table_name); + if (table->table->file->ha_table_flags() & HA_CAN_REPAIR) + length= my_snprintf(buf, sizeof(buf), ER(ER_TABLE_NEEDS_UPGRADE), + table->table_name); + else + length= my_snprintf(buf, sizeof(buf), ER(ER_TABLE_NEEDS_REBUILD), + table->table_name); protocol->store(buf, length, system_charset_info); fatal_error=1; break; diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index e3c0ed28052..b070768a7b6 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -242,7 +242,7 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len) if (str == end) { info->is_float = 1; // we can't use variable decimals here - return 1; + DBUG_RETURN(1); } DBUG_RETURN(0); } diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 8b6cc2caf10..628e3b49719 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1026,7 +1026,7 @@ bool close_cached_tables(THD *thd, TABLE_LIST *tables, table_list= table_list->next_global) { /* A check that the table was locked for write is done by the caller. */ - TABLE *table= find_table_for_mdl_upgrade(thd->open_tables, table_list->db, + TABLE *table= find_table_for_mdl_upgrade(thd, table_list->db, table_list->table_name, TRUE); /* May return NULL if this table has already been closed via an alias. */ @@ -3120,22 +3120,26 @@ TABLE *find_locked_table(TABLE *list, const char *db, const char *table_name) lock from the list of open tables, emit error if no such table found. - @param list List of TABLE objects to be searched + @param thd Thread context @param db Database name. @param table_name Name of table. @param no_error Don't emit error if no suitable TABLE instance were found. + @note This function checks if the connection holds a global IX + metadata lock. If no such lock is found, it is not safe to + upgrade the lock and ER_TABLE_NOT_LOCKED_FOR_WRITE will be + reported. + @return Pointer to TABLE instance with MDL_SHARED_NO_WRITE, MDL_SHARED_NO_READ_WRITE, or MDL_EXCLUSIVE metadata lock, NULL otherwise. */ -TABLE *find_table_for_mdl_upgrade(TABLE *list, const char *db, - const char *table_name, - bool no_error) +TABLE *find_table_for_mdl_upgrade(THD *thd, const char *db, + const char *table_name, bool no_error) { - TABLE *tab= find_locked_table(list, db, table_name); + TABLE *tab= find_locked_table(thd->open_tables, db, table_name); if (!tab) { @@ -3143,19 +3147,29 @@ TABLE *find_table_for_mdl_upgrade(TABLE *list, const char *db, my_error(ER_TABLE_NOT_LOCKED, MYF(0), table_name); return NULL; } - else + + /* + It is not safe to upgrade the metadata lock without a global IX lock. + This can happen with FLUSH TABLES <list> WITH READ LOCK as we in these + cases don't take a global IX lock in order to be compatible with + global read lock. + */ + if (!thd->mdl_context.is_lock_owner(MDL_key::GLOBAL, "", "", + MDL_INTENTION_EXCLUSIVE)) { - while (tab->mdl_ticket != NULL && - !tab->mdl_ticket->is_upgradable_or_exclusive() && - (tab= find_locked_table(tab->next, db, table_name))) - continue; - if (!tab) - { - if (!no_error) - my_error(ER_TABLE_NOT_LOCKED_FOR_WRITE, MYF(0), table_name); - return 0; - } + if (!no_error) + my_error(ER_TABLE_NOT_LOCKED_FOR_WRITE, MYF(0), table_name); + return NULL; } + + while (tab->mdl_ticket != NULL && + !tab->mdl_ticket->is_upgradable_or_exclusive() && + (tab= find_locked_table(tab->next, db, table_name))) + continue; + + if (!tab && !no_error) + my_error(ER_TABLE_NOT_LOCKED_FOR_WRITE, MYF(0), table_name); + return tab; } @@ -4653,8 +4667,7 @@ open_tables_check_upgradable_mdl(THD *thd, TABLE_LIST *tables_start, Note that find_table_for_mdl_upgrade() will report an error if no suitable ticket is found. */ - if (!find_table_for_mdl_upgrade(thd->open_tables, table->db, - table->table_name, FALSE)) + if (!find_table_for_mdl_upgrade(thd, table->db, table->table_name, false)) return TRUE; } } @@ -4711,6 +4724,14 @@ bool open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags, bool has_prelocking_list; DBUG_ENTER("open_tables"); + /* Accessing data in XA_IDLE or XA_PREPARED is not allowed. */ + enum xa_states xa_state= thd->transaction.xid_state.xa_state; + if (*start && (xa_state == XA_IDLE || xa_state == XA_PREPARED)) + { + my_error(ER_XAER_RMFAIL, MYF(0), xa_state_names[xa_state]); + DBUG_RETURN(true); + } + /* temporary mem_root for new .frm parsing. TODO: variables for size diff --git a/sql/sql_base.h b/sql/sql_base.h index 35fa04b3674..dc8320687fc 100644 --- a/sql/sql_base.h +++ b/sql/sql_base.h @@ -1,4 +1,4 @@ -/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc. +/* Copyright (c) 2006, 2011, 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 @@ -290,7 +290,7 @@ bool tdc_open_view(THD *thd, TABLE_LIST *table_list, const char *alias, char *cache_key, uint cache_key_length, MEM_ROOT *mem_root, uint flags); void tdc_flush_unused_tables(); -TABLE *find_table_for_mdl_upgrade(TABLE *list, const char *db, +TABLE *find_table_for_mdl_upgrade(THD *thd, const char *db, const char *table_name, bool no_error); void mark_tmp_table_for_reuse(TABLE *table); diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 21aed554ace..dd245d6ccab 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc. +/* Copyright (c) 2000, 2011, 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 @@ -11,8 +11,7 @@ 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 */ - + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /***************************************************************************** ** @@ -768,7 +767,7 @@ THD::THD() #if defined(ENABLED_DEBUG_SYNC) debug_sync_control(0), #endif /* defined(ENABLED_DEBUG_SYNC) */ - main_warning_info(0) + main_warning_info(0, false) { ulong tmp; @@ -827,7 +826,7 @@ THD::THD() client_capabilities= 0; // minimalistic client ull=0; system_thread= NON_SYSTEM_THREAD; - cleanup_done= abort_on_warning= no_warnings_for_error= 0; + cleanup_done= abort_on_warning= 0; peer_port= 0; // For SHOW PROCESSLIST transaction.m_pending_rows_event= 0; transaction.on= 1; @@ -1100,10 +1099,6 @@ MYSQL_ERROR* THD::raise_condition(uint sql_errno, query_cache_abort(&query_cache_tls); - /* FIXME: broken special case */ - if (no_warnings_for_error && (level == MYSQL_ERROR::WARN_LEVEL_ERROR)) - DBUG_RETURN(NULL); - /* When simulating OOM, skip writing to error log to avoid mtr errors */ DBUG_EXECUTE_IF("simulate_out_of_memory", DBUG_RETURN(NULL);); diff --git a/sql/sql_class.h b/sql/sql_class.h index 7e63205018a..060f2ef77f5 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, 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 @@ -2089,7 +2089,6 @@ public: bool enable_slow_log; /* enable slow log for current statement */ bool abort_on_warning; bool got_warning; /* Set on call to push_warning() */ - bool no_warnings_for_error; /* no warnings on call to my_error() */ /* set during loop of derived table processing */ bool derived_tables_processing; my_bool tablespace_op; /* This is TRUE in DISCARD/IMPORT TABLESPACE */ @@ -2807,6 +2806,7 @@ private: /** The current internal error handler for this thread, or NULL. */ Internal_error_handler *m_internal_handler; + /** The lex to hold the parsed tree of conventional (non-prepared) queries. Whereas for prepared and stored procedure statements we use an own lex diff --git a/sql/sql_cursor.cc b/sql/sql_cursor.cc index f607936d5b9..aaf483f7a2f 100644 --- a/sql/sql_cursor.cc +++ b/sql/sql_cursor.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2005-2006 MySQL AB +/* Copyright (c) 2005, 2011, 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 @@ -46,7 +46,7 @@ class Materialized_cursor: public Server_side_cursor public: Materialized_cursor(select_result *result, TABLE *table); - int fill_item_list(THD *thd, List<Item> &send_result_set_metadata); + int send_result_set_metadata(THD *thd, List<Item> &send_result_set_metadata); virtual bool is_open() const { return table != 0; } virtual int open(JOIN *join __attribute__((unused))); virtual void fetch(ulong num_rows); @@ -133,7 +133,13 @@ int mysql_open_cursor(THD *thd, select_result *result, if (rc) { if (result_materialize->materialized_cursor) + { + /* Rollback metadata in the client-server protocol. */ + result_materialize->abort_result_set(); + delete result_materialize->materialized_cursor; + } + goto end; } @@ -142,6 +148,12 @@ int mysql_open_cursor(THD *thd, select_result *result, Materialized_cursor *materialized_cursor= result_materialize->materialized_cursor; + /* + NOTE: close_thread_tables() has been called in + mysql_execute_command(), so all tables except from the cursor + temporary table have been closed. + */ + if ((rc= materialized_cursor->open(0))) { delete materialized_cursor; @@ -202,14 +214,16 @@ Materialized_cursor::Materialized_cursor(select_result *result_arg, /** - Preserve the original metadata that would be sent to the client. + Preserve the original metadata to be sent to the client. + Initiate sending of the original metadata to the client + (call Protocol::send_result_set_metadata()). @param thd Thread identifier. @param send_result_set_metadata List of fields that would be sent. */ -int Materialized_cursor::fill_item_list(THD *thd, - List<Item> &send_result_set_metadata) +int Materialized_cursor::send_result_set_metadata( + THD *thd, List<Item> &send_result_set_metadata) { Query_arena backup_arena; int rc; @@ -241,6 +255,14 @@ int Materialized_cursor::fill_item_list(THD *thd, ident->db_name= thd->strdup(send_field.db_name); ident->table_name= thd->strdup(send_field.table_name); } + + /* + Original metadata result set should be sent here. After + mysql_execute_command() is finished, item_list can not be used for + sending metadata, because it references closed table. + */ + rc= result->send_result_set_metadata(item_list, Protocol::SEND_NUM_ROWS); + end: thd->restore_active_arena(this, &backup_arena); /* Check for thd->is_error() in case of OOM */ @@ -253,31 +275,29 @@ int Materialized_cursor::open(JOIN *join __attribute__((unused))) THD *thd= fake_unit.thd; int rc; Query_arena backup_arena; + thd->set_n_backup_active_arena(this, &backup_arena); - /* Create a list of fields and start sequential scan */ + + /* Create a list of fields and start sequential scan. */ + rc= result->prepare(item_list, &fake_unit); - if (!rc && !(rc= table->file->ha_rnd_init(TRUE))) - is_rnd_inited= 1; + rc= !rc && table->file->ha_rnd_init(TRUE); + is_rnd_inited= !rc; thd->restore_active_arena(this, &backup_arena); - if (rc == 0) + + /* Commit or rollback metadata in the client-server protocol. */ + + if (!rc) { - /* - Now send the result set metadata to the client. We need to - do it here, as in Select_materialize::send_result_set_metadata the items - for column types are not yet created (send_result_set_metadata requires - a list of items). The new types may differ from the original - ones sent at prepare if some of them were altered by MySQL - HEAP tables mechanism -- used when create_tmp_field_from_item - may alter the original column type. - - We can't simply supply SEND_EOF flag to send_result_set_metadata, because - send_result_set_metadata doesn't flush the network buffer. - */ - rc= result->send_result_set_metadata(item_list, Protocol::SEND_NUM_ROWS); thd->server_status|= SERVER_STATUS_CURSOR_EXISTS; result->send_eof(); } + else + { + result->abort_result_set(); + } + return rc; } @@ -370,13 +390,14 @@ bool Select_materialize::send_result_set_metadata(List<Item> &list, uint flags) materialized_cursor= new (&table->mem_root) Materialized_cursor(result, table); - if (! materialized_cursor) + if (!materialized_cursor) { free_tmp_table(table->in_use, table); table= 0; return TRUE; } - if (materialized_cursor->fill_item_list(unit->thd, list)) + + if (materialized_cursor->send_result_set_metadata(unit->thd, list)) { delete materialized_cursor; table= 0; diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 38f39ec0be7..035e992db1f 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc +/* Copyright (c) 2000, 2011, 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 @@ -833,12 +833,9 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) } thd->push_internal_handler(&err_handler); - if (thd->killed || - (tables && mysql_rm_table_no_locks(thd, tables, true, false, true, true))) - { - tables= NULL; - } - else + if (!thd->killed && + !(tables && + mysql_rm_table_no_locks(thd, tables, true, false, true, true))) { /* We temporarily disable the binary log while dropping the objects @@ -923,7 +920,7 @@ update_binlog: thd->server_status|= SERVER_STATUS_DB_DROPPED; my_ok(thd, deleted_tables); } - else if (mysql_bin_log.is_open()) + else if (mysql_bin_log.is_open() && !silent) { char *query, *query_pos, *query_end, *query_data_start; TABLE_LIST *tbl; @@ -938,6 +935,16 @@ update_binlog: for (tbl= tables; tbl; tbl= tbl->next_local) { uint tbl_name_len; + bool exists; + + // Only write drop table to the binlog for tables that no longer exist. + if (check_if_table_exists(thd, tbl, &exists)) + { + error= true; + goto exit; + } + if (exists) + continue; /* 3 for the quotes and the comma*/ tbl_name_len= strlen(tbl->table_name) + 3; @@ -1038,9 +1045,9 @@ static bool find_db_tables_and_rm_known_files(THD *thd, MY_DIR *dirp, } if (!(extension= strrchr(file->name, '.'))) extension= strend(file->name); - if (find_type(extension, &deletable_extentions,1+2) <= 0) + if (find_type(extension, &deletable_extentions, FIND_TYPE_NO_PREFIX) <= 0) { - if (find_type(extension, ha_known_exts(),1+2) <= 0) + if (find_type(extension, ha_known_exts(), FIND_TYPE_NO_PREFIX) <= 0) *found_other_files= true; continue; } diff --git a/sql/sql_error.cc b/sql/sql_error.cc index d0982b879e7..24516f03bee 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -1,5 +1,4 @@ -/* Copyright (C) 1995-2002 MySQL AB, - Copyright (C) 2008-2009 Sun Microsystems, Inc +/* Copyright (c) 1995, 2011, 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 @@ -458,10 +457,11 @@ Diagnostics_area::disable_status() m_status= DA_DISABLED; } -Warning_info::Warning_info(ulonglong warn_id_arg) +Warning_info::Warning_info(ulonglong warn_id_arg, bool allow_unlimited_warnings) :m_statement_warn_count(0), m_current_row_for_warning(1), m_warn_id(warn_id_arg), + m_allow_unlimited_warnings(allow_unlimited_warnings), m_read_only(FALSE) { /* Initialize sub structures */ @@ -543,7 +543,8 @@ MYSQL_ERROR *Warning_info::push_warning(THD *thd, if (! m_read_only) { - if (m_warn_list.elements < thd->variables.max_error_count) + if (m_allow_unlimited_warnings || + m_warn_list.elements < thd->variables.max_error_count) { cond= new (& m_warn_root) MYSQL_ERROR(& m_warn_root); if (cond) @@ -559,6 +560,20 @@ MYSQL_ERROR *Warning_info::push_warning(THD *thd, return cond; } +MYSQL_ERROR *Warning_info::push_warning(THD *thd, const MYSQL_ERROR *sql_condition) +{ + MYSQL_ERROR *new_condition= push_warning(thd, + sql_condition->get_sql_errno(), + sql_condition->get_sqlstate(), + sql_condition->get_level(), + sql_condition->get_message_text()); + + if (new_condition) + new_condition->copy_opt_attributes(sql_condition); + + return new_condition; +} + /* Push the warning to error list if there is still room in the list diff --git a/sql/sql_error.h b/sql/sql_error.h index 14dc5e6d12c..955b3767847 100644 --- a/sql/sql_error.h +++ b/sql/sql_error.h @@ -1,5 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB, - Copyright (C) 2008-2009 Sun Microsystems, Inc +/* Copyright (c) 2000, 2011, 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 @@ -12,7 +11,7 @@ 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 */ + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef SQL_ERROR_H #define SQL_ERROR_H @@ -323,10 +322,13 @@ class Warning_info { /** A memory root to allocate warnings and errors */ MEM_ROOT m_warn_root; + /** List of warnings of all severities (levels). */ List <MYSQL_ERROR> m_warn_list; + /** A break down of the number of warnings per severity (level). */ uint m_warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_END]; + /** The number of warnings of the current statement. Warning_info life cycle differs from statement life cycle -- it may span @@ -334,20 +336,25 @@ class Warning_info m_statement_warn_count 0, whereas m_warn_list is not empty. */ uint m_statement_warn_count; + /* Row counter, to print in errors and warnings. Not increased in create_sort_index(); may differ from examined_row_count. */ ulong m_current_row_for_warning; - /** Used to optionally clear warnings only once per statement. */ + + /** Used to optionally clear warnings only once per statement. */ ulonglong m_warn_id; + /** Indicates if push_warning() allows unlimited number of warnings. */ + bool m_allow_unlimited_warnings; + private: Warning_info(const Warning_info &rhs); /* Not implemented */ Warning_info& operator=(const Warning_info &rhs); /* Not implemented */ public: - Warning_info(ulonglong warn_id_arg); + Warning_info(ulonglong warn_id_arg, bool allow_unlimited_warnings); ~Warning_info(); /** @@ -384,19 +391,13 @@ public: void append_warnings(THD *thd, List<MYSQL_ERROR> *src) { MYSQL_ERROR *err; - MYSQL_ERROR *copy; List_iterator_fast<MYSQL_ERROR> it(*src); /* Don't use ::push_warning() to avoid invocation of condition handlers or escalation of warnings to errors. */ while ((err= it++)) - { - copy= Warning_info::push_warning(thd, err->get_sql_errno(), err->get_sqlstate(), - err->get_level(), err->get_message_text()); - if (copy) - copy->copy_opt_attributes(err); - } + Warning_info::push_warning(thd, err); } /** @@ -462,6 +463,9 @@ public: MYSQL_ERROR::enum_warning_level level, const char* msg); + /** Add a new condition to the current list. */ + MYSQL_ERROR *push_warning(THD *thd, const MYSQL_ERROR *sql_condition); + /** Set the read only status for this statement area. This is a privileged operation, reserved for the implementation of diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index b5cd3ac9e9a..cd40af5a46d 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2004 MySQL AB, 2008-2009 Sun Microsystems, Inc +/* Copyright (c) 2000, 2011, 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 @@ -613,7 +613,8 @@ retry: if (keyname) { - if ((keyno=find_type(keyname, &table->s->keynames, 1+2)-1)<0) + if ((keyno= find_type(keyname, &table->s->keynames, + FIND_TYPE_NO_PREFIX) - 1) < 0) { my_error(ER_KEY_DOES_NOT_EXITS, MYF(0), keyname, tables->alias); goto err; diff --git a/sql/sql_help.cc b/sql/sql_help.cc index 7d106fbe936..858205f8da6 100644 --- a/sql/sql_help.cc +++ b/sql/sql_help.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, 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 @@ -284,10 +284,12 @@ int get_topics_for_keyword(THD *thd, TABLE *topics, TABLE *relations, Field *rtopic_id, *rkey_id; DBUG_ENTER("get_topics_for_keyword"); - if ((iindex_topic= find_type((char*) primary_key_name, - &topics->s->keynames, 1+2)-1)<0 || - (iindex_relations= find_type((char*) primary_key_name, - &relations->s->keynames, 1+2)-1)<0) + if ((iindex_topic= + find_type(primary_key_name, &topics->s->keynames, + FIND_TYPE_NO_PREFIX) - 1) < 0 || + (iindex_relations= + find_type(primary_key_name, &relations->s->keynames, + FIND_TYPE_NO_PREFIX) - 1) < 0) { my_message(ER_CORRUPT_HELP_DB, ER(ER_CORRUPT_HELP_DB), MYF(0)); DBUG_RETURN(-1); diff --git a/sql/sql_lex.h b/sql/sql_lex.h index a9abe174d6e..e6b5f23f17e 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -944,20 +944,19 @@ inline bool st_select_lex_unit::is_union () #define ALTER_CHANGE_COLUMN_DEFAULT (1L << 8) #define ALTER_KEYS_ONOFF (1L << 9) #define ALTER_CONVERT (1L << 10) -#define ALTER_FORCE (1L << 11) -#define ALTER_RECREATE (1L << 12) -#define ALTER_ADD_PARTITION (1L << 13) -#define ALTER_DROP_PARTITION (1L << 14) -#define ALTER_COALESCE_PARTITION (1L << 15) -#define ALTER_REORGANIZE_PARTITION (1L << 16) -#define ALTER_PARTITION (1L << 17) -#define ALTER_ADMIN_PARTITION (1L << 18) -#define ALTER_TABLE_REORG (1L << 19) -#define ALTER_REBUILD_PARTITION (1L << 20) -#define ALTER_ALL_PARTITION (1L << 21) -#define ALTER_REMOVE_PARTITIONING (1L << 22) -#define ALTER_FOREIGN_KEY (1L << 23) -#define ALTER_TRUNCATE_PARTITION (1L << 24) +#define ALTER_RECREATE (1L << 11) +#define ALTER_ADD_PARTITION (1L << 12) +#define ALTER_DROP_PARTITION (1L << 13) +#define ALTER_COALESCE_PARTITION (1L << 14) +#define ALTER_REORGANIZE_PARTITION (1L << 15) +#define ALTER_PARTITION (1L << 16) +#define ALTER_ADMIN_PARTITION (1L << 17) +#define ALTER_TABLE_REORG (1L << 18) +#define ALTER_REBUILD_PARTITION (1L << 19) +#define ALTER_ALL_PARTITION (1L << 20) +#define ALTER_REMOVE_PARTITIONING (1L << 21) +#define ALTER_FOREIGN_KEY (1L << 22) +#define ALTER_TRUNCATE_PARTITION (1L << 23) enum enum_alter_table_change_level { diff --git a/sql/sql_load.cc b/sql/sql_load.cc index a2d443fbbc8..0589488d850 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -1337,7 +1337,7 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, CHARSET_INFO *cs, /* Set of a stack for unget if long terminators */ - uint length=max(field_term_length,line_term_length)+1; + uint length= max(cs->mbmaxlen, max(field_term_length, line_term_length)) + 1; set_if_bigger(length,line_start.length()); stack=stack_pos=(int*) sql_alloc(sizeof(int)*length); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index d9e1245bf66..d9d99de2911 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, 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 @@ -4439,7 +4439,11 @@ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables) char buff[1024]; String str(buff,(uint32) sizeof(buff), system_charset_info); str.length(0); - thd->lex->unit.print(&str, QT_ORDINARY); + /* + The warnings system requires input in utf8, @see + mysqld_show_warnings(). + */ + thd->lex->unit.print(&str, QT_TO_SYSTEM_CHARSET); str.append('\0'); push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, ER_YES, str.ptr()); @@ -7219,10 +7223,20 @@ bool parse_sql(THD *thd, bool mysql_parse_status= MYSQLparse(thd) != 0; - /* Check that if MYSQLparse() failed, thd->is_error() is set. */ + /* + Check that if MYSQLparse() failed either thd->is_error() is set, or an + internal error handler is set. + + The assert will not catch a situation where parsing fails without an + error reported if an error handler exists. The problem is that the + error handler might have intercepted the error, so thd->is_error() is + not set. However, there is no way to be 100% sure here (the error + handler might be for other errors than parsing one). + */ DBUG_ASSERT(!mysql_parse_status || - (mysql_parse_status && thd->is_error())); + (mysql_parse_status && thd->is_error()) || + (mysql_parse_status && thd->get_internal_handler())); /* Reset parser state. */ diff --git a/sql/sql_plist.h b/sql/sql_plist.h index db85266be15..b71136cd9ab 100644 --- a/sql/sql_plist.h +++ b/sql/sql_plist.h @@ -95,6 +95,7 @@ public: *last= a; *B::prev_ptr(a)= last; I::set_last(B::next_ptr(a)); + C::inc(); } inline void insert_after(T *pos, T *a) { @@ -112,6 +113,7 @@ public: } else I::set_last(B::next_ptr(a)); + C::inc(); } } inline void remove(T *a) @@ -188,6 +190,20 @@ public: /** + Hook class which via its methods specifies which members + of T should be used for participating in a intrusive list. +*/ + +template <typename T, T* T::*next, T** T::*prev> +struct I_P_List_adapter +{ + static inline T **next_ptr(T *el) { return &(el->*next); } + + static inline T ***prev_ptr(T *el) { return &(el->*prev); } +}; + + +/** Element counting policy class for I_P_List to be used in cases when no element counting should be done. */ diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 31adbe5db36..dd16bda60ec 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2002, 2011, 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 @@ -2784,6 +2784,7 @@ void mysql_sql_stmt_close(THD *thd) } } + /** Handle long data in pieces from client. @@ -2840,16 +2841,26 @@ void mysql_stmt_get_longdata(THD *thd, char *packet, ulong packet_length) param= stmt->param_array[param_number]; + Diagnostics_area new_stmt_da, *save_stmt_da= thd->stmt_da; + Warning_info new_warnning_info(thd->query_id, false); + Warning_info *save_warinig_info= thd->warning_info; + + thd->stmt_da= &new_stmt_da; + thd->warning_info= &new_warnning_info; + #ifndef EMBEDDED_LIBRARY - if (param->set_longdata(packet, (ulong) (packet_end - packet))) + param->set_longdata(packet, (ulong) (packet_end - packet)); #else - if (param->set_longdata(thd->extra_data, thd->extra_length)) + param->set_longdata(thd->extra_data, thd->extra_length); #endif + if (thd->stmt_da->is_error()) { stmt->state= Query_arena::STMT_ERROR; - stmt->last_errno= ER_OUTOFMEMORY; - sprintf(stmt->last_error, ER(ER_OUTOFMEMORY), 0); + stmt->last_errno= thd->stmt_da->sql_errno(); + strncpy(stmt->last_error, thd->stmt_da->message(), MYSQL_ERRMSG_SIZE); } + thd->stmt_da= save_stmt_da; + thd->warning_info= save_warinig_info; general_log_print(thd, thd->command, NullS); @@ -3389,6 +3400,13 @@ Prepared_statement::execute_loop(String *expanded_query, bool error; int reprepare_attempt= 0; + /* Check if we got an error when sending long data */ + if (state == Query_arena::ERROR) + { + my_message(last_errno, last_error, MYF(0)); + return TRUE; + } + if (set_parameters(expanded_query, packet, packet_end)) return TRUE; @@ -3656,12 +3674,6 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor) status_var_increment(thd->status_var.com_stmt_execute); - /* Check if we got an error when sending long data */ - if (state == Query_arena::STMT_ERROR) - { - my_message(last_errno, last_error, MYF(0)); - return TRUE; - } if (flags & (uint) IS_IN_USE) { my_error(ER_PS_NO_RECURSION, MYF(0)); @@ -3889,7 +3901,7 @@ Ed_result_set::Ed_result_set(List<Ed_row> *rows_arg, */ Ed_connection::Ed_connection(THD *thd) - :m_warning_info(thd->query_id), + :m_warning_info(thd->query_id, false), m_thd(thd), m_rsets(0), m_current_rset(0) diff --git a/sql/sql_reload.cc b/sql/sql_reload.cc index 0810459cb49..a09aa5511bd 100644 --- a/sql/sql_reload.cc +++ b/sql/sql_reload.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2011, 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 @@ -220,12 +220,26 @@ bool reload_acl_and_cache(THD *thd, unsigned long options, if (tables) { for (TABLE_LIST *t= tables; t; t= t->next_local) - if (!find_table_for_mdl_upgrade(thd->open_tables, t->db, - t->table_name, FALSE)) + if (!find_table_for_mdl_upgrade(thd, t->db, t->table_name, false)) return 1; } else { + /* + It is not safe to upgrade the metadata lock without GLOBAL IX lock. + This can happen with FLUSH TABLES <list> WITH READ LOCK as we in these + cases don't take a GLOBAL IX lock in order to be compatible with + global read lock. + */ + if (thd->open_tables && + !thd->mdl_context.is_lock_owner(MDL_key::GLOBAL, "", "", + MDL_INTENTION_EXCLUSIVE)) + { + my_error(ER_TABLE_NOT_LOCKED_FOR_WRITE, MYF(0), + thd->open_tables->s->table_name.str); + return true; + } + for (TABLE *tab= thd->open_tables; tab; tab= tab->next) { if (! tab->mdl_ticket->is_upgradable_or_exclusive()) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 3173b6c1a0e..7334b03f076 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -991,7 +991,7 @@ JOIN::optimize() If all items were resolved by opt_sum_query, there is no need to open any tables. */ - if ((res=opt_sum_query(select_lex->leaf_tables, all_fields, conds))) + if ((res=opt_sum_query(thd, select_lex->leaf_tables, all_fields, conds))) { if (res == HA_ERR_KEY_NOT_FOUND) { @@ -1972,7 +1972,11 @@ JOIN::exec() if (!curr_join->sort_and_group && curr_join->const_tables != curr_join->tables) curr_join->join_tab[curr_join->const_tables].sorted= 0; - if ((tmp_error= do_select(curr_join, (List<Item> *) 0, curr_tmp_table, 0))) + + Procedure *save_proc= curr_join->procedure; + tmp_error= do_select(curr_join, (List<Item> *) 0, curr_tmp_table, 0); + curr_join->procedure= save_proc; + if (tmp_error) { error= tmp_error; DBUG_VOID_RETURN; @@ -12620,10 +12624,14 @@ end_send(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)), } if (join->having && join->having->val_int() == 0) DBUG_RETURN(NESTED_LOOP_OK); // Didn't match having - error=0; if (join->procedure) - error=join->procedure->send_row(join->procedure_fields_list); - else if (join->do_send_rows) + { + if (join->procedure->send_row(join->procedure_fields_list)) + DBUG_RETURN(NESTED_LOOP_ERROR); + DBUG_RETURN(NESTED_LOOP_OK); + } + error=0; + if (join->do_send_rows) error=join->result->send_data(*join->fields); if (error) DBUG_RETURN(NESTED_LOOP_ERROR); /* purecov: inspected */ diff --git a/sql/sql_select.h b/sql/sql_select.h index bdb9d1a315c..ea4a22527d3 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -619,7 +619,8 @@ bool is_indexed_agg_distinct(JOIN *join, List<Item_field> *out_args); /* functions from opt_sum.cc */ bool simple_pred(Item_func *func_item, Item **args, bool *inv_order); -int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds); +int opt_sum_query(THD* thd, + TABLE_LIST *tables, List<Item> &all_fields, COND *conds); /* from sql_delete.cc, used by opt_range.cc */ extern "C" int refpos_order_cmp(void* arg, const void *a,const void *b); diff --git a/sql/sql_show.cc b/sql/sql_show.cc index abef175ab55..9e9de5e3524 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1379,17 +1379,24 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet, if (!(thd->variables.sql_mode & MODE_NO_TABLE_OPTIONS) && !foreign_db_mode) { show_table_options= TRUE; - /* - Get possible table space definitions and append them - to the CREATE TABLE statement - */ - if ((for_str= file->get_tablespace_name(thd,0,0))) + /* TABLESPACE and STORAGE */ + if (share->tablespace || + share->default_storage_media != HA_SM_DEFAULT) { - packet->append(STRING_WITH_LEN(" /*!50100 TABLESPACE ")); - packet->append(for_str, strlen(for_str)); - packet->append(STRING_WITH_LEN(" STORAGE DISK */")); - my_free(for_str); + packet->append(STRING_WITH_LEN(" /*!50100")); + if (share->tablespace) + { + packet->append(STRING_WITH_LEN(" TABLESPACE ")); + packet->append(share->tablespace, strlen(share->tablespace)); + } + + if (share->default_storage_media == HA_SM_DISK) + packet->append(STRING_WITH_LEN(" STORAGE DISK")); + if (share->default_storage_media == HA_SM_MEMORY) + packet->append(STRING_WITH_LEN(" STORAGE MEMORY")); + + packet->append(STRING_WITH_LEN(" */")); } /* @@ -3409,6 +3416,45 @@ end: /** + Trigger_error_handler is intended to intercept and silence SQL conditions + that might happen during trigger loading for SHOW statements. + The potential SQL conditions are: + + - ER_PARSE_ERROR -- this error is thrown if a trigger definition file + is damaged or contains invalid CREATE TRIGGER statement. That should + not happen in normal life. + + - ER_TRG_NO_DEFINER -- this warning is thrown when we're loading a + trigger created/imported in/from the version of MySQL, which does not + support trigger definers. + + - ER_TRG_NO_CREATION_CTX -- this warning is thrown when we're loading a + trigger created/imported in/from the version of MySQL, which does not + support trigger creation contexts. +*/ + +class Trigger_error_handler : public Internal_error_handler +{ +public: + bool handle_condition(THD *thd, + uint sql_errno, + const char* sqlstate, + MYSQL_ERROR::enum_warning_level level, + const char* msg, + MYSQL_ERROR ** cond_hdl) + { + if (sql_errno == ER_PARSE_ERROR || + sql_errno == ER_TRG_NO_DEFINER || + sql_errno == ER_TRG_NO_CREATION_CTX) + return true; + + return false; + } +}; + + + +/** @brief Fill I_S tables whose data are retrieved from frm files and storage engine @@ -3549,6 +3595,12 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) it.rewind(); /* To get access to new elements in basis list */ while ((db_name= it++)) { + LEX_STRING orig_db_name; + + /* db_name can be changed in make_table_list() func */ + if (!thd->make_lex_string(&orig_db_name, db_name->str, + db_name->length, FALSE)) + goto err; #ifndef NO_EMBEDDED_ACCESS_CHECKS if (!(check_access(thd, SELECT_ACL, db_name->str, &thd->col_access, NULL, 0, 1) || @@ -3557,7 +3609,6 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) acl_get(sctx->host, sctx->ip, sctx->priv_user, db_name->str, 0)) #endif { - thd->no_warnings_for_error= 1; List<LEX_STRING> table_names; int res= make_table_name_list(thd, &table_names, lex, &lookup_field_vals, @@ -3606,24 +3657,34 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) if (!(table_open_method & ~OPEN_FRM_ONLY) && !with_i_schema) { - if (!fill_schema_table_from_frm(thd, tables, schema_table, db_name, - table_name, schema_table_idx, - can_deadlock)) + /* + Here we need to filter out warnings, which can happen + during loading of triggers in fill_schema_table_from_frm(), + because we don't need those warnings to pollute output of + SELECT from I_S / SHOW-statements. + */ + + Trigger_error_handler err_handler; + thd->push_internal_handler(&err_handler); + + int res= fill_schema_table_from_frm(thd, tables, schema_table, + db_name, table_name, + schema_table_idx, + can_deadlock); + + thd->pop_internal_handler(); + + if (!res) continue; } int res; - LEX_STRING tmp_lex_string, orig_db_name; + LEX_STRING tmp_lex_string; /* Set the parent lex of 'sel' because it is needed by sel.init_query() which is called inside make_table_list. */ - thd->no_warnings_for_error= 1; sel.parent_lex= lex; - /* db_name can be changed in make_table_list() func */ - if (!thd->make_lex_string(&orig_db_name, db_name->str, - db_name->length, FALSE)) - goto err; if (make_table_list(thd, &sel, db_name, table_name)) goto err; TABLE_LIST *show_table_list= sel.table_list.first; @@ -5496,12 +5557,9 @@ static void store_schema_partitions_record(THD *thd, TABLE *schema_table, strlen(part_elem->tablespace_name), cs); else { - char *ts= showing_table->file->get_tablespace_name(thd,0,0); + char *ts= showing_table->s->tablespace; if(ts) - { table->field[24]->store(ts, strlen(ts), cs); - my_free(ts); - } else table->field[24]->set_null(); } @@ -6669,6 +6727,92 @@ int make_schema_select(THD *thd, SELECT_LEX *sel, } +/** + Fill INFORMATION_SCHEMA-table, leave correct Diagnostics_area / + Warning_info state after itself. + + This function is a wrapper around ST_SCHEMA_TABLE::fill_table(), which + may "partially silence" some errors. The thing is that during + fill_table() many errors might be emitted. These errors stem from the + nature of fill_table(). + + For example, SELECT ... FROM INFORMATION_SCHEMA.xxx WHERE TABLE_NAME = 'xxx' + results in a number of 'Table <db name>.xxx does not exist' errors, + because fill_table() tries to open the 'xxx' table in every possible + database. + + Those errors are cleared (the error status is cleared from + Diagnostics_area) inside fill_table(), but they remain in Warning_info + (Warning_info is not cleared because it may contain useful warnings). + + This function is responsible for making sure that Warning_info does not + contain warnings corresponding to the cleared errors. + + @note: THD::no_warnings_for_error used to be set before calling + fill_table(), thus those errors didn't go to Warning_info. This is not + the case now (THD::no_warnings_for_error was eliminated as a hack), so we + need to take care of those warnings here. + + @param thd Thread context. + @param table_list I_S table. + @param join_table JOIN/SELECT table. + + @return Error status. + @retval TRUE Error. + @retval FALSE Success. +*/ +static bool do_fill_table(THD *thd, + TABLE_LIST *table_list, + JOIN_TAB *join_table) +{ + // NOTE: fill_table() may generate many "useless" warnings, which will be + // ignored afterwards. On the other hand, there might be "useful" + // warnings, which should be presented to the user. Warning_info usually + // stores no more than THD::variables.max_error_count warnings. + // The problem is that "useless warnings" may occupy all the slots in the + // Warning_info, so "useful warnings" get rejected. In order to avoid + // that problem we create a Warning_info instance, which is capable of + // storing "unlimited" number of warnings. + Warning_info wi(thd->query_id, true); + Warning_info *wi_saved= thd->warning_info; + + thd->warning_info= &wi; + + bool res= table_list->schema_table->fill_table( + thd, table_list, join_table->select_cond); + + thd->warning_info= wi_saved; + + // Pass an error if any. + + if (thd->stmt_da->is_error()) + { + thd->warning_info->push_warning(thd, + thd->stmt_da->sql_errno(), + thd->stmt_da->get_sqlstate(), + MYSQL_ERROR::WARN_LEVEL_ERROR, + thd->stmt_da->message()); + } + + // Pass warnings (if any). + // + // Filter out warnings with WARN_LEVEL_ERROR level, because they + // correspond to the errors which were filtered out in fill_table(). + + + List_iterator_fast<MYSQL_ERROR> it(wi.warn_list()); + MYSQL_ERROR *err; + + while ((err= it++)) + { + if (err->get_level() != MYSQL_ERROR::WARN_LEVEL_ERROR) + thd->warning_info->push_warning(thd, err); + } + + return res; +} + + /* Fill temporary schema tables before SELECT @@ -6691,7 +6835,6 @@ bool get_schema_tables_result(JOIN *join, bool result= 0; DBUG_ENTER("get_schema_tables_result"); - thd->no_warnings_for_error= 1; for (JOIN_TAB *tab= join->join_tab; tab < tmp_join_tab; tab++) { if (!tab->table || !tab->table->pos_in_table_list) @@ -6742,8 +6885,7 @@ bool get_schema_tables_result(JOIN *join, else table_list->table->file->stats.records= 0; - if (table_list->schema_table->fill_table(thd, table_list, - tab->select_cond)) + if (do_fill_table(thd, table_list, tab)) { result= 1; join->error= 1; @@ -6755,7 +6897,6 @@ bool get_schema_tables_result(JOIN *join, table_list->schema_table_state= executed_place; } } - thd->no_warnings_for_error= 0; DBUG_RETURN(result); } diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 2855bb0ec4a..f98ac676525 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1917,7 +1917,7 @@ bool mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists, by parser) it is safe to cache pointer to the TABLE instances in its elements. */ - table->table= find_table_for_mdl_upgrade(thd->open_tables, table->db, + table->table= find_table_for_mdl_upgrade(thd, table->db, table->table_name, false); if (!table->table) DBUG_RETURN(true); @@ -5281,17 +5281,12 @@ mysql_prepare_alter_table(THD *thd, TABLE *table, if (!(used_fields & HA_CREATE_USED_KEY_BLOCK_SIZE)) create_info->key_block_size= table->s->key_block_size; - if (!create_info->tablespace && create_info->storage_media != HA_SM_MEMORY) - { - char *tablespace= static_cast<char *>(thd->alloc(FN_LEN + 1)); - /* - Regular alter table of disk stored table (no tablespace/storage change) - Copy tablespace name - */ - if (tablespace && - (table->file->get_tablespace_name(thd, tablespace, FN_LEN))) - create_info->tablespace= tablespace; - } + if (!create_info->tablespace) + create_info->tablespace= table->s->tablespace; + + if (create_info->storage_media == HA_SM_DEFAULT) + create_info->storage_media= table->s->default_storage_media; + restore_record(table, s->default_values); // Empty record for DEFAULT Create_field *def; @@ -6665,15 +6660,15 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, NO need to tamper with MERGE tables. The real open is done later. */ Open_table_context ot_ctx(thd, MYSQL_OPEN_REOPEN); - TABLE *t_table; + TABLE_LIST temp_table_list; + TABLE_LIST *t_table_list; if (new_name != table_name || new_db != db) { - table_list->alias= new_name; - table_list->table_name= new_name; - table_list->table_name_length= strlen(new_name); - table_list->db= new_db; - table_list->db_length= strlen(new_db); - table_list->mdl_request.ticket= target_mdl_request.ticket; + temp_table_list.init_one_table(new_db, strlen(new_db), + new_name, strlen(new_name), + new_name, TL_READ_NO_INSERT); + temp_table_list.mdl_request.ticket= target_mdl_request.ticket; + t_table_list= &temp_table_list; } else { @@ -6683,20 +6678,21 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, to request the lock. */ table_list->mdl_request.ticket= mdl_ticket; + t_table_list= table_list; } - if (open_table(thd, table_list, thd->mem_root, &ot_ctx)) + if (open_table(thd, t_table_list, thd->mem_root, &ot_ctx)) { goto err_with_mdl; } - t_table= table_list->table; /* Tell the handler that a new frm file is in place. */ - error= t_table->file->ha_create_handler_files(path, NULL, CHF_INDEX_FLAG, - create_info); + error= t_table_list->table->file->ha_create_handler_files(path, NULL, + CHF_INDEX_FLAG, + create_info); - DBUG_ASSERT(thd->open_tables == t_table); + DBUG_ASSERT(thd->open_tables == t_table_list->table); close_thread_table(thd, &thd->open_tables); - table_list->table= 0; + t_table_list->table= NULL; if (error) goto err_with_mdl; diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index c2e3cd9944a..d026714c007 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2005 MySQL AB, 2008-2009 Sun Microsystems, Inc +/* Copyright (c) 2004, 2011, 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 @@ -30,6 +30,7 @@ #include "sql_db.h" // get_default_db_collation #include "sql_acl.h" // *_ACL, is_acl_user #include "sql_handler.h" // mysql_ha_rm_tables +#include "sp_cache.h" // sp_invalidate_cache /*************************************************************************/ @@ -467,8 +468,7 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create) if (thd->locked_tables_mode) { /* Under LOCK TABLES we must only accept write locked tables. */ - if (!(tables->table= find_table_for_mdl_upgrade(thd->open_tables, - tables->db, + if (!(tables->table= find_table_for_mdl_upgrade(thd, tables->db, tables->table_name, FALSE))) goto end; @@ -518,6 +518,12 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create) */ thd->locked_tables_list.reopen_tables(thd); + /* + Invalidate SP-cache. That's needed because triggers may change list of + pre-locking tables. + */ + sp_cache_invalidate(); + end: if (!result) { @@ -1219,13 +1225,12 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db, DBUG_RETURN(1); // EOM } - - if (!thd->no_warnings_for_error) - push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, - ER_TRG_NO_CREATION_CTX, - ER(ER_TRG_NO_CREATION_CTX), - (const char*) db, - (const char*) table_name); + + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_TRG_NO_CREATION_CTX, + ER(ER_TRG_NO_CREATION_CTX), + (const char*) db, + (const char*) table_name); if (!(trg_client_cs_name= alloc_lex_string(&table->mem_root)) || !(trg_connection_cl_name= alloc_lex_string(&table->mem_root)) || @@ -1356,12 +1361,12 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db, MySQL, which does not support triggers definers. We should emit warning here. */ - if (!thd->no_warnings_for_error) - push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, - ER_TRG_NO_DEFINER, ER(ER_TRG_NO_DEFINER), - (const char*) db, - (const char*) sp->m_name.str); - + + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_TRG_NO_DEFINER, ER(ER_TRG_NO_DEFINER), + (const char*) db, + (const char*) sp->m_name.str); + /* Set definer to the '' to correct displaying in the information schema. diff --git a/sql/sql_truncate.cc b/sql/sql_truncate.cc index 909c6a08b67..67ed608f114 100644 --- a/sql/sql_truncate.cc +++ b/sql/sql_truncate.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2011, 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 @@ -327,7 +327,7 @@ bool Truncate_statement::lock_table(THD *thd, TABLE_LIST *table_ref, */ if (thd->locked_tables_mode) { - if (!(table= find_table_for_mdl_upgrade(thd->open_tables, table_ref->db, + if (!(table= find_table_for_mdl_upgrade(thd, table_ref->db, table_ref->table_name, FALSE))) DBUG_RETURN(TRUE); diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 17b8056a165..6051aa028c7 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -841,7 +841,8 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view, thd->variables.sql_mode&= ~MODE_ANSI_QUOTES; lex->unit.print(&view_query, QT_ORDINARY); - lex->unit.print(&is_query, QT_IS); + lex->unit.print(&is_query, + enum_query_type(QT_TO_SYSTEM_CHARSET | QT_WITHOUT_INTRODUCERS)); thd->variables.sql_mode|= sql_mode; } diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 02e0d347ef7..13a1b8029f2 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -6747,7 +6747,7 @@ alter_list_item: } | FORCE_SYM { - Lex->alter_info.flags|= ALTER_FORCE; + Lex->alter_info.flags|= ALTER_RECREATE; } | alter_order_clause { diff --git a/sql/strfunc.cc b/sql/strfunc.cc index a0e2f39f8dc..0c0742b3805 100644 --- a/sql/strfunc.cc +++ b/sql/strfunc.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2003 MySQL AB +/* Copyright (c) 2003, 2011, 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 @@ -96,7 +96,7 @@ ulonglong find_set(TYPELIB *lib, const char *str, uint length, CHARSET_INFO *cs, /* Function to find a string in a TYPELIB - (Same format as mysys/typelib.c) + (similar to find_type() of mysys/typelib.c) SYNOPSIS find_type() diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 612ce48de0b..ad7bf3fef2a 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -1030,13 +1030,32 @@ static bool session_readonly(sys_var *self, THD *thd, set_var *var) self->name.str, "GLOBAL"); return true; } + +static bool +check_max_allowed_packet(sys_var *self, THD *thd, set_var *var) +{ + longlong val; + if (session_readonly(self, thd, var)) + return true; + + val= var->save_result.ulonglong_value; + if (val < (longlong) global_system_variables.net_buffer_length) + { + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + WARN_OPTION_BELOW_LIMIT, ER(WARN_OPTION_BELOW_LIMIT), + "max_allowed_packet", "net_buffer_length"); + } + return false; +} + + static Sys_var_ulong Sys_max_allowed_packet( "max_allowed_packet", "Max packet length to send to or receive from the server", SESSION_VAR(max_allowed_packet), CMD_LINE(REQUIRED_ARG), VALID_RANGE(1024, 1024*1024*1024), DEFAULT(1024*1024), BLOCK_SIZE(1024), NO_MUTEX_GUARD, NOT_IN_BINLOG, - ON_CHECK(session_readonly)); + ON_CHECK(check_max_allowed_packet)); static Sys_var_ulonglong Sys_max_binlog_cache_size( "max_binlog_cache_size", @@ -1182,6 +1201,16 @@ static Sys_var_harows Sys_sql_max_join_size( NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(fix_max_join_size), DEPRECATED(70000, 0)); +static Sys_var_ulong Sys_max_long_data_size( + "max_long_data_size", + "The maximum BLOB length to send to server from " + "mysql_send_long_data API. Deprecated option; " + "use max_allowed_packet instead.", + READ_ONLY GLOBAL_VAR(max_long_data_size), + CMD_LINE(REQUIRED_ARG, OPT_MAX_LONG_DATA_SIZE), + VALID_RANGE(1024, UINT_MAX32), DEFAULT(1024*1024), + BLOCK_SIZE(1)); + static PolyLock_mutex PLock_prepared_stmt_count(&LOCK_prepared_stmt_count); static Sys_var_ulong Sys_max_prepared_stmt_count( "max_prepared_stmt_count", @@ -1257,12 +1286,29 @@ static Sys_var_mybool Sys_named_pipe( DEFAULT(FALSE)); #endif + +static bool +check_net_buffer_length(sys_var *self, THD *thd, set_var *var) +{ + longlong val; + if (session_readonly(self, thd, var)) + return true; + + val= var->save_result.ulonglong_value; + if (val > (longlong) global_system_variables.max_allowed_packet) + { + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + WARN_OPTION_BELOW_LIMIT, ER(WARN_OPTION_BELOW_LIMIT), + "max_allowed_packet", "net_buffer_length"); + } + return false; +} static Sys_var_ulong Sys_net_buffer_length( "net_buffer_length", "Buffer length for TCP/IP and socket communication", SESSION_VAR(net_buffer_length), CMD_LINE(REQUIRED_ARG), VALID_RANGE(1024, 1024*1024), DEFAULT(16384), BLOCK_SIZE(1024), - NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(session_readonly)); + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_net_buffer_length)); static bool fix_net_read_timeout(sys_var *self, THD *thd, enum_var_type type) { @@ -2756,7 +2802,7 @@ static Sys_var_charptr Sys_slow_log_path( ON_CHECK(check_log_path), ON_UPDATE(fix_slow_log_file)); /// @todo deprecate these four legacy have_PLUGIN variables and use I_S instead -export SHOW_COMP_OPTION have_csv, have_innodb; +export SHOW_COMP_OPTION have_csv, have_innodb= SHOW_OPTION_DISABLED; export SHOW_COMP_OPTION have_ndbcluster, have_partitioning; static Sys_var_have Sys_have_csv( "have_csv", "have_csv", diff --git a/sql/table.cc b/sql/table.cc index 4c7f0df624c..f66d754de53 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -750,6 +750,9 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, const char **interval_array; enum legacy_db_type legacy_db_type; my_bitmap_map *bitmaps; + uchar *extra_segment_buff= 0; + const uint format_section_header_size= 8; + uchar *format_section_fields= 0; DBUG_ENTER("open_binary_frm"); new_field_pack_flag= head[27]; @@ -942,27 +945,27 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, if ((n_length= uint4korr(head+55))) { /* Read extra data segment */ - uchar *buff, *next_chunk, *buff_end; + uchar *next_chunk, *buff_end; DBUG_PRINT("info", ("extra segment size is %u bytes", n_length)); - if (!(next_chunk= buff= (uchar*) my_malloc(n_length, MYF(MY_WME)))) + if (!(extra_segment_buff= (uchar*) my_malloc(n_length, MYF(MY_WME)))) goto err; - if (mysql_file_pread(file, buff, n_length, record_offset + share->reclength, + next_chunk= extra_segment_buff; + if (mysql_file_pread(file, extra_segment_buff, + n_length, record_offset + share->reclength, MYF(MY_NABP))) { - my_free(buff); goto err; } - share->connect_string.length= uint2korr(buff); + share->connect_string.length= uint2korr(next_chunk); if (!(share->connect_string.str= strmake_root(&share->mem_root, (char*) next_chunk + 2, share->connect_string. length))) { - my_free(buff); goto err; } next_chunk+= share->connect_string.length + 2; - buff_end= buff + n_length; + buff_end= extra_segment_buff + n_length; if (next_chunk + 2 < buff_end) { uint str_db_type_length= uint2korr(next_chunk); @@ -979,7 +982,6 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, plugin_data(tmp_plugin, handlerton *))) { /* bad file, legacy_db_type did not match the name */ - my_free(buff); goto err; } /* @@ -1009,7 +1011,6 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, error= 8; my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--skip-partition"); - my_free(buff); goto err; } plugin_unlock(NULL, share->db_plugin); @@ -1025,7 +1026,6 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, error= 8; name.str[name.length]=0; my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), name.str); - my_free(buff); goto err; /* purecov: end */ } @@ -1042,7 +1042,6 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, memdup_root(&share->mem_root, next_chunk + 4, partition_info_str_len + 1))) { - my_free(buff); goto err; } } @@ -1050,7 +1049,6 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, if (partition_info_str_len) { DBUG_PRINT("info", ("WITH_PARTITION_STORAGE_ENGINE is not defined")); - my_free(buff); goto err; } #endif @@ -1088,7 +1086,6 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, { DBUG_PRINT("error", ("fulltext key uses parser that is not defined in .frm")); - my_free(buff); goto err; } parser_name.str= (char*) next_chunk; @@ -1099,7 +1096,6 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, if (! keyinfo->parser) { my_error(ER_PLUGIN_IS_NOT_LOADED, MYF(0), parser_name.str); - my_free(buff); goto err; } } @@ -1111,19 +1107,68 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, { DBUG_PRINT("error", ("long table comment is not defined in .frm")); - my_free(buff); goto err; } share->comment.length = uint2korr(next_chunk); if (! (share->comment.str= strmake_root(&share->mem_root, (char*)next_chunk + 2, share->comment.length))) { - my_free(buff); goto err; } next_chunk+= 2 + share->comment.length; } - my_free(buff); + + if (next_chunk + format_section_header_size < buff_end) + { + /* + New extra data segment called "format section" with additional + table and column properties introduced by MySQL Cluster + based on 5.1.20 + + Table properties: + TABLESPACE <ts> and STORAGE [DISK|MEMORY] + + Column properties: + COLUMN_FORMAT [DYNAMIC|FIXED] and STORAGE [DISK|MEMORY] + */ + DBUG_PRINT("info", ("Found format section")); + + /* header */ + const uint format_section_length= uint2korr(next_chunk); + const uint format_section_flags= uint4korr(next_chunk+2); + /* 2 bytes unused */ + + if (next_chunk + format_section_length > buff_end) + { + DBUG_PRINT("error", ("format section length too long: %u", + format_section_length)); + goto err; + } + DBUG_PRINT("info", ("format_section_length: %u, format_section_flags: %u", + format_section_length, format_section_flags)); + + share->default_storage_media= + (enum ha_storage_media) (format_section_flags & 0x7); + + /* tablespace */ + const char *tablespace= + (const char*)next_chunk + format_section_header_size; + const uint tablespace_length= strlen(tablespace); + if (tablespace_length && + !(share->tablespace= strmake_root(&share->mem_root, + tablespace, tablespace_length+1))) + { + goto err; + } + DBUG_PRINT("info", ("tablespace: '%s'", + share->tablespace ? share->tablespace : "<null>")); + + /* pointer to format section for fields */ + format_section_fields= + next_chunk + format_section_header_size + tablespace_length + 1; + + next_chunk+= format_section_length; + } } share->key_block_size= uint2korr(head+62); @@ -1438,14 +1483,26 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, error= 8; goto err; } + + if (format_section_fields) + { + const uchar field_flags= format_section_fields[i]; + const uchar field_storage= (field_flags & STORAGE_TYPE_MASK); + const uchar field_column_format= + ((field_flags >> COLUMN_FORMAT_SHIFT)& COLUMN_FORMAT_MASK); + DBUG_PRINT("debug", ("field flags: %u, storage: %u, column_format: %u", + field_flags, field_storage, field_column_format)); + (void)field_storage; /* Reserved by and used in MySQL Cluster */ + (void)field_column_format; /* Reserved by and used in MySQL Cluster */ + } } *field_ptr=0; // End marker /* Fix key->name and key_part->field */ if (key_parts) { - uint primary_key=(uint) (find_type((char*) primary_key_name, - &share->keynames, 3) - 1); + uint primary_key=(uint) (find_type(primary_key_name, &share->keynames, + FIND_TYPE_NO_PREFIX) - 1); longlong ha_option= handler_file->ha_table_flags(); keyinfo= share->key_info; key_part= keyinfo->key_part; @@ -1705,6 +1762,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, if (use_hash) (void) my_hash_check(&share->name_hash); #endif + my_free(extra_segment_buff); DBUG_RETURN (0); err: @@ -1712,6 +1770,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, share->open_errno= my_errno; share->errarg= errarg; my_free(disk_buff); + my_free(extra_segment_buff); delete crypted; delete handler_file; my_hash_free(&share->name_hash); @@ -2688,6 +2747,8 @@ void update_create_info_from_table(HA_CREATE_INFO *create_info, TABLE *table) create_info->default_table_charset= share->table_charset; create_info->table_charset= 0; create_info->comment= share->comment; + create_info->storage_media= share->default_storage_media; + create_info->tablespace= share->tablespace; DBUG_VOID_RETURN; } diff --git a/sql/table.h b/sql/table.h index 39e9ef2e0dd..afdf4f7baa9 100644 --- a/sql/table.h +++ b/sql/table.h @@ -651,6 +651,16 @@ struct TABLE_SHARE */ int cached_row_logging_check; + /* + Storage media to use for this table (unless another storage + media has been specified on an individual column - in versions + where that is supported) + */ + enum ha_storage_media default_storage_media; + + /* Name of the tablespace used for this table */ + char *tablespace; + #ifdef WITH_PARTITION_STORAGE_ENGINE /* filled in when reading from frm */ bool auto_partitioned; diff --git a/sql/transaction.cc b/sql/transaction.cc index 85686810893..94a32200274 100644 --- a/sql/transaction.cc +++ b/sql/transaction.cc @@ -79,6 +79,33 @@ static bool xa_trans_rolled_back(XID_STATE *xid_state) /** + Rollback the active XA transaction. + + @note Resets rm_error before calling ha_rollback(), so + the thd->transaction.xid structure gets reset + by ha_rollback() / THD::transaction::cleanup(). + + @return TRUE if the rollback failed, FALSE otherwise. +*/ + +static bool xa_trans_force_rollback(THD *thd) +{ + /* + We must reset rm_error before calling ha_rollback(), + so thd->transaction.xid structure gets reset + by ha_rollback()/THD::transaction::cleanup(). + */ + thd->transaction.xid_state.rm_error= 0; + if (ha_rollback_trans(thd, true)) + { + my_error(ER_XAER_RMERR, MYF(0)); + return true; + } + return false; +} + + +/** Begin a new transaction. @note Beginning a transaction implicitly commits any current @@ -362,6 +389,13 @@ bool trans_savepoint(THD *thd, LEX_STRING name) !opt_using_transactions) DBUG_RETURN(FALSE); + enum xa_states xa_state= thd->transaction.xid_state.xa_state; + if (xa_state != XA_NOTR) + { + my_error(ER_XAER_RMFAIL, MYF(0), xa_state_names[xa_state]); + DBUG_RETURN(TRUE); + } + sv= find_savepoint(thd, name); if (*sv) /* old savepoint of the same name exists */ @@ -435,6 +469,13 @@ bool trans_rollback_to_savepoint(THD *thd, LEX_STRING name) DBUG_RETURN(TRUE); } + enum xa_states xa_state= thd->transaction.xid_state.xa_state; + if (xa_state != XA_NOTR) + { + my_error(ER_XAER_RMFAIL, MYF(0), xa_state_names[xa_state]); + DBUG_RETURN(TRUE); + } + if (ha_rollback_to_savepoint(thd, sv)) res= TRUE; else if (((thd->variables.option_bits & OPTION_KEEP_LOG) || @@ -635,8 +676,7 @@ bool trans_xa_commit(THD *thd) if (xa_trans_rolled_back(&thd->transaction.xid_state)) { - if (ha_rollback_trans(thd, TRUE)) - my_error(ER_XAER_RMERR, MYF(0)); + xa_trans_force_rollback(thd); res= thd->is_error(); } else if (xa_state == XA_IDLE && thd->lex->xa_opt == XA_ONE_PHASE) @@ -725,15 +765,7 @@ bool trans_xa_rollback(THD *thd) DBUG_RETURN(TRUE); } - /* - Resource Manager error is meaningless at this point, as we perform - explicit rollback request by user. We must reset rm_error before - calling ha_rollback(), so thd->transaction.xid structure gets reset - by ha_rollback()/THD::transaction::cleanup(). - */ - thd->transaction.xid_state.rm_error= 0; - if ((res= test(ha_rollback_trans(thd, TRUE)))) - my_error(ER_XAER_RMERR, MYF(0)); + res= xa_trans_force_rollback(thd); thd->variables.option_bits&= ~(OPTION_BEGIN | OPTION_KEEP_LOG); thd->transaction.all.modified_non_trans_table= FALSE; diff --git a/sql/unireg.cc b/sql/unireg.cc index 6433b8bc7c2..5a44c5e68f5 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -124,6 +124,9 @@ bool mysql_create_frm(THD *thd, const char *file_name, #endif Pack_header_error_handler pack_header_error_handler; int error; + const uint format_section_header_size= 8; + uint format_section_length; + uint tablespace_length= 0; DBUG_ENTER("mysql_create_frm"); DBUG_ASSERT(*fn_rext((char*)file_name)); // Check .frm extension @@ -256,6 +259,18 @@ bool mysql_create_frm(THD *thd, const char *file_name, forminfo[46]=(uchar) create_info->comment.length; } + /* + Add room in extra segment for "format section" with additional + table and column properties + */ + if (create_info->tablespace) + tablespace_length= strlen(create_info->tablespace); + format_section_length= + format_section_header_size + + tablespace_length + 1 + + create_fields.elements; + create_info->extra_size+= format_section_length; + if ((file=create_frm(thd, file_name, db, table, reclength, fileinfo, create_info, keys, key_info)) < 0) { @@ -353,6 +368,55 @@ bool mysql_create_frm(THD *thd, const char *file_name, goto err; } + /* "Format section" with additional table and column properties */ + { + uchar *ptr, *format_section_buff; + if (!(format_section_buff=(uchar*) my_malloc(format_section_length, + MYF(MY_WME)))) + goto err; + ptr= format_section_buff; + + /* header */ + const uint format_section_flags= + create_info->storage_media; // 3 bits + const uint format_section_unused= 0; + int2store(ptr+0, format_section_length); + int4store(ptr+2, format_section_flags); + int2store(ptr+6, format_section_unused); + ptr+= format_section_header_size; + + /* tablespace name */ + if (tablespace_length > 0) + memcpy(ptr, create_info->tablespace, tablespace_length); + ptr+= tablespace_length; + *ptr= 0; /* tablespace string terminating zero */ + ptr++; + + /* column properties */ + Create_field *field; + List_iterator<Create_field> it(create_fields); + while ((field=it++)) + { + const uchar field_storage= 0; /* Used in MySQL Cluster */ + const uchar field_column_format= 0; /* Used in MySQL Cluster */ + const uchar field_flags= + field_storage + (field_column_format << COLUMN_FORMAT_SHIFT); + *ptr= field_flags; + ptr++; + } + DBUG_ASSERT(format_section_buff + format_section_length == ptr); + + if (mysql_file_write(file, format_section_buff, + format_section_length, MYF_RW)) + { + my_free(format_section_buff); + goto err; + } + DBUG_PRINT("info", ("wrote format section, length: %u", + format_section_length)); + my_free(format_section_buff); + } + mysql_file_seek(file, filepos, MY_SEEK_SET, MYF(0)); if (mysql_file_write(file, forminfo, 288, MYF_RW) || mysql_file_write(file, screen_buff, info_length, MYF_RW) || diff --git a/storage/archive/ha_archive.h b/storage/archive/ha_archive.h index fec41c12b81..a56cc3dd799 100644 --- a/storage/archive/ha_archive.h +++ b/storage/archive/ha_archive.h @@ -90,7 +90,7 @@ public: return (HA_NO_TRANSACTIONS | HA_REC_NOT_IN_SEQ | HA_CAN_BIT_FIELD | HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | HA_STATS_RECORDS_IS_EXACT | - HA_HAS_RECORDS | + HA_HAS_RECORDS | HA_CAN_REPAIR | HA_FILE_BASED | HA_CAN_INSERT_DELAYED | HA_CAN_GEOMETRY); } ulong index_flags(uint idx, uint part, bool all_parts) const diff --git a/storage/csv/ha_tina.h b/storage/csv/ha_tina.h index 845b50e3869..9fcaf2519c6 100644 --- a/storage/csv/ha_tina.h +++ b/storage/csv/ha_tina.h @@ -106,7 +106,8 @@ public: ulonglong table_flags() const { return (HA_NO_TRANSACTIONS | HA_REC_NOT_IN_SEQ | HA_NO_AUTO_INCREMENT | - HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE); + HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | + HA_CAN_REPAIR); } ulong index_flags(uint idx, uint part, bool all_parts) const { diff --git a/storage/federated/ha_federated.h b/storage/federated/ha_federated.h index e39bac525b5..6614b389b1f 100644 --- a/storage/federated/ha_federated.h +++ b/storage/federated/ha_federated.h @@ -149,7 +149,8 @@ public: HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | HA_NO_PREFIX_CHAR_KEYS | HA_PRIMARY_KEY_REQUIRED_FOR_DELETE | HA_NO_TRANSACTIONS /* until fixed by WL#2952 */ | - HA_PARTIAL_COLUMN_READ | HA_NULL_IN_KEY); + HA_PARTIAL_COLUMN_READ | HA_NULL_IN_KEY | + HA_CAN_REPAIR); } /* This is a bitmap of flags that says how the storage engine diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt index d4b98f2af0d..01034eede69 100644 --- a/storage/innobase/CMakeLists.txt +++ b/storage/innobase/CMakeLists.txt @@ -241,7 +241,6 @@ SET(INNOBASE_SOURCES btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c row/row0sel.c row/row0uins.c row/row0umod.c row/row0undo.c row/row0upd.c row/row0vers.c srv/srv0srv.c srv/srv0start.c sync/sync0arr.c sync/sync0rw.c sync/sync0sync.c - thr/thr0loc.c trx/trx0i_s.c trx/trx0purge.c trx/trx0rec.c trx/trx0roll.c trx/trx0rseg.c trx/trx0sys.c trx/trx0trx.c trx/trx0undo.c usr/usr0sess.c diff --git a/storage/innobase/btr/btr0cur.c b/storage/innobase/btr/btr0cur.c index e182840b1a0..c4034d0896a 100644 --- a/storage/innobase/btr/btr0cur.c +++ b/storage/innobase/btr/btr0cur.c @@ -4904,27 +4904,45 @@ btr_copy_blob_prefix( /*******************************************************************//** Copies the prefix of a compressed BLOB. The clustered index record -that points to this BLOB must be protected by a lock or a page latch. */ +that points to this BLOB must be protected by a lock or a page latch. +@return number of bytes written to buf */ static -void +ulint btr_copy_zblob_prefix( /*==================*/ - z_stream* d_stream,/*!< in/out: the decompressing stream */ + byte* buf, /*!< out: the externally stored part of + the field, or a prefix of it */ + ulint len, /*!< in: length of buf, in bytes */ ulint zip_size,/*!< in: compressed BLOB page size */ ulint space_id,/*!< in: space id of the BLOB pages */ ulint page_no,/*!< in: page number of the first BLOB page */ ulint offset) /*!< in: offset on the first BLOB page */ { - ulint page_type = FIL_PAGE_TYPE_ZBLOB; + ulint page_type = FIL_PAGE_TYPE_ZBLOB; + mem_heap_t* heap; + int err; + z_stream d_stream; + + d_stream.next_out = buf; + d_stream.avail_out = len; + d_stream.next_in = Z_NULL; + d_stream.avail_in = 0; + + /* Zlib inflate needs 32 kilobytes for the default + window size, plus a few kilobytes for small objects. */ + heap = mem_heap_create(40000); + page_zip_set_alloc(&d_stream, heap); ut_ad(ut_is_2pow(zip_size)); ut_ad(zip_size >= PAGE_ZIP_MIN_SIZE); ut_ad(zip_size <= UNIV_PAGE_SIZE); ut_ad(space_id); + err = inflateInit(&d_stream); + ut_a(err == Z_OK); + for (;;) { buf_page_t* bpage; - int err; ulint next_page_no; /* There is no latch on bpage directly. Instead, @@ -4940,7 +4958,7 @@ btr_copy_zblob_prefix( " compressed BLOB" " page %lu space %lu\n", (ulong) page_no, (ulong) space_id); - return; + goto func_exit; } if (UNIV_UNLIKELY @@ -4966,13 +4984,13 @@ btr_copy_zblob_prefix( offset += 4; } - d_stream->next_in = bpage->zip.data + offset; - d_stream->avail_in = zip_size - offset; + d_stream.next_in = bpage->zip.data + offset; + d_stream.avail_in = zip_size - offset; - err = inflate(d_stream, Z_NO_FLUSH); + err = inflate(&d_stream, Z_NO_FLUSH); switch (err) { case Z_OK: - if (!d_stream->avail_out) { + if (!d_stream.avail_out) { goto end_of_blob; } break; @@ -4989,13 +5007,13 @@ inflate_error: " compressed BLOB" " page %lu space %lu returned %d (%s)\n", (ulong) page_no, (ulong) space_id, - err, d_stream->msg); + err, d_stream.msg); case Z_BUF_ERROR: goto end_of_blob; } if (next_page_no == FIL_NULL) { - if (!d_stream->avail_in) { + if (!d_stream.avail_in) { ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: unexpected end of" @@ -5004,7 +5022,7 @@ inflate_error: (ulong) page_no, (ulong) space_id); } else { - err = inflate(d_stream, Z_FINISH); + err = inflate(&d_stream, Z_FINISH); switch (err) { case Z_STREAM_END: case Z_BUF_ERROR: @@ -5016,7 +5034,7 @@ inflate_error: end_of_blob: buf_page_release_zip(bpage); - return; + goto func_exit; } buf_page_release_zip(bpage); @@ -5028,6 +5046,12 @@ end_of_blob: offset = FIL_PAGE_NEXT; page_type = FIL_PAGE_TYPE_ZBLOB2; } + +func_exit: + inflateEnd(&d_stream); + mem_heap_free(heap); + UNIV_MEM_ASSERT_RW(buf, d_stream.total_out); + return(d_stream.total_out); } /*******************************************************************//** @@ -5053,28 +5077,8 @@ btr_copy_externally_stored_field_prefix_low( } if (UNIV_UNLIKELY(zip_size)) { - int err; - z_stream d_stream; - mem_heap_t* heap; - - /* Zlib inflate needs 32 kilobytes for the default - window size, plus a few kilobytes for small objects. */ - heap = mem_heap_create(40000); - page_zip_set_alloc(&d_stream, heap); - - err = inflateInit(&d_stream); - ut_a(err == Z_OK); - - d_stream.next_out = buf; - d_stream.avail_out = len; - d_stream.avail_in = 0; - - btr_copy_zblob_prefix(&d_stream, zip_size, - space_id, page_no, offset); - inflateEnd(&d_stream); - mem_heap_free(heap); - UNIV_MEM_ASSERT_RW(buf, d_stream.total_out); - return(d_stream.total_out); + return(btr_copy_zblob_prefix(buf, len, zip_size, + space_id, page_no, offset)); } else { return(btr_copy_blob_prefix(buf, len, space_id, page_no, offset)); diff --git a/storage/innobase/btr/btr0sea.c b/storage/innobase/btr/btr0sea.c index d192ee7c132..93573a300e4 100644 --- a/storage/innobase/btr/btr0sea.c +++ b/storage/innobase/btr/btr0sea.c @@ -1213,8 +1213,8 @@ btr_search_drop_page_hash_when_freed( having to fear a deadlock. */ block = buf_page_get_gen(space, zip_size, page_no, RW_S_LATCH, NULL, - BUF_GET_IF_IN_POOL, __FILE__, __LINE__, - &mtr); + BUF_PEEK_IF_IN_POOL, __FILE__, __LINE__, + &mtr); /* Because the buffer pool mutex was released by buf_page_peek_if_search_hashed(), it is possible that the block was removed from the buffer pool by another thread diff --git a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c index 1ddf15ef8b9..cf5b90a2539 100644 --- a/storage/innobase/buf/buf0buf.c +++ b/storage/innobase/buf/buf0buf.c @@ -1233,7 +1233,7 @@ buf_pool_init_instance( buf_pool->page_hash = hash_create(2 * buf_pool->curr_size); buf_pool->zip_hash = hash_create(2 * buf_pool->curr_size); - + buf_pool->last_printout_time = ut_time(); } /* 2. Initialize flushing fields @@ -1365,11 +1365,11 @@ buf_pool_drop_hash_index_instance( /* block->is_hashed cannot be modified when we have an x-latch on btr_search_latch; see the comment in buf0buf.h */ - + if (!block->is_hashed) { continue; } - + /* To follow the latching order, we have to release btr_search_latch before acquiring block->latch. */ @@ -1378,14 +1378,14 @@ buf_pool_drop_hash_index_instance( we must rescan all blocks, because some may become hashed again. */ *released_search_latch = TRUE; - + rw_lock_x_lock(&block->lock); - + /* This should be guaranteed by the callers, which will be holding btr_search_enabled_mutex. */ ut_ad(!btr_search_enabled); - + /* Because we did not buffer-fix the block by calling buf_block_get_gen(), it is possible that the block has been @@ -1395,7 +1395,7 @@ buf_pool_drop_hash_index_instance( block is mapped to. All we want to do is to drop any hash entries referring to the page. */ - + /* It is possible that block->page.state != BUF_FILE_PAGE. Even that does not matter, because @@ -1403,18 +1403,18 @@ buf_pool_drop_hash_index_instance( check block->is_hashed before doing anything. block->is_hashed can only be set on uncompressed file pages. */ - + btr_search_drop_page_hash_index(block); - + rw_lock_x_unlock(&block->lock); - + rw_lock_x_lock(&btr_search_latch); - + ut_ad(!btr_search_enabled); } } } - + /********************************************************************//** Drops the adaptive hash index. To prevent a livelock, this function is only to be called while holding btr_search_latch and while @@ -1990,30 +1990,30 @@ buf_pool_resize(void) ulint min_change_size = 1048576 * srv_buf_pool_instances; buf_pool_mutex_enter_all(); - + if (srv_buf_pool_old_size == srv_buf_pool_size) { - + buf_pool_mutex_exit_all(); return; } else if (srv_buf_pool_curr_size + min_change_size > srv_buf_pool_size) { - + change_size = (srv_buf_pool_curr_size - srv_buf_pool_size) / UNIV_PAGE_SIZE; buf_pool_mutex_exit_all(); - + /* Disable adaptive hash indexes and empty the index in order to free up memory in the buffer pool chunks. */ buf_pool_shrink(change_size); } else if (srv_buf_pool_curr_size + min_change_size < srv_buf_pool_size) { - + /* Enlarge the buffer pool by at least one megabyte */ - + change_size = srv_buf_pool_size - srv_buf_pool_curr_size; buf_pool_mutex_exit_all(); @@ -2026,10 +2026,10 @@ buf_pool_resize(void) return; } - + buf_pool_page_hash_rebuild(); } - + /****************************************************************//** Remove the sentinel block for the watch before replacing it with a real block. buf_page_watch_clear() or buf_page_watch_occurred() will notice that @@ -2530,16 +2530,19 @@ buf_block_align_instance( /* TODO: protect buf_pool->chunks with a mutex (it will currently remain constant after buf_pool_init()) */ for (chunk = buf_pool->chunks, i = buf_pool->n_chunks; i--; chunk++) { - lint offs = ptr - chunk->blocks->frame; + ulint offs; - if (UNIV_UNLIKELY(offs < 0)) { + if (UNIV_UNLIKELY(ptr < chunk->blocks->frame)) { continue; } + /* else */ + + offs = ptr - chunk->blocks->frame; offs >>= UNIV_PAGE_SIZE_SHIFT; - if (UNIV_LIKELY((ulint) offs < chunk->size)) { + if (UNIV_LIKELY(offs < chunk->size)) { buf_block_t* block = &chunk->blocks[offs]; /* The function buf_chunk_init() invokes @@ -2716,7 +2719,7 @@ buf_page_get_gen( ulint rw_latch,/*!< in: RW_S_LATCH, RW_X_LATCH, RW_NO_LATCH */ buf_block_t* guess, /*!< in: guessed block or NULL */ ulint mode, /*!< in: BUF_GET, BUF_GET_IF_IN_POOL, - BUF_GET_NO_LATCH, or + BUF_PEEK_IF_IN_POOL, BUF_GET_NO_LATCH, or BUF_GET_IF_IN_POOL_OR_WATCH */ const char* file, /*!< in: file name */ ulint line, /*!< in: line where called */ @@ -2735,16 +2738,26 @@ buf_page_get_gen( ut_ad((rw_latch == RW_S_LATCH) || (rw_latch == RW_X_LATCH) || (rw_latch == RW_NO_LATCH)); - ut_ad((mode != BUF_GET_NO_LATCH) || (rw_latch == RW_NO_LATCH)); - ut_ad(mode == BUF_GET - || mode == BUF_GET_IF_IN_POOL - || mode == BUF_GET_NO_LATCH - || mode == BUF_GET_IF_IN_POOL_OR_WATCH); +#ifdef UNIV_DEBUG + switch (mode) { + case BUF_GET_NO_LATCH: + ut_ad(rw_latch == RW_NO_LATCH); + break; + case BUF_GET: + case BUF_GET_IF_IN_POOL: + case BUF_PEEK_IF_IN_POOL: + case BUF_GET_IF_IN_POOL_OR_WATCH: + break; + default: + ut_error; + } +#endif /* UNIV_DEBUG */ ut_ad(zip_size == fil_space_get_zip_size(space)); ut_ad(ut_is_2pow(zip_size)); #ifndef UNIV_LOG_DEBUG - ut_ad(!ibuf_inside(mtr) || ibuf_page_low(space, zip_size, offset, - FALSE, file, line, NULL)); + ut_ad(!ibuf_inside(mtr) + || ibuf_page_low(space, zip_size, offset, + FALSE, file, line, NULL)); #endif buf_pool->stat.n_page_gets++; fold = buf_page_address_fold(space, offset); @@ -2799,6 +2812,7 @@ loop2: buf_pool_mutex_exit(buf_pool); if (mode == BUF_GET_IF_IN_POOL + || mode == BUF_PEEK_IF_IN_POOL || mode == BUF_GET_IF_IN_POOL_OR_WATCH) { return(NULL); @@ -2839,7 +2853,8 @@ got_block: must_read = buf_block_get_io_fix(block) == BUF_IO_READ; - if (must_read && mode == BUF_GET_IF_IN_POOL) { + if (must_read && (mode == BUF_GET_IF_IN_POOL + || mode == BUF_PEEK_IF_IN_POOL)) { /* The page is being read to buffer pool, but we cannot wait around for the read to @@ -2873,7 +2888,7 @@ wait_until_unfixed: Try again later. */ buf_pool_mutex_exit(buf_pool); os_thread_sleep(WAIT_FOR_READ); - + goto loop; } @@ -2962,6 +2977,7 @@ wait_until_unfixed: mutex_exit(&buf_pool->zip_mutex); buf_pool->n_pend_unzip++; + bpage->state = BUF_BLOCK_ZIP_FREE; buf_buddy_free(buf_pool, bpage, sizeof *bpage); buf_pool_mutex_exit(buf_pool); @@ -3055,7 +3071,9 @@ wait_until_unfixed: buf_pool_mutex_exit(buf_pool); - buf_page_set_accessed_make_young(&block->page, access_time); + if (UNIV_LIKELY(mode != BUF_PEEK_IF_IN_POOL)) { + buf_page_set_accessed_make_young(&block->page, access_time); + } #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG ut_a(!block->page.file_page_was_freed); @@ -3108,11 +3126,12 @@ wait_until_unfixed: mtr_memo_push(mtr, block, fix_type); - if (!access_time) { + if (UNIV_LIKELY(mode != BUF_PEEK_IF_IN_POOL) && !access_time) { /* In the case of a first access, try to apply linear read-ahead */ - buf_read_ahead_linear(space, zip_size, offset, mtr); + buf_read_ahead_linear(space, zip_size, offset, + ibuf_inside(mtr)); } #ifdef UNIV_IBUF_COUNT_DEBUG @@ -3226,7 +3245,7 @@ buf_page_optimistic_get( buf_read_ahead_linear(buf_block_get_space(block), buf_block_get_zip_size(block), buf_block_get_page_no(block), - mtr); + ibuf_inside(mtr)); } #ifdef UNIV_IBUF_COUNT_DEBUG @@ -3302,7 +3321,7 @@ buf_page_get_known_nowait( buf_pool_mutex_exit(buf_pool); } - ut_ad(!ibuf_inside(mtr) || (mode == BUF_KEEP_OLD)); + ut_ad(!ibuf_inside(mtr) || mode == BUF_KEEP_OLD); if (rw_latch == RW_S_LATCH) { success = rw_lock_s_lock_nowait(&(block->lock), @@ -3568,13 +3587,12 @@ buf_page_init_for_read( ut_ad(!ibuf_bitmap_page(zip_size, offset)); - mtr_start(&mtr); - ibuf_enter(&mtr); + ibuf_mtr_start(&mtr); if (!recv_no_ibuf_operations && !ibuf_page(space, zip_size, offset, &mtr)) { - mtr_commit(&mtr); + ibuf_mtr_commit(&mtr); return(NULL); } @@ -3698,6 +3716,7 @@ err_exit: /* The block was added by some other thread. */ watch_page = NULL; + bpage->state = BUF_BLOCK_ZIP_FREE; buf_buddy_free(buf_pool, bpage, sizeof *bpage); buf_buddy_free(buf_pool, data, zip_size); @@ -3758,7 +3777,7 @@ func_exit: if (mode == BUF_READ_IBUF_PAGES_ONLY) { - mtr_commit(&mtr); + ibuf_mtr_commit(&mtr); } ut_ad(!bpage || buf_page_in_file(bpage)); @@ -4786,7 +4805,7 @@ buf_get_modified_ratio_pct(void) buf_get_total_list_len(&lru_len, &free_len, &flush_list_len); ratio = (100 * flush_list_len) / (1 + lru_len + free_len); - + /* 1 + is there to avoid division by zero */ return(ratio); @@ -5169,7 +5188,7 @@ buf_all_freed(void) return(TRUE); } - + /*********************************************************************//** Checks that there currently are no pending i/o-operations for the buffer pool. diff --git a/storage/innobase/buf/buf0lru.c b/storage/innobase/buf/buf0lru.c index 910e8386a71..64afcecfe3c 100644 --- a/storage/innobase/buf/buf0lru.c +++ b/storage/innobase/buf/buf0lru.c @@ -247,74 +247,78 @@ buf_LRU_drop_page_hash_for_tablespace( sizeof(ulint) * BUF_LRU_DROP_SEARCH_HASH_SIZE); buf_pool_mutex_enter(buf_pool); + num_entries = 0; scan_again: - num_entries = 0; bpage = UT_LIST_GET_LAST(buf_pool->LRU); while (bpage != NULL) { - mutex_t* block_mutex = buf_page_get_mutex(bpage); buf_page_t* prev_bpage; + ibool is_fixed; - mutex_enter(block_mutex); prev_bpage = UT_LIST_GET_PREV(LRU, bpage); ut_a(buf_page_in_file(bpage)); if (buf_page_get_state(bpage) != BUF_BLOCK_FILE_PAGE || bpage->space != id - || bpage->buf_fix_count > 0 || bpage->io_fix != BUF_IO_NONE) { - /* We leave the fixed pages as is in this scan. - To be dealt with later in the final scan. */ - mutex_exit(block_mutex); + /* Compressed pages are never hashed. + Skip blocks of other tablespaces. + Skip I/O-fixed blocks (to be dealt with later). */ +next_page: + bpage = prev_bpage; + continue; + } + + mutex_enter(&((buf_block_t*) bpage)->mutex); + is_fixed = bpage->buf_fix_count > 0 + || !((buf_block_t*) bpage)->is_hashed; + mutex_exit(&((buf_block_t*) bpage)->mutex); + + if (is_fixed) { goto next_page; } - if (((buf_block_t*) bpage)->is_hashed) { + /* Store the page number so that we can drop the hash + index in a batch later. */ + page_arr[num_entries] = bpage->offset; + ut_a(num_entries < BUF_LRU_DROP_SEARCH_HASH_SIZE); + ++num_entries; - /* Store the offset(i.e.: page_no) in the array - so that we can drop hash index in a batch - later. */ - page_arr[num_entries] = bpage->offset; - mutex_exit(block_mutex); - ut_a(num_entries < BUF_LRU_DROP_SEARCH_HASH_SIZE); - ++num_entries; + if (num_entries < BUF_LRU_DROP_SEARCH_HASH_SIZE) { + goto next_page; + } - if (num_entries < BUF_LRU_DROP_SEARCH_HASH_SIZE) { - goto next_page; - } + /* Array full. We release the buf_pool->mutex to obey + the latching order. */ + buf_pool_mutex_exit(buf_pool); - /* Array full. We release the buf_pool->mutex to - obey the latching order. */ - buf_pool_mutex_exit(buf_pool); + buf_LRU_drop_page_hash_batch( + id, zip_size, page_arr, num_entries); - buf_LRU_drop_page_hash_batch( - id, zip_size, page_arr, num_entries); + num_entries = 0; - num_entries = 0; + buf_pool_mutex_enter(buf_pool); - buf_pool_mutex_enter(buf_pool); - } else { - mutex_exit(block_mutex); - } + /* Note that we released the buf_pool mutex above + after reading the prev_bpage during processing of a + page_hash_batch (i.e.: when the array was full). + Because prev_bpage could belong to a compressed-only + block, it may have been relocated, and thus the + pointer cannot be trusted. Because bpage is of type + buf_block_t, it is safe to dereference. -next_page: - /* Note that we may have released the buf_pool mutex - above after reading the prev_bpage during processing - of a page_hash_batch (i.e.: when the array was full). - This means that prev_bpage can change in LRU list. - This is OK because this function is a 'best effort' - to drop as many search hash entries as possible and - it does not guarantee that ALL such entries will be - dropped. */ - bpage = prev_bpage; + bpage can change in the LRU list. This is OK because + this function is a 'best effort' to drop as many + search hash entries as possible and it does not + guarantee that ALL such entries will be dropped. */ /* If, however, bpage has been removed from LRU list to the free list then we should restart the scan. bpage->state is protected by buf_pool mutex. */ - if (bpage && !buf_page_in_file(bpage)) { - ut_a(num_entries == 0); + if (bpage + && buf_page_get_state(bpage) != BUF_BLOCK_FILE_PAGE) { goto scan_again; } } @@ -1889,6 +1893,7 @@ buf_LRU_block_remove_hashed_page( buf_pool, bpage->zip.data, page_zip_get_size(&bpage->zip)); + bpage->state = BUF_BLOCK_ZIP_FREE; buf_buddy_free(buf_pool, bpage, sizeof(*bpage)); buf_pool_mutex_exit_allow(buf_pool); diff --git a/storage/innobase/buf/buf0rea.c b/storage/innobase/buf/buf0rea.c index 3e36b707585..eeaa21ae9ef 100644 --- a/storage/innobase/buf/buf0rea.c +++ b/storage/innobase/buf/buf0rea.c @@ -236,12 +236,10 @@ UNIV_INTERN ulint buf_read_ahead_linear( /*==================*/ - ulint space, /*!< in: space id */ - ulint zip_size,/*!< in: compressed page size in bytes, or 0 */ - ulint offset, /*!< in: page number of a page; NOTE: the current thread - must want access to this page (see NOTE 3 above) */ - mtr_t *mtr) /*!< in: mtr with knowledge if we're inside ibuf - routine */ + ulint space, /*!< in: space id */ + ulint zip_size, /*!< in: compressed page size in bytes, or 0 */ + ulint offset, /*!< in: page number; see NOTE 3 above */ + ibool inside_ibuf) /*!< in: TRUE if we are inside ibuf routine */ { buf_pool_t* buf_pool = buf_pool_get(space, offset); ib_int64_t tablespace_version; @@ -431,11 +429,9 @@ buf_read_ahead_linear( /* If we got this far, read-ahead can be sensible: do it */ - if (ibuf_inside(mtr)) { - ibuf_mode = BUF_READ_IBUF_PAGES_ONLY; - } else { - ibuf_mode = BUF_READ_ANY_PAGE; - } + ibuf_mode = inside_ibuf + ? BUF_READ_IBUF_PAGES_ONLY | OS_AIO_SIMULATED_WAKE_LATER + : BUF_READ_ANY_PAGE | OS_AIO_SIMULATED_WAKE_LATER; count = 0; @@ -452,7 +448,7 @@ buf_read_ahead_linear( if (!ibuf_bitmap_page(zip_size, i)) { count += buf_read_page_low( &err, FALSE, - ibuf_mode | OS_AIO_SIMULATED_WAKE_LATER, + ibuf_mode, space, zip_size, FALSE, tablespace_version, i); if (err == DB_TABLESPACE_DELETED) { ut_print_timestamp(stderr); diff --git a/storage/innobase/dict/dict0load.c b/storage/innobase/dict/dict0load.c index 14490980bb6..37bf4a1ad59 100644 --- a/storage/innobase/dict/dict0load.c +++ b/storage/innobase/dict/dict0load.c @@ -2258,10 +2258,12 @@ loop: /* Since table names in SYS_FOREIGN are stored in a case-insensitive order, we have to check that the table name matches also in a binary string comparison. On Unix, MySQL allows table names that only differ - in character case. */ - - if (0 != ut_memcmp(field, table_name, len)) { + in character case. If lower_case_table_names=2 then what is stored + may not be the same case, but the previous comparison showed that they + match with no-case. */ + if ((srv_lower_case_table_names != 2) + && (0 != ut_memcmp(field, table_name, len))) { goto next_rec; } diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 14870b5ee63..74a33d05760 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -51,6 +51,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA #include <mysql/plugin.h> #include <mysql/innodb_priv.h> #include <mysql/psi/psi.h> +#include <my_sys.h> /** @file ha_innodb.cc */ @@ -81,7 +82,6 @@ extern "C" { #include "fil0fil.h" #include "trx0xa.h" #include "row0merge.h" -#include "thr0loc.h" #include "dict0boot.h" #include "ha_prototypes.h" #include "ut0mem.h" @@ -279,7 +279,6 @@ static PSI_mutex_info all_innodb_mutexes[] = { {&sync_thread_mutex_key, "sync_thread_mutex", 0}, # endif /* UNIV_SYNC_DEBUG */ {&trx_doublewrite_mutex_key, "trx_doublewrite_mutex", 0}, - {&thr_local_mutex_key, "thr_local_mutex", 0}, {&trx_undo_mutex_key, "trx_undo_mutex", 0} }; # endif /* UNIV_PFS_MUTEX */ @@ -1147,6 +1146,20 @@ innobase_strcasecmp( } /******************************************************************//** +Strip dir name from a full path name and return only the file name +@return file name or "null" if no file name */ +extern "C" UNIV_INTERN +const char* +innobase_basename( +/*==============*/ + const char* path_name) /*!< in: full path name */ +{ + const char* name = base_name(path_name); + + return((name) ? name : "null"); +} + +/******************************************************************//** Makes all characters in a NUL-terminated UTF-8 string lower case. */ extern "C" UNIV_INTERN void @@ -2594,7 +2607,6 @@ innobase_alter_table_flags( uint flags) { return(HA_INPLACE_ADD_INDEX_NO_READ_WRITE - | HA_INPLACE_ADD_INDEX_NO_WRITE | HA_INPLACE_DROP_INDEX_NO_READ_WRITE | HA_INPLACE_ADD_UNIQUE_INDEX_NO_READ_WRITE | HA_INPLACE_DROP_UNIQUE_INDEX_NO_READ_WRITE @@ -9261,7 +9273,8 @@ innodb_mutex_show_status( if (mutex->count_using > 0) { buf1len= my_snprintf(buf1, sizeof(buf1), "%s:%s", - mutex->cmutex_name, mutex->cfile_name); + mutex->cmutex_name, + innobase_basename(mutex->cfile_name)); buf2len= my_snprintf(buf2, sizeof(buf2), "count=%lu, spin_waits=%lu," " spin_rounds=%lu, " @@ -9291,7 +9304,8 @@ innodb_mutex_show_status( } #else /* UNIV_DEBUG */ buf1len= (uint) my_snprintf(buf1, sizeof(buf1), "%s:%lu", - mutex->cfile_name, (ulong) mutex->cline); + innobase_basename(mutex->cfile_name), + (ulong) mutex->cline); buf2len= (uint) my_snprintf(buf2, sizeof(buf2), "os_waits=%lu", (ulong) mutex->count_os_wait); @@ -9307,7 +9321,8 @@ innodb_mutex_show_status( if (block_mutex) { buf1len = (uint) my_snprintf(buf1, sizeof buf1, "combined %s:%lu", - block_mutex->cfile_name, + innobase_basename( + block_mutex->cfile_name), (ulong) block_mutex->cline); buf2len = (uint) my_snprintf(buf2, sizeof buf2, "os_waits=%lu", @@ -9338,7 +9353,8 @@ innodb_mutex_show_status( } buf1len = my_snprintf(buf1, sizeof buf1, "%s:%lu", - lock->cfile_name, (ulong) lock->cline); + innobase_basename(lock->cfile_name), + (ulong) lock->cline); buf2len = my_snprintf(buf2, sizeof buf2, "os_waits=%lu", (ulong) lock->count_os_wait); @@ -9353,7 +9369,8 @@ innodb_mutex_show_status( if (block_lock) { buf1len = (uint) my_snprintf(buf1, sizeof buf1, "combined %s:%lu", - block_lock->cfile_name, + innobase_basename( + block_lock->cfile_name), (ulong) block_lock->cline); buf2len = (uint) my_snprintf(buf2, sizeof buf2, "os_waits=%lu", @@ -11357,7 +11374,7 @@ mysql_declare_plugin(innobase) MYSQL_STORAGE_ENGINE_PLUGIN, &innobase_storage_engine, innobase_hton_name, - "Innobase Oy", + plugin_author, "Supports transactions, row-level locking, and foreign keys", PLUGIN_LICENSE_GPL, innobase_init, /* Plugin Init */ diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc index 00aced180ce..de5cc682078 100644 --- a/storage/innobase/handler/i_s.cc +++ b/storage/innobase/handler/i_s.cc @@ -47,8 +47,6 @@ extern "C" { #include "trx0trx.h" /* for TRX_QUE_STATE_STR_MAX_LEN */ } -static const char plugin_author[] = "Innobase Oy"; - #define OK(expr) \ if ((expr) != 0) { \ DBUG_RETURN(1); \ @@ -1059,7 +1057,7 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_lock_waits = /* plugin author (for SHOW PLUGINS) */ /* const char* */ - STRUCT_FLD(author, "Innobase Oy"), + STRUCT_FLD(author, plugin_author), /* general descriptive text (for SHOW PLUGINS) */ /* const char* */ diff --git a/storage/innobase/handler/i_s.h b/storage/innobase/handler/i_s.h index 402c88bbedb..dc0deef119b 100644 --- a/storage/innobase/handler/i_s.h +++ b/storage/innobase/handler/i_s.h @@ -26,6 +26,8 @@ Created July 18, 2007 Vasil Dimov #ifndef i_s_h #define i_s_h +const char plugin_author[] = "Oracle Corporation"; + extern struct st_mysql_plugin i_s_innodb_trx; extern struct st_mysql_plugin i_s_innodb_locks; extern struct st_mysql_plugin i_s_innodb_lock_waits; diff --git a/storage/innobase/ibuf/ibuf0ibuf.c b/storage/innobase/ibuf/ibuf0ibuf.c index 6b81e11b52e..6771ab219a4 100644 --- a/storage/innobase/ibuf/ibuf0ibuf.c +++ b/storage/innobase/ibuf/ibuf0ibuf.c @@ -44,7 +44,6 @@ Created 7/19/1997 Heikki Tuuri #include "fsp0fsp.h" #include "trx0sys.h" #include "fil0fil.h" -#include "thr0loc.h" #include "rem0rec.h" #include "btr0cur.h" #include "btr0pcur.h" @@ -329,10 +328,11 @@ inside an insert buffer routine. */ UNIV_INTERN void ibuf_enter( - mtr_t *mtr) /*!< in: mtr stores ibuf_inside info */ -/*============*/ +/*=======*/ + mtr_t* mtr) /*!< in/out: mini-transaction */ { - mtr->ibuf_inside = TRUE; + ut_ad(!mtr->inside_ibuf); + mtr->inside_ibuf = TRUE; } /******************************************************************//** @@ -341,26 +341,25 @@ exiting an insert buffer routine. */ UNIV_INLINE void ibuf_exit( - mtr_t *mtr) /*!< in: mtr stores ibuf_inside info */ -/*===========*/ +/*======*/ + mtr_t* mtr) /*!< in/out: mini-transaction */ { - mtr->ibuf_inside = FALSE; + ut_ad(mtr->inside_ibuf); + mtr->inside_ibuf = FALSE; } -/******************************************************************//** -Returns TRUE if the current OS thread is performing an insert buffer -routine. - -For instance, a read-ahead of non-ibuf pages is forbidden by threads -that are executing an insert buffer routine. -@return TRUE if inside an insert buffer routine */ -UNIV_INTERN -ibool -ibuf_inside( - mtr_t *mtr) /*!< in: mtr stores ibuf_inside info */ -/*=============*/ +/**************************************************************//** +Commits an insert buffer mini-transaction and sets the persistent +cursor latch mode to BTR_NO_LATCHES, that is, detaches the cursor. */ +UNIV_INLINE +void +ibuf_btr_pcur_commit_specify_mtr( +/*=============================*/ + btr_pcur_t* pcur, /*!< in/out: persistent cursor */ + mtr_t* mtr) /*!< in/out: mini-transaction */ { - return(mtr->ibuf_inside); + ut_d(ibuf_exit(mtr)); + btr_pcur_commit_specify_mtr(pcur, mtr); } /******************************************************************//** @@ -370,7 +369,7 @@ static page_t* ibuf_header_page_get( /*=================*/ - mtr_t* mtr) /*!< in: mtr */ + mtr_t* mtr) /*!< in/out: mini-transaction */ { buf_block_t* block; @@ -559,7 +558,7 @@ ibuf_init_at_db_start(void) mutex_exit(&ibuf_mutex); ibuf->empty = (page_get_n_recs(root) == 0); - mtr_commit(&mtr); + ibuf_mtr_commit(&mtr); heap = mem_heap_create(450); @@ -1219,18 +1218,30 @@ ibuf_page_low( return(ret); } +#ifdef UNIV_DEBUG +# define ibuf_rec_get_page_no(mtr,rec) ibuf_rec_get_page_no_func(mtr,rec) +#else /* UNIV_DEBUG */ +# define ibuf_rec_get_page_no(mtr,rec) ibuf_rec_get_page_no_func(rec) +#endif /* UNIV_DEBUG */ + /********************************************************************//** Returns the page number field of an ibuf record. @return page number */ static ulint -ibuf_rec_get_page_no( -/*=================*/ +ibuf_rec_get_page_no_func( +/*======================*/ +#ifdef UNIV_DEBUG + mtr_t* mtr, /*!< in: mini-transaction owning rec */ +#endif /* UNIV_DEBUG */ const rec_t* rec) /*!< in: ibuf record */ { const byte* field; ulint len; + ut_ad(mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_X_FIX) + || mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_S_FIX)); + ut_ad(ibuf_inside(mtr)); ut_ad(rec_get_n_fields_old(rec) > 2); field = rec_get_nth_field_old(rec, 1, &len); @@ -1252,19 +1263,31 @@ ibuf_rec_get_page_no( return(mach_read_from_4(field)); } +#ifdef UNIV_DEBUG +# define ibuf_rec_get_space(mtr,rec) ibuf_rec_get_space_func(mtr,rec) +#else /* UNIV_DEBUG */ +# define ibuf_rec_get_space(mtr,rec) ibuf_rec_get_space_func(rec) +#endif /* UNIV_DEBUG */ + /********************************************************************//** Returns the space id field of an ibuf record. For < 4.1.x format records returns 0. @return space id */ static ulint -ibuf_rec_get_space( -/*===============*/ +ibuf_rec_get_space_func( +/*====================*/ +#ifdef UNIV_DEBUG + mtr_t* mtr, /*!< in: mini-transaction owning rec */ +#endif /* UNIV_DEBUG */ const rec_t* rec) /*!< in: ibuf record */ { const byte* field; ulint len; + ut_ad(mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_X_FIX) + || mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_S_FIX)); + ut_ad(ibuf_inside(mtr)); ut_ad(rec_get_n_fields_old(rec) > 2); field = rec_get_nth_field_old(rec, 1, &len); @@ -1285,12 +1308,22 @@ ibuf_rec_get_space( return(0); } +#ifdef UNIV_DEBUG +# define ibuf_rec_get_info(mtr,rec,op,comp,info_len,counter) \ + ibuf_rec_get_info_func(mtr,rec,op,comp,info_len,counter) +#else /* UNIV_DEBUG */ +# define ibuf_rec_get_info(mtr,rec,op,comp,info_len,counter) \ + ibuf_rec_get_info_func(rec,op,comp,info_len,counter) +#endif /****************************************************************//** Get various information about an ibuf record in >= 4.1.x format. */ static void -ibuf_rec_get_info( -/*==============*/ +ibuf_rec_get_info_func( +/*===================*/ +#ifdef UNIV_DEBUG + mtr_t* mtr, /*!< in: mini-transaction owning rec */ +#endif /* UNIV_DEBUG */ const rec_t* rec, /*!< in: ibuf record */ ibuf_op_t* op, /*!< out: operation type, or NULL */ ibool* comp, /*!< out: compact flag, or NULL */ @@ -1309,6 +1342,9 @@ ibuf_rec_get_info( ulint info_len_local; ulint counter_local; + ut_ad(mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_X_FIX) + || mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_S_FIX)); + ut_ad(ibuf_inside(mtr)); fields = rec_get_n_fields_old(rec); ut_a(fields > 4); @@ -1357,17 +1393,29 @@ ibuf_rec_get_info( } } +#ifdef UNIV_DEBUG +# define ibuf_rec_get_op_type(mtr,rec) ibuf_rec_get_op_type_func(mtr,rec) +#else /* UNIV_DEBUG */ +# define ibuf_rec_get_op_type(mtr,rec) ibuf_rec_get_op_type_func(rec) +#endif + /****************************************************************//** Returns the operation type field of an ibuf record. @return operation type */ static ibuf_op_t -ibuf_rec_get_op_type( -/*=================*/ +ibuf_rec_get_op_type_func( +/*======================*/ +#ifdef UNIV_DEBUG + mtr_t* mtr, /*!< in: mini-transaction owning rec */ +#endif /* UNIV_DEBUG */ const rec_t* rec) /*!< in: ibuf record */ { ulint len; + ut_ad(mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_X_FIX) + || mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_S_FIX)); + ut_ad(ibuf_inside(mtr)); ut_ad(rec_get_n_fields_old(rec) > 2); (void) rec_get_nth_field_old(rec, 1, &len); @@ -1379,7 +1427,7 @@ ibuf_rec_get_op_type( } else { ibuf_op_t op; - ibuf_rec_get_info(rec, &op, NULL, NULL, NULL); + ibuf_rec_get_info(mtr, rec, &op, NULL, NULL, NULL); return(op); } @@ -1578,6 +1626,14 @@ ibuf_build_entry_pre_4_1_x( return(tuple); } +#ifdef UNIV_DEBUG +# define ibuf_build_entry_from_ibuf_rec(mtr,ibuf_rec,heap,pindex) \ + ibuf_build_entry_from_ibuf_rec_func(mtr,ibuf_rec,heap,pindex) +#else /* UNIV_DEBUG */ +# define ibuf_build_entry_from_ibuf_rec(mtr,ibuf_rec,heap,pindex) \ + ibuf_build_entry_from_ibuf_rec_func(ibuf_rec,heap,pindex) +#endif + /*********************************************************************//** Builds the entry used to @@ -1596,8 +1652,11 @@ hold a latch to the ibuf_rec page as long as the entry is used! @return own: entry to insert to a non-clustered index */ static dtuple_t* -ibuf_build_entry_from_ibuf_rec( -/*===========================*/ +ibuf_build_entry_from_ibuf_rec_func( +/*================================*/ +#ifdef UNIV_DEBUG + mtr_t* mtr, /*!< in: mini-transaction owning rec */ +#endif /* UNIV_DEBUG */ const rec_t* ibuf_rec, /*!< in: record in an insert buffer */ mem_heap_t* heap, /*!< in: heap where built */ dict_index_t** pindex) /*!< out, own: dummy index that @@ -1614,6 +1673,10 @@ ibuf_build_entry_from_ibuf_rec( ulint comp; dict_index_t* index; + ut_ad(mtr_memo_contains_page(mtr, ibuf_rec, MTR_MEMO_PAGE_X_FIX) + || mtr_memo_contains_page(mtr, ibuf_rec, MTR_MEMO_PAGE_S_FIX)); + ut_ad(ibuf_inside(mtr)); + data = rec_get_nth_field_old(ibuf_rec, 1, &len); if (len > 1) { @@ -1634,7 +1697,7 @@ ibuf_build_entry_from_ibuf_rec( types = rec_get_nth_field_old(ibuf_rec, 3, &len); - ibuf_rec_get_info(ibuf_rec, NULL, &comp, &info_len, NULL); + ibuf_rec_get_info(mtr, ibuf_rec, NULL, &comp, &info_len, NULL); index = ibuf_dummy_index_create(n_fields, comp); @@ -1721,6 +1784,12 @@ ibuf_rec_get_size( return(size); } +#ifdef UNIV_DEBUG +# define ibuf_rec_get_volume(mtr,rec) ibuf_rec_get_volume_func(mtr,rec) +#else /* UNIV_DEBUG */ +# define ibuf_rec_get_volume(mtr,rec) ibuf_rec_get_volume_func(rec) +#endif + /********************************************************************//** Returns the space taken by a stored non-clustered index entry if converted to an index record. @@ -1728,8 +1797,11 @@ an index record. taken in the page directory */ static ulint -ibuf_rec_get_volume( -/*================*/ +ibuf_rec_get_volume_func( +/*=====================*/ +#ifdef UNIV_DEBUG + mtr_t* mtr, /*!< in: mini-transaction owning rec */ +#endif /* UNIV_DEBUG */ const rec_t* ibuf_rec)/*!< in: ibuf record */ { ulint len; @@ -1740,6 +1812,9 @@ ibuf_rec_get_volume( ibool pre_4_1; ulint comp; + ut_ad(mtr_memo_contains_page(mtr, ibuf_rec, MTR_MEMO_PAGE_X_FIX) + || mtr_memo_contains_page(mtr, ibuf_rec, MTR_MEMO_PAGE_S_FIX)); + ut_ad(ibuf_inside(mtr)); ut_ad(rec_get_n_fields_old(ibuf_rec) > 2); data = rec_get_nth_field_old(ibuf_rec, 1, &len); @@ -1767,7 +1842,7 @@ ibuf_rec_get_volume( types = rec_get_nth_field_old(ibuf_rec, 3, &len); - ibuf_rec_get_info(ibuf_rec, &op, &comp, &info_len, NULL); + ibuf_rec_get_info(mtr, ibuf_rec, &op, &comp, &info_len, NULL); if (op == IBUF_OP_DELETE_MARK || op == IBUF_OP_DELETE) { /* Delete-marking a record doesn't take any @@ -1784,7 +1859,7 @@ ibuf_rec_get_volume( mem_heap_t* heap = mem_heap_create(500); entry = ibuf_build_entry_from_ibuf_rec( - ibuf_rec, heap, &dummy_index); + mtr, ibuf_rec, heap, &dummy_index); volume = rec_get_converted_size(dummy_index, entry, 0); @@ -2142,17 +2217,11 @@ ibuf_add_free_page(void) mtr_commit(&mtr); return(FALSE); - } - - { - buf_block_t* block; - - block = buf_page_get( + } else { + buf_block_t* block = buf_page_get( IBUF_SPACE_ID, 0, page_no, RW_X_LATCH, &mtr); - buf_block_dbg_add_level(block, SYNC_TREE_NODE_NEW); - page = buf_block_get_frame(block); } @@ -2184,7 +2253,7 @@ ibuf_add_free_page(void) ibuf_bitmap_page_set_bits( bitmap_page, page_no, zip_size, IBUF_BITMAP_IBUF, TRUE, &mtr); - mtr_commit(&mtr); + ibuf_mtr_commit(&mtr); return(TRUE); } @@ -2225,14 +2294,12 @@ ibuf_remove_free_page(void) mutex_exit(&ibuf_mutex); mutex_exit(&ibuf_pessimistic_insert_mutex); - mtr_commit(&mtr); + ibuf_mtr_commit(&mtr); return; } - ibuf_exit(&mtr); - mtr_start(&mtr2); - ibuf_enter(&mtr2); + ibuf_mtr_start(&mtr2); root = ibuf_tree_root_get(&mtr2); @@ -2245,7 +2312,8 @@ ibuf_remove_free_page(void) because in fseg_free_page we access level 1 pages, and the root is a level 2 page. */ - mtr_commit(&mtr2); + ibuf_mtr_commit(&mtr2); + ibuf_exit(&mtr); /* Since pessimistic inserts were prevented, we know that the page is still in the free list. NOTE that also deletes may take @@ -2305,7 +2373,7 @@ ibuf_remove_free_page(void) #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG buf_page_set_file_page_was_freed(IBUF_SPACE_ID, page_no); #endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */ - mtr_commit(&mtr); + ibuf_mtr_commit(&mtr); } /***********************************************************************//** @@ -2357,20 +2425,30 @@ ibuf_free_excess_pages(void) } } +#ifdef UNIV_DEBUG +# define ibuf_get_merge_page_nos(contract,rec,mtr,ids,vers,pages,n_stored) \ + ibuf_get_merge_page_nos_func(contract,rec,mtr,ids,vers,pages,n_stored) +#else /* UNIV_DEBUG */ +# define ibuf_get_merge_page_nos(contract,rec,mtr,ids,vers,pages,n_stored) \ + ibuf_get_merge_page_nos_func(contract,rec,ids,vers,pages,n_stored) +#endif /* UNIV_DEBUG */ + /*********************************************************************//** Reads page numbers from a leaf in an ibuf tree. @return a lower limit for the combined volume of records which will be merged */ static ulint -ibuf_get_merge_page_nos( -/*====================*/ +ibuf_get_merge_page_nos_func( +/*=========================*/ ibool contract,/*!< in: TRUE if this function is called to contract the tree, FALSE if this is called when a single page becomes full and we look if it pays to read also nearby pages */ - rec_t* rec, /*!< in: record from which we read up and down - in the chain of records */ + const rec_t* rec, /*!< in: insert buffer record */ +#ifdef UNIV_DEBUG + mtr_t* mtr, /*!< in: mini-transaction holding rec */ +#endif /* UNIV_DEBUG */ ulint* space_ids,/*!< in/out: space id's of the pages */ ib_int64_t* space_versions,/*!< in/out: tablespace version timestamps; used to prevent reading in old @@ -2393,18 +2471,22 @@ ibuf_get_merge_page_nos( ulint limit; ulint n_pages; + ut_ad(mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_X_FIX) + || mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_S_FIX)); + ut_ad(ibuf_inside(mtr)); + *n_stored = 0; limit = ut_min(IBUF_MAX_N_PAGES_MERGED, buf_pool_get_curr_size() / 4); if (page_rec_is_supremum(rec)) { - rec = page_rec_get_prev(rec); + rec = page_rec_get_prev_const(rec); } if (page_rec_is_infimum(rec)) { - rec = page_rec_get_next(rec); + rec = page_rec_get_next_const(rec); } if (page_rec_is_supremum(rec)) { @@ -2412,8 +2494,8 @@ ibuf_get_merge_page_nos( return(0); } - first_page_no = ibuf_rec_get_page_no(rec); - first_space_id = ibuf_rec_get_space(rec); + first_page_no = ibuf_rec_get_page_no(mtr, rec); + first_space_id = ibuf_rec_get_space(mtr, rec); n_pages = 0; prev_page_no = 0; prev_space_id = 0; @@ -2424,8 +2506,8 @@ ibuf_get_merge_page_nos( while (!page_rec_is_infimum(rec) && UNIV_LIKELY(n_pages < limit)) { - rec_page_no = ibuf_rec_get_page_no(rec); - rec_space_id = ibuf_rec_get_space(rec); + rec_page_no = ibuf_rec_get_page_no(mtr, rec); + rec_space_id = ibuf_rec_get_space(mtr, rec); if (rec_space_id != first_space_id || (rec_page_no / IBUF_MERGE_AREA) @@ -2442,10 +2524,10 @@ ibuf_get_merge_page_nos( prev_page_no = rec_page_no; prev_space_id = rec_space_id; - rec = page_rec_get_prev(rec); + rec = page_rec_get_prev_const(rec); } - rec = page_rec_get_next(rec); + rec = page_rec_get_next_const(rec); /* At the loop start there is no prev page; we mark this with a pair of space id, page no (0, 0) for which there can never be entries in @@ -2463,8 +2545,8 @@ ibuf_get_merge_page_nos( rec_page_no = 1; rec_space_id = 0; } else { - rec_page_no = ibuf_rec_get_page_no(rec); - rec_space_id = ibuf_rec_get_space(rec); + rec_page_no = ibuf_rec_get_page_no(mtr, rec); + rec_space_id = ibuf_rec_get_space(mtr, rec); ut_ad(rec_page_no > IBUF_TREE_ROOT_PAGE_NO); } @@ -2475,9 +2557,9 @@ ibuf_get_merge_page_nos( || rec_page_no != prev_page_no) && (prev_space_id != 0 || prev_page_no != 0)) { - if ((prev_page_no == first_page_no - && prev_space_id == first_space_id) - || contract + if (contract + || (prev_page_no == first_page_no + && prev_space_id == first_space_id) || (volume_for_page > ((IBUF_MERGE_THRESHOLD - 1) * 4 * UNIV_PAGE_SIZE @@ -2510,14 +2592,14 @@ ibuf_get_merge_page_nos( break; } - rec_volume = ibuf_rec_get_volume(rec); + rec_volume = ibuf_rec_get_volume(mtr, rec); volume_for_page += rec_volume; prev_page_no = rec_page_no; prev_space_id = rec_space_id; - rec = page_rec_get_next(rec); + rec = page_rec_get_next_const(rec); } #ifdef UNIV_IBUF_DEBUG @@ -2563,9 +2645,7 @@ ibuf_contract_ext( return(0); } - mtr_start(&mtr); - - ibuf_enter(&mtr); + ibuf_mtr_start(&mtr); /* Open a cursor to a randomly chosen leaf of the tree, at a random position within the leaf */ @@ -2584,20 +2664,21 @@ ibuf_contract_ext( ut_ad(page_get_page_no(btr_pcur_get_page(&pcur)) == FSP_IBUF_TREE_ROOT_PAGE_NO); - mtr_commit(&mtr); + ibuf_mtr_commit(&mtr); btr_pcur_close(&pcur); return(0); } - sum_sizes = ibuf_get_merge_page_nos(TRUE, btr_pcur_get_rec(&pcur), + sum_sizes = ibuf_get_merge_page_nos(TRUE, + btr_pcur_get_rec(&pcur), &mtr, space_ids, space_versions, page_nos, n_pages); #if 0 /* defined UNIV_IBUF_DEBUG */ fprintf(stderr, "Ibuf contract sync %lu pages %lu volume %lu\n", sync, *n_pages, sum_sizes); #endif - mtr_commit(&mtr); + ibuf_mtr_commit(&mtr); btr_pcur_close(&pcur); buf_read_ibuf_merge_pages(sync, space_ids, space_versions, page_nos, @@ -2737,6 +2818,13 @@ ibuf_get_volume_buffered_hash( return(TRUE); } +#ifdef UNIV_DEBUG +# define ibuf_get_volume_buffered_count(mtr,rec,hash,size,n_recs) \ + ibuf_get_volume_buffered_count_func(mtr,rec,hash,size,n_recs) +#else /* UNIV_DEBUG */ +# define ibuf_get_volume_buffered_count(mtr,rec,hash,size,n_recs) \ + ibuf_get_volume_buffered_count_func(rec,hash,size,n_recs) +#endif /*********************************************************************//** Update the estimate of the number of records on a page, and get the space taken by merging the buffered record to the index page. @@ -2744,8 +2832,11 @@ get the space taken by merging the buffered record to the index page. taken in the page directory */ static ulint -ibuf_get_volume_buffered_count( -/*===========================*/ +ibuf_get_volume_buffered_count_func( +/*================================*/ +#ifdef UNIV_DEBUG + mtr_t* mtr, /*!< in: mini-transaction owning rec */ +#endif /* UNIV_DEBUG */ const rec_t* rec, /*!< in: insert buffer record */ ulint* hash, /*!< in/out: hash array */ ulint size, /*!< in: number of elements in hash array */ @@ -2755,8 +2846,13 @@ ibuf_get_volume_buffered_count( ulint len; ibuf_op_t ibuf_op; const byte* types; - ulint n_fields = rec_get_n_fields_old(rec); + ulint n_fields; + ut_ad(mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_X_FIX) + || mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_S_FIX)); + ut_ad(ibuf_inside(mtr)); + + n_fields = rec_get_n_fields_old(rec); ut_ad(n_fields > 4); n_fields -= 4; @@ -2841,7 +2937,7 @@ get_volume_comp: mem_heap_t* heap = mem_heap_create(500); entry = ibuf_build_entry_from_ibuf_rec( - rec, heap, &dummy_index); + mtr, rec, heap, &dummy_index); volume = rec_get_converted_size(dummy_index, entry, 0); @@ -2862,7 +2958,7 @@ static ulint ibuf_get_volume_buffered( /*=====================*/ - btr_pcur_t* pcur, /*!< in: pcur positioned at a place in an + const btr_pcur_t*pcur, /*!< in: pcur positioned at a place in an insert buffer tree where we would insert an entry for the index page whose number is page_no, latch mode has to be BTR_MODIFY_PREV @@ -2872,16 +2968,17 @@ ibuf_get_volume_buffered( lint* n_recs, /*!< in/out: minimum number of records on the page after the buffered changes have been applied, or NULL to disable the counting */ - mtr_t* mtr) /*!< in: mtr */ + mtr_t* mtr) /*!< in: mini-transaction of pcur */ { - ulint volume; - rec_t* rec; - page_t* page; - ulint prev_page_no; - page_t* prev_page; - ulint next_page_no; - page_t* next_page; - ulint hash_bitmap[128 / sizeof(ulint)]; /* bitmap of buffered recs */ + ulint volume; + const rec_t* rec; + const page_t* page; + ulint prev_page_no; + const page_t* prev_page; + ulint next_page_no; + const page_t* next_page; + /* bitmap of buffered recs */ + ulint hash_bitmap[128 / sizeof(ulint)]; ut_a(trx_sys_multiple_tablespace_format); @@ -2902,26 +2999,22 @@ ibuf_get_volume_buffered( ut_ad(page_validate(page, ibuf->index)); if (page_rec_is_supremum(rec)) { - rec = page_rec_get_prev(rec); + rec = page_rec_get_prev_const(rec); } - for (;;) { - if (page_rec_is_infimum(rec)) { - - break; - } + for (; !page_rec_is_infimum(rec); + rec = page_rec_get_prev_const(rec)) { + ut_ad(page_align(rec) == page); - if (page_no != ibuf_rec_get_page_no(rec) - || space != ibuf_rec_get_space(rec)) { + if (page_no != ibuf_rec_get_page_no(mtr, rec) + || space != ibuf_rec_get_space(mtr, rec)) { goto count_later; } volume += ibuf_get_volume_buffered_count( - rec, hash_bitmap, UT_ARR_SIZE(hash_bitmap), n_recs); - - rec = page_rec_get_prev(rec); - ut_ad(page_align(rec) == page); + mtr, rec, + hash_bitmap, UT_ARR_SIZE(hash_bitmap), n_recs); } /* Look at the previous page */ @@ -2937,7 +3030,8 @@ ibuf_get_volume_buffered( buf_block_t* block; block = buf_page_get( - IBUF_SPACE_ID, 0, prev_page_no, RW_X_LATCH, mtr); + IBUF_SPACE_ID, 0, prev_page_no, RW_X_LATCH, + mtr); buf_block_dbg_add_level(block, SYNC_TREE_NODE); @@ -2947,14 +3041,15 @@ ibuf_get_volume_buffered( } #ifdef UNIV_BTR_DEBUG - ut_a(btr_page_get_next(prev_page, mtr) - == page_get_page_no(page)); + ut_a(btr_page_get_next(prev_page, mtr) == page_get_page_no(page)); #endif /* UNIV_BTR_DEBUG */ rec = page_get_supremum_rec(prev_page); - rec = page_rec_get_prev(rec); + rec = page_rec_get_prev_const(rec); + + for (;; rec = page_rec_get_prev_const(rec)) { + ut_ad(page_align(rec) == prev_page); - for (;;) { if (page_rec_is_infimum(rec)) { /* We cannot go to yet a previous page, because we @@ -2964,42 +3059,35 @@ ibuf_get_volume_buffered( return(UNIV_PAGE_SIZE); } - if (page_no != ibuf_rec_get_page_no(rec) - || space != ibuf_rec_get_space(rec)) { + if (page_no != ibuf_rec_get_page_no(mtr, rec) + || space != ibuf_rec_get_space(mtr, rec)) { goto count_later; } volume += ibuf_get_volume_buffered_count( - rec, hash_bitmap, UT_ARR_SIZE(hash_bitmap), n_recs); - - rec = page_rec_get_prev(rec); - ut_ad(page_align(rec) == prev_page); + mtr, rec, + hash_bitmap, UT_ARR_SIZE(hash_bitmap), n_recs); } count_later: rec = btr_pcur_get_rec(pcur); if (!page_rec_is_supremum(rec)) { - rec = page_rec_get_next(rec); + rec = page_rec_get_next_const(rec); } - for (;;) { - if (page_rec_is_supremum(rec)) { - - break; - } - - if (page_no != ibuf_rec_get_page_no(rec) - || space != ibuf_rec_get_space(rec)) { + for (; !page_rec_is_supremum(rec); + rec = page_rec_get_next_const(rec)) { + if (page_no != ibuf_rec_get_page_no(mtr, rec) + || space != ibuf_rec_get_space(mtr, rec)) { return(volume); } volume += ibuf_get_volume_buffered_count( - rec, hash_bitmap, UT_ARR_SIZE(hash_bitmap), n_recs); - - rec = page_rec_get_next(rec); + mtr, rec, + hash_bitmap, UT_ARR_SIZE(hash_bitmap), n_recs); } /* Look at the next page */ @@ -3015,7 +3103,8 @@ count_later: buf_block_t* block; block = buf_page_get( - IBUF_SPACE_ID, 0, next_page_no, RW_X_LATCH, mtr); + IBUF_SPACE_ID, 0, next_page_no, RW_X_LATCH, + mtr); buf_block_dbg_add_level(block, SYNC_TREE_NODE); @@ -3029,9 +3118,11 @@ count_later: #endif /* UNIV_BTR_DEBUG */ rec = page_get_infimum_rec(next_page); - rec = page_rec_get_next(rec); + rec = page_rec_get_next_const(rec); + + for (;; rec = page_rec_get_next_const(rec)) { + ut_ad(page_align(rec) == next_page); - for (;;) { if (page_rec_is_supremum(rec)) { /* We give up */ @@ -3039,17 +3130,15 @@ count_later: return(UNIV_PAGE_SIZE); } - if (page_no != ibuf_rec_get_page_no(rec) - || space != ibuf_rec_get_space(rec)) { + if (page_no != ibuf_rec_get_page_no(mtr, rec) + || space != ibuf_rec_get_space(mtr, rec)) { return(volume); } volume += ibuf_get_volume_buffered_count( - rec, hash_bitmap, UT_ARR_SIZE(hash_bitmap), n_recs); - - rec = page_rec_get_next(rec); - ut_ad(page_align(rec) == next_page); + mtr, rec, + hash_bitmap, UT_ARR_SIZE(hash_bitmap), n_recs); } } @@ -3070,8 +3159,7 @@ ibuf_update_max_tablespace_id(void) ut_a(!dict_table_is_comp(ibuf->index->table)); - mtr_start(&mtr); - ibuf_enter(&mtr); + ibuf_mtr_start(&mtr); btr_pcur_open_at_index_side( FALSE, ibuf->index, BTR_SEARCH_LEAF, &pcur, TRUE, &mtr); @@ -3094,13 +3182,20 @@ ibuf_update_max_tablespace_id(void) max_space_id = mach_read_from_4(field); } - mtr_commit(&mtr); + ibuf_mtr_commit(&mtr); /* printf("Maximum space id in insert buffer %lu\n", max_space_id); */ fil_set_max_space_id_if_bigger(max_space_id); } +#ifdef UNIV_DEBUG +# define ibuf_get_entry_counter_low(mtr,rec,space,page_no) \ + ibuf_get_entry_counter_low_func(mtr,rec,space,page_no) +#else /* UNIV_DEBUG */ +# define ibuf_get_entry_counter_low(mtr,rec,space,page_no) \ + ibuf_get_entry_counter_low_func(rec,space,page_no) +#endif /****************************************************************//** Helper function for ibuf_set_entry_counter. Checks if rec is for (space, page_no), and if so, reads counter value from it and returns that + 1. @@ -3108,8 +3203,11 @@ Otherwise, returns 0. @return new counter value, or 0 */ static ulint -ibuf_get_entry_counter_low( -/*=======================*/ +ibuf_get_entry_counter_low_func( +/*============================*/ +#ifdef UNIV_DEBUG + mtr_t* mtr, /*!< in: mini-transaction of rec */ +#endif /* UNIV_DEBUG */ const rec_t* rec, /*!< in: insert buffer record */ ulint space, /*!< in: space id */ ulint page_no) /*!< in: page number */ @@ -3118,6 +3216,9 @@ ibuf_get_entry_counter_low( const byte* field; ulint len; + ut_ad(ibuf_inside(mtr)); + ut_ad(mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_X_FIX) + || mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_S_FIX)); ut_ad(rec_get_n_fields_old(rec) > 2); field = rec_get_nth_field_old(rec, 1, &len); @@ -3189,12 +3290,15 @@ ibuf_set_entry_counter( ulint counter = 0; /* pcur points to either a user rec or to a page's infimum record. */ + ut_ad(ibuf_inside(mtr)); + ut_ad(mtr_memo_contains(mtr, btr_pcur_get_block(pcur), + MTR_MEMO_PAGE_X_FIX)); ut_ad(page_validate(btr_pcur_get_page(pcur), ibuf->index)); if (btr_pcur_is_on_user_rec(pcur)) { counter = ibuf_get_entry_counter_low( - btr_pcur_get_rec(pcur), space, page_no); + mtr, btr_pcur_get_rec(pcur), space, page_no); if (UNIV_UNLIKELY(counter == ULINT_UNDEFINED)) { /* The record lacks a counter field. @@ -3250,7 +3354,7 @@ ibuf_set_entry_counter( ut_ad(page_rec_is_user_rec(rec)); counter = ibuf_get_entry_counter_low( - rec, space, page_no); + mtr, rec, space, page_no); if (UNIV_UNLIKELY(counter == ULINT_UNDEFINED)) { /* The record lacks a counter field. @@ -3419,12 +3523,9 @@ ibuf_insert_low( return(DB_STRONG_FAIL); } } - mtr_start(&mtr); - } else { - mtr_start(&mtr); - ibuf_enter(&mtr); } + ibuf_mtr_start(&mtr); btr_pcur_open(ibuf->index, ibuf_entry, PAGE_CUR_LE, mode, &pcur, &mtr); ut_ad(page_validate(btr_pcur_get_page(&pcur), ibuf->index)); @@ -3479,8 +3580,7 @@ fail_exit: #ifdef UNIV_IBUF_COUNT_DEBUG ut_a((buffered == 0) || ibuf_count_get(space, page_no)); #endif - mtr_start(&bitmap_mtr); - bitmap_mtr.ibuf_inside = mtr.ibuf_inside; + ibuf_mtr_start(&bitmap_mtr); bitmap_page = ibuf_bitmap_get_map_page(space, page_no, zip_size, &bitmap_mtr); @@ -3501,15 +3601,15 @@ fail_exit: if (buffered + entry_size + page_dir_calc_reserved_space(1) > ibuf_index_page_calc_free_from_bits(zip_size, bits)) { /* Release the bitmap page latch early. */ - mtr_commit(&bitmap_mtr); + ibuf_mtr_commit(&bitmap_mtr); /* It may not fit */ do_merge = TRUE; - ibuf_get_merge_page_nos( - FALSE, btr_pcur_get_rec(&pcur), - space_ids, space_versions, - page_nos, &n_stored); + ibuf_get_merge_page_nos(FALSE, + btr_pcur_get_rec(&pcur), &mtr, + space_ids, space_versions, + page_nos, &n_stored); goto fail_exit; } @@ -3522,7 +3622,7 @@ fail_exit: && !ibuf_set_entry_counter(ibuf_entry, space, page_no, &pcur, mode == BTR_MODIFY_PREV, &mtr)) { bitmap_fail: - mtr_commit(&bitmap_mtr); + ibuf_mtr_commit(&bitmap_mtr); goto fail_exit; } @@ -3540,7 +3640,7 @@ bitmap_fail: &bitmap_mtr); } - mtr_commit(&bitmap_mtr); + ibuf_mtr_commit(&bitmap_mtr); cursor = btr_pcur_get_btr_cur(&pcur); @@ -3605,7 +3705,7 @@ func_exit: } #endif - mtr_commit(&mtr); + ibuf_mtr_commit(&mtr); btr_pcur_close(&pcur); mem_heap_free(heap); @@ -4156,7 +4256,7 @@ ibuf_restore_pos( /* The tablespace has been dropped. It is possible that another thread has deleted the insert buffer entry. Do not complain. */ - btr_pcur_commit_specify_mtr(pcur, mtr); + ibuf_btr_pcur_commit_specify_mtr(pcur, mtr); } else { fprintf(stderr, "InnoDB: ERROR: Submit the output to" @@ -4174,7 +4274,7 @@ ibuf_restore_pos( page_rec_get_next(btr_pcur_get_rec(pcur))); fflush(stderr); - btr_pcur_commit_specify_mtr(pcur, mtr); + ibuf_btr_pcur_commit_specify_mtr(pcur, mtr); fputs("InnoDB: Validating insert buffer tree:\n", stderr); if (!btr_validate_index(ibuf->index, NULL)) { @@ -4198,8 +4298,8 @@ ibool ibuf_delete_rec( /*============*/ ulint space, /*!< in: space id */ - ulint page_no,/*!< in: index page number where the record - should belong */ + ulint page_no,/*!< in: index page number that the record + should belong to */ btr_pcur_t* pcur, /*!< in: pcur positioned on the record to delete, having latch mode BTR_MODIFY_LEAF */ const dtuple_t* search_tuple, @@ -4212,8 +4312,8 @@ ibuf_delete_rec( ut_ad(ibuf_inside(mtr)); ut_ad(page_rec_is_user_rec(btr_pcur_get_rec(pcur))); - ut_ad(ibuf_rec_get_page_no(btr_pcur_get_rec(pcur)) == page_no); - ut_ad(ibuf_rec_get_space(btr_pcur_get_rec(pcur)) == space); + ut_ad(ibuf_rec_get_page_no(mtr, btr_pcur_get_rec(pcur)) == page_no); + ut_ad(ibuf_rec_get_space(mtr, btr_pcur_get_rec(pcur)) == space); success = btr_cur_optimistic_delete(btr_pcur_get_btr_cur(pcur), mtr); @@ -4246,22 +4346,22 @@ ibuf_delete_rec( } ut_ad(page_rec_is_user_rec(btr_pcur_get_rec(pcur))); - ut_ad(ibuf_rec_get_page_no(btr_pcur_get_rec(pcur)) == page_no); - ut_ad(ibuf_rec_get_space(btr_pcur_get_rec(pcur)) == space); + ut_ad(ibuf_rec_get_page_no(mtr, btr_pcur_get_rec(pcur)) == page_no); + ut_ad(ibuf_rec_get_space(mtr, btr_pcur_get_rec(pcur)) == space); /* We have to resort to a pessimistic delete from ibuf */ btr_pcur_store_position(pcur, mtr); + ibuf_btr_pcur_commit_specify_mtr(pcur, mtr); - btr_pcur_commit_specify_mtr(pcur, mtr); - + ibuf_mtr_start(mtr); mutex_enter(&ibuf_mutex); - mtr_start(mtr); - if (!ibuf_restore_pos(space, page_no, search_tuple, BTR_MODIFY_TREE, pcur, mtr)) { mutex_exit(&ibuf_mutex); + ut_ad(!ibuf_inside(mtr)); + ut_ad(mtr->state == MTR_COMMITTED); goto func_exit; } @@ -4278,9 +4378,11 @@ ibuf_delete_rec( mutex_exit(&ibuf_mutex); ibuf->empty = (page_get_n_recs(root) == 0); - btr_pcur_commit_specify_mtr(pcur, mtr); + ibuf_btr_pcur_commit_specify_mtr(pcur, mtr); func_exit: + ut_ad(!ibuf_inside(mtr)); + ut_ad(mtr->state == MTR_COMMITTED); btr_pcur_close(pcur); return(TRUE); @@ -4372,18 +4474,20 @@ ibuf_merge_or_delete_for_page( update_ibuf_bitmap = FALSE; } else { page_t* bitmap_page; + ulint bitmap_bits; - mtr_start(&mtr); + ibuf_mtr_start(&mtr); bitmap_page = ibuf_bitmap_get_map_page( space, page_no, zip_size, &mtr); + bitmap_bits = ibuf_bitmap_page_get_bits( + bitmap_page, page_no, zip_size, + IBUF_BITMAP_BUFFERED, &mtr); - if (!ibuf_bitmap_page_get_bits(bitmap_page, page_no, - zip_size, - IBUF_BITMAP_BUFFERED, - &mtr)) { + ibuf_mtr_commit(&mtr); + + if (!bitmap_bits) { /* No inserts buffered for this page */ - mtr_commit(&mtr); if (!tablespace_being_deleted) { fil_decr_pending_ibuf_merges(space); @@ -4391,7 +4495,6 @@ ibuf_merge_or_delete_for_page( return; } - mtr_commit(&mtr); } } else if (block && (ibuf_fixed_addr_page(space, zip_size, page_no) @@ -4402,7 +4505,7 @@ ibuf_merge_or_delete_for_page( heap = mem_heap_create(512); - if (!trx_sys_multiple_tablespace_format) { + if (UNIV_UNLIKELY(!trx_sys_multiple_tablespace_format)) { ut_a(trx_doublewrite_must_reset_space_ids); search_tuple = ibuf_search_tuple_build(space, page_no, heap); } else { @@ -4429,8 +4532,7 @@ ibuf_merge_or_delete_for_page( ut_print_timestamp(stderr); - mtr_start(&mtr); - ibuf_enter(&mtr); + ibuf_mtr_start(&mtr); fputs(" InnoDB: Dump of the ibuf bitmap page:\n", stderr); @@ -4438,8 +4540,7 @@ ibuf_merge_or_delete_for_page( bitmap_page = ibuf_bitmap_get_map_page(space, page_no, zip_size, &mtr); buf_page_print(bitmap_page, 0); - - mtr_commit(&mtr); + ibuf_mtr_commit(&mtr); fputs("\nInnoDB: Dump of the page:\n", stderr); @@ -4470,8 +4571,7 @@ ibuf_merge_or_delete_for_page( memset(dops, 0, sizeof(dops)); loop: - mtr_start(&mtr); - ibuf_enter(&mtr); + ibuf_mtr_start(&mtr); if (block) { ibool success; @@ -4505,8 +4605,8 @@ loop: rec = btr_pcur_get_rec(&pcur); /* Check if the entry is for this index page */ - if (ibuf_rec_get_page_no(rec) != page_no - || ibuf_rec_get_space(rec) != space) { + if (ibuf_rec_get_page_no(&mtr, rec) != page_no + || ibuf_rec_get_space(&mtr, rec) != space) { if (block) { page_header_reset_last_insert( @@ -4529,7 +4629,7 @@ loop: dtuple_t* entry; trx_id_t max_trx_id; dict_index_t* dummy_index; - ibuf_op_t op = ibuf_rec_get_op_type(rec); + ibuf_op_t op = ibuf_rec_get_op_type(&mtr, rec); max_trx_id = page_get_max_trx_id(page_align(rec)); page_update_max_trx_id(block, page_zip, max_trx_id, @@ -4538,7 +4638,7 @@ loop: ut_ad(page_validate(page_align(rec), ibuf->index)); entry = ibuf_build_entry_from_ibuf_rec( - rec, heap, &dummy_index); + &mtr, rec, heap, &dummy_index); ut_ad(page_validate(block->frame, dummy_index)); @@ -4571,14 +4671,14 @@ loop: Store and restore the cursor position. */ ut_ad(rec == btr_pcur_get_rec(&pcur)); ut_ad(page_rec_is_user_rec(rec)); - ut_ad(ibuf_rec_get_page_no(rec) == page_no); - ut_ad(ibuf_rec_get_space(rec) == space); + ut_ad(ibuf_rec_get_page_no(&mtr, rec) + == page_no); + ut_ad(ibuf_rec_get_space(&mtr, rec) == space); btr_pcur_store_position(&pcur, &mtr); - btr_pcur_commit_specify_mtr(&pcur, &mtr); + ibuf_btr_pcur_commit_specify_mtr(&pcur, &mtr); - mtr_start(&mtr); - ibuf_enter(&mtr); + ibuf_mtr_start(&mtr); success = buf_page_get_known_nowait( RW_X_LATCH, block, @@ -4593,7 +4693,8 @@ loop: BTR_MODIFY_LEAF, &pcur, &mtr)) { - mtr_commit(&mtr); + ut_ad(!ibuf_inside(&mtr)); + ut_ad(mtr.state == MTR_COMMITTED); mops[op]++; ibuf_dummy_index_free(dummy_index); goto loop; @@ -4608,7 +4709,7 @@ loop: ibuf_dummy_index_free(dummy_index); } else { - dops[ibuf_rec_get_op_type(rec)]++; + dops[ibuf_rec_get_op_type(&mtr, rec)]++; } /* Delete the record from ibuf */ @@ -4619,7 +4720,7 @@ loop: goto loop; } else if (btr_pcur_is_after_last_on_page(&pcur)) { - mtr_commit(&mtr); + ibuf_mtr_commit(&mtr); btr_pcur_close(&pcur); goto loop; @@ -4653,7 +4754,7 @@ reset_bit: } } - mtr_commit(&mtr); + ibuf_mtr_commit(&mtr); btr_pcur_close(&pcur); mem_heap_free(heap); @@ -4696,9 +4797,8 @@ ibuf_delete_for_discarded_space( mem_heap_t* heap; btr_pcur_t pcur; dtuple_t* search_tuple; - rec_t* ibuf_rec; + const rec_t* ibuf_rec; ulint page_no; - ibool closed; mtr_t mtr; /* Counts for discarded operations. */ @@ -4713,8 +4813,7 @@ ibuf_delete_for_discarded_space( memset(dops, 0, sizeof(dops)); loop: - mtr_start(&mtr); - ibuf_enter(&mtr); + ibuf_mtr_start(&mtr); /* Position pcur in the insert buffer at the first entry for the space */ @@ -4734,19 +4833,18 @@ loop: ibuf_rec = btr_pcur_get_rec(&pcur); /* Check if the entry is for this space */ - if (ibuf_rec_get_space(ibuf_rec) != space) { + if (ibuf_rec_get_space(&mtr, ibuf_rec) != space) { goto leave_loop; } - page_no = ibuf_rec_get_page_no(ibuf_rec); + page_no = ibuf_rec_get_page_no(&mtr, ibuf_rec); - dops[ibuf_rec_get_op_type(ibuf_rec)]++; + dops[ibuf_rec_get_op_type(&mtr, ibuf_rec)]++; /* Delete the record from ibuf */ - closed = ibuf_delete_rec(space, page_no, &pcur, search_tuple, - &mtr); - if (closed) { + if (ibuf_delete_rec(space, page_no, &pcur, search_tuple, + &mtr)) { /* Deletion was pessimistic and mtr was committed: we start from the beginning again */ @@ -4754,7 +4852,7 @@ loop: } if (btr_pcur_is_after_last_on_page(&pcur)) { - mtr_commit(&mtr); + ibuf_mtr_commit(&mtr); btr_pcur_close(&pcur); goto loop; @@ -4762,7 +4860,7 @@ loop: } leave_loop: - mtr_commit(&mtr); + ibuf_mtr_commit(&mtr); btr_pcur_close(&pcur); #ifdef HAVE_ATOMIC_BUILTINS @@ -4789,17 +4887,15 @@ ibuf_is_empty(void) const page_t* root; mtr_t mtr; - mtr_start(&mtr); - ibuf_enter(&mtr); + ibuf_mtr_start(&mtr); mutex_enter(&ibuf_mutex); root = ibuf_tree_root_get(&mtr); mutex_exit(&ibuf_mutex); is_empty = (page_get_n_recs(root) == 0); - mtr_commit(&mtr); - ut_a(is_empty == ibuf->empty); + ibuf_mtr_commit(&mtr); return(is_empty); } diff --git a/storage/innobase/include/btr0pcur.h b/storage/innobase/include/btr0pcur.h index 2334a266280..6c11c973fc9 100644 --- a/storage/innobase/include/btr0pcur.h +++ b/storage/innobase/include/btr0pcur.h @@ -150,7 +150,7 @@ UNIV_INLINE ulint btr_pcur_get_up_match( /*==================*/ - btr_pcur_t* cursor); /*!< in: memory buffer for persistent cursor */ + const btr_pcur_t* cursor); /*!< in: persistent cursor */ /**************************************************************//** Gets the low_match value for a pcur after a search. @return number of matched fields at the cursor or to the right if @@ -159,7 +159,7 @@ UNIV_INLINE ulint btr_pcur_get_low_match( /*===================*/ - btr_pcur_t* cursor); /*!< in: memory buffer for persistent cursor */ + const btr_pcur_t* cursor); /*!< in: persistent cursor */ /**************************************************************//** If mode is PAGE_CUR_G or PAGE_CUR_GE, opens a persistent cursor on the first user record satisfying the search condition, in the case PAGE_CUR_L or @@ -264,22 +264,6 @@ ulint btr_pcur_get_rel_pos( /*=================*/ const btr_pcur_t* cursor);/*!< in: persistent cursor */ -/*********************************************************//** -Sets the mtr field for a pcur. */ -UNIV_INLINE -void -btr_pcur_set_mtr( -/*=============*/ - btr_pcur_t* cursor, /*!< in: persistent cursor */ - mtr_t* mtr); /*!< in, own: mtr */ -/*********************************************************//** -Gets the mtr field for a pcur. -@return mtr */ -UNIV_INLINE -mtr_t* -btr_pcur_get_mtr( -/*=============*/ - btr_pcur_t* cursor); /*!< in: persistent cursor */ /**************************************************************//** Commits the mtr and sets the pcur latch mode to BTR_NO_LATCHES, that is, the cursor becomes detached. If there have been modifications @@ -387,10 +371,6 @@ page_cur_t* btr_pcur_get_page_cur( /*==================*/ const btr_pcur_t* cursor); /*!< in: persistent cursor */ -#else /* UNIV_DEBUG */ -# define btr_pcur_get_btr_cur(cursor) (&(cursor)->btr_cur) -# define btr_pcur_get_page_cur(cursor) (&(cursor)->btr_cur.page_cur) -#endif /* UNIV_DEBUG */ /*********************************************************//** Returns the page of a persistent cursor. @return pointer to the page */ @@ -398,7 +378,7 @@ UNIV_INLINE page_t* btr_pcur_get_page( /*==============*/ - btr_pcur_t* cursor);/*!< in: persistent cursor */ + const btr_pcur_t* cursor);/*!< in: persistent cursor */ /*********************************************************//** Returns the buffer block of a persistent cursor. @return pointer to the block */ @@ -406,7 +386,7 @@ UNIV_INLINE buf_block_t* btr_pcur_get_block( /*===============*/ - btr_pcur_t* cursor);/*!< in: persistent cursor */ + const btr_pcur_t* cursor);/*!< in: persistent cursor */ /*********************************************************//** Returns the record of a persistent cursor. @return pointer to the record */ @@ -414,7 +394,14 @@ UNIV_INLINE rec_t* btr_pcur_get_rec( /*=============*/ - btr_pcur_t* cursor);/*!< in: persistent cursor */ + const btr_pcur_t* cursor);/*!< in: persistent cursor */ +#else /* UNIV_DEBUG */ +# define btr_pcur_get_btr_cur(cursor) (&(cursor)->btr_cur) +# define btr_pcur_get_page_cur(cursor) (&(cursor)->btr_cur.page_cur) +# define btr_pcur_get_page(cursor) ((cursor)->btr_cur.page_cur.block->frame) +# define btr_pcur_get_block(cursor) ((cursor)->btr_cur.page_cur.block) +# define btr_pcur_get_rec(cursor) ((cursor)->btr_cur.page_cur.rec) +#endif /* UNIV_DEBUG */ /*********************************************************//** Checks if the persistent cursor is on a user record. */ UNIV_INLINE @@ -517,9 +504,6 @@ struct btr_pcur_struct{ /* NOTE that the following fields may possess dynamically allocated memory which should be freed if not needed anymore! */ - mtr_t* mtr; /*!< NULL, or this field may contain - a mini-transaction which holds the - latch on the cursor page */ byte* old_rec_buf; /*!< NULL, or a dynamically allocated buffer for old_rec */ ulint buf_size; /*!< old_rec_buf size if old_rec_buf diff --git a/storage/innobase/include/btr0pcur.ic b/storage/innobase/include/btr0pcur.ic index 0c38797e6c5..59fdb21824b 100644 --- a/storage/innobase/include/btr0pcur.ic +++ b/storage/innobase/include/btr0pcur.ic @@ -42,34 +42,6 @@ btr_pcur_get_rel_pos( return(cursor->rel_pos); } -/*********************************************************//** -Sets the mtr field for a pcur. */ -UNIV_INLINE -void -btr_pcur_set_mtr( -/*=============*/ - btr_pcur_t* cursor, /*!< in: persistent cursor */ - mtr_t* mtr) /*!< in, own: mtr */ -{ - ut_ad(cursor); - - cursor->mtr = mtr; -} - -/*********************************************************//** -Gets the mtr field for a pcur. -@return mtr */ -UNIV_INLINE -mtr_t* -btr_pcur_get_mtr( -/*=============*/ - btr_pcur_t* cursor) /*!< in: persistent cursor */ -{ - ut_ad(cursor); - - return(cursor->mtr); -} - #ifdef UNIV_DEBUG /*********************************************************//** Returns the btr cursor component of a persistent cursor. @@ -95,7 +67,7 @@ btr_pcur_get_page_cur( { return(btr_cur_get_page_cur(btr_pcur_get_btr_cur(cursor))); } -#endif /* UNIV_DEBUG */ + /*********************************************************//** Returns the page of a persistent cursor. @return pointer to the page */ @@ -103,7 +75,7 @@ UNIV_INLINE page_t* btr_pcur_get_page( /*==============*/ - btr_pcur_t* cursor) /*!< in: persistent cursor */ + const btr_pcur_t* cursor) /*!< in: persistent cursor */ { ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED); @@ -117,7 +89,7 @@ UNIV_INLINE buf_block_t* btr_pcur_get_block( /*===============*/ - btr_pcur_t* cursor) /*!< in: persistent cursor */ + const btr_pcur_t* cursor) /*!< in: persistent cursor */ { ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED); @@ -131,13 +103,14 @@ UNIV_INLINE rec_t* btr_pcur_get_rec( /*=============*/ - btr_pcur_t* cursor) /*!< in: persistent cursor */ + const btr_pcur_t* cursor) /*!< in: persistent cursor */ { ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED); ut_ad(cursor->latch_mode != BTR_NO_LATCHES); return(btr_cur_get_rec(btr_pcur_get_btr_cur(cursor))); } +#endif /* UNIV_DEBUG */ /**************************************************************//** Gets the up_match value for a pcur after a search. @@ -147,9 +120,9 @@ UNIV_INLINE ulint btr_pcur_get_up_match( /*==================*/ - btr_pcur_t* cursor) /*!< in: memory buffer for persistent cursor */ + const btr_pcur_t* cursor) /*!< in: persistent cursor */ { - btr_cur_t* btr_cursor; + const btr_cur_t* btr_cursor; ut_ad((cursor->pos_state == BTR_PCUR_WAS_POSITIONED) || (cursor->pos_state == BTR_PCUR_IS_POSITIONED)); @@ -169,9 +142,9 @@ UNIV_INLINE ulint btr_pcur_get_low_match( /*===================*/ - btr_pcur_t* cursor) /*!< in: memory buffer for persistent cursor */ + const btr_pcur_t* cursor) /*!< in: persistent cursor */ { - btr_cur_t* btr_cursor; + const btr_cur_t* btr_cursor; ut_ad((cursor->pos_state == BTR_PCUR_WAS_POSITIONED) || (cursor->pos_state == BTR_PCUR_IS_POSITIONED)); diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h index dbd5adee0cc..8fb008997ab 100644 --- a/storage/innobase/include/buf0buf.h +++ b/storage/innobase/include/buf0buf.h @@ -41,6 +41,8 @@ Created 11/5/1995 Heikki Tuuri /* @{ */ #define BUF_GET 10 /*!< get always */ #define BUF_GET_IF_IN_POOL 11 /*!< get if in pool */ +#define BUF_PEEK_IF_IN_POOL 12 /*!< get if in pool, do not make + the block young in the LRU list */ #define BUF_GET_NO_LATCH 14 /*!< get and bufferfix, but set no latch; we have separated this case, because @@ -396,7 +398,7 @@ buf_page_get_gen( ulint rw_latch,/*!< in: RW_S_LATCH, RW_X_LATCH, RW_NO_LATCH */ buf_block_t* guess, /*!< in: guessed block or NULL */ ulint mode, /*!< in: BUF_GET, BUF_GET_IF_IN_POOL, - BUF_GET_NO_LATCH or + BUF_PEEK_IF_IN_POOL, BUF_GET_NO_LATCH or BUF_GET_IF_IN_POOL_OR_WATCH */ const char* file, /*!< in: file name */ ulint line, /*!< in: line where called */ diff --git a/storage/innobase/include/buf0rea.h b/storage/innobase/include/buf0rea.h index 6e1f832942a..9906981209a 100644 --- a/storage/innobase/include/buf0rea.h +++ b/storage/innobase/include/buf0rea.h @@ -71,11 +71,10 @@ UNIV_INTERN ulint buf_read_ahead_linear( /*==================*/ - ulint space, /*!< in: space id */ - ulint zip_size,/*!< in: compressed page size in bytes, or 0 */ - ulint offset, /*!< in: page number of a page; NOTE: the current thread - must want access to this page (see NOTE 3 above) */ - mtr_t *mtr); /*!< in: mtr to get ibuf_inside indicator */ + ulint space, /*!< in: space id */ + ulint zip_size, /*!< in: compressed page size in bytes, or 0 */ + ulint offset, /*!< in: page number; see NOTE 3 above */ + ibool inside_ibuf); /*!< in: TRUE if we are inside ibuf routine */ /********************************************************************//** Issues read requests for pages which the ibuf module wants to read in, in order to contract the insert buffer tree. Technically, this function is like diff --git a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h index b75002944bd..dd9e8db82ee 100644 --- a/storage/innobase/include/ha_prototypes.h +++ b/storage/innobase/include/ha_prototypes.h @@ -174,6 +174,15 @@ innobase_strcasecmp( const char* b); /*!< in: second string to compare */ /******************************************************************//** +Strip dir name from a full path name and return only its file name. +@return file name or "null" if no file name */ +UNIV_INTERN +const char* +innobase_basename( +/*==============*/ + const char* path_name); /*!< in: full path name */ + +/******************************************************************//** Returns true if the thread is executing a SELECT statement. @return true if thd is executing SELECT */ diff --git a/storage/innobase/include/ibuf0ibuf.h b/storage/innobase/include/ibuf0ibuf.h index 464571d1ff8..0f1cb0fe688 100644 --- a/storage/innobase/include/ibuf0ibuf.h +++ b/storage/innobase/include/ibuf0ibuf.h @@ -104,6 +104,22 @@ UNIV_INTERN void ibuf_update_max_tablespace_id(void); /*===============================*/ +/***************************************************************//** +Starts an insert buffer mini-transaction. */ +UNIV_INLINE +void +ibuf_mtr_start( +/*===========*/ + mtr_t* mtr) /*!< out: mini-transaction */ + __attribute__((nonnull)); +/***************************************************************//** +Commits an insert buffer mini-transaction. */ +UNIV_INLINE +void +ibuf_mtr_commit( +/*============*/ + mtr_t* mtr) /*!< in/out: mini-transaction */ + __attribute__((nonnull)); /*********************************************************************//** Initializes an ibuf bitmap page. */ UNIV_INTERN @@ -224,19 +240,12 @@ routine. For instance, a read-ahead of non-ibuf pages is forbidden by threads that are executing an insert buffer routine. @return TRUE if inside an insert buffer routine */ -UNIV_INTERN +UNIV_INLINE ibool ibuf_inside( - mtr_t* mtr);/*!< in: ibuf_inside stored on mtr */ -/*=============*/ -/***********************************************************************//** -Sets ibuf_inside indicator on current MTR. -*/ -UNIV_INTERN -void -ibuf_enter( - mtr_t* mtr);/*!< in: ibuf_inside stored on mtr */ -/*=============*/ +/*========*/ + const mtr_t* mtr) /*!< in: mini-transaction */ + __attribute__((nonnull, pure)); /***********************************************************************//** Checks if a page address is an ibuf bitmap page (level 3 page) address. @return TRUE if a bitmap page */ diff --git a/storage/innobase/include/ibuf0ibuf.ic b/storage/innobase/include/ibuf0ibuf.ic index e3fa6e3e929..0a22667a260 100644 --- a/storage/innobase/include/ibuf0ibuf.ic +++ b/storage/innobase/include/ibuf0ibuf.ic @@ -37,6 +37,30 @@ buffer inserts to this page. If there is this much of free space, the corresponding bits are set in the ibuf bitmap. */ #define IBUF_PAGE_SIZE_PER_FREE_SPACE 32 +/***************************************************************//** +Starts an insert buffer mini-transaction. */ +UNIV_INLINE +void +ibuf_mtr_start( +/*===========*/ + mtr_t* mtr) /*!< out: mini-transaction */ +{ + mtr_start(mtr); + mtr->inside_ibuf = TRUE; +} +/***************************************************************//** +Commits an insert buffer mini-transaction. */ +UNIV_INLINE +void +ibuf_mtr_commit( +/*============*/ + mtr_t* mtr) /*!< in/out: mini-transaction */ +{ + ut_ad(mtr->inside_ibuf); + ut_d(mtr->inside_ibuf = FALSE); + mtr_commit(mtr); +} + /** Insert buffer struct */ struct ibuf_struct{ ulint size; /*!< current size of the ibuf index @@ -120,6 +144,22 @@ ibuf_should_try( return(FALSE); } +/******************************************************************//** +Returns TRUE if the current OS thread is performing an insert buffer +routine. + +For instance, a read-ahead of non-ibuf pages is forbidden by threads +that are executing an insert buffer routine. +@return TRUE if inside an insert buffer routine */ +UNIV_INLINE +ibool +ibuf_inside( +/*========*/ + const mtr_t* mtr) /*!< in: mini-transaction */ +{ + return(mtr->inside_ibuf); +} + /***********************************************************************//** Checks if a page address is an ibuf bitmap page address. @return TRUE if a bitmap page */ diff --git a/storage/innobase/include/mtr0mtr.h b/storage/innobase/include/mtr0mtr.h index 2aaad3322c3..5582ad63039 100644 --- a/storage/innobase/include/mtr0mtr.h +++ b/storage/innobase/include/mtr0mtr.h @@ -190,21 +190,21 @@ functions). The page number parameter was originally written as 0. @{ */ /* @} */ /***************************************************************//** -Starts a mini-transaction and creates a mini-transaction handle -and buffer in the memory buffer given by the caller. -@return mtr buffer which also acts as the mtr handle */ +Starts a mini-transaction. */ UNIV_INLINE -mtr_t* +void mtr_start( /*======*/ - mtr_t* mtr); /*!< in: memory buffer for the mtr buffer */ + mtr_t* mtr) /*!< out: mini-transaction */ + __attribute__((nonnull)); /***************************************************************//** Commits a mini-transaction. */ UNIV_INTERN void mtr_commit( /*=======*/ - mtr_t* mtr); /*!< in: mini-transaction */ + mtr_t* mtr) /*!< in/out: mini-transaction */ + __attribute__((nonnull)); /**********************************************************//** Sets and returns a savepoint in mtr. @return savepoint */ @@ -378,8 +378,8 @@ struct mtr_struct{ #endif dyn_array_t memo; /*!< memo stack for locks etc. */ dyn_array_t log; /*!< mini-transaction log */ - ibool ibuf_inside; - /* TRUE if inside ibuf changes */ + ibool inside_ibuf; + /*!< TRUE if inside ibuf changes */ ibool modifications; /* TRUE if the mtr made modifications to buffer pool pages */ diff --git a/storage/innobase/include/mtr0mtr.ic b/storage/innobase/include/mtr0mtr.ic index 9baf2ae1d48..3d87eea2710 100644 --- a/storage/innobase/include/mtr0mtr.ic +++ b/storage/innobase/include/mtr0mtr.ic @@ -30,27 +30,23 @@ Created 11/26/1995 Heikki Tuuri #include "mach0data.h" /***************************************************************//** -Starts a mini-transaction and creates a mini-transaction handle -and a buffer in the memory buffer given by the caller. -@return mtr buffer which also acts as the mtr handle */ +Starts a mini-transaction. */ UNIV_INLINE -mtr_t* +void mtr_start( /*======*/ - mtr_t* mtr) /*!< in: memory buffer for the mtr buffer */ + mtr_t* mtr) /*!< out: mini-transaction */ { dyn_array_create(&(mtr->memo)); dyn_array_create(&(mtr->log)); mtr->log_mode = MTR_LOG_ALL; mtr->modifications = FALSE; - mtr->ibuf_inside = FALSE; + mtr->inside_ibuf = FALSE; mtr->n_log_recs = 0; ut_d(mtr->state = MTR_ACTIVE); ut_d(mtr->magic_n = MTR_MAGIC_N); - - return(mtr); } /***************************************************//** diff --git a/storage/innobase/include/page0page.h b/storage/innobase/include/page0page.h index 826fd13125d..0a15dfbf2a1 100644 --- a/storage/innobase/include/page0page.h +++ b/storage/innobase/include/page0page.h @@ -952,7 +952,7 @@ UNIV_INTERN ibool page_rec_validate( /*==============*/ - rec_t* rec, /*!< in: physical record */ + const rec_t* rec, /*!< in: physical record */ const ulint* offsets);/*!< in: array returned by rec_get_offsets() */ /***************************************************************//** Checks that the first directory slot points to the infimum record and @@ -972,7 +972,7 @@ UNIV_INTERN ibool page_simple_validate_old( /*=====================*/ - page_t* page); /*!< in: old-style index page */ + const page_t* page); /*!< in: index page in ROW_FORMAT=REDUNDANT */ /***************************************************************//** This function checks the consistency of an index page when we do not know the index. This is also resilient so that this should never crash @@ -982,7 +982,7 @@ UNIV_INTERN ibool page_simple_validate_new( /*=====================*/ - page_t* block); /*!< in: new-style index page */ + const page_t* page); /*!< in: index page in ROW_FORMAT!=REDUNDANT */ /***************************************************************//** This function checks the consistency of an index page. @return TRUE if ok */ @@ -990,7 +990,7 @@ UNIV_INTERN ibool page_validate( /*==========*/ - page_t* page, /*!< in: index page */ + const page_t* page, /*!< in: index page */ dict_index_t* index); /*!< in: data dictionary index containing the page record type definition */ /***************************************************************//** diff --git a/storage/innobase/include/rem0rec.h b/storage/innobase/include/rem0rec.h index 9ffb5c7d9e5..3d157f1da95 100644 --- a/storage/innobase/include/rem0rec.h +++ b/storage/innobase/include/rem0rec.h @@ -600,6 +600,7 @@ ulint rec_offs_size( /*==========*/ const ulint* offsets);/*!< in: array returned by rec_get_offsets() */ +#ifdef UNIV_DEBUG /**********************************************************//** Returns a pointer to the start of the record. @return pointer to start */ @@ -607,7 +608,7 @@ UNIV_INLINE byte* rec_get_start( /*==========*/ - rec_t* rec, /*!< in: pointer to record */ + const rec_t* rec, /*!< in: pointer to record */ const ulint* offsets);/*!< in: array returned by rec_get_offsets() */ /**********************************************************//** Returns a pointer to the end of the record. @@ -616,8 +617,12 @@ UNIV_INLINE byte* rec_get_end( /*========*/ - rec_t* rec, /*!< in: pointer to record */ + const rec_t* rec, /*!< in: pointer to record */ const ulint* offsets);/*!< in: array returned by rec_get_offsets() */ +#else /* UNIV_DEBUG */ +# define rec_get_start(rec, offsets) ((rec) - rec_offs_extra_size(offsets)) +# define rec_get_end(rec, offsets) ((rec) + rec_offs_data_size(offsets)) +#endif /* UNIV_DEBUG */ /***************************************************************//** Copies a physical record to a buffer. @return pointer to the origin of the copy */ diff --git a/storage/innobase/include/rem0rec.ic b/storage/innobase/include/rem0rec.ic index ba306eaf27f..3d386710d7d 100644 --- a/storage/innobase/include/rem0rec.ic +++ b/storage/innobase/include/rem0rec.ic @@ -1462,6 +1462,7 @@ rec_offs_size( return(rec_offs_data_size(offsets) + rec_offs_extra_size(offsets)); } +#ifdef UNIV_DEBUG /**********************************************************//** Returns a pointer to the end of the record. @return pointer to end */ @@ -1469,11 +1470,11 @@ UNIV_INLINE byte* rec_get_end( /*========*/ - rec_t* rec, /*!< in: pointer to record */ + const rec_t* rec, /*!< in: pointer to record */ const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ { ut_ad(rec_offs_validate(rec, NULL, offsets)); - return(rec + rec_offs_data_size(offsets)); + return((rec_t*) rec + rec_offs_data_size(offsets)); } /**********************************************************//** @@ -1483,12 +1484,13 @@ UNIV_INLINE byte* rec_get_start( /*==========*/ - rec_t* rec, /*!< in: pointer to record */ + const rec_t* rec, /*!< in: pointer to record */ const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ { ut_ad(rec_offs_validate(rec, NULL, offsets)); - return(rec - rec_offs_extra_size(offsets)); + return((rec_t*) rec - rec_offs_extra_size(offsets)); } +#endif /* UNIV_DEBUG */ /***************************************************************//** Copies a physical record to a buffer. diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index 252d1424c63..fb5bc56920a 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -442,16 +442,8 @@ typedef enum srv_stats_method_name_enum srv_stats_method_name_t; #ifndef UNIV_HOTBACKUP /** Types of threads existing in the system. */ enum srv_thread_type { - SRV_COM = 1, /**< threads serving communication and queries */ - SRV_CONSOLE, /**< thread serving console */ - SRV_WORKER, /**< threads serving parallelized queries and + SRV_WORKER = 0, /**< threads serving parallelized queries and queries released from lock wait */ -#if 0 - /* Utility threads */ - SRV_BUFFER, /**< thread flushing dirty buffer blocks */ - SRV_RECOVERY, /**< threads finishing a recovery */ - SRV_INSERT, /**< thread flushing the insert buffer to disk */ -#endif SRV_MASTER /**< the master thread, (whose type number must be biggest) */ }; @@ -490,13 +482,6 @@ ulint srv_get_n_threads(void); /*===================*/ /*********************************************************************//** -Returns the calling thread type. -@return SRV_COM, ... */ - -enum srv_thread_type -srv_get_thread_type(void); -/*=====================*/ -/*********************************************************************//** Check whether thread type has reserved a slot. @return slot number or UNDEFINED if not found*/ UNIV_INTERN diff --git a/storage/innobase/include/sync0arr.h b/storage/innobase/include/sync0arr.h index 5f1280f5e28..6e931346238 100644 --- a/storage/innobase/include/sync0arr.h +++ b/storage/innobase/include/sync0arr.h @@ -115,8 +115,11 @@ Prints warnings of long semaphore waits to stderr. @return TRUE if fatal semaphore wait threshold was exceeded */ UNIV_INTERN ibool -sync_array_print_long_waits(void); -/*=============================*/ +sync_array_print_long_waits( +/*========================*/ + os_thread_id_t* waiter, /*!< out: longest waiting thread */ + const void** sema) /*!< out: longest-waited-for semaphore */ + __attribute__((nonnull)); /********************************************************************//** Validates the integrity of the wait array. Checks that the number of reserved cells equals the count variable. */ diff --git a/storage/innobase/include/sync0sync.h b/storage/innobase/include/sync0sync.h index b4f9e21933f..a24c2106033 100644 --- a/storage/innobase/include/sync0sync.h +++ b/storage/innobase/include/sync0sync.h @@ -110,7 +110,6 @@ extern mysql_pfs_key_t syn_arr_mutex_key; extern mysql_pfs_key_t sync_thread_mutex_key; # endif /* UNIV_SYNC_DEBUG */ extern mysql_pfs_key_t trx_doublewrite_mutex_key; -extern mysql_pfs_key_t thr_local_mutex_key; extern mysql_pfs_key_t trx_undo_mutex_key; #endif /* UNIV_PFS_MUTEX */ diff --git a/storage/innobase/include/thr0loc.h b/storage/innobase/include/thr0loc.h deleted file mode 100644 index 14da8bffdd7..00000000000 --- a/storage/innobase/include/thr0loc.h +++ /dev/null @@ -1,82 +0,0 @@ -/***************************************************************************** - -Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved. - -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free Software -Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along with -this program; if not, write to the Free Software Foundation, Inc., 59 Temple -Place, Suite 330, Boston, MA 02111-1307 USA - -*****************************************************************************/ - -/**************************************************//** -@file include/thr0loc.h -The thread local storage - -Created 10/5/1995 Heikki Tuuri -*******************************************************/ - -/* This module implements storage private to each thread, -a capability useful in some situations like storing the -OS handle to the current thread, or its priority. */ - -#ifndef thr0loc_h -#define thr0loc_h - -#include "univ.i" -#include "os0thread.h" - -/****************************************************************//** -Initializes the thread local storage module. */ -UNIV_INTERN -void -thr_local_init(void); -/*================*/ - /****************************************************************//** -Close the thread local storage module. */ -UNIV_INTERN -void -thr_local_close(void); -/*=================*/ -/*******************************************************************//** -Creates a local storage struct for the calling new thread. */ -UNIV_INTERN -void -thr_local_create(void); -/*==================*/ -/*******************************************************************//** -Frees the local storage struct for the specified thread. */ -UNIV_INTERN -void -thr_local_free( -/*===========*/ - os_thread_id_t id); /*!< in: thread id */ -/*******************************************************************//** -Gets the slot number in the thread table of a thread. -@return slot number */ -UNIV_INTERN -ulint -thr_local_get_slot_no( -/*==================*/ - os_thread_id_t id); /*!< in: thread id of the thread */ -/*******************************************************************//** -Sets in the local storage the slot number in the thread table of a thread. */ -UNIV_INTERN -void -thr_local_set_slot_no( -/*==================*/ - os_thread_id_t id, /*!< in: thread id of the thread */ - ulint slot_no);/*!< in: slot number */ - -#ifndef UNIV_NONINL -#include "thr0loc.ic" -#endif - -#endif diff --git a/storage/innobase/include/thr0loc.ic b/storage/innobase/include/thr0loc.ic deleted file mode 100644 index ce44e512320..00000000000 --- a/storage/innobase/include/thr0loc.ic +++ /dev/null @@ -1,24 +0,0 @@ -/***************************************************************************** - -Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved. - -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free Software -Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along with -this program; if not, write to the Free Software Foundation, Inc., 59 Temple -Place, Suite 330, Boston, MA 02111-1307 USA - -*****************************************************************************/ - -/**************************************************//** -@file include/thr0loc.ic -Thread local storage - -Created 10/4/1995 Heikki Tuuri -*******************************************************/ diff --git a/storage/innobase/mem/mem0dbg.c b/storage/innobase/mem/mem0dbg.c index d91e610a08a..ae43d6097a6 100644 --- a/storage/innobase/mem/mem0dbg.c +++ b/storage/innobase/mem/mem0dbg.c @@ -24,6 +24,8 @@ but is included in mem0mem.* ! Created 6/9/1994 Heikki Tuuri *************************************************************************/ +#include "ha_prototypes.h" + #ifdef UNIV_MEM_DEBUG # ifndef UNIV_HOTBACKUP /* The mutex which protects in the debug version the hash table @@ -400,7 +402,7 @@ mem_hash_remove( fprintf(stderr, "Memory heap or buffer freed in %s line %lu" " did not exist.\n", - file_name, (ulong) line); + innobase_basename(file_name), (ulong) line); ut_error; } @@ -419,8 +421,9 @@ mem_hash_remove( "in %s line %lu and tried to free in %s line %lu.\n" "Hex dump of 400 bytes around memory heap" " first block start:\n", - node->nth_heap, node->file_name, (ulong) node->line, - file_name, (ulong) line); + node->nth_heap, + innobase_basename(node->file_name), (ulong) node->line, + innobase_basename(file_name), (ulong) line); ut_print_buf(stderr, (byte*)node->heap - 200, 400); fputs("\nDump of the mem heap:\n", stderr); mem_heap_validate_or_print(node->heap, NULL, TRUE, &error, @@ -763,7 +766,8 @@ mem_validate_no_assert(void) "Inconsistency in memory heap" " or buffer created\n" "in %s line %lu.\n", - node->file_name, node->line); + innobase_basename(node->file_name), + node->line); mutex_exit(&mem_hash_mutex); @@ -989,7 +993,8 @@ mem_print_info_low( fprintf(outfile, "%lu: file %s line %lu of size %lu phys.size %lu" " with %lu blocks, type %lu\n", - node->nth_heap, node->file_name, node->line, + node->nth_heap, + innobase_basename(node->file_name), node->line, allocated_mem, ph_size, n_blocks, (node->heap)->type); next_heap: diff --git a/storage/innobase/mtr/mtr0mtr.c b/storage/innobase/mtr/mtr0mtr.c index 0b2100319c2..877cb93b926 100644 --- a/storage/innobase/mtr/mtr0mtr.c +++ b/storage/innobase/mtr/mtr0mtr.c @@ -251,6 +251,7 @@ mtr_commit( ut_ad(mtr); ut_ad(mtr->magic_n == MTR_MAGIC_N); ut_ad(mtr->state == MTR_ACTIVE); + ut_ad(!mtr->inside_ibuf); ut_d(mtr->state = MTR_COMMITTING); #ifndef UNIV_HOTBACKUP diff --git a/storage/innobase/page/page0page.c b/storage/innobase/page/page0page.c index 99182e85849..964d0e2abef 100644 --- a/storage/innobase/page/page0page.c +++ b/storage/innobase/page/page0page.c @@ -166,11 +166,11 @@ static ibool page_dir_slot_check( /*================*/ - page_dir_slot_t* slot) /*!< in: slot */ + const page_dir_slot_t* slot) /*!< in: slot */ { - page_t* page; - ulint n_slots; - ulint n_owned; + const page_t* page; + ulint n_slots; + ulint n_owned; ut_a(slot); @@ -1803,12 +1803,12 @@ UNIV_INTERN ibool page_rec_validate( /*==============*/ - rec_t* rec, /*!< in: physical record */ + const rec_t* rec, /*!< in: physical record */ const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ { - ulint n_owned; - ulint heap_no; - page_t* page; + ulint n_owned; + ulint heap_no; + const page_t* page; page = page_align(rec); ut_a(!page_is_comp(page) == !rec_offs_comp(offsets)); @@ -1889,16 +1889,16 @@ UNIV_INTERN ibool page_simple_validate_old( /*=====================*/ - page_t* page) /*!< in: old-style index page */ + const page_t* page) /*!< in: index page in ROW_FORMAT=REDUNDANT */ { - page_dir_slot_t* slot; - ulint slot_no; - ulint n_slots; - rec_t* rec; - byte* rec_heap_top; - ulint count; - ulint own_count; - ibool ret = FALSE; + const page_dir_slot_t* slot; + ulint slot_no; + ulint n_slots; + const rec_t* rec; + const byte* rec_heap_top; + ulint count; + ulint own_count; + ibool ret = FALSE; ut_a(!page_is_comp(page)); @@ -2011,7 +2011,7 @@ page_simple_validate_old( goto func_exit; } - rec = page_rec_get_next(rec); + rec = page_rec_get_next_const(rec); own_count++; } @@ -2072,7 +2072,7 @@ page_simple_validate_old( goto func_exit; } - rec = page_rec_get_next(rec); + rec = page_rec_get_next_const(rec); } if (UNIV_UNLIKELY(page_dir_get_n_heap(page) != count + 1)) { @@ -2099,16 +2099,16 @@ UNIV_INTERN ibool page_simple_validate_new( /*=====================*/ - page_t* page) /*!< in: new-style index page */ + const page_t* page) /*!< in: index page in ROW_FORMAT!=REDUNDANT */ { - page_dir_slot_t* slot; - ulint slot_no; - ulint n_slots; - rec_t* rec; - byte* rec_heap_top; - ulint count; - ulint own_count; - ibool ret = FALSE; + const page_dir_slot_t* slot; + ulint slot_no; + ulint n_slots; + const rec_t* rec; + const byte* rec_heap_top; + ulint count; + ulint own_count; + ibool ret = FALSE; ut_a(page_is_comp(page)); @@ -2221,7 +2221,7 @@ page_simple_validate_new( goto func_exit; } - rec = page_rec_get_next(rec); + rec = page_rec_get_next_const(rec); own_count++; } @@ -2283,7 +2283,7 @@ page_simple_validate_new( goto func_exit; } - rec = page_rec_get_next(rec); + rec = page_rec_get_next_const(rec); } if (UNIV_UNLIKELY(page_dir_get_n_heap(page) != count + 1)) { @@ -2308,26 +2308,26 @@ UNIV_INTERN ibool page_validate( /*==========*/ - page_t* page, /*!< in: index page */ + const page_t* page, /*!< in: index page */ dict_index_t* index) /*!< in: data dictionary index containing the page record type definition */ { - page_dir_slot_t*slot; - mem_heap_t* heap; - byte* buf; - ulint count; - ulint own_count; - ulint rec_own_count; - ulint slot_no; - ulint data_size; - rec_t* rec; - rec_t* old_rec = NULL; - ulint offs; - ulint n_slots; - ibool ret = FALSE; - ulint i; - ulint* offsets = NULL; - ulint* old_offsets = NULL; + const page_dir_slot_t* slot; + mem_heap_t* heap; + byte* buf; + ulint count; + ulint own_count; + ulint rec_own_count; + ulint slot_no; + ulint data_size; + const rec_t* rec; + const rec_t* old_rec = NULL; + ulint offs; + ulint n_slots; + ibool ret = FALSE; + ulint i; + ulint* offsets = NULL; + ulint* old_offsets = NULL; if (UNIV_UNLIKELY((ibool) !!page_is_comp(page) != dict_table_is_comp(index->table))) { @@ -2482,7 +2482,7 @@ page_validate( count++; own_count++; old_rec = rec; - rec = page_rec_get_next(rec); + rec = page_rec_get_next_const(rec); /* set old_offsets to offsets; recycle offsets */ { @@ -2556,7 +2556,7 @@ n_owned_zero: buf[offs + i] = 1; } - rec = page_rec_get_next(rec); + rec = page_rec_get_next_const(rec); } if (UNIV_UNLIKELY(page_dir_get_n_heap(page) != count + 1)) { diff --git a/storage/innobase/page/page0zip.c b/storage/innobase/page/page0zip.c index 704b0c88e02..f077a56b087 100644 --- a/storage/innobase/page/page0zip.c +++ b/storage/innobase/page/page0zip.c @@ -653,13 +653,13 @@ page_zip_dir_encode( Allocate memory for zlib. */ static void* -page_zip_malloc( +page_zip_zalloc( /*============*/ void* opaque, /*!< in/out: memory heap */ uInt items, /*!< in: number of items to allocate */ uInt size) /*!< in: size of an item in bytes */ { - return(mem_heap_alloc(opaque, items * size)); + return(mem_heap_zalloc(opaque, items * size)); } /**********************************************************************//** @@ -684,7 +684,7 @@ page_zip_set_alloc( { z_stream* strm = stream; - strm->zalloc = page_zip_malloc; + strm->zalloc = page_zip_zalloc; strm->zfree = page_zip_free; strm->opaque = heap; } @@ -2912,19 +2912,18 @@ zlib_error: page_zip_set_alloc(&d_stream, heap); - if (UNIV_UNLIKELY(inflateInit2(&d_stream, UNIV_PAGE_SIZE_SHIFT) - != Z_OK)) { - ut_error; - } - d_stream.next_in = page_zip->data + PAGE_DATA; /* Subtract the space reserved for the page header and the end marker of the modification log. */ d_stream.avail_in = page_zip_get_size(page_zip) - (PAGE_DATA + 1); - d_stream.next_out = page + PAGE_ZIP_START; d_stream.avail_out = UNIV_PAGE_SIZE - PAGE_ZIP_START; + if (UNIV_UNLIKELY(inflateInit2(&d_stream, UNIV_PAGE_SIZE_SHIFT) + != Z_OK)) { + ut_error; + } + /* Decode the zlib header and the index information. */ if (UNIV_UNLIKELY(inflate(&d_stream, Z_BLOCK) != Z_OK)) { diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c index 3e10aa03096..dcf22656ad8 100644 --- a/storage/innobase/srv/srv0srv.c +++ b/storage/innobase/srv/srv0srv.c @@ -66,7 +66,6 @@ Created 10/8/1995 Heikki Tuuri #include "mem0mem.h" #include "mem0pool.h" #include "sync0sync.h" -#include "thr0loc.h" #include "que0que.h" #include "log0recv.h" #include "pars0pars.h" @@ -690,7 +689,7 @@ Unix.*/ struct srv_slot_struct{ os_thread_id_t id; /*!< thread id */ os_thread_t handle; /*!< thread handle */ - unsigned type:3; /*!< thread type: user, utility etc. */ + unsigned type:1; /*!< thread type: user, utility etc. */ unsigned in_use:1; /*!< TRUE if this slot is in use */ unsigned suspended:1; /*!< TRUE if the thread is waiting for the event of this slot */ @@ -797,6 +796,7 @@ srv_table_get_nth_slot( /*===================*/ ulint index) /*!< in: index of the slot */ { + ut_ad(mutex_own(&kernel_mutex)); ut_a(index < OS_THREAD_MAX_N); return(srv_sys->threads + index); @@ -815,7 +815,7 @@ srv_get_n_threads(void) mutex_enter(&kernel_mutex); - for (i = SRV_COM; i < SRV_MASTER + 1; i++) { + for (i = 0; i < SRV_MASTER + 1; i++) { n_threads += srv_n_threads[i]; } @@ -825,13 +825,46 @@ srv_get_n_threads(void) return(n_threads); } +#ifdef UNIV_DEBUG /*********************************************************************//** -Reserves a slot in the thread table for the current thread. Also creates the -thread local storage struct for the current thread. NOTE! The server mutex -has to be reserved by the caller! -@return reserved slot index */ +Validates the type of a thread table slot. +@return TRUE if ok */ static -ulint +ibool +srv_thread_type_validate( +/*=====================*/ + enum srv_thread_type type) /*!< in: thread type */ +{ + switch (type) { + case SRV_WORKER: + case SRV_MASTER: + return(TRUE); + } + ut_error; + return(FALSE); +} +#endif /* UNIV_DEBUG */ + +/*********************************************************************//** +Gets the type of a thread table slot. +@return thread type */ +static +enum srv_thread_type +srv_slot_get_type( +/*==============*/ + const srv_slot_t* slot) /*!< in: thread slot */ +{ + enum srv_thread_type type = (enum srv_thread_type) slot->type; + ut_ad(srv_thread_type_validate(type)); + return(type); +} + +/*********************************************************************//** +Reserves a slot in the thread table for the current thread. +NOTE! The server mutex has to be reserved by the caller! +@return reserved slot */ +static +srv_slot_t* srv_table_reserve_slot( /*===================*/ enum srv_thread_type type) /*!< in: type of the thread */ @@ -839,8 +872,7 @@ srv_table_reserve_slot( srv_slot_t* slot; ulint i; - ut_a(type > 0); - ut_a(type <= SRV_MASTER); + ut_ad(srv_thread_type_validate(type)); ut_ad(mutex_own(&kernel_mutex)); i = 0; @@ -851,53 +883,40 @@ srv_table_reserve_slot( slot = srv_table_get_nth_slot(i); } - ut_a(slot->in_use == FALSE); - slot->in_use = TRUE; slot->suspended = FALSE; slot->type = type; + ut_ad(srv_slot_get_type(slot) == type); slot->id = os_thread_get_curr_id(); slot->handle = os_thread_get_curr(); - thr_local_create(); - - thr_local_set_slot_no(os_thread_get_curr_id(), i); - - return(i); + return(slot); } /*********************************************************************//** Suspends the calling thread to wait for the event in its thread slot. -NOTE! The server mutex has to be reserved by the caller! -@return event for the calling thread to wait */ +NOTE! The server mutex has to be reserved by the caller! */ static -os_event_t -srv_suspend_thread(void) -/*====================*/ +void +srv_suspend_thread( +/*===============*/ + srv_slot_t* slot) /*!< in/out: thread slot */ { - srv_slot_t* slot; - os_event_t event; - ulint slot_no; enum srv_thread_type type; ut_ad(mutex_own(&kernel_mutex)); - - slot_no = thr_local_get_slot_no(os_thread_get_curr_id()); + ut_ad(slot->in_use); + ut_ad(!slot->suspended); + ut_ad(slot->id == os_thread_get_curr_id()); if (srv_print_thread_releases) { fprintf(stderr, "Suspending thread %lu to slot %lu\n", - (ulong) os_thread_get_curr_id(), (ulong) slot_no); + (ulong) os_thread_get_curr_id(), + (ulong) (slot - srv_sys->threads)); } - slot = srv_table_get_nth_slot(slot_no); - - type = slot->type; - - ut_ad(type >= SRV_WORKER); - ut_ad(type <= SRV_MASTER); - - event = slot->event; + type = srv_slot_get_type(slot); slot->suspended = TRUE; @@ -905,9 +924,7 @@ srv_suspend_thread(void) srv_n_threads_active[type]--; - os_event_reset(event); - - return(event); + os_event_reset(slot->event); } /*********************************************************************//** @@ -926,8 +943,7 @@ srv_release_threads( ulint i; ulint count = 0; - ut_ad(type >= SRV_WORKER); - ut_ad(type <= SRV_MASTER); + ut_ad(srv_thread_type_validate(type)); ut_ad(n > 0); ut_ad(mutex_own(&kernel_mutex)); @@ -935,7 +951,8 @@ srv_release_threads( slot = srv_table_get_nth_slot(i); - if (slot->in_use && slot->type == type && slot->suspended) { + if (slot->in_use && slot->suspended + && srv_slot_get_type(slot) == type) { slot->suspended = FALSE; @@ -963,34 +980,6 @@ srv_release_threads( } /*********************************************************************//** -Returns the calling thread type. -@return SRV_COM, ... */ -UNIV_INTERN -enum srv_thread_type -srv_get_thread_type(void) -/*=====================*/ -{ - ulint slot_no; - srv_slot_t* slot; - enum srv_thread_type type; - - mutex_enter(&kernel_mutex); - - slot_no = thr_local_get_slot_no(os_thread_get_curr_id()); - - slot = srv_table_get_nth_slot(slot_no); - - type = slot->type; - - ut_ad(type >= SRV_WORKER); - ut_ad(type <= SRV_MASTER); - - mutex_exit(&kernel_mutex); - - return(type); -} - -/*********************************************************************//** Check whether thread type has reserved a slot. Return the first slot that is found. This works because we currently have only 1 thread of each type. @return slot number or ULINT_UNDEFINED if not found*/ @@ -1003,6 +992,7 @@ srv_thread_has_reserved_slot( ulint i; ulint slot_no = ULINT_UNDEFINED; + ut_ad(srv_thread_type_validate(type)); mutex_enter(&kernel_mutex); for (i = 0; i < OS_THREAD_MAX_N; i++) { @@ -1040,22 +1030,18 @@ srv_init(void) mutex_create(srv_innodb_monitor_mutex_key, &srv_innodb_monitor_mutex, SYNC_NO_ORDER_CHECK); - srv_sys->threads = mem_alloc(OS_THREAD_MAX_N * sizeof(srv_slot_t)); + srv_sys->threads = mem_zalloc(OS_THREAD_MAX_N * sizeof(srv_slot_t)); for (i = 0; i < OS_THREAD_MAX_N; i++) { - slot = srv_table_get_nth_slot(i); - slot->in_use = FALSE; - slot->type=0; /* Avoid purify errors */ + slot = srv_sys->threads + i; slot->event = os_event_create(NULL); ut_a(slot->event); } - srv_mysql_table = mem_alloc(OS_THREAD_MAX_N * sizeof(srv_slot_t)); + srv_mysql_table = mem_zalloc(OS_THREAD_MAX_N * sizeof(srv_slot_t)); for (i = 0; i < OS_THREAD_MAX_N; i++) { slot = srv_mysql_table + i; - slot->in_use = FALSE; - slot->type = 0; slot->event = os_event_create(NULL); ut_a(slot->event); } @@ -1142,7 +1128,6 @@ srv_general_init(void) os_sync_init(); sync_init(); mem_init(srv_mem_pool_size); - thr_local_init(); } /*======================= InnoDB Server FIFO queue =======================*/ @@ -1501,7 +1486,7 @@ srv_table_reserve_slot_for_mysql(void) while (slot->in_use) { i++; - if (i >= OS_THREAD_MAX_N) { + if (UNIV_UNLIKELY(i >= OS_THREAD_MAX_N)) { ut_print_timestamp(stderr); @@ -2382,6 +2367,12 @@ srv_error_monitor_thread( ib_uint64_t old_lsn; ib_uint64_t new_lsn; ib_int64_t sig_count; + /* longest waiting thread for a semaphore */ + os_thread_id_t waiter = os_thread_get_curr_id(); + os_thread_id_t old_waiter = waiter; + /* the semaphore that is being waited for */ + const void* sema = NULL; + const void* old_sema = NULL; old_lsn = srv_start_lsn; @@ -2435,7 +2426,8 @@ loop: sync_arr_wake_threads_if_sema_free(); - if (sync_array_print_long_waits()) { + if (sync_array_print_long_waits(&waiter, &sema) + && sema == old_sema && os_thread_eq(waiter, old_waiter)) { fatal_cnt++; if (fatal_cnt > 10) { @@ -2450,6 +2442,8 @@ loop: } } else { fatal_cnt = 0; + old_waiter = waiter; + old_sema = sema; } /* Flush stderr so that a database user gets the output @@ -2489,7 +2483,7 @@ srv_is_any_background_thread_active(void) mutex_enter(&kernel_mutex); - for (i = SRV_COM; i <= SRV_MASTER; ++i) { + for (i = 0; i <= SRV_MASTER; ++i) { if (srv_n_threads_active[i] != 0) { ret = TRUE; break; @@ -2643,7 +2637,7 @@ srv_master_thread( os_thread_create */ { buf_pool_stat_t buf_stat; - os_event_t event; + srv_slot_t* slot; ulint old_activity_count; ulint n_pages_purged = 0; ulint n_bytes_merged; @@ -2671,7 +2665,7 @@ srv_master_thread( mutex_enter(&kernel_mutex); - srv_table_reserve_slot(SRV_MASTER); + slot = srv_table_reserve_slot(SRV_MASTER); srv_n_threads_active[SRV_MASTER]++; @@ -3060,7 +3054,7 @@ suspend_thread: goto loop; } - event = srv_suspend_thread(); + srv_suspend_thread(slot); mutex_exit(&kernel_mutex); @@ -3070,7 +3064,7 @@ suspend_thread: manual also mentions this string in several places. */ srv_main_thread_op_info = "waiting for server activity"; - os_event_wait(event); + os_event_wait(slot->event); if (srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS) { /* This is only extra safety, the thread should exit @@ -3084,8 +3078,6 @@ suspend_thread: main thread goes back to loop. */ goto loop; - - OS_THREAD_DUMMY_RETURN; /* Not reached, avoid compiler warning */ } /*********************************************************************//** @@ -3100,7 +3092,6 @@ srv_purge_thread( { srv_slot_t* slot; ulint retries = 0; - ulint slot_no = ULINT_UNDEFINED; ulint n_total_purged = ULINT_UNDEFINED; ut_a(srv_n_purge_threads == 1); @@ -3116,9 +3107,7 @@ srv_purge_thread( mutex_enter(&kernel_mutex); - slot_no = srv_table_reserve_slot(SRV_WORKER); - - slot = srv_table_get_nth_slot(slot_no); + slot = srv_table_reserve_slot(SRV_WORKER); ++srv_n_threads_active[SRV_WORKER]; @@ -3137,15 +3126,13 @@ srv_purge_thread( || (n_total_purged == 0 && retries >= TRX_SYS_N_RSEGS)) { - os_event_t event; - mutex_enter(&kernel_mutex); - event = srv_suspend_thread(); + srv_suspend_thread(slot); mutex_exit(&kernel_mutex); - os_event_wait(event); + os_event_wait(slot->event); retries = 0; } @@ -3179,16 +3166,11 @@ srv_purge_thread( mutex_enter(&kernel_mutex); - ut_ad(srv_table_get_nth_slot(slot_no) == slot); - /* Decrement the active count. */ - srv_suspend_thread(); + srv_suspend_thread(slot); slot->in_use = FALSE; - /* Free the thread local memory. */ - thr_local_free(os_thread_get_curr_id()); - mutex_exit(&kernel_mutex); #ifdef UNIV_DEBUG_THREAD_CREATION diff --git a/storage/innobase/srv/srv0start.c b/storage/innobase/srv/srv0start.c index 050fe460652..79eae610a05 100644 --- a/storage/innobase/srv/srv0start.c +++ b/storage/innobase/srv/srv0start.c @@ -85,7 +85,6 @@ Created 2/16/1996 Heikki Tuuri # include "row0row.h" # include "row0mysql.h" # include "btr0pcur.h" -# include "thr0loc.h" # include "os0sync.h" /* for INNODB_RW_LOCKS_USE_ATOMICS */ # include "zlib.h" /* for ZLIB_VERSION */ @@ -2210,7 +2209,6 @@ innobase_shutdown_for_mysql(void) ibuf_close(); log_shutdown(); lock_sys_close(); - thr_local_close(); trx_sys_file_format_close(); trx_sys_close(); diff --git a/storage/innobase/sync/sync0arr.c b/storage/innobase/sync/sync0arr.c index 3ecbce72ebd..30caddccced 100644 --- a/storage/innobase/sync/sync0arr.c +++ b/storage/innobase/sync/sync0arr.c @@ -40,6 +40,7 @@ Created 9/5/1995 Heikki Tuuri #include "os0sync.h" #include "os0file.h" #include "srv0srv.h" +#include "ha_prototypes.h" /* WAIT ARRAY @@ -478,8 +479,8 @@ sync_array_cell_print( fprintf(file, "--Thread %lu has waited at %s line %lu" " for %.2f seconds the semaphore:\n", - (ulong) os_thread_pf(cell->thread), cell->file, - (ulong) cell->line, + (ulong) os_thread_pf(cell->thread), + innobase_basename(cell->file), (ulong) cell->line, difftime(time(NULL), cell->reservation_time)); if (type == SYNC_MUTEX) { @@ -493,7 +494,8 @@ sync_array_cell_print( "Last time reserved in file %s line %lu, " #endif /* UNIV_SYNC_DEBUG */ "waiters flag %lu\n", - (void*) mutex, mutex->cfile_name, (ulong) mutex->cline, + (void*) mutex, innobase_basename(mutex->cfile_name), + (ulong) mutex->cline, (ulong) mutex->lock_word, #ifdef UNIV_SYNC_DEBUG mutex->file_name, (ulong) mutex->line, @@ -512,7 +514,7 @@ sync_array_cell_print( fprintf(file, " RW-latch at %p created in file %s line %lu\n", - (void*) rwlock, rwlock->cfile_name, + (void*) rwlock, innobase_basename(rwlock->cfile_name), (ulong) rwlock->cline); writer = rw_lock_get_writer(rwlock); if (writer != RW_LOCK_NOT_LOCKED) { @@ -533,7 +535,7 @@ sync_array_cell_print( (ulong) rw_lock_get_reader_count(rwlock), (ulong) rwlock->waiters, rwlock->lock_word, - rwlock->last_s_file_name, + innobase_basename(rwlock->last_s_file_name), (ulong) rwlock->last_s_line, rwlock->last_x_file_name, (ulong) rwlock->last_x_line); @@ -913,8 +915,10 @@ Prints warnings of long semaphore waits to stderr. @return TRUE if fatal semaphore wait threshold was exceeded */ UNIV_INTERN ibool -sync_array_print_long_waits(void) -/*=============================*/ +sync_array_print_long_waits( +/*========================*/ + os_thread_id_t* waiter, /*!< out: longest waiting thread */ + const void** sema) /*!< out: longest-waited-for semaphore */ { sync_cell_t* cell; ibool old_val; @@ -922,6 +926,7 @@ sync_array_print_long_waits(void) ulint i; ulint fatal_timeout = srv_fatal_semaphore_wait_threshold; ibool fatal = FALSE; + double longest_diff = 0; #ifdef UNIV_DEBUG_VALGRIND /* Increase the timeouts if running under valgrind because it executes @@ -937,22 +942,36 @@ sync_array_print_long_waits(void) for (i = 0; i < sync_primary_wait_array->n_cells; i++) { + double diff; + void* wait_object; + cell = sync_array_get_nth_cell(sync_primary_wait_array, i); - if (cell->wait_object != NULL && cell->waiting - && difftime(time(NULL), cell->reservation_time) - > SYNC_ARRAY_TIMEOUT) { + wait_object = cell->wait_object; + + if (wait_object == NULL || !cell->waiting) { + + continue; + } + + diff = difftime(time(NULL), cell->reservation_time); + + if (diff > SYNC_ARRAY_TIMEOUT) { fputs("InnoDB: Warning: a long semaphore wait:\n", stderr); sync_array_cell_print(stderr, cell); noticed = TRUE; } - if (cell->wait_object != NULL && cell->waiting - && difftime(time(NULL), cell->reservation_time) - > fatal_timeout) { + if (diff > fatal_timeout) { fatal = TRUE; } + + if (diff > longest_diff) { + longest_diff = diff; + *sema = wait_object; + *waiter = cell->thread; + } } if (noticed) { diff --git a/storage/innobase/sync/sync0rw.c b/storage/innobase/sync/sync0rw.c index 73d1e3aa46e..397d505df50 100644 --- a/storage/innobase/sync/sync0rw.c +++ b/storage/innobase/sync/sync0rw.c @@ -39,6 +39,7 @@ Created 9/11/1995 Heikki Tuuri #include "mem0mem.h" #include "srv0srv.h" #include "os0sync.h" /* for INNODB_RW_LOCKS_USE_ATOMICS */ +#include "ha_prototypes.h" /* IMPLEMENTATION OF THE RW_LOCK @@ -407,7 +408,8 @@ lock_loop: " cfile %s cline %lu rnds %lu\n", (ulong) os_thread_pf(os_thread_get_curr_id()), (void*) lock, - lock->cfile_name, (ulong) lock->cline, (ulong) i); + innobase_basename(lock->cfile_name), + (ulong) lock->cline, (ulong) i); } /* We try once again to obtain the lock */ @@ -442,7 +444,8 @@ lock_loop: "Thread %lu OS wait rw-s-lock at %p" " cfile %s cline %lu\n", os_thread_pf(os_thread_get_curr_id()), - (void*) lock, lock->cfile_name, + (void*) lock, + innobase_basename(lock->cfile_name), (ulong) lock->cline); } @@ -664,7 +667,8 @@ lock_loop: "Thread %lu spin wait rw-x-lock at %p" " cfile %s cline %lu rnds %lu\n", os_thread_pf(os_thread_get_curr_id()), (void*) lock, - lock->cfile_name, (ulong) lock->cline, (ulong) i); + innobase_basename(lock->cfile_name), + (ulong) lock->cline, (ulong) i); } sync_array_reserve_cell(sync_primary_wait_array, @@ -687,7 +691,8 @@ lock_loop: "Thread %lu OS wait for rw-x-lock at %p" " cfile %s cline %lu\n", os_thread_pf(os_thread_get_curr_id()), (void*) lock, - lock->cfile_name, (ulong) lock->cline); + innobase_basename(lock->cfile_name), + (ulong) lock->cline); } /* these stats may not be accurate */ diff --git a/storage/innobase/sync/sync0sync.c b/storage/innobase/sync/sync0sync.c index 0f6a60ca260..23fd64cc5ed 100644 --- a/storage/innobase/sync/sync0sync.c +++ b/storage/innobase/sync/sync0sync.c @@ -43,6 +43,7 @@ Created 9/5/1995 Heikki Tuuri #ifdef UNIV_SYNC_DEBUG # include "srv0start.h" /* srv_is_being_started */ #endif /* UNIV_SYNC_DEBUG */ +#include "ha_prototypes.h" /* REASONS FOR IMPLEMENTING THE SPIN LOCK MUTEX @@ -543,7 +544,8 @@ spin_loop: "Thread %lu spin wait mutex at %p" " cfile %s cline %lu rnds %lu\n", (ulong) os_thread_pf(os_thread_get_curr_id()), (void*) mutex, - mutex->cfile_name, (ulong) mutex->cline, (ulong) i); + innobase_basename(mutex->cfile_name), + (ulong) mutex->cline, (ulong) i); #endif mutex_spin_round_count += i; @@ -620,7 +622,8 @@ spin_loop: fprintf(stderr, "Thread %lu OS wait mutex at %p cfile %s cline %lu rnds %lu\n", (ulong) os_thread_pf(os_thread_get_curr_id()), (void*) mutex, - mutex->cfile_name, (ulong) mutex->cline, (ulong) i); + innobase_basename(mutex->cfile_name), + (ulong) mutex->cline, (ulong) i); #endif mutex_os_wait_count++; @@ -869,7 +872,8 @@ sync_print_warning( if (mutex->magic_n == MUTEX_MAGIC_N) { fprintf(stderr, "Mutex created at %s %lu\n", - mutex->cfile_name, (ulong) mutex->cline); + innobase_basename(mutex->cfile_name), + (ulong) mutex->cline); if (mutex_get_lock_word(mutex) != 0) { ulint line; diff --git a/storage/innobase/thr/thr0loc.c b/storage/innobase/thr/thr0loc.c deleted file mode 100644 index b7364afa166..00000000000 --- a/storage/innobase/thr/thr0loc.c +++ /dev/null @@ -1,287 +0,0 @@ -/***************************************************************************** - -Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved. - -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free Software -Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along with -this program; if not, write to the Free Software Foundation, Inc., 59 Temple -Place, Suite 330, Boston, MA 02111-1307 USA - -*****************************************************************************/ - -/**************************************************//** -@file thr/thr0loc.c -The thread local storage - -Created 10/5/1995 Heikki Tuuri -*******************************************************/ - -#include "thr0loc.h" -#ifdef UNIV_NONINL -#include "thr0loc.ic" -#endif - -#include "sync0sync.h" -#include "hash0hash.h" -#include "mem0mem.h" -#include "srv0srv.h" - -/* - IMPLEMENTATION OF THREAD LOCAL STORAGE - ====================================== - -The threads sometimes need private data which depends on the thread id. -This is implemented as a hash table, where the hash value is calculated -from the thread id, to prepare for a large number of threads. The hash table -is protected by a mutex. If you need modify the program and put new data to -the thread local storage, just add it to struct thr_local_struct in the -header file. */ - -/** Mutex protecting thr_local_hash */ -static mutex_t thr_local_mutex; - -/** The hash table. The module is not yet initialized when it is NULL. */ -static hash_table_t* thr_local_hash = NULL; - -/** Thread local data */ -typedef struct thr_local_struct thr_local_t; - -#ifdef UNIV_PFS_MUTEX -/* Key to register the mutex with performance schema */ -UNIV_INTERN mysql_pfs_key_t thr_local_mutex_key; -#endif /* UNIV_PFS_MUTEX */ - -/** @brief Thread local data. -The private data for each thread should be put to -the structure below and the accessor functions written -for the field. */ -struct thr_local_struct{ - os_thread_id_t id; /*!< id of the thread which owns this struct */ - os_thread_t handle; /*!< operating system handle to the thread */ - ulint slot_no;/*!< the index of the slot in the thread table - for this thread */ - ibool in_ibuf;/*!< TRUE if the thread is doing an ibuf - operation */ - hash_node_t hash; /*!< hash chain node */ - ulint magic_n;/*!< magic number (THR_LOCAL_MAGIC_N) */ -}; - -/** The value of thr_local_struct::magic_n */ -#define THR_LOCAL_MAGIC_N 1231234 - -#ifdef UNIV_DEBUG -/*******************************************************************//** -Validates thread local data. -@return TRUE if valid */ -static -ibool -thr_local_validate( -/*===============*/ - const thr_local_t* local) /*!< in: data to validate */ -{ - ut_ad(local->magic_n == THR_LOCAL_MAGIC_N); - ut_ad(local->slot_no == ULINT_UNDEFINED - || local->slot_no < OS_THREAD_MAX_N); - ut_ad(local->in_ibuf == FALSE || local->in_ibuf == TRUE); - return(TRUE); -} -#endif /* UNIV_DEBUG */ - -/*******************************************************************//** -Returns the local storage struct for a thread. -@return local storage */ -static -thr_local_t* -thr_local_get( -/*==========*/ - os_thread_id_t id) /*!< in: thread id of the thread */ -{ - thr_local_t* local; - -try_again: - ut_ad(thr_local_hash); - ut_ad(mutex_own(&thr_local_mutex)); - - /* Look for the local struct in the hash table */ - - local = NULL; - - HASH_SEARCH(hash, thr_local_hash, os_thread_pf(id), - thr_local_t*, local, ut_ad(thr_local_validate(local)), - os_thread_eq(local->id, id)); - if (local == NULL) { - mutex_exit(&thr_local_mutex); - - thr_local_create(); - - mutex_enter(&thr_local_mutex); - - goto try_again; - } - - ut_ad(thr_local_validate(local)); - - return(local); -} - -/*******************************************************************//** -Gets the slot number in the thread table of a thread. -@return slot number */ -UNIV_INTERN -ulint -thr_local_get_slot_no( -/*==================*/ - os_thread_id_t id) /*!< in: thread id of the thread */ -{ - ulint slot_no; - thr_local_t* local; - - mutex_enter(&thr_local_mutex); - - local = thr_local_get(id); - - slot_no = local->slot_no; - - mutex_exit(&thr_local_mutex); - - return(slot_no); -} - -/*******************************************************************//** -Sets the slot number in the thread table of a thread. */ -UNIV_INTERN -void -thr_local_set_slot_no( -/*==================*/ - os_thread_id_t id, /*!< in: thread id of the thread */ - ulint slot_no)/*!< in: slot number */ -{ - thr_local_t* local; - - mutex_enter(&thr_local_mutex); - - local = thr_local_get(id); - - local->slot_no = slot_no; - - mutex_exit(&thr_local_mutex); -} - -/*******************************************************************//** -Creates a local storage struct for the calling new thread. */ -UNIV_INTERN -void -thr_local_create(void) -/*==================*/ -{ - thr_local_t* local; - - if (thr_local_hash == NULL) { - thr_local_init(); - } - - local = mem_alloc(sizeof(thr_local_t)); - - local->id = os_thread_get_curr_id(); - local->handle = os_thread_get_curr(); - local->magic_n = THR_LOCAL_MAGIC_N; - local->slot_no = ULINT_UNDEFINED; - local->in_ibuf = FALSE; - - mutex_enter(&thr_local_mutex); - - HASH_INSERT(thr_local_t, hash, thr_local_hash, - os_thread_pf(os_thread_get_curr_id()), - local); - - mutex_exit(&thr_local_mutex); -} - -/*******************************************************************//** -Frees the local storage struct for the specified thread. */ -UNIV_INTERN -void -thr_local_free( -/*===========*/ - os_thread_id_t id) /*!< in: thread id */ -{ - thr_local_t* local; - - mutex_enter(&thr_local_mutex); - - /* Look for the local struct in the hash table */ - - HASH_SEARCH(hash, thr_local_hash, os_thread_pf(id), - thr_local_t*, local, ut_ad(thr_local_validate(local)), - os_thread_eq(local->id, id)); - if (local == NULL) { - mutex_exit(&thr_local_mutex); - - return; - } - - HASH_DELETE(thr_local_t, hash, thr_local_hash, - os_thread_pf(id), local); - - mutex_exit(&thr_local_mutex); - - ut_a(local->magic_n == THR_LOCAL_MAGIC_N); - ut_ad(thr_local_validate(local)); - - mem_free(local); -} - -/****************************************************************//** -Initializes the thread local storage module. */ -UNIV_INTERN -void -thr_local_init(void) -/*================*/ -{ - - ut_a(thr_local_hash == NULL); - - thr_local_hash = hash_create(OS_THREAD_MAX_N + 100); - - mutex_create(thr_local_mutex_key, - &thr_local_mutex, SYNC_THR_LOCAL); -} - -/******************************************************************** -Close the thread local storage module. */ -UNIV_INTERN -void -thr_local_close(void) -/*=================*/ -{ - ulint i; - - ut_a(thr_local_hash != NULL); - - /* Free the hash elements. We don't remove them from the table - because we are going to destroy the table anyway. */ - for (i = 0; i < hash_get_n_cells(thr_local_hash); i++) { - thr_local_t* local; - - local = HASH_GET_FIRST(thr_local_hash, i); - - while (local) { - thr_local_t* prev_local = local; - - local = HASH_GET_NEXT(hash, prev_local); - ut_a(prev_local->magic_n == THR_LOCAL_MAGIC_N); - ut_ad(thr_local_validate(prev_local)); - mem_free(prev_local); - } - } - - hash_table_free(thr_local_hash); - thr_local_hash = NULL; -} diff --git a/storage/innobase/trx/trx0i_s.c b/storage/innobase/trx/trx0i_s.c index aff49e20726..c18b747da6d 100644 --- a/storage/innobase/trx/trx0i_s.c +++ b/storage/innobase/trx/trx0i_s.c @@ -518,7 +518,7 @@ fill_trx_row( query[stmt_len] = '\0'; row->trx_query = ha_storage_put_memlim( - cache->storage, stmt, stmt_len + 1, + cache->storage, query, stmt_len + 1, MAX_ALLOWED_FOR_STORAGE(cache)); row->trx_query_cs = innobase_get_charset(trx->mysql_thd); diff --git a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c index 820c40fe857..0d01bedc4fb 100644 --- a/storage/innobase/trx/trx0trx.c +++ b/storage/innobase/trx/trx0trx.c @@ -38,7 +38,6 @@ Created 3/26/1996 Heikki Tuuri #include "usr0sess.h" #include "read0read.h" #include "srv0srv.h" -#include "thr0loc.h" #include "btr0sea.h" #include "os0proc.h" #include "trx0xa.h" diff --git a/storage/innobase/ut/ut0dbg.c b/storage/innobase/ut/ut0dbg.c index 42ad8c03762..64fadd76d1c 100644 --- a/storage/innobase/ut/ut0dbg.c +++ b/storage/innobase/ut/ut0dbg.c @@ -25,6 +25,7 @@ Created 1/30/1994 Heikki Tuuri #include "univ.i" #include "ut0dbg.h" +#include "ha_prototypes.h" #if defined(__GNUC__) && (__GNUC__ > 2) #else @@ -55,12 +56,13 @@ ut_dbg_assertion_failed( ut_print_timestamp(stderr); #ifdef UNIV_HOTBACKUP fprintf(stderr, " InnoDB: Assertion failure in file %s line %lu\n", - file, line); + innobase_basename(file), line); #else /* UNIV_HOTBACKUP */ fprintf(stderr, " InnoDB: Assertion failure in thread %lu" " in file %s line %lu\n", - os_thread_pf(os_thread_get_curr_id()), file, line); + os_thread_pf(os_thread_get_curr_id()), + innobase_basename(file), line); #endif /* UNIV_HOTBACKUP */ if (expr) { fprintf(stderr, @@ -93,7 +95,8 @@ ut_dbg_stop_thread( { #ifndef UNIV_HOTBACKUP fprintf(stderr, "InnoDB: Thread %lu stopped in file %s line %lu\n", - os_thread_pf(os_thread_get_curr_id()), file, line); + os_thread_pf(os_thread_get_curr_id()), + innobase_basename(file), line); os_thread_sleep(1000000000); #endif /* !UNIV_HOTBACKUP */ } diff --git a/storage/myisam/ft_stopwords.c b/storage/myisam/ft_stopwords.c index e8d81cbbbb1..a9814af220b 100644 --- a/storage/myisam/ft_stopwords.c +++ b/storage/myisam/ft_stopwords.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2005 MySQL AB +/* Copyright (c) 2000, 2011, 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 @@ -16,7 +16,7 @@ /* Written by Sergei A. Golubchik, who has a shared copyright to this code */ #include "ftdefs.h" -#include "my_handler.h" +#include "my_compare.h" static CHARSET_INFO *ft_stopword_cs= NULL; diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index c7b6b2239ce..16457088f9c 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -639,7 +639,7 @@ ha_myisam::ha_myisam(handlerton *hton, TABLE_SHARE *table_arg) HA_DUPLICATE_POS | HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY | HA_FILE_BASED | HA_CAN_GEOMETRY | HA_NO_TRANSACTIONS | HA_CAN_INSERT_DELAYED | HA_CAN_BIT_FIELD | HA_CAN_RTREEKEYS | - HA_HAS_RECORDS | HA_STATS_RECORDS_IS_EXACT), + HA_HAS_RECORDS | HA_STATS_RECORDS_IS_EXACT | HA_CAN_REPAIR), can_enable_indexes(1) {} diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index 5d8a7c3daef..af50ac27c96 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -80,6 +80,7 @@ static SORT_KEY_BLOCKS *alloc_key_blocks(MI_CHECK *param, uint blocks, uint buffer_length); static ha_checksum mi_byte_checksum(const uchar *buf, uint length); static void set_data_file_type(SORT_INFO *sort_info, MYISAM_SHARE *share); +static HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, uchar *a); void myisamchk_init(MI_CHECK *param) { @@ -4729,3 +4730,92 @@ set_data_file_type(SORT_INFO *sort_info, MYISAM_SHARE *share) share->delete_record=tmp.delete_record; } } + +/* + Find the first NULL value in index-suffix values tuple + + SYNOPSIS + ha_find_null() + keyseg Array of keyparts for key suffix + a Key suffix value tuple + + DESCRIPTION + Find the first NULL value in index-suffix values tuple. + + TODO + Consider optimizing this function or its use so we don't search for + NULL values in completely NOT NULL index suffixes. + + RETURN + First key part that has NULL as value in values tuple, or the last key + part (with keyseg->type==HA_TYPE_END) if values tuple doesn't contain + NULLs. +*/ + +static HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, uchar *a) +{ + for (; (enum ha_base_keytype) keyseg->type != HA_KEYTYPE_END; keyseg++) + { + uchar *end; + if (keyseg->null_bit) + { + if (!*a++) + return keyseg; + } + end= a+ keyseg->length; + + switch ((enum ha_base_keytype) keyseg->type) { + case HA_KEYTYPE_TEXT: + case HA_KEYTYPE_BINARY: + case HA_KEYTYPE_BIT: + if (keyseg->flag & HA_SPACE_PACK) + { + int a_length; + get_key_length(a_length, a); + a += a_length; + break; + } + else + a= end; + break; + case HA_KEYTYPE_VARTEXT1: + case HA_KEYTYPE_VARTEXT2: + case HA_KEYTYPE_VARBINARY1: + case HA_KEYTYPE_VARBINARY2: + { + int a_length; + get_key_length(a_length, a); + a+= a_length; + break; + } + case HA_KEYTYPE_NUM: + if (keyseg->flag & HA_SPACE_PACK) + { + int alength= *a++; + end= a+alength; + } + a= end; + break; + case HA_KEYTYPE_INT8: + case HA_KEYTYPE_SHORT_INT: + case HA_KEYTYPE_USHORT_INT: + case HA_KEYTYPE_LONG_INT: + case HA_KEYTYPE_ULONG_INT: + case HA_KEYTYPE_INT24: + case HA_KEYTYPE_UINT24: +#ifdef HAVE_LONG_LONG + case HA_KEYTYPE_LONGLONG: + case HA_KEYTYPE_ULONGLONG: +#endif + case HA_KEYTYPE_FLOAT: + case HA_KEYTYPE_DOUBLE: + a= end; + break; + case HA_KEYTYPE_END: /* purecov: inspected */ + /* keep compiler happy */ + DBUG_ASSERT(0); + break; + } + } + return keyseg; +} diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c index 35b68fe00df..d56f1e18930 100644 --- a/storage/myisam/myisamchk.c +++ b/storage/myisam/myisamchk.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB +/* Copyright (c) 2000, 2011, 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 @@ -673,7 +673,8 @@ get_one_option(int optid, int method; enum_mi_stats_method UNINIT_VAR(method_conv); myisam_stats_method_str= argument; - if ((method=find_type(argument, &myisam_stats_method_typelib, 2)) <= 0) + if ((method= find_type(argument, &myisam_stats_method_typelib, + FIND_TYPE_BASIC)) <= 0) { fprintf(stderr, "Invalid value of stats_method: %s.\n", argument); exit(1); diff --git a/storage/myisammrg/myrg_open.c b/storage/myisammrg/myrg_open.c index c545aff912f..533e5d13cdd 100644 --- a/storage/myisammrg/myrg_open.c +++ b/storage/myisammrg/myrg_open.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc +/* Copyright (c) 2000, 2011, 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 @@ -77,7 +77,7 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking) { if (!strncmp(buff+1,"INSERT_METHOD=",14)) { /* Lookup insert method */ - int tmp=find_type(buff+15,&merge_insert_method,2); + int tmp= find_type(buff + 15, &merge_insert_method, FIND_TYPE_BASIC); found_merge_insert_method = (uint) (tmp >= 0 ? tmp : 0); } continue; /* Skip comments */ @@ -271,7 +271,7 @@ MYRG_INFO *myrg_parent_open(const char *parent_name, { /* Compare buffer with global methods list: merge_insert_method. */ insert_method= find_type(child_name_buff + 15, - &merge_insert_method, 2); + &merge_insert_method, FIND_TYPE_BASIC); } continue; } diff --git a/storage/perfschema/unittest/pfs-t.cc b/storage/perfschema/unittest/pfs-t.cc index 20e736a546f..46e02306aca 100644 --- a/storage/perfschema/unittest/pfs-t.cc +++ b/storage/perfschema/unittest/pfs-t.cc @@ -1205,6 +1205,8 @@ void test_enabled() void do_all_tests() { + /* Using initialize_performance_schema(), no partial init needed. */ + test_bootstrap(); test_bad_registration(); test_init_disabled(); diff --git a/storage/perfschema/unittest/pfs_instr-oom-t.cc b/storage/perfschema/unittest/pfs_instr-oom-t.cc index 13335326932..a00afe8b36a 100644 --- a/storage/perfschema/unittest/pfs_instr-oom-t.cc +++ b/storage/perfschema/unittest/pfs_instr-oom-t.cc @@ -199,7 +199,11 @@ void test_oom() void do_all_tests() { + PFS_atomic::init(); + test_oom(); + + PFS_atomic::cleanup(); } int main(int, char **) diff --git a/storage/perfschema/unittest/pfs_instr-t.cc b/storage/perfschema/unittest/pfs_instr-t.cc index 2ef9a5769ca..b13135aa615 100644 --- a/storage/perfschema/unittest/pfs_instr-t.cc +++ b/storage/perfschema/unittest/pfs_instr-t.cc @@ -400,10 +400,14 @@ void test_per_thread_wait() void do_all_tests() { + PFS_atomic::init(); + test_no_instruments(); test_no_instances(); test_with_instances(); test_per_thread_wait(); + + PFS_atomic::cleanup(); } int main(int, char **) diff --git a/storage/perfschema/unittest/pfs_instr_class-oom-t.cc b/storage/perfschema/unittest/pfs_instr_class-oom-t.cc index 9ccaf432ba2..95dccc420d7 100644 --- a/storage/perfschema/unittest/pfs_instr_class-oom-t.cc +++ b/storage/perfschema/unittest/pfs_instr_class-oom-t.cc @@ -47,7 +47,11 @@ void test_oom() void do_all_tests() { + PFS_atomic::init(); + test_oom(); + + PFS_atomic::cleanup(); } int main(int, char **) diff --git a/storage/perfschema/unittest/pfs_instr_class-t.cc b/storage/perfschema/unittest/pfs_instr_class-t.cc index f9a1ee510b1..ac34f082fe8 100644 --- a/storage/perfschema/unittest/pfs_instr_class-t.cc +++ b/storage/perfschema/unittest/pfs_instr_class-t.cc @@ -554,6 +554,8 @@ void test_instruments_reset() void do_all_tests() { + PFS_atomic::init(); + test_no_registration(); test_mutex_registration(); test_rwlock_registration(); @@ -562,6 +564,8 @@ void do_all_tests() test_file_registration(); test_table_registration(); test_instruments_reset(); + + PFS_atomic::cleanup(); } int main(int, char **) diff --git a/storage/perfschema/unittest/pfs_timer-t.cc b/storage/perfschema/unittest/pfs_timer-t.cc index d8663c5ccda..69b554c7b31 100644 --- a/storage/perfschema/unittest/pfs_timer-t.cc +++ b/storage/perfschema/unittest/pfs_timer-t.cc @@ -105,7 +105,11 @@ void test_timers() void do_all_tests() { + PFS_atomic::init(); + test_timers(); + + PFS_atomic::cleanup(); } int main(int, char **) diff --git a/strings/decimal.c b/strings/decimal.c index e081c063033..4766c3b2d00 100644 --- a/strings/decimal.c +++ b/strings/decimal.c @@ -248,7 +248,7 @@ void max_decimal(int precision, int frac, decimal_t *to) } -static dec1 *remove_leading_zeroes(decimal_t *from, int *intg_result) +static dec1 *remove_leading_zeroes(const decimal_t *from, int *intg_result) { int intg= from->intg, i; dec1 *buf0= from->buf; @@ -326,7 +326,7 @@ int decimal_actual_fraction(decimal_t *from) E_DEC_OK/E_DEC_TRUNCATED/E_DEC_OVERFLOW */ -int decimal2string(decimal_t *from, char *to, int *to_len, +int decimal2string(const decimal_t *from, char *to, int *to_len, int fixed_precision, int fixed_decimals, char filler) { @@ -942,7 +942,7 @@ fatal_error: E_DEC_OK/E_DEC_OVERFLOW/E_DEC_TRUNCATED */ -int decimal2double(decimal_t *from, double *to) +int decimal2double(const decimal_t *from, double *to) { char strbuf[FLOATING_POINT_BUFFER], *end; int len= sizeof(strbuf); @@ -1461,7 +1461,7 @@ int decimal_bin_size(int precision, int scale) */ int -decimal_round(decimal_t *from, decimal_t *to, int scale, +decimal_round(const decimal_t *from, decimal_t *to, int scale, decimal_round_mode mode) { int frac0=scale>0 ? ROUND_UP(scale) : scale/DIG_PER_DEC1, @@ -1695,7 +1695,7 @@ int decimal_result_size(decimal_t *from1, decimal_t *from2, char op, int param) return -1; /* shut up the warning */ } -static int do_add(decimal_t *from1, decimal_t *from2, decimal_t *to) +static int do_add(const decimal_t *from1, const decimal_t *from2, decimal_t *to) { int intg1=ROUND_UP(from1->intg), intg2=ROUND_UP(from2->intg), frac1=ROUND_UP(from1->frac), frac2=ROUND_UP(from2->frac), @@ -1777,7 +1777,7 @@ static int do_add(decimal_t *from1, decimal_t *from2, decimal_t *to) /* to=from1-from2. if to==0, return -1/0/+1 - the result of the comparison */ -static int do_sub(decimal_t *from1, decimal_t *from2, decimal_t *to) +static int do_sub(const decimal_t *from1, const decimal_t *from2, decimal_t *to) { int intg1=ROUND_UP(from1->intg), intg2=ROUND_UP(from2->intg), frac1=ROUND_UP(from1->frac), frac2=ROUND_UP(from2->frac); @@ -1846,7 +1846,7 @@ static int do_sub(decimal_t *from1, decimal_t *from2, decimal_t *to) /* ensure that always from1 > from2 (and intg1 >= intg2) */ if (carry) { - swap_variables(decimal_t *,from1,from1); + swap_variables(const decimal_t *, from1, from2); swap_variables(dec1 *,start1, start2); swap_variables(int,intg1,intg2); swap_variables(int,frac1,frac2); @@ -1912,35 +1912,35 @@ static int do_sub(decimal_t *from1, decimal_t *from2, decimal_t *to) return error; } -int decimal_intg(decimal_t *from) +int decimal_intg(const decimal_t *from) { int res; remove_leading_zeroes(from, &res); return res; } -int decimal_add(decimal_t *from1, decimal_t *from2, decimal_t *to) +int decimal_add(const decimal_t *from1, const decimal_t *from2, decimal_t *to) { if (likely(from1->sign == from2->sign)) return do_add(from1, from2, to); return do_sub(from1, from2, to); } -int decimal_sub(decimal_t *from1, decimal_t *from2, decimal_t *to) +int decimal_sub(const decimal_t *from1, const decimal_t *from2, decimal_t *to) { if (likely(from1->sign == from2->sign)) return do_sub(from1, from2, to); return do_add(from1, from2, to); } -int decimal_cmp(decimal_t *from1, decimal_t *from2) +int decimal_cmp(const decimal_t *from1, const decimal_t *from2) { if (likely(from1->sign == from2->sign)) return do_sub(from1, from2, 0); return from1->sign > from2->sign ? -1 : 1; } -int decimal_is_zero(decimal_t *from) +int decimal_is_zero(const decimal_t *from) { dec1 *buf1=from->buf, *end=buf1+ROUND_UP(from->intg)+ROUND_UP(from->frac); @@ -1971,7 +1971,7 @@ int decimal_is_zero(decimal_t *from) XXX if this library is to be used with huge numbers of thousands of digits, fast multiplication must be implemented. */ -int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to) +int decimal_mul(const decimal_t *from1, const decimal_t *from2, decimal_t *to) { int intg1=ROUND_UP(from1->intg), intg2=ROUND_UP(from2->intg), frac1=ROUND_UP(from1->frac), frac2=ROUND_UP(from2->frac), @@ -2095,8 +2095,8 @@ int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to) changed to malloc (or at least fallback to malloc if alloca() fails) but then, decimal_mul() should be rewritten too :( */ -static int do_div_mod(decimal_t *from1, decimal_t *from2, - decimal_t *to, decimal_t *mod, int scale_incr) +static int do_div_mod(const decimal_t *from1, const decimal_t *from2, + decimal_t *to, decimal_t *mod, int scale_incr) { int frac1=ROUND_UP(from1->frac)*DIG_PER_DEC1, prec1=from1->intg+frac1, frac2=ROUND_UP(from2->frac)*DIG_PER_DEC1, prec2=from2->intg+frac2, @@ -2181,9 +2181,12 @@ static int do_div_mod(decimal_t *from1, decimal_t *from2, } buf0=to->buf; stop0=buf0+intg0+frac0; + DBUG_ASSERT(stop0 <= &to->buf[to->len]); if (likely(div_mod)) - while (dintg++ < 0) + while (dintg++ < 0 && buf0 < &to->buf[to->len]) + { *buf0++=0; + } len1=(i=ROUND_UP(prec1))+ROUND_UP(2*frac2+scale_incr+1) + 1; set_if_bigger(len1, 3); @@ -2355,7 +2358,8 @@ done: */ int -decimal_div(decimal_t *from1, decimal_t *from2, decimal_t *to, int scale_incr) +decimal_div(const decimal_t *from1, const decimal_t *from2, decimal_t *to, + int scale_incr) { return do_div_mod(from1, from2, to, 0, scale_incr); } @@ -2387,7 +2391,7 @@ decimal_div(decimal_t *from1, decimal_t *from2, decimal_t *to, int scale_incr) thus, there's no requirement for M or N to be integers */ -int decimal_mod(decimal_t *from1, decimal_t *from2, decimal_t *to) +int decimal_mod(const decimal_t *from1, const decimal_t *from2, decimal_t *to) { return do_div_mod(from1, from2, 0, to, 0); } diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 9c06ac0a4ad..348ea9b6f29 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2002, 2011, 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 @@ -34,6 +34,7 @@ #include <m_string.h> #include <mysqld_error.h> #include <sql_common.h> +#include <mysql/client_plugin.h> #define VER "2.1" #define MAX_TEST_QUERY_LENGTH 300 /* MAX QUERY BUFFER LENGTH */ @@ -59,6 +60,7 @@ static unsigned int test_count= 0; static unsigned int opt_count= 0; static unsigned int iter_count= 0; static my_bool have_innodb= FALSE; +static char *opt_plugin_dir= 0, *opt_default_auth= 0; static const char *opt_basedir= "./"; static const char *opt_vardir= "mysql-test/var"; @@ -245,6 +247,11 @@ static MYSQL *mysql_client_init(MYSQL* con) if (res && shared_memory_base_name) mysql_options(res, MYSQL_SHARED_MEMORY_BASE_NAME, shared_memory_base_name); #endif + if (opt_plugin_dir && *opt_plugin_dir) + mysql_options(res, MYSQL_PLUGIN_DIR, opt_plugin_dir); + + if (opt_default_auth && *opt_default_auth) + mysql_options(res, MYSQL_DEFAULT_AUTH, opt_default_auth); return res; } @@ -326,6 +333,11 @@ static MYSQL* client_connect(ulong flag, uint protocol, my_bool auto_reconnect) /* enable local infile, in non-binary builds often disabled by default */ mysql_options(mysql, MYSQL_OPT_LOCAL_INFILE, 0); mysql_options(mysql, MYSQL_OPT_PROTOCOL, &protocol); + if (opt_plugin_dir && *opt_plugin_dir) + mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir); + + if (opt_default_auth && *opt_default_auth) + mysql_options(mysql, MYSQL_DEFAULT_AUTH, opt_default_auth); if (!(mysql_real_connect(mysql, opt_host, opt_user, opt_password, opt_db ? opt_db:"test", opt_port, @@ -15682,8 +15694,11 @@ static void test_bug13488() check_execute(stmt1, rc); if (!opt_silent) - printf("data is: %s", (f1 == 1 && f2 == 1 && f3 == 2)?"OK": - "wrong"); + { + printf("data: f1: %d; f2: %d; f3: %d\n", f1, f2, f3); + printf("data is: %s\n", + (f1 == 1 && f2 == 1 && f3 == 2) ? "OK" : "wrong"); + } DIE_UNLESS(f1 == 1 && f2 == 1 && f3 == 2); rc= mysql_query(mysql, "drop table t1, t2"); myquery(rc); @@ -19464,6 +19479,56 @@ static void test_bug49972() } +/* + Bug #56976: Severe Denial Of Service in prepared statements +*/ +static void test_bug56976() +{ + MYSQL_STMT *stmt; + MYSQL_BIND bind[1]; + int rc; + const char* query = "SELECT LENGTH(?)"; + char *long_buffer; + unsigned long i, packet_len = 256 * 1024L; + unsigned long dos_len = 2 * 1024 * 1024L; + + DBUG_ENTER("test_bug56976"); + myheader("test_bug56976"); + + stmt= mysql_stmt_init(mysql); + check_stmt(stmt); + + rc= mysql_stmt_prepare(stmt, query, strlen(query)); + check_execute(stmt, rc); + + memset(bind, 0, sizeof(bind)); + bind[0].buffer_type = MYSQL_TYPE_TINY_BLOB; + + rc= mysql_stmt_bind_param(stmt, bind); + check_execute(stmt, rc); + + long_buffer= (char*) my_malloc(packet_len, MYF(0)); + DIE_UNLESS(long_buffer); + + memset(long_buffer, 'a', packet_len); + + for (i= 0; i < dos_len / packet_len; i++) + { + rc= mysql_stmt_send_long_data(stmt, 0, long_buffer, packet_len); + check_execute(stmt, rc); + } + + my_free(long_buffer); + rc= mysql_stmt_execute(stmt); + + DIE_UNLESS(rc && mysql_stmt_errno(stmt) == ER_UNKNOWN_ERROR); + + mysql_stmt_close(stmt); + + DBUG_VOID_RETURN; +} + + /** Bug#57058 SERVER_QUERY_WAS_SLOW not wired up. */ @@ -19502,6 +19567,28 @@ static void test_bug57058() } +/** + Bug#11766854: 60075: MYSQL_LOAD_CLIENT_PLUGIN DOESN'T CLEAR ERROR +*/ + +static void test_bug11766854() +{ + struct st_mysql_client_plugin *plugin; + + DBUG_ENTER("test_bug11766854"); + myheader("test_bug11766854"); + + plugin= mysql_load_plugin(mysql, "foo", -1, 0); + DIE_UNLESS(plugin == 0); + + plugin= mysql_load_plugin(mysql, "qa_auth_client", -1, 0); + DIE_UNLESS(plugin != 0); + DIE_IF(mysql_errno(mysql)); + + DBUG_VOID_RETURN; +} + + /* Read and parse arguments and MySQL options from my.cnf */ @@ -19559,6 +19646,12 @@ static struct my_option client_test_long_options[] = {"getopt-ll-test", 'g', "Option for testing bug in getopt library", &opt_getopt_ll_test, &opt_getopt_ll_test, 0, GET_LL, REQUIRED_ARG, 0, 0, LONGLONG_MAX, 0, 0, 0}, + {"plugin_dir", 0, "Directory for client-side plugins.", + (uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"default_auth", 0, "Default authentication client-side plugin to use.", + (uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; @@ -19838,6 +19931,8 @@ static struct my_tests_st my_tests[]= { { "test_bug47485", test_bug47485 }, { "test_bug58036", test_bug58036 }, { "test_bug57058", test_bug57058 }, + { "test_bug56976", test_bug56976 }, + { "test_bug11766854", test_bug11766854 }, { 0, 0 } }; diff --git a/unittest/mysys/my_vsnprintf-t.c b/unittest/mysys/my_vsnprintf-t.c index e7f37774f85..7f93f5bb195 100644 --- a/unittest/mysys/my_vsnprintf-t.c +++ b/unittest/mysys/my_vsnprintf-t.c @@ -110,8 +110,11 @@ int main(void) test1("Positional arguments octal: <7777>", "Positional arguments octal: <%1$o>", 07777); + /* Can't use int arguments, as they may be different size from pointers */ + test1("Padding and %p <0x12> <0x034> <0x0000ab> < 0xcd>", - "Padding and %%p <%04p> <%05p> <%08p> <%8p>", 0x12, 0x34, 0xab, 0xcd); + "Padding and %%p <%04p> <%05p> <%08p> <%8p>", + (void*) 0x12, (void*) 0x34, (void*) 0xab, (void*) 0xcd); test1("F with a width (ignored) and precision: <12.34568>", "F with a width (ignored) and precision: <%10.5f>", 12.3456789); diff --git a/vio/viosocket.c b/vio/viosocket.c index 163eb279d45..0f3a32d62ae 100644 --- a/vio/viosocket.c +++ b/vio/viosocket.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, 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 @@ -1060,6 +1060,34 @@ ssize_t vio_pending(Vio *vio) /** + Checks if the error code, returned by vio_getnameinfo(), means it was the + "No-name" error. + + Windows-specific note: getnameinfo() returns WSANO_DATA instead of + EAI_NODATA or EAI_NONAME when no reverse mapping is available at the host + (i.e. Windows can't get hostname by IP-address). This error should be + treated as EAI_NONAME. + + @return if the error code is actually EAI_NONAME. + @retval true if the error code is EAI_NONAME. + @retval false otherwise. +*/ + +my_bool vio_is_no_name_error(int err_code) +{ +#ifdef _WIN32 + + return err_code == WSANO_DATA || err_code == EAI_NONAME; + +#else + + return err_code == EAI_NONAME; + +#endif +} + + +/** This is a wrapper for the system getnameinfo(), because different OS differ in the getnameinfo() implementation: - Solaris 10 requires that the 2nd argument (salen) must match the |