diff --git a/LICENSE b/LICENSE index 3bb2929330cc..eb3a747c40b8 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ Licensing Information User Manual -MySQL 5.7.28 (and later) +MySQL 5.7.44 Community __________________________________________________________________ Introduction @@ -8,24 +8,24 @@ Introduction This License Information User Manual contains Oracle's product license and other licensing information, including licensing information for third-party software which may be included in this distribution of - MySQL 5.7.28 (and later). + MySQL 5.7.44 Community. - Last updated: February 2023 + Last updated: August 2023 Licensing Information - This is a release of MySQL 5.7.28 (and later), brought to you by the - MySQL team at Oracle. This software is released under version 2 of the - GNU General Public License (GPLv2), as set forth below, with the - following additional permissions: + This release of MySQL 5.7.44 Community is brought to you by the MySQL + team at Oracle. This software is released under version 2 of the GNU + General Public License (GPLv2), as set forth below, with the following + additional permissions: - This distribution of MySQL 5.7.28 (and later) is distributed with - certain software (including but not limited to OpenSSL) that is - licensed under separate terms, as designated in a particular file or - component or in the license documentation. Without limiting your rights - under the GPLv2, the authors of MySQL hereby grant you an additional - permission to link the program and your derivative works with the - separately licensed software that they have included with the program. + This distribution of MySQL 5.7.44 Community is distributed with certain + software (including but not limited to OpenSSL) that is licensed under + separate terms, as designated in a particular file or component or in + the license documentation. Without limiting your rights under the + GPLv2, the authors of MySQL hereby grant you an additional permission + to link the program and your derivative works with the separately + licensed software that they have included with the program. This distribution includes the MySQL C API client library (libmysqlclient) otherwise known as MySQL Connector/C. Without limiting @@ -735,138 +735,122 @@ PURPOSE. Editline Library (libedit) -Some files are: ----------------------------------------------------------------- - Copyright (c) 1992, 1993 -The Regents of the University of California. All rights reserved. - -This code is derived from software contributed to -Berkeley by Christos Zoulas of Cornell University. - -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. - -Some files are: ----------------------------------------------------------------- -Copyright (c) 2001 The NetBSD Foundation, Inc. -All rights reserved. - -This code is derived from software contributed to The NetBSD Foundation - -by Anthony Mallet. - -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. - -THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. -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 FOUNDATION 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 Regents of the University of California. All rights reserved. -Some files are: ----------------------------------------------------------------- -Copyright (c) 1997 The NetBSD Foundation, Inc. -All rights reserved. +This code is derived from software contributed to Berkeley by +Christos Zoulas of Cornell University. -This code is derived from software contributed to The NetBSD Foundation +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. -by Jaromir Dolecek. +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. -Redistribution and use in source and binary forms, -with or without modification, are permitted provided -that the following conditions are met: +Files with different/specific license header +====================== +src/readline.c +src/literal.h +src/literal.c +src/getline.c +src/filecomplete.h +src/filecomplete.c +src/eln.c +src/chartype.h +src/chartype.c +src/read.h +----------------------- +/*- + * Copyright (c) 1997 The NetBSD Foundation, Inc. + * Copyright (c) 2001 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Jaromir Dolecek. + * + * 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. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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. + */ -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. - -THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. -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 FOUNDATION 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. +src/wcsdup.c +------------- +* + * Copyright (C) 2006 Aleksey Cheusov + * + * 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. Permission to modify the code and to distribute modified + * code is also granted without any restrictions. + */ -Some files are: ----------------------------------------------------------------- -Copyright (c) 1998 Todd C. Miller - -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 TODD C. MILLER -DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL TODD C. MILLER 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. +src/reallocarr.c +---------------- +/*- + * Copyright (c) 2015 Joerg Sonnenberger . + * 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. + * + * 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 HOLDERS 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. + */ ====================================================================== ====================================================================== @@ -3880,141 +3864,27 @@ This file is public domain and comes with NO WARRANTY of any kind ====================================================================== ====================================================================== -OpenSSL 1.x - -You are receiving a copy of OpenSSL as part of this product in -object code form. The terms of the Oracle license do NOT apply to -OpenSSL. OpenSSL is licensed under a double license, of the OpenSSL -License and the original SSLeay license, separate from the Oracle -product. If you do not wish to install this library, you may remove -it, but the Oracle program might not operate properly or at all -without it. - ---------------------------------------------------------------------- - - LICENSE ISSUES - ============== +OpenSSL 3.0 - The OpenSSL toolkit stays under a double license, i.e. both the conditions of - the OpenSSL License and the original SSLeay license apply to the toolkit. - See below for the actual license texts. +You may be receiving a copy of OpenSSL 3.0 as part of this product in +object code form. +The terms of the Oracle license do NOT apply to OpenSSL 3.0. +OpenSSL 3.0 is licensed under the Apache 2.0 license, separate from +the Oracle product. +If you do not wish to install this library, you may remove it, but +the Oracle program might not operate properly or at all without it. - OpenSSL License - --------------- - -/* ==================================================================== - * Copyright (c) 1998-2019 The OpenSSL Project. 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 acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED 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 OpenSSL PROJECT OR - * ITS 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. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). +/* + * Copyright 2003-2022 The OpenSSL Project Authors. All Rights Reserved. * - */ + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html +*/ - Original SSLeay License - ----------------------- - -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * 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 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 cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ +See Apache License v2.0, January 2004 in the +'Standard Licenses' section. ====================================================================== ====================================================================== @@ -5169,6 +5039,219 @@ That's all there is to it! ====================================================================== ====================================================================== +Apache License v2.0, January 2004 + +The following applies to all products licensed under the Apache 2.0 +License: You may not use the identified files except in compliance +with the Apache License, Version 2.0 (the "License.") You may obtain a +copy of the License at http://www.apache.org/licenses/LICENSE-2.0. A +copy of the license is also reproduced below. Unless required by +applicable law or agreed to in writing, software distributed under the +License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for +the specific language governing permissions and limitations under the +License. + +Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, +and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the +copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other +entities that control, are controlled by, or are under common control +with that entity. For the purposes of this definition, "control" means +(i) the power, direct or indirect, to cause the direction or +management of such entity, whether by contract or otherwise, or (ii) +ownership of fifty percent (50%) or more of the outstanding shares, or +(iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising +permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, +including but not limited to software source code, documentation +source, and configuration files. + +"Object" form shall mean any form resulting from mechanical +transformation or translation of a Source form, including but not +limited to compiled object code, generated documentation, and +conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object +form, made available under the License, as indicated by a copyright +notice that is included in or attached to the work (an example is +provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object +form, that is based on (or derived from) the Work and for which the +editorial revisions, annotations, elaborations, or other modifications +represent, as a whole, an original work of authorship. For the +purposes of this License, Derivative Works shall not include works +that remain separable from, or merely link (or bind by name) to the +interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the +original version of the Work and any modifications or additions to +that Work or Derivative Works thereof, that is intentionally submitted +to Licensor for inclusion in the Work by the copyright owner or by an +individual or Legal Entity authorized to submit on behalf of the +copyright owner. For the purposes of this definition, "submitted" +means any form of electronic, verbal, or written communication sent to +the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control +systems, and issue tracking systems that are managed by, or on behalf +of, the Licensor for the purpose of discussing and improving the Work, +but excluding communication that is conspicuously marked or otherwise +designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity +on behalf of whom a Contribution has been received by Licensor and +subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +copyright license to reproduce, prepare Derivative Works of, publicly +display, publicly perform, sublicense, and distribute the Work and +such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except +as stated in this section) patent license to make, have made, use, +offer to sell, sell, import, and otherwise transfer the Work, where +such license applies only to those patent claims licensable by such +Contributor that are necessarily infringed by their Contribution(s) +alone or by combination of their Contribution(s) with the Work to +which such Contribution(s) was submitted. If You institute patent +litigation against any entity (including a cross-claim or counterclaim +in a lawsuit) alleging that the Work or a Contribution incorporated +within the Work constitutes direct or contributory patent +infringement, then any patent licenses granted to You under this +License for that Work shall terminate as of the date such litigation +is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work +or Derivative Works thereof in any medium, with or without +modifications, and in Source or Object form, provided that You meet +the following conditions: + +(a) You must give any other recipients of the Work or Derivative Works +a copy of this License; and + +(b) You must cause any modified files to carry prominent notices +stating that You changed the files; and + +(c) You must retain, in the Source form of any Derivative Works that +You distribute, all copyright, patent, trademark, and attribution +notices from the Source form of the Work, excluding those notices that +do not pertain to any part of the Derivative Works; and + +(d) If the Work includes a "NOTICE" text file as part of its +distribution, then any Derivative Works that You distribute must +include a readable copy of the attribution notices contained + +within such NOTICE file, excluding those notices that do not pertain +to any part of the Derivative Works, in at least one of the following +places: within a NOTICE text file distributed as part of the +Derivative Works; within the Source form or documentation, if provided +along with the Derivative Works; or, within a display generated by the +Derivative Works, if and wherever such third-party notices normally +appear. The contents of the NOTICE file are for informational purposes +only and do not modify the License. You may add Your own attribution +notices within Derivative Works that You distribute, alongside or as +an addendum to the NOTICE text from the Work, provided that such +additional attribution notices cannot be construed as modifying the +License. + +You may add Your own copyright statement to Your modifications and may +provide additional or different license terms and conditions for use, +reproduction, or distribution of Your modifications, or for any such +Derivative Works as a whole, provided Your use, reproduction, and +distribution of the Work otherwise complies with the conditions stated +in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, +any Contribution intentionally submitted for inclusion in the Work by +You to the Licensor shall be under the terms and conditions of this +License, without any additional terms or conditions. Notwithstanding +the above, nothing herein shall supersede or modify the terms of any +separate license agreement you may have executed with Licensor +regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade +names, trademarks, service marks, or product names of the Licensor, +except as required for reasonable and customary use in describing the +origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed +to in writing, Licensor provides the Work (and each Contributor +provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied, including, without +limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, +MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely +responsible for determining the appropriateness of using or +redistributing the Work and assume any risks associated with Your +exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, +whether in tort (including negligence), contract, or otherwise, unless +required by applicable law (such as deliberate and grossly negligent +acts) or agreed to in writing, shall any Contributor be liable to You +for damages, including any direct, indirect, special, incidental, or +consequential damages of any character arising as a result of this +License or out of the use or inability to use the Work (including but +not limited to damages for loss of goodwill, work stoppage, computer +failure or malfunction, or any and all other commercial damages or +losses), even if such Contributor has been advised of the possibility +of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing +the Work or Derivative Works thereof, You may choose to offer, and +charge a fee for, acceptance of support, warranty, indemnity, or other +liability obligations and/or rights consistent with this +License. However, in accepting such obligations, You may act only on +Your own behalf and on Your sole responsibility, not on behalf of any +other Contributor, and only if You agree to indemnify, defend, and +hold each Contributor harmless for any liability incurred by, or +claims asserted against, such Contributor by reason of your accepting +any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work + +To apply the Apache License to your work, attach the following boilerplate +notice, with the fields enclosed by brackets "[]" replaced with your own +identifying information. (Don't include the brackets!) The text should be +enclosed in the appropriate comment syntax for the file format. We also +recommend that a file or class name and description of purpose be included +on the same "printed page" as the copyright notice for easier identification +within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +implied. See the License for the specific language governing permissions +and limitations under the License. + + ====================================================================== + ====================================================================== + Written Offer for Source Code For any software that you receive from Oracle in binary form which is diff --git a/VERSION b/VERSION index a08fe805f094..49c8c0d2dc2c 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=7 -MYSQL_VERSION_PATCH=42 +MYSQL_VERSION_PATCH=44 MYSQL_VERSION_EXTRA= diff --git a/cmake/readline.cmake b/cmake/readline.cmake index 117373af2840..721ba0a409d3 100644 --- a/cmake/readline.cmake +++ b/cmake/readline.cmake @@ -90,7 +90,7 @@ MACRO (FIND_CURSES) ENDIF() ENDMACRO() -SET(CURRENT_LIBEDIT_DIRECTORY "extra/libedit/libedit-20210910-3.1") +SET(CURRENT_LIBEDIT_DIRECTORY "extra/libedit/libedit-20221030-3.1") MACRO (MYSQL_USE_BUNDLED_EDITLINE) SET(WITH_EDITLINE "bundled" CACHE STRING "By default use bundled editline") diff --git a/cmake/ssl.cmake b/cmake/ssl.cmake index f553ae836e04..d04f94533dee 100644 --- a/cmake/ssl.cmake +++ b/cmake/ssl.cmake @@ -92,6 +92,62 @@ MACRO(RESET_SSL_VARIABLES) UNSET(HAVE_SHA512_DIGEST_LENGTH CACHE) ENDMACRO() +# Fetch OpenSSL version number. +# OpenSSL < 3: +# #define OPENSSL_VERSION_NUMBER 0x1000103fL +# Encoded as MNNFFPPS: major minor fix patch status +# +# OpenSSL 3: +# #define OPENSSL_VERSION_NUMBER +# ( (OPENSSL_VERSION_MAJOR<<28) +# |(OPENSSL_VERSION_MINOR<<20) +# |(OPENSSL_VERSION_PATCH<<4) +# |_OPENSSL_VERSION_PRE_RELEASE ) +MACRO(FIND_OPENSSL_VERSION) + FOREACH(version_part + OPENSSL_VERSION_MAJOR + OPENSSL_VERSION_MINOR + OPENSSL_VERSION_PATCH + ) + FILE(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" ${version_part} + REGEX "^#[\t ]*define[\t ]+${version_part}[\t ]+([0-9]+).*") + STRING(REGEX REPLACE + "^.*${version_part}[\t ]+([0-9]+).*" "\\1" + ${version_part} "${${version_part}}") + ENDFOREACH() + IF(OPENSSL_VERSION_MAJOR VERSION_EQUAL 3) + # OpenSSL 3 + SET(OPENSSL_MAJOR_VERSION "${OPENSSL_VERSION_MAJOR}") + SET(OPENSSL_MINOR_VERSION "${OPENSSL_VERSION_MINOR}") + SET(OPENSSL_FIX_VERSION "${OPENSSL_VERSION_PATCH}") + ELSE() + # Verify version number. Version information looks like: + # #define OPENSSL_VERSION_NUMBER 0x1000103fL + # Encoded as MNNFFPPS: major minor fix patch status + FILE(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" + OPENSSL_VERSION_NUMBER + REGEX "^#[ ]*define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x[0-9].*" + ) + STRING(REGEX REPLACE + "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9]).*$" "\\1" + OPENSSL_MAJOR_VERSION "${OPENSSL_VERSION_NUMBER}" + ) + STRING(REGEX REPLACE + "^.*OPENSSL_VERSION_NUMBER[\t ]+0x[0-9]([0-9][0-9]).*$" "\\1" + OPENSSL_MINOR_VERSION "${OPENSSL_VERSION_NUMBER}" + ) + STRING(REGEX REPLACE + "^.*OPENSSL_VERSION_NUMBER[\t ]+0x[0-9][0-9][0-9]([0-9][0-9]).*$" "\\1" + OPENSSL_FIX_VERSION "${OPENSSL_VERSION_NUMBER}" + ) + ENDIF() + SET(OPENSSL_VERSION + "${OPENSSL_MAJOR_VERSION}.${OPENSSL_MINOR_VERSION}.${OPENSSL_FIX_VERSION}" + ) + SET(OPENSSL_VERSION ${OPENSSL_VERSION} CACHE INTERNAL "") + MESSAGE(STATUS "OPENSSL_VERSION (${WITH_SSL}) is ${OPENSSL_VERSION}") +ENDMACRO(FIND_OPENSSL_VERSION) + # MYSQL_CHECK_SSL # # Provides the following configure options: @@ -194,30 +250,8 @@ MACRO (MYSQL_CHECK_SSL) ENDIF() IF(OPENSSL_INCLUDE_DIR) - # Verify version number. Version information looks like: - # #define OPENSSL_VERSION_NUMBER 0x1000103fL - # Encoded as MNNFFPPS: major minor fix patch status - FILE(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" - OPENSSL_VERSION_NUMBER - REGEX "^#[ ]*define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x[0-9].*" - ) - STRING(REGEX REPLACE - "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9]).*$" "\\1" - OPENSSL_MAJOR_VERSION "${OPENSSL_VERSION_NUMBER}" - ) - STRING(REGEX REPLACE - "^.*OPENSSL_VERSION_NUMBER[\t ]+0x[0-9]([0-9][0-9]).*$" "\\1" - OPENSSL_MINOR_VERSION "${OPENSSL_VERSION_NUMBER}" - ) - STRING(REGEX REPLACE - "^.*OPENSSL_VERSION_NUMBER[\t ]+0x[0-9][0-9][0-9]([0-9][0-9]).*$" "\\1" - OPENSSL_FIX_VERSION "${OPENSSL_VERSION_NUMBER}" - ) + FIND_OPENSSL_VERSION() ENDIF() - SET(OPENSSL_VERSION - "${OPENSSL_MAJOR_VERSION}.${OPENSSL_MINOR_VERSION}.${OPENSSL_FIX_VERSION}" - ) - SET(OPENSSL_VERSION ${OPENSSL_VERSION} CACHE INTERNAL "") IF("${OPENSSL_VERSION}" VERSION_GREATER "1.1.0") ADD_DEFINITIONS(-DHAVE_TLSv13) @@ -229,7 +263,8 @@ MACRO (MYSQL_CHECK_SSL) IF(OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARY AND CRYPTO_LIBRARY AND - OPENSSL_MAJOR_VERSION STREQUAL "1" + (OPENSSL_MAJOR_VERSION STREQUAL "1" OR + OPENSSL_MAJOR_VERSION STREQUAL "3") ) SET(OPENSSL_FOUND TRUE) ELSE() @@ -312,3 +347,16 @@ MACRO (MYSQL_CHECK_SSL) "Wrong option or path for WITH_SSL=${WITH_SSL}.") ENDIF() ENDMACRO() + +# Silence OpenSSL 3 deprecation warnings. +MACRO(DOWNGRADE_OPENSSL3_DEPRECATION_WARNINGS) + IF(OPENSSL_MAJOR_VERSION VERSION_EQUAL 3) + IF(MY_COMPILER_IS_GNU_OR_CLANG) + ADD_COMPILE_FLAGS(${ARGV} + COMPILE_FLAGS "-Wno-deprecated-declarations") + ELSEIF(WIN32) + ADD_COMPILE_FLAGS(${ARGV} + COMPILE_FLAGS "/wd4996") + ENDIF() + ENDIF() +ENDMACRO() diff --git a/extra/libedit/libedit-20210910-3.1/COPYING b/extra/libedit/libedit-20221030-3.1/COPYING similarity index 100% rename from extra/libedit/libedit-20210910-3.1/COPYING rename to extra/libedit/libedit-20221030-3.1/COPYING diff --git a/extra/libedit/libedit-20210910-3.1/ChangeLog b/extra/libedit/libedit-20221030-3.1/ChangeLog similarity index 97% rename from extra/libedit/libedit-20210910-3.1/ChangeLog rename to extra/libedit/libedit-20221030-3.1/ChangeLog index 7c19c9aa3bf5..d11a9889ee7e 100644 --- a/extra/libedit/libedit-20210910-3.1/ChangeLog +++ b/extra/libedit/libedit-20221030-3.1/ChangeLog @@ -1,6 +1,21 @@ * See also NetBSD changelog: http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libedit +2022-10-30 Jess Thrysoee + + * src/sys.h, src/reallocarr.c: Remove unused sys/cdefs.h include, to compile against musl libc + Reported by Matt Boehlke + + * version-info: 0:70:0 + +2022-10-09 Jess Thrysoee + + * version-info: 0:69:0 + + * src/sys.h: Add __sun guard around sys/types.h in sys.h + + * all: sync with upstream source + 2021-09-10 Jess Thrysoee * all: sync with upstream source diff --git a/extra/libedit/libedit-20210910-3.1/INSTALL b/extra/libedit/libedit-20221030-3.1/INSTALL similarity index 100% rename from extra/libedit/libedit-20210910-3.1/INSTALL rename to extra/libedit/libedit-20221030-3.1/INSTALL diff --git a/extra/libedit/libedit-20210910-3.1/Makefile.am b/extra/libedit/libedit-20221030-3.1/Makefile.am similarity index 100% rename from extra/libedit/libedit-20210910-3.1/Makefile.am rename to extra/libedit/libedit-20221030-3.1/Makefile.am diff --git a/extra/libedit/libedit-20210910-3.1/Makefile.in b/extra/libedit/libedit-20221030-3.1/Makefile.in similarity index 99% rename from extra/libedit/libedit-20210910-3.1/Makefile.in rename to extra/libedit/libedit-20221030-3.1/Makefile.in index 82c6524e427b..f7ba2e285578 100644 --- a/extra/libedit/libedit-20210910-3.1/Makefile.in +++ b/extra/libedit/libedit-20221030-3.1/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.16.4 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. @@ -189,8 +189,7 @@ am__define_uniq_tagged_files = \ DIST_SUBDIRS = src examples doc am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/libedit.pc.in COPYING ChangeLog INSTALL THANKS \ - compile config.guess config.sub depcomp install-sh ltmain.sh \ - missing + compile config.guess config.sub install-sh ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -263,6 +262,7 @@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ diff --git a/extra/libedit/libedit-20210910-3.1/THANKS b/extra/libedit/libedit-20221030-3.1/THANKS similarity index 100% rename from extra/libedit/libedit-20210910-3.1/THANKS rename to extra/libedit/libedit-20221030-3.1/THANKS diff --git a/extra/libedit/libedit-20210910-3.1/acinclude.m4 b/extra/libedit/libedit-20221030-3.1/acinclude.m4 similarity index 86% rename from extra/libedit/libedit-20210910-3.1/acinclude.m4 rename to extra/libedit/libedit-20221030-3.1/acinclude.m4 index da6b832ffc39..95faf65f4990 100644 --- a/extra/libedit/libedit-20210910-3.1/acinclude.m4 +++ b/extra/libedit/libedit-20221030-3.1/acinclude.m4 @@ -39,11 +39,12 @@ AC_DEFUN([EL_GETPW_R_POSIX], # The prototype for the POSIX version is: # int getpwnam_r(char *, struct passwd *, char *, size_t, struct passwd **) # int getpwuid_r(uid_t, struct passwd *, char *, size_t, struct passwd **); - AC_TRY_LINK([#include + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[#include #include - #include ], - [getpwnam_r(NULL, NULL, NULL, (size_t)0, NULL); - getpwuid_r((uid_t)0, NULL, NULL, (size_t)0, NULL);], + #include ]], + [[getpwnam_r(NULL, NULL, NULL, (size_t)0, NULL); + getpwuid_r((uid_t)0, NULL, NULL, (size_t)0, NULL);]])], [AC_DEFINE([HAVE_GETPW_R_POSIX], 1, [Define to 1 if you have getpwnam_r and getpwuid_r that are POSIX.1 compatible.]) AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)]) @@ -55,11 +56,12 @@ AC_DEFUN([EL_GETPW_R_DRAFT], # The prototype for the POSIX draft version is: # struct passwd *getpwuid_r(uid_t, struct passwd *, char *, int); # struct passwd *getpwnam_r(char *, struct passwd *, char *, int); - AC_TRY_LINK([#include + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[#include #include - #include ], - [getpwnam_r(NULL, NULL, NULL, (size_t)0); - getpwuid_r((uid_t)0, NULL, NULL, (size_t)0);], + #include ]], + [[getpwnam_r(NULL, NULL, NULL, (size_t)0); + getpwuid_r((uid_t)0, NULL, NULL, (size_t)0);]])], [AC_DEFINE([HAVE_GETPW_R_DRAFT], 1, [Define to 1 if you have getpwnam_r and getpwuid_r that are draft POSIX.1 versions.]) AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)]) diff --git a/extra/libedit/libedit-20210910-3.1/aclocal.m4 b/extra/libedit/libedit-20221030-3.1/aclocal.m4 similarity index 99% rename from extra/libedit/libedit-20210910-3.1/aclocal.m4 rename to extra/libedit/libedit-20221030-3.1/aclocal.m4 index f478853e3a9c..fe9723af9009 100644 --- a/extra/libedit/libedit-20210910-3.1/aclocal.m4 +++ b/extra/libedit/libedit-20221030-3.1/aclocal.m4 @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.16.4 -*- Autoconf -*- +# generated automatically by aclocal 1.16.5 -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. @@ -35,7 +35,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.16.4], [], +m4_if([$1], [1.16.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,7 +51,7 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.16.4])dnl +[AM_AUTOMAKE_VERSION([1.16.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) @@ -428,6 +428,10 @@ m4_defn([AC_PROG_CC]) # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl +m4_ifdef([_$0_ALREADY_INIT], + [m4_fatal([$0 expanded multiple times +]m4_defn([_$0_ALREADY_INIT]))], + [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl diff --git a/extra/libedit/libedit-20210910-3.1/compile b/extra/libedit/libedit-20221030-3.1/compile similarity index 100% rename from extra/libedit/libedit-20210910-3.1/compile rename to extra/libedit/libedit-20221030-3.1/compile diff --git a/extra/libedit/libedit-20210910-3.1/config.h.in b/extra/libedit/libedit-20221030-3.1/config.h.in similarity index 99% rename from extra/libedit/libedit-20210910-3.1/config.h.in rename to extra/libedit/libedit-20221030-3.1/config.h.in index bb70953bd802..7c2241130015 100644 --- a/extra/libedit/libedit-20210910-3.1/config.h.in +++ b/extra/libedit/libedit-20221030-3.1/config.h.in @@ -72,6 +72,9 @@ /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H +/* Define to 1 if you have the `reallocarr' function. */ +#undef HAVE_REALLOCARR + /* Define to 1 if you have the `regcomp' function. */ #undef HAVE_REGCOMP @@ -229,9 +232,6 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* Define as the return type of signal handlers (`int' or `void'). */ -#undef RETSIGTYPE - /* Define to 1 if all of the C90 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ diff --git a/extra/libedit/libedit-20210910-3.1/configure b/extra/libedit/libedit-20221030-3.1/configure similarity index 94% rename from extra/libedit/libedit-20210910-3.1/configure rename to extra/libedit/libedit-20221030-3.1/configure index 57da2cf4b49f..8072cf6f3e97 100755 --- a/extra/libedit/libedit-20210910-3.1/configure +++ b/extra/libedit/libedit-20221030-3.1/configure @@ -617,7 +617,7 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libedit' -PACKAGE_TARNAME='libedit-20210910' +PACKAGE_TARNAME='libedit-20221030' PACKAGE_VERSION='3.1' PACKAGE_STRING='libedit 3.1' PACKAGE_BUGREPORT='' @@ -689,6 +689,7 @@ ac_ct_AR AR DLLTOOL OBJDUMP +FILECMD LN_S NM ac_ct_DUMPBIN @@ -1417,7 +1418,7 @@ Fine tuning of the installation directories: --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root - [DATAROOTDIR/doc/libedit-20210910] + [DATAROOTDIR/doc/libedit-20221030] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] @@ -4539,7 +4540,7 @@ fi # Define the identity of the package. - PACKAGE='libedit-20210910' + PACKAGE='libedit-20221030' VERSION='3.1' @@ -4780,8 +4781,8 @@ esac -macro_version='2.4.6' -macro_revision='2.4.6' +macro_version='2.4.7' +macro_revision='2.4.7' @@ -5409,13 +5410,13 @@ else mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 @@ -5553,7 +5554,7 @@ esac fi fi - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; @@ -5657,7 +5658,7 @@ else $as_nop lt_cv_sys_max_cmd_len=8192; ;; - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -5700,7 +5701,7 @@ else $as_nop sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi @@ -5905,6 +5906,114 @@ esac +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}file", so it can be a program name with args. +set dummy ${ac_tool_prefix}file; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_FILECMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$FILECMD"; then + ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_FILECMD="${ac_tool_prefix}file" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +FILECMD=$ac_cv_prog_FILECMD +if test -n "$FILECMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5 +printf "%s\n" "$FILECMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_FILECMD"; then + ac_ct_FILECMD=$FILECMD + # Extract the first word of "file", so it can be a program name with args. +set dummy file; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_FILECMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_FILECMD"; then + ac_cv_prog_ac_ct_FILECMD="$ac_ct_FILECMD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_FILECMD="file" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_FILECMD=$ac_cv_prog_ac_ct_FILECMD +if test -n "$ac_ct_FILECMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FILECMD" >&5 +printf "%s\n" "$ac_ct_FILECMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_FILECMD" = x; then + FILECMD=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + FILECMD=$ac_ct_FILECMD + fi +else + FILECMD="$ac_cv_prog_FILECMD" +fi + + + + + + + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 @@ -6048,7 +6157,7 @@ beos*) bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; @@ -6082,14 +6191,14 @@ darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac @@ -6103,7 +6212,7 @@ haiku*) ;; hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' @@ -6150,7 +6259,7 @@ netbsd*) newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; @@ -6523,13 +6632,29 @@ esac fi : ${AR=ar} -: ${AR_FLAGS=cru} +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because thats what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. + +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS + + + + + + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. + @@ -6946,7 +7071,7 @@ esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" @@ -6964,20 +7089,20 @@ fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ @@ -7001,7 +7126,7 @@ for ac_symprfx in "" "_"; do if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, + # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ @@ -7019,9 +7144,9 @@ for ac_symprfx in "" "_"; do " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -7224,7 +7349,7 @@ case $with_sysroot in #( fi ;; #( /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( @@ -7349,7 +7474,7 @@ ia64-*-hpux*) ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; @@ -7370,7 +7495,7 @@ ia64-*-hpux*) printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; @@ -7382,7 +7507,7 @@ ia64-*-hpux*) ;; esac else - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; @@ -7408,7 +7533,7 @@ mips64*-*linux*) printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; @@ -7416,7 +7541,7 @@ mips64*-*linux*) emul="${emul}64" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; @@ -7424,7 +7549,7 @@ mips64*-*linux*) emul="${emul}ltsmip" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; @@ -7448,14 +7573,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; @@ -7563,7 +7688,7 @@ printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) @@ -8346,8 +8471,8 @@ int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cru libconftest.a conftest.o" >&5 - $AR cru libconftest.a conftest.o 2>&5 + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 + $AR $AR_FLAGS libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF @@ -8375,11 +8500,11 @@ printf "%s\n" "$lt_cv_ld_force_load" >&6; } darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) - case ${MACOSX_DEPLOYMENT_TARGET},$host in - 10.[012],*|,*powerpc*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - *) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + case $MACOSX_DEPLOYMENT_TARGET,$host in + 10.[012],*|,*powerpc*-darwin[5-8]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac @@ -8738,8 +8863,8 @@ esac ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld @@ -9251,7 +9376,7 @@ lt_prog_compiler_static= lt_prog_compiler_static='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' @@ -9674,15 +9799,15 @@ printf %s "checking whether the $compiler linker ($LD) supports shared libraries case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time + # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) @@ -9734,7 +9859,7 @@ printf %s "checking whether the $compiler linker ($LD) supports shared libraries whole_archive_flag_spec= fi supports_anon_versioning=no - case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in + case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -9846,6 +9971,7 @@ _LT_EOF emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes + file_list_spec='@' ;; interix[3-9]*) @@ -9860,7 +9986,7 @@ _LT_EOF # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) @@ -9903,7 +10029,7 @@ _LT_EOF compiler_needs_object=yes ;; esac - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes @@ -9915,7 +10041,7 @@ _LT_EOF if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi @@ -9931,7 +10057,7 @@ _LT_EOF archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi @@ -10063,7 +10189,7 @@ _LT_EOF if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -10334,12 +10460,12 @@ fi cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in - cl*) - # Native MSVC + cl* | icl*) + # Native MSVC or ICC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes @@ -10380,7 +10506,7 @@ fi fi' ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. @@ -10421,8 +10547,8 @@ fi output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + archive_expsym_cmds="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no @@ -10456,7 +10582,7 @@ fi ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes @@ -10707,6 +10833,7 @@ printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes + file_list_spec='@' ;; osf3*) @@ -11399,7 +11526,7 @@ cygwin* | mingw* | pw32* | cegcc*) case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; @@ -11409,14 +11536,14 @@ cygwin* | mingw* | pw32* | cegcc*) ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' @@ -11435,7 +11562,7 @@ cygwin* | mingw* | pw32* | cegcc*) done IFS=$lt_save_ifs # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form @@ -11472,7 +11599,7 @@ cygwin* | mingw* | pw32* | cegcc*) ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -11505,7 +11632,7 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then @@ -12658,30 +12785,41 @@ striplib= old_striplib= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 printf %s "checking whether stripping libraries is possible... " >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } +if test -z "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - fi - ;; - *) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + fi + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - ;; - esac + ;; + esac + fi fi @@ -12772,7 +12910,7 @@ CC=$lt_save_CC # libtool -version-info -LT_VERSION=0:68:0 +LT_VERSION=0:70:0 # Check whether --enable-silent-rules was given. @@ -12818,31 +12956,67 @@ AM_BACKSLASH='\' # Checks for programs. +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -#AC_PROG_CC -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -printf %s "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -printf "%s\n" "no, using $LN_S" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_AWK+y} +if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -12855,7 +13029,7 @@ do esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_AWK="$ac_prog" + ac_cv_prog_ac_ct_CC="gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi @@ -12865,39 +13039,45 @@ IFS=$as_save_IFS fi fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -printf "%s\n" "$AWK" >&6; } +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi - test -n "$AWK" && break -done - - - MANTYPE= - TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb" - for ac_prog in nroff awf -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_NROFF+y} +if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop - case $NROFF in - [\\/]* | ?:[\\/]*) - ac_cv_path_NROFF="$NROFF" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $TestPath + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( @@ -12907,7 +13087,7 @@ do esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_NROFF="$as_dir$ac_word$ac_exec_ext" + ac_cv_prog_CC="${ac_tool_prefix}cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi @@ -12915,24 +13095,772 @@ done done IFS=$as_save_IFS - ;; -esac fi -NROFF=$ac_cv_path_NROFF -if test -n "$NROFF"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NROFF" >&5 -printf "%s\n" "$NROFF" >&6; } +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi - test -n "$NROFF" && break -done -test -n "$NROFF" || NROFF="/bin/false" - - if ${NROFF} -mdoc ${srcdir}/doc/editrc.5.roff >/dev/null 2>&1; then + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +fi + + +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion -version; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else $as_nop + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+y} +ac_save_CFLAGS=$CFLAGS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +else $as_nop + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +printf %s "checking whether $CC understands -c and -o together... " >&6; } +if test ${am_cv_prog_cc_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +printf %s "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +printf "%s\n" "no, using $LN_S" >&6; } +fi + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AWK" && break +done + + + MANTYPE= + TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb" + for ac_prog in nroff awf +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_NROFF+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $NROFF in + [\\/]* | ?:[\\/]*) + ac_cv_path_NROFF="$NROFF" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $TestPath +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_NROFF="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +NROFF=$ac_cv_path_NROFF +if test -n "$NROFF"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NROFF" >&5 +printf "%s\n" "$NROFF" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$NROFF" && break +done +test -n "$NROFF" || NROFF="/bin/false" + + if ${NROFF} -mdoc ${srcdir}/doc/editrc.5.roff >/dev/null 2>&1; then MANTYPE=mdoc fi @@ -13325,8 +14253,6 @@ fi fi -# Autoupdate added the next two lines to ensure that your configure -# script's behavior did not change. They are probably safe to remove. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 printf %s "checking for egrep... " >&6; } @@ -14170,39 +15096,6 @@ fi ## _AIX is offended by rpl_malloc and rpl_realloc #AC_FUNC_MALLOC #AC_FUNC_REALLOC -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 -printf %s "checking return type of signal handlers... " >&6; } -if test ${ac_cv_type_signal+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include - -int -main (void) -{ -return *(signal (0, 0)) (0) == 1; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_type_signal=int -else $as_nop - ac_cv_type_signal=void -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 -printf "%s\n" "$ac_cv_type_signal" >&6; } - -printf "%s\n" "#define RETSIGTYPE $ac_cv_type_signal" >>confdefs.h - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 printf %s "checking whether lstat correctly handles trailing slash... " >&6; } if test ${ac_cv_func_lstat_dereferences_slashed_symlink+y} @@ -14456,6 +15349,12 @@ then : printf "%s\n" "#define HAVE_SECURE_GETENV 1" >>confdefs.h fi +ac_fn_c_check_func "$LINENO" "reallocarr" "ac_cv_func_reallocarr" +if test "x$ac_cv_func_reallocarr" = xyes +then : + printf "%s\n" "#define HAVE_REALLOCARR 1" >>confdefs.h + +fi # strlcpy @@ -15401,6 +16300,7 @@ lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_q lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +FILECMD='`$ECHO "$FILECMD" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' @@ -15409,6 +16309,7 @@ want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' @@ -15529,6 +16430,7 @@ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ +FILECMD \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ @@ -15537,7 +16439,6 @@ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ -AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ @@ -16484,6 +17385,9 @@ to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd +# A file(cmd) program that detects file types. +FILECMD=$lt_FILECMD + # An object symbol dumper. OBJDUMP=$lt_OBJDUMP @@ -16508,8 +17412,11 @@ sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR +# Flags to create an archive (by configure). +lt_ar_flags=$lt_ar_flags + # Flags to create an archive. -AR_FLAGS=$lt_AR_FLAGS +AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec @@ -16885,7 +17792,7 @@ ltmain=$ac_aux_dir/ltmain.sh # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ + $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || diff --git a/extra/libedit/libedit-20210910-3.1/configure.ac b/extra/libedit/libedit-20221030-3.1/configure.ac similarity index 95% rename from extra/libedit/libedit-20210910-3.1/configure.ac rename to extra/libedit/libedit-20221030-3.1/configure.ac index 72a41f9c1b97..1b2a06db751c 100644 --- a/extra/libedit/libedit-20210910-3.1/configure.ac +++ b/extra/libedit/libedit-20221030-3.1/configure.ac @@ -23,25 +23,24 @@ # "./configure --disable-silent-rules" or "make V=1" # -AC_INIT(libedit, [EL_RELEASE],, libedit-[EL_TIMESTAMP]) +AC_INIT([libedit],[EL_RELEASE],[],[libedit-EL_TIMESTAMP]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([src/strlcat.c]) -AC_CONFIG_HEADER([config.h]) +AC_CONFIG_HEADERS([config.h]) # features of Posix that are extensions to C (define _GNU_SOURCE) AC_USE_SYSTEM_EXTENSIONS AM_INIT_AUTOMAKE -AC_PROG_LIBTOOL +LT_INIT # libtool -version-info -AC_SUBST(LT_VERSION, [0:68:0]) +AC_SUBST(LT_VERSION, [0:70:0]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) # Checks for programs. -AC_PROG_CC_C99 -#AC_PROG_CC +AC_PROG_CC AC_PROG_LN_S AC_PROG_AWK EL_MANTYPE @@ -70,7 +69,9 @@ AM_CONDITIONAL(ENABLE_EXAMPLES, [test "$enable_examples" = "yes"]) # Checks for header files. AC_HEADER_DIRENT -AC_HEADER_STDC +AC_CHECK_INCLUDES_DEFAULT +AC_PROG_EGREP + AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([fcntl.h limits.h malloc.h stdlib.h string.h sys/ioctl.h sys/param.h unistd.h curses.h ncurses.h sys/cdefs.h termcap.h]) @@ -117,9 +118,8 @@ AC_PROG_GCC_TRADITIONAL ## _AIX is offended by rpl_malloc and rpl_realloc #AC_FUNC_MALLOC #AC_FUNC_REALLOC -AC_TYPE_SIGNAL AC_FUNC_STAT -AC_CHECK_FUNCS([endpwent isascii memchr memset re_comp regcomp strcasecmp strchr strcspn strdup strerror strrchr strstr strtol issetugid wcsdup strlcpy strlcat vis strvis strunvis __secure_getenv secure_getenv]) +AC_CHECK_FUNCS([endpwent isascii memchr memset re_comp regcomp strcasecmp strchr strcspn strdup strerror strrchr strstr strtol issetugid wcsdup strlcpy strlcat vis strvis strunvis __secure_getenv secure_getenv reallocarr]) # strlcpy AC_CHECK_FUNC(strlcpy, found_strlcpy=yes, found_strlcpy=no) diff --git a/extra/libedit/libedit-20210910-3.1/depcomp b/extra/libedit/libedit-20221030-3.1/depcomp similarity index 100% rename from extra/libedit/libedit-20210910-3.1/depcomp rename to extra/libedit/libedit-20221030-3.1/depcomp diff --git a/extra/libedit/libedit-20210910-3.1/doc/Makefile.am b/extra/libedit/libedit-20221030-3.1/doc/Makefile.am similarity index 100% rename from extra/libedit/libedit-20210910-3.1/doc/Makefile.am rename to extra/libedit/libedit-20221030-3.1/doc/Makefile.am diff --git a/extra/libedit/libedit-20210910-3.1/doc/Makefile.in b/extra/libedit/libedit-20221030-3.1/doc/Makefile.in similarity index 99% rename from extra/libedit/libedit-20210910-3.1/doc/Makefile.in rename to extra/libedit/libedit-20221030-3.1/doc/Makefile.in index 3f0a1d02aded..22e8a75b8cfd 100644 --- a/extra/libedit/libedit-20210910-3.1/doc/Makefile.in +++ b/extra/libedit/libedit-20221030-3.1/doc/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.16.4 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. @@ -183,6 +183,7 @@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ diff --git a/extra/libedit/libedit-20210910-3.1/doc/editline.3.roff b/extra/libedit/libedit-20221030-3.1/doc/editline.3.roff similarity index 100% rename from extra/libedit/libedit-20210910-3.1/doc/editline.3.roff rename to extra/libedit/libedit-20221030-3.1/doc/editline.3.roff diff --git a/extra/libedit/libedit-20210910-3.1/doc/editline.7.roff b/extra/libedit/libedit-20221030-3.1/doc/editline.7.roff similarity index 100% rename from extra/libedit/libedit-20210910-3.1/doc/editline.7.roff rename to extra/libedit/libedit-20221030-3.1/doc/editline.7.roff diff --git a/extra/libedit/libedit-20210910-3.1/doc/editrc.5.roff b/extra/libedit/libedit-20221030-3.1/doc/editrc.5.roff similarity index 100% rename from extra/libedit/libedit-20210910-3.1/doc/editrc.5.roff rename to extra/libedit/libedit-20221030-3.1/doc/editrc.5.roff diff --git a/extra/libedit/libedit-20210910-3.1/doc/mdoc2man.awk b/extra/libedit/libedit-20221030-3.1/doc/mdoc2man.awk similarity index 100% rename from extra/libedit/libedit-20210910-3.1/doc/mdoc2man.awk rename to extra/libedit/libedit-20221030-3.1/doc/mdoc2man.awk diff --git a/extra/libedit/libedit-20210910-3.1/examples/Makefile.am b/extra/libedit/libedit-20221030-3.1/examples/Makefile.am similarity index 100% rename from extra/libedit/libedit-20210910-3.1/examples/Makefile.am rename to extra/libedit/libedit-20221030-3.1/examples/Makefile.am diff --git a/extra/libedit/libedit-20210910-3.1/examples/Makefile.in b/extra/libedit/libedit-20221030-3.1/examples/Makefile.in similarity index 99% rename from extra/libedit/libedit-20210910-3.1/examples/Makefile.in rename to extra/libedit/libedit-20221030-3.1/examples/Makefile.in index c67310e0271b..e337394ed681 100644 --- a/extra/libedit/libedit-20210910-3.1/examples/Makefile.in +++ b/extra/libedit/libedit-20221030-3.1/examples/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.16.4 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. @@ -209,6 +209,7 @@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ diff --git a/extra/libedit/libedit-20210910-3.1/examples/fileman.c b/extra/libedit/libedit-20221030-3.1/examples/fileman.c similarity index 100% rename from extra/libedit/libedit-20210910-3.1/examples/fileman.c rename to extra/libedit/libedit-20221030-3.1/examples/fileman.c diff --git a/extra/libedit/libedit-20210910-3.1/examples/fuzz1.c b/extra/libedit/libedit-20221030-3.1/examples/fuzz1.c similarity index 100% rename from extra/libedit/libedit-20210910-3.1/examples/fuzz1.c rename to extra/libedit/libedit-20221030-3.1/examples/fuzz1.c diff --git a/extra/libedit/libedit-20210910-3.1/examples/tc1.c b/extra/libedit/libedit-20221030-3.1/examples/tc1.c similarity index 100% rename from extra/libedit/libedit-20210910-3.1/examples/tc1.c rename to extra/libedit/libedit-20221030-3.1/examples/tc1.c diff --git a/extra/libedit/libedit-20210910-3.1/examples/wtc1.c b/extra/libedit/libedit-20221030-3.1/examples/wtc1.c similarity index 100% rename from extra/libedit/libedit-20210910-3.1/examples/wtc1.c rename to extra/libedit/libedit-20221030-3.1/examples/wtc1.c diff --git a/extra/libedit/libedit-20210910-3.1/install-sh b/extra/libedit/libedit-20221030-3.1/install-sh similarity index 100% rename from extra/libedit/libedit-20210910-3.1/install-sh rename to extra/libedit/libedit-20221030-3.1/install-sh diff --git a/extra/libedit/libedit-20210910-3.1/libedit.pc.in b/extra/libedit/libedit-20221030-3.1/libedit.pc.in similarity index 100% rename from extra/libedit/libedit-20210910-3.1/libedit.pc.in rename to extra/libedit/libedit-20221030-3.1/libedit.pc.in diff --git a/extra/libedit/libedit-20210910-3.1/ltmain.sh b/extra/libedit/libedit-20221030-3.1/ltmain.sh similarity index 93% rename from extra/libedit/libedit-20210910-3.1/ltmain.sh rename to extra/libedit/libedit-20221030-3.1/ltmain.sh index 0f0a2da3f9dd..2a50d7f6f72a 100644 --- a/extra/libedit/libedit-20210910-3.1/ltmain.sh +++ b/extra/libedit/libedit-20221030-3.1/ltmain.sh @@ -1,12 +1,12 @@ -#! /bin/sh +#! /usr/bin/env sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in -## by inline-source v2014-01-03.01 +## by inline-source v2019-02-19.15 -# libtool (GNU libtool) 2.4.6 +# libtool (GNU libtool) 2.4.7 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 -# Copyright (C) 1996-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-2019, 2021-2022 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -31,8 +31,8 @@ PROGRAM=libtool PACKAGE=libtool -VERSION=2.4.6 -package_revision=2.4.6 +VERSION=2.4.7 +package_revision=2.4.7 ## ------ ## @@ -64,34 +64,25 @@ package_revision=2.4.6 # libraries, which are installed to $pkgauxdir. # Set a version string for this script. -scriptversion=2015-01-20.17; # UTC +scriptversion=2019-02-19.15; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 -# Copyright (C) 2004-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# 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 3 of the License, or -# (at your option) any later version. - -# As a special exception to the GNU General Public License, if you distribute -# this file as part of a program or library that is built using GNU Libtool, -# you may include this file under the same distribution terms that you use -# for the rest of that program. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNES 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, see . +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2004-2019, 2021 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 2 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. -# Please report bugs or propose patches to gary@gnu.org. +# Please report bugs or propose patches to: +# ## ------ ## @@ -139,9 +130,12 @@ do _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# These NLS vars are set unconditionally (bootstrap issue #24). Unset those +# in case the environment reset is needed later and the $save_* variant is not +# defined (see the code above). +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL # Make sure IFS has a sensible default sp=' ' @@ -159,6 +153,26 @@ if test "${PATH_SEPARATOR+set}" != set; then fi +# func_unset VAR +# -------------- +# Portably unset VAR. +# In some shells, an 'unset VAR' statement leaves a non-zero return +# status if VAR is already unset, which might be problematic if the +# statement is used at the end of a function (thus poisoning its return +# value) or when 'set -e' is active (causing even a spurious abort of +# the script in this case). +func_unset () +{ + { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } +} + + +# Make sure CDPATH doesn't cause `cd` commands to output the target dir. +func_unset CDPATH + +# Make sure ${,E,F}GREP behave sanely. +func_unset GREP_OPTIONS + ## ------------------------- ## ## Locate command utilities. ## @@ -259,7 +273,7 @@ test -z "$SED" && { rm -f conftest.in conftest.tmp conftest.nl conftest.out } - func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin + func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" rm -f conftest.sed SED=$func_path_progs_result } @@ -295,7 +309,7 @@ test -z "$GREP" && { rm -f conftest.in conftest.tmp conftest.nl conftest.out } - func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin + func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" GREP=$func_path_progs_result } @@ -360,6 +374,35 @@ sed_double_backslash="\ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" +# require_check_ifs_backslash +# --------------------------- +# Check if we can use backslash as IFS='\' separator, and set +# $check_ifs_backshlash_broken to ':' or 'false'. +require_check_ifs_backslash=func_require_check_ifs_backslash +func_require_check_ifs_backslash () +{ + _G_save_IFS=$IFS + IFS='\' + _G_check_ifs_backshlash='a\\b' + for _G_i in $_G_check_ifs_backshlash + do + case $_G_i in + a) + check_ifs_backshlash_broken=false + ;; + '') + break + ;; + *) + check_ifs_backshlash_broken=: + break + ;; + esac + done + IFS=$_G_save_IFS + require_check_ifs_backslash=: +} + ## ----------------- ## ## Global variables. ## @@ -580,16 +623,16 @@ if test yes = "$_G_HAVE_PLUSEQ_OP"; then { $debug_cmd - func_quote_for_eval "$2" - eval "$1+=\\ \$func_quote_for_eval_result" + func_quote_arg pretty "$2" + eval "$1+=\\ \$func_quote_arg_result" }' else func_append_quoted () { $debug_cmd - func_quote_for_eval "$2" - eval "$1=\$$1\\ \$func_quote_for_eval_result" + func_quote_arg pretty "$2" + eval "$1=\$$1\\ \$func_quote_arg_result" } fi @@ -1091,85 +1134,203 @@ func_relative_path () } -# func_quote_for_eval ARG... -# -------------------------- -# Aesthetically quote ARGs to be evaled later. -# This function returns two values: -# i) func_quote_for_eval_result -# double-quoted, suitable for a subsequent eval -# ii) func_quote_for_eval_unquoted_result -# has all characters that are still active within double -# quotes backslashified. -func_quote_for_eval () +# func_quote_portable EVAL ARG +# ---------------------------- +# Internal function to portably implement func_quote_arg. Note that we still +# keep attention to performance here so we as much as possible try to avoid +# calling sed binary (so far O(N) complexity as long as func_append is O(1)). +func_quote_portable () { $debug_cmd - func_quote_for_eval_unquoted_result= - func_quote_for_eval_result= - while test 0 -lt $#; do - case $1 in - *[\\\`\"\$]*) - _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; - *) - _G_unquoted_arg=$1 ;; - esac - if test -n "$func_quote_for_eval_unquoted_result"; then - func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" - else - func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" + $require_check_ifs_backslash + + func_quote_portable_result=$2 + + # one-time-loop (easy break) + while true + do + if $1; then + func_quote_portable_result=`$ECHO "$2" | $SED \ + -e "$sed_double_quote_subst" -e "$sed_double_backslash"` + break fi - case $_G_unquoted_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and variable expansion - # for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_quoted_arg=\"$_G_unquoted_arg\" + # Quote for eval. + case $func_quote_portable_result in + *[\\\`\"\$]*) + # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string + # contains the shell wildcard characters. + case $check_ifs_backshlash_broken$func_quote_portable_result in + :*|*[\[\*\?]*) + func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ + | $SED "$sed_quote_subst"` + break + ;; + esac + + func_quote_portable_old_IFS=$IFS + for _G_char in '\' '`' '"' '$' + do + # STATE($1) PREV($2) SEPARATOR($3) + set start "" "" + func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy + IFS=$_G_char + for _G_part in $func_quote_portable_result + do + case $1 in + quote) + func_append func_quote_portable_result "$3$2" + set quote "$_G_part" "\\$_G_char" + ;; + start) + set first "" "" + func_quote_portable_result= + ;; + first) + set quote "$_G_part" "" + ;; + esac + done + done + IFS=$func_quote_portable_old_IFS ;; - *) - _G_quoted_arg=$_G_unquoted_arg - ;; + *) ;; esac - - if test -n "$func_quote_for_eval_result"; then - func_append func_quote_for_eval_result " $_G_quoted_arg" - else - func_append func_quote_for_eval_result "$_G_quoted_arg" - fi - shift + break done + + func_quote_portable_unquoted_result=$func_quote_portable_result + case $func_quote_portable_result in + # double-quote args containing shell metacharacters to delay + # word splitting, command substitution and variable expansion + # for a subsequent eval. + # many bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_portable_result=\"$func_quote_portable_result\" + ;; + esac } -# func_quote_for_expand ARG -# ------------------------- -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () -{ - $debug_cmd +# func_quotefast_eval ARG +# ----------------------- +# Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', +# but optimized for speed. Result is stored in $func_quotefast_eval. +if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then + printf -v _GL_test_printf_tilde %q '~' + if test '\~' = "$_GL_test_printf_tilde"; then + func_quotefast_eval () + { + printf -v func_quotefast_eval_result %q "$1" + } + else + # Broken older Bash implementations. Make those faster too if possible. + func_quotefast_eval () + { + case $1 in + '~'*) + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + ;; + *) + printf -v func_quotefast_eval_result %q "$1" + ;; + esac + } + fi +else + func_quotefast_eval () + { + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + } +fi - case $1 in - *[\\\`\"]*) - _G_arg=`$ECHO "$1" | $SED \ - -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; - *) - _G_arg=$1 ;; + +# func_quote_arg MODEs ARG +# ------------------------ +# Quote one ARG to be evaled later. MODEs argument may contain zero or more +# specifiers listed below separated by ',' character. This function returns two +# values: +# i) func_quote_arg_result +# double-quoted (when needed), suitable for a subsequent eval +# ii) func_quote_arg_unquoted_result +# has all characters that are still active within double +# quotes backslashified. Available only if 'unquoted' is specified. +# +# Available modes: +# ---------------- +# 'eval' (default) +# - escape shell special characters +# 'expand' +# - the same as 'eval'; but do not quote variable references +# 'pretty' +# - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might +# be used later in func_quote to get output like: 'echo "a b"' instead +# of 'echo a\ b'. This is slower than default on some shells. +# 'unquoted' +# - produce also $func_quote_arg_unquoted_result which does not contain +# wrapping double-quotes. +# +# Examples for 'func_quote_arg pretty,unquoted string': +# +# string | *_result | *_unquoted_result +# ------------+-----------------------+------------------- +# " | \" | \" +# a b | "a b" | a b +# "a b" | "\"a b\"" | \"a b\" +# * | "*" | * +# z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" +# +# Examples for 'func_quote_arg pretty,unquoted,expand string': +# +# string | *_result | *_unquoted_result +# --------------+---------------------+-------------------- +# z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" +func_quote_arg () +{ + _G_quote_expand=false + case ,$1, in + *,expand,*) + _G_quote_expand=: + ;; esac - case $_G_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_arg=\"$_G_arg\" + case ,$1, in + *,pretty,*|*,expand,*|*,unquoted,*) + func_quote_portable $_G_quote_expand "$2" + func_quote_arg_result=$func_quote_portable_result + func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result + ;; + *) + # Faster quote-for-eval for some shells. + func_quotefast_eval "$2" + func_quote_arg_result=$func_quotefast_eval_result ;; esac +} + - func_quote_for_expand_result=$_G_arg +# func_quote MODEs ARGs... +# ------------------------ +# Quote all ARGs to be evaled later and join them into single command. See +# func_quote_arg's description for more info. +func_quote () +{ + $debug_cmd + _G_func_quote_mode=$1 ; shift + func_quote_result= + while test 0 -lt $#; do + func_quote_arg "$_G_func_quote_mode" "$1" + if test -n "$func_quote_result"; then + func_append func_quote_result " $func_quote_arg_result" + else + func_append func_quote_result "$func_quote_arg_result" + fi + shift + done } @@ -1215,8 +1376,8 @@ func_show_eval () _G_cmd=$1 _G_fail_exp=${2-':'} - func_quote_for_expand "$_G_cmd" - eval "func_notquiet $func_quote_for_expand_result" + func_quote_arg pretty,expand "$_G_cmd" + eval "func_notquiet $func_quote_arg_result" $opt_dry_run || { eval "$_G_cmd" @@ -1241,8 +1402,8 @@ func_show_eval_locale () _G_fail_exp=${2-':'} $opt_quiet || { - func_quote_for_expand "$_G_cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$_G_cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || { @@ -1369,30 +1530,26 @@ func_lt_ver () # End: #! /bin/sh -# Set a version string for this script. -scriptversion=2014-01-07.03; # UTC - # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 -# Copyright (C) 2010-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# 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 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2010-2019, 2021 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 2 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Please report bugs or propose patches to: +# -# Please report bugs or propose patches to gary@gnu.org. +# Set a version string for this script. +scriptversion=2019-02-19.15; # UTC ## ------ ## @@ -1415,7 +1572,7 @@ scriptversion=2014-01-07.03; # UTC # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file -# starting with '# Written by ' and ending with '# warranty; '. +# starting with '# Written by ' and ending with '# Copyright'. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the @@ -1427,7 +1584,7 @@ scriptversion=2014-01-07.03; # UTC # to display verbose messages only when your user has specified # '--verbose'. # -# After sourcing this file, you can plug processing for additional +# After sourcing this file, you can plug in processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. @@ -1476,8 +1633,8 @@ fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## # This section contains functions for adding, removing, and running hooks -# to the main code. A hook is just a named list of of function, that can -# be run in order later on. +# in the main code. A hook is just a list of function names that can be +# run in order later on. # func_hookable FUNC_NAME # ----------------------- @@ -1510,7 +1667,8 @@ func_add_hook () # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ -# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. +# Remove HOOK_FUNC from the list of hook functions to be called by +# FUNC_NAME. func_remove_hook () { $debug_cmd @@ -1519,10 +1677,28 @@ func_remove_hook () } +# func_propagate_result FUNC_NAME_A FUNC_NAME_B +# --------------------------------------------- +# If the *_result variable of FUNC_NAME_A _is set_, assign its value to +# *_result variable of FUNC_NAME_B. +func_propagate_result () +{ + $debug_cmd + + func_propagate_result_result=: + if eval "test \"\${${1}_result+set}\" = set" + then + eval "${2}_result=\$${1}_result" + else + func_propagate_result_result=false + fi +} + + # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. -# It is assumed that the list of hook functions contains nothing more +# It's assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. @@ -1532,22 +1708,19 @@ func_run_hooks () case " $hookable_fns " in *" $1 "*) ;; - *) func_fatal_error "'$1' does not support hook funcions.n" ;; + *) func_fatal_error "'$1' does not support hook functions." ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do - eval $_G_hook '"$@"' - - # store returned options list back into positional - # parameters for next 'cmd' execution. - eval _G_hook_result=\$${_G_hook}_result - eval set dummy "$_G_hook_result"; shift + func_unset "${_G_hook}_result" + eval $_G_hook '${1+"$@"}' + func_propagate_result $_G_hook func_run_hooks + if $func_propagate_result_result; then + eval set dummy "$func_run_hooks_result"; shift + fi done - - func_quote_for_eval ${1+"$@"} - func_run_hooks_result=$func_quote_for_eval_result } @@ -1557,10 +1730,18 @@ func_run_hooks () ## --------------- ## # In order to add your own option parsing hooks, you must accept the -# full positional parameter list in your hook function, remove any -# options that you action, and then pass back the remaining unprocessed -# options in '_result', escaped suitably for -# 'eval'. Like this: +# full positional parameter list from your hook function. You may remove +# or edit any options that you action, and then pass back the remaining +# unprocessed options in '_result', escaped +# suitably for 'eval'. +# +# The '_result' variable is automatically unset +# before your hook gets called; for best performance, only set the +# *_result variable when necessary (i.e. don't call the 'func_quote' +# function unnecessarily because it can be an expensive operation on some +# machines). +# +# Like this: # # my_options_prep () # { @@ -1570,9 +1751,8 @@ func_run_hooks () # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' -# -# func_quote_for_eval ${1+"$@"} -# my_options_prep_result=$func_quote_for_eval_result +# # No change in '$@' (ignored completely by this hook). Leave +# # my_options_prep_result variable intact. # } # func_add_hook func_options_prep my_options_prep # @@ -1581,25 +1761,36 @@ func_run_hooks () # { # $debug_cmd # -# # Note that for efficiency, we parse as many options as we can +# args_changed=false +# +# # Note that, for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in -# --silent|-s) opt_silent=: ;; +# --silent|-s) opt_silent=: +# args_changed=: +# ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift +# args_changed=: # ;; -# *) set dummy "$_G_opt" "$*"; shift; break ;; +# *) # Make sure the first unrecognised option "$_G_opt" +# # is added back to "$@" in case we need it later, +# # if $args_changed was set to 'true'. +# set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # -# func_quote_for_eval ${1+"$@"} -# my_silent_option_result=$func_quote_for_eval_result +# # Only call 'func_quote' here if we processed at least one argument. +# if $args_changed; then +# func_quote eval ${1+"$@"} +# my_silent_option_result=$func_quote_result +# fi # } # func_add_hook func_parse_options my_silent_option # @@ -1610,17 +1801,26 @@ func_run_hooks () # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." -# -# func_quote_for_eval ${1+"$@"} -# my_option_validation_result=$func_quote_for_eval_result # } # func_add_hook func_validate_options my_option_validation # -# You'll alse need to manually amend $usage_message to reflect the extra +# You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. +# func_options_finish [ARG]... +# ---------------------------- +# Finishing the option parse loop (call 'func_options' hooks ATM). +func_options_finish () +{ + $debug_cmd + + func_run_hooks func_options ${1+"$@"} + func_propagate_result func_run_hooks func_options_finish +} + + # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the @@ -1630,17 +1830,27 @@ func_options () { $debug_cmd - func_options_prep ${1+"$@"} - eval func_parse_options \ - ${func_options_prep_result+"$func_options_prep_result"} - eval func_validate_options \ - ${func_parse_options_result+"$func_parse_options_result"} + _G_options_quoted=false - eval func_run_hooks func_options \ - ${func_validate_options_result+"$func_validate_options_result"} + for my_func in options_prep parse_options validate_options options_finish + do + func_unset func_${my_func}_result + func_unset func_run_hooks_result + eval func_$my_func '${1+"$@"}' + func_propagate_result func_$my_func func_options + if $func_propagate_result_result; then + eval set dummy "$func_options_result"; shift + _G_options_quoted=: + fi + done - # save modified positional parameters for caller - func_options_result=$func_run_hooks_result + $_G_options_quoted || { + # As we (func_options) are top-level options-parser function and + # nobody quoted "$@" for us yet, we need to do it explicitly for + # caller. + func_quote eval ${1+"$@"} + func_options_result=$func_quote_result + } } @@ -1649,9 +1859,8 @@ func_options () # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and -# needs to propogate that back to rest of this script, then the complete -# modified list must be put in 'func_run_hooks_result' before -# returning. +# needs to propagate that back to rest of this script, then the complete +# modified list must be put in 'func_run_hooks_result' before returning. func_hookable func_options_prep func_options_prep () { @@ -1662,9 +1871,7 @@ func_options_prep () opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} - - # save modified positional parameters for caller - func_options_prep_result=$func_run_hooks_result + func_propagate_result func_run_hooks func_options_prep } @@ -1676,25 +1883,32 @@ func_parse_options () { $debug_cmd - func_parse_options_result= - + _G_parse_options_requote=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} - - # Adjust func_parse_options positional parameters to match - eval set dummy "$func_run_hooks_result"; shift + func_propagate_result func_run_hooks func_parse_options + if $func_propagate_result_result; then + eval set dummy "$func_parse_options_result"; shift + # Even though we may have changed "$@", we passed the "$@" array + # down into the hook and it quoted it for us (because we are in + # this if-branch). No need to quote it again. + _G_parse_options_requote=false + fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break + # We expect that one of the options parsed in this function matches + # and thus we remove _G_opt from "$@" and need to re-quote. + _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' - func_echo "enabling shell trace mode" + func_echo "enabling shell trace mode" >&2 $debug_cmd ;; @@ -1704,7 +1918,10 @@ func_parse_options () ;; --warnings|--warning|-W) - test $# = 0 && func_missing_arg $_G_opt && break + if test $# = 0 && func_missing_arg $_G_opt; then + _G_parse_options_requote=: + break + fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above @@ -1757,15 +1974,24 @@ func_parse_options () shift ;; - --) break ;; + --) _G_parse_options_requote=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + *) set dummy "$_G_opt" ${1+"$@"}; shift + _G_match_parse_options=false + break + ;; esac + + if $_G_match_parse_options; then + _G_parse_options_requote=: + fi done - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - func_parse_options_result=$func_quote_for_eval_result + if $_G_parse_options_requote; then + # save modified positional parameters for caller + func_quote eval ${1+"$@"} + func_parse_options_result=$func_quote_result + fi } @@ -1782,12 +2008,10 @@ func_validate_options () test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} + func_propagate_result func_run_hooks func_validate_options # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE - - # save modified positional parameters for caller - func_validate_options_result=$func_run_hooks_result } @@ -1843,8 +2067,8 @@ func_missing_arg () # func_split_equals STRING # ------------------------ -# Set func_split_equals_lhs and func_split_equals_rhs shell variables after -# splitting STRING at the '=' sign. +# Set func_split_equals_lhs and func_split_equals_rhs shell variables +# after splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ @@ -1859,8 +2083,9 @@ then func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} - test "x$func_split_equals_lhs" = "x$1" \ - && func_split_equals_rhs= + if test "x$func_split_equals_lhs" = "x$1"; then + func_split_equals_rhs= + fi }' else # ...otherwise fall back to using expr, which is often a shell builtin. @@ -1870,7 +2095,7 @@ else func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= - test "x$func_split_equals_lhs" = "x$1" \ + test "x$func_split_equals_lhs=" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals @@ -1896,7 +2121,7 @@ else { $debug_cmd - func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` + func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt @@ -1938,31 +2163,44 @@ func_usage_message () # func_version # ------------ # Echo version message to standard output and exit. +# The version message is extracted from the calling file's header +# comments, with leading '# ' stripped: +# 1. First display the progname and version +# 2. Followed by the header comment line matching /^# Written by / +# 3. Then a blank line followed by the first following line matching +# /^# Copyright / +# 4. Immediately followed by any lines between the previous matches, +# except lines preceding the intervening completely blank line. +# For example, see the header comments of this file. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' - /(C)/!b go - :more - /\./!{ - N - s|\n# | | - b more - } - :go - /^# Written by /,/# warranty; / { - s|^# || - s|^# *$|| - s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| - p + /^# Written by /!b + s|^# ||; p; n + + :fwd2blnk + /./ { + n + b fwd2blnk } - /^# Written by / { - s|^# || - p + p; n + + :holdwrnt + s|^# || + s|^# *$|| + /^Copyright /!{ + /./H + n + b holdwrnt } - /^warranty; /q' < "$progpath" + + s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| + G + s|\(\n\)\n*|\1|g + p; q' < "$progpath" exit $? } @@ -1972,12 +2210,12 @@ func_version () # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. -scriptversion='(GNU libtool) 2.4.6' +scriptversion='(GNU libtool) 2.4.7' # func_echo ARG... @@ -2068,7 +2306,7 @@ include the following information: compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) - version: $progname (GNU libtool) 2.4.6 + version: $progname (GNU libtool) 2.4.7 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` @@ -2124,7 +2362,7 @@ fi # a configuration failure hint, and exit. func_fatal_configuration () { - func__fatal_error ${1+"$@"} \ + func_fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } @@ -2270,6 +2508,8 @@ libtool_options_prep () nonopt= preserve_args= + _G_rc_lt_options_prep=: + # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) @@ -2293,11 +2533,16 @@ libtool_options_prep () uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; + *) + _G_rc_lt_options_prep=false + ;; esac - # Pass back the list of options. - func_quote_for_eval ${1+"$@"} - libtool_options_prep_result=$func_quote_for_eval_result + if $_G_rc_lt_options_prep; then + # Pass back the list of options. + func_quote eval ${1+"$@"} + libtool_options_prep_result=$func_quote_result + fi } func_add_hook func_options_prep libtool_options_prep @@ -2309,9 +2554,12 @@ libtool_parse_options () { $debug_cmd + _G_rc_lt_parse_options=false + # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do + _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in @@ -2386,15 +2634,20 @@ libtool_parse_options () func_append preserve_args " $_G_opt" ;; - # An option not handled by this hook function: - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + # An option not handled by this hook function: + *) set dummy "$_G_opt" ${1+"$@"} ; shift + _G_match_lt_parse_options=false + break + ;; esac + $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done - - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - libtool_parse_options_result=$func_quote_for_eval_result + if $_G_rc_lt_parse_options; then + # save modified positional parameters for caller + func_quote eval ${1+"$@"} + libtool_parse_options_result=$func_quote_result + fi } func_add_hook func_parse_options libtool_parse_options @@ -2451,8 +2704,8 @@ libtool_validate_options () } # Pass back the unparsed argument list - func_quote_for_eval ${1+"$@"} - libtool_validate_options_result=$func_quote_for_eval_result + func_quote eval ${1+"$@"} + libtool_validate_options_result=$func_quote_result } func_add_hook func_validate_options libtool_validate_options @@ -3418,8 +3671,8 @@ func_mode_compile () esac done - func_quote_for_eval "$libobj" - test "X$libobj" != "X$func_quote_for_eval_result" \ + func_quote_arg pretty "$libobj" + test "X$libobj" != "X$func_quote_arg_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" @@ -3492,8 +3745,8 @@ compiler." func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result - func_quote_for_eval "$srcfile" - qsrcfile=$func_quote_for_eval_result + func_quote_arg pretty "$srcfile" + qsrcfile=$func_quote_arg_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then @@ -3648,7 +3901,8 @@ This mode accepts the following additional options: -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking - -Wc,FLAG pass FLAG directly to the compiler + -Wc,FLAG + -Xcompiler FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. @@ -3754,6 +4008,8 @@ The following components of LINK-COMMAND are treated specially: -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wa,FLAG + -Xassembler FLAG pass linker-specific FLAG directly to the assembler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) @@ -4096,8 +4352,8 @@ func_mode_install () case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. - func_quote_for_eval "$nonopt" - install_prog="$func_quote_for_eval_result " + func_quote_arg pretty "$nonopt" + install_prog="$func_quote_arg_result " arg=$1 shift else @@ -4107,8 +4363,8 @@ func_mode_install () # The real first argument should be the name of the installation program. # Aesthetically quote it. - func_quote_for_eval "$arg" - func_append install_prog "$func_quote_for_eval_result" + func_quote_arg pretty "$arg" + func_append install_prog "$func_quote_arg_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; @@ -4165,12 +4421,12 @@ func_mode_install () esac # Aesthetically quote the argument. - func_quote_for_eval "$arg" - func_append install_prog " $func_quote_for_eval_result" + func_quote_arg pretty "$arg" + func_append install_prog " $func_quote_arg_result" if test -n "$arg2"; then - func_quote_for_eval "$arg2" + func_quote_arg pretty "$arg2" fi - func_append install_shared_prog " $func_quote_for_eval_result" + func_append install_shared_prog " $func_quote_arg_result" done test -z "$install_prog" && \ @@ -4181,8 +4437,8 @@ func_mode_install () if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else - func_quote_for_eval "$install_override_mode" - func_append install_shared_prog " -m $func_quote_for_eval_result" + func_quote_arg pretty "$install_override_mode" + func_append install_shared_prog " -m $func_quote_arg_result" fi fi @@ -4478,8 +4734,8 @@ func_mode_install () relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { - func_quote_for_expand "$relink_command" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$relink_command" + eval "func_echo $func_quote_arg_result" } if eval "$relink_command"; then : else @@ -5258,7 +5514,8 @@ else if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" - qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + func_quote_arg pretty "$ECHO" + qECHO=$func_quote_arg_result $ECHO "\ # A function that is used when there is no print builtin or printf. @@ -5268,7 +5525,7 @@ func_fallback_echo () \$1 _LTECHO_EOF' } - ECHO=\"$qECHO\" + ECHO=$qECHO fi # Very basic option parsing. These options are (a) specific to @@ -6611,9 +6868,9 @@ func_mode_link () while test "$#" -gt 0; do arg=$1 shift - func_quote_for_eval "$arg" - qarg=$func_quote_for_eval_unquoted_result - func_append libtool_args " $func_quote_for_eval_result" + func_quote_arg pretty,unquoted "$arg" + qarg=$func_quote_arg_unquoted_result + func_append libtool_args " $func_quote_arg_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then @@ -6849,6 +7106,13 @@ func_mode_link () prev= continue ;; + xassembler) + func_append compiler_flags " -Xassembler $qarg" + prev= + func_append compile_command " -Xassembler $qarg" + func_append finalize_command " -Xassembler $qarg" + continue + ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" @@ -7019,7 +7283,7 @@ func_mode_link () # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; @@ -7039,7 +7303,7 @@ func_mode_link () esac elif test X-lc_r = "X$arg"; then case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc_r directly, use -pthread flag. continue ;; @@ -7069,8 +7333,20 @@ func_mode_link () prev=xcompiler continue ;; - - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + # Solaris ld rejects as of 11.4. Refer to Oracle bug 22985199. + -pthread) + case $host in + *solaris2*) ;; + *) + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + ;; + esac + continue + ;; + -mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" @@ -7211,9 +7487,9 @@ func_mode_link () save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs - func_quote_for_eval "$flag" - func_append arg " $func_quote_for_eval_result" - func_append compiler_flags " $func_quote_for_eval_result" + func_quote_arg pretty "$flag" + func_append arg " $func_quote_arg_result" + func_append compiler_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" @@ -7227,16 +7503,21 @@ func_mode_link () save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs - func_quote_for_eval "$flag" - func_append arg " $wl$func_quote_for_eval_result" - func_append compiler_flags " $wl$func_quote_for_eval_result" - func_append linker_flags " $func_quote_for_eval_result" + func_quote_arg pretty "$flag" + func_append arg " $wl$func_quote_arg_result" + func_append compiler_flags " $wl$func_quote_arg_result" + func_append linker_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; + -Xassembler) + prev=xassembler + continue + ;; + -Xcompiler) prev=xcompiler continue @@ -7254,8 +7535,8 @@ func_mode_link () # -msg_* for osf cc -msg_*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; # Flags to be passed through unchanged, with rationale: @@ -7272,12 +7553,17 @@ func_mode_link () # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang + # -fsanitize=* Clang/GCC memory and address sanitizer + # -fuse-ld=* Linker select flags for GCC + # -Wa,* Pass flags directly to the assembler -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ + -specs=*|-fsanitize=*|-fuse-ld=*|-Wa,*) + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" @@ -7298,15 +7584,15 @@ func_mode_link () continue else # Otherwise treat like 'Some other compiler flag' below - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result fi ;; # Some other compiler flag. -* | +*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; *.$objext) @@ -7426,8 +7712,8 @@ func_mode_link () *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; esac # arg @@ -8632,7 +8918,7 @@ func_mode_link () test CXX = "$tagname" && { case $host_os in linux*) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi @@ -8805,7 +9091,7 @@ func_mode_link () # case $version_type in # correct linux to gnu/linux during the next big refactor - darwin|freebsd-elf|linux|osf|windows|none) + darwin|freebsd-elf|linux|midnightbsd-elf|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor @@ -8896,7 +9182,7 @@ func_mode_link () versuffix=.$current.$revision ;; - freebsd-elf) + freebsd-elf | midnightbsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision @@ -9122,7 +9408,7 @@ func_mode_link () *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) @@ -9933,8 +10219,8 @@ EOF for cmd in $concat_cmds; do IFS=$save_ifs $opt_quiet || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? @@ -10027,8 +10313,8 @@ EOF eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? @@ -10502,12 +10788,13 @@ EOF elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + func_quote_arg pretty "$var_value" + relink_command="$var=$func_quote_arg_result; export $var; $relink_command" fi done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + func_quote eval cd "`pwd`" + func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)" + relink_command=$func_quote_arg_unquoted_result fi # Only actually do things if not in dry run mode. @@ -10747,13 +11034,15 @@ EOF elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + func_quote_arg pretty,unquoted "$var_value" + relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command" fi done # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + func_quote eval cd "`pwd`" + relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + func_quote_arg pretty,unquoted "$relink_command" + relink_command=$func_quote_arg_unquoted_result if test yes = "$hardcode_automatic"; then relink_command= fi diff --git a/extra/libedit/libedit-20210910-3.1/m4/libtool.m4 b/extra/libedit/libedit-20221030-3.1/m4/libtool.m4 similarity index 97% rename from extra/libedit/libedit-20210910-3.1/m4/libtool.m4 rename to extra/libedit/libedit-20221030-3.1/m4/libtool.m4 index 92060119f737..79a2451ef520 100644 --- a/extra/libedit/libedit-20210910-3.1/m4/libtool.m4 +++ b/extra/libedit/libedit-20221030-3.1/m4/libtool.m4 @@ -1,6 +1,7 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # -# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -31,7 +32,7 @@ m4_define([_LT_COPYING], [dnl # along with this program. If not, see . ]) -# serial 58 LT_INIT +# serial 59 LT_INIT # LT_PREREQ(VERSION) @@ -181,6 +182,7 @@ m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_DECL_FILECMD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl @@ -219,8 +221,8 @@ esac ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld @@ -778,7 +780,7 @@ _LT_EOF # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ + $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || @@ -1042,8 +1044,8 @@ int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD - echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD - $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF @@ -1068,11 +1070,11 @@ _LT_EOF darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) - case ${MACOSX_DEPLOYMENT_TARGET},$host in - 10.[[012]],*|,*powerpc*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - *) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + case $MACOSX_DEPLOYMENT_TARGET,$host in + 10.[[012]],*|,*powerpc*-darwin[[5-8]]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac @@ -1121,12 +1123,12 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(module_expsym_cmds, $1)="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else @@ -1240,7 +1242,8 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], -[AC_MSG_CHECKING([for sysroot]) +[m4_require([_LT_DECL_SED])dnl +AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot @@ -1257,7 +1260,7 @@ case $with_sysroot in #( fi ;; #( /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( @@ -1287,7 +1290,7 @@ ia64-*-hpux*) # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; @@ -1304,7 +1307,7 @@ ia64-*-hpux*) echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; @@ -1316,7 +1319,7 @@ ia64-*-hpux*) ;; esac else - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; @@ -1338,7 +1341,7 @@ mips64*-*linux*) echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; @@ -1346,7 +1349,7 @@ mips64*-*linux*) emul="${emul}64" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; @@ -1354,7 +1357,7 @@ mips64*-*linux*) emul="${emul}ltsmip" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; @@ -1374,14 +1377,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; @@ -1449,7 +1452,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) @@ -1488,9 +1491,22 @@ need_locks=$enable_libtool_lock m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} -: ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because thats what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. + +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS +_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)]) + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. +_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}], + [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no @@ -1709,7 +1725,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl lt_cv_sys_max_cmd_len=8192; ;; - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -1752,7 +1768,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi @@ -2202,26 +2218,35 @@ m4_defun([_LT_CMD_STRIPLIB], striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) +if test -z "$STRIP"; then + AC_MSG_RESULT([no]) else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) - else + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) AC_MSG_RESULT([no]) - fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac + ;; + esac + fi fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) @@ -2544,7 +2569,7 @@ cygwin* | mingw* | pw32* | cegcc*) case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; @@ -2554,14 +2579,14 @@ m4_if([$1], [],[ ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' @@ -2580,7 +2605,7 @@ m4_if([$1], [],[ done IFS=$lt_save_ifs # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form @@ -2617,7 +2642,7 @@ m4_if([$1], [],[ ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -2650,7 +2675,7 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then @@ -3449,7 +3474,7 @@ beos*) bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; @@ -3483,14 +3508,14 @@ darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac @@ -3504,7 +3529,7 @@ haiku*) ;; hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' @@ -3551,7 +3576,7 @@ netbsd*) newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; @@ -3678,13 +3703,13 @@ else mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 @@ -3710,7 +3735,7 @@ else # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; @@ -3950,7 +3975,7 @@ esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" @@ -3968,20 +3993,20 @@ fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ @@ -4005,7 +4030,7 @@ for ac_symprfx in "" "_"; do if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, + # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ @@ -4023,9 +4048,9 @@ for ac_symprfx in "" "_"; do " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -4312,7 +4337,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) @@ -4395,7 +4420,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' @@ -4731,7 +4756,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' @@ -4914,7 +4939,7 @@ m4_if([$1], [CXX], [ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) @@ -4922,7 +4947,7 @@ m4_if([$1], [CXX], [ ;; cygwin* | mingw* | cegcc*) case $cc_basename in - cl*) + cl* | icl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) @@ -4979,15 +5004,15 @@ dnl Note also adjust exclude_expsyms for C++ above. case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time + # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) @@ -5039,7 +5064,7 @@ dnl Note also adjust exclude_expsyms for C++ above. _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no - case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in + case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -5151,6 +5176,7 @@ _LT_EOF emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; interix[[3-9]]*) @@ -5165,7 +5191,7 @@ _LT_EOF # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) @@ -5208,7 +5234,7 @@ _LT_EOF _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes @@ -5220,7 +5246,7 @@ _LT_EOF if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi @@ -5236,7 +5262,7 @@ _LT_EOF _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi @@ -5368,7 +5394,7 @@ _LT_EOF if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -5551,12 +5577,12 @@ _LT_EOF cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in - cl*) - # Native MSVC + cl* | icl*) + # Native MSVC or ICC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes @@ -5597,7 +5623,7 @@ _LT_EOF fi' ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. @@ -5645,7 +5671,7 @@ _LT_EOF ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes @@ -5856,6 +5882,7 @@ _LT_EOF emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; osf3*) @@ -6626,8 +6653,8 @@ if test yes != "$_lt_caught_CXX_error"; then cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC + ,cl* | no,cl* | ,icl* | no,icl*) + # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' @@ -6725,6 +6752,7 @@ if test yes != "$_lt_caught_CXX_error"; then emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; dgux*) @@ -6755,7 +6783,7 @@ if test yes != "$_lt_caught_CXX_error"; then _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes @@ -6892,7 +6920,7 @@ if test yes != "$_lt_caught_CXX_error"; then # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in @@ -7032,13 +7060,13 @@ if test yes != "$_lt_caught_CXX_error"; then _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' @@ -8184,6 +8212,14 @@ _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) +# _LT_DECL_FILECMD +# ---------------- +# Check for a file(cmd) program that can be used to detect file type and magic +m4_defun([_LT_DECL_FILECMD], +[AC_CHECK_TOOL([FILECMD], [file], [:]) +_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types]) +])# _LD_DECL_FILECMD + # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates diff --git a/extra/libedit/libedit-20210910-3.1/m4/ltoptions.m4 b/extra/libedit/libedit-20221030-3.1/m4/ltoptions.m4 similarity index 99% rename from extra/libedit/libedit-20210910-3.1/m4/ltoptions.m4 rename to extra/libedit/libedit-20221030-3.1/m4/ltoptions.m4 index 94b082976667..b0b5e9c21260 100644 --- a/extra/libedit/libedit-20210910-3.1/m4/ltoptions.m4 +++ b/extra/libedit/libedit-20221030-3.1/m4/ltoptions.m4 @@ -1,7 +1,7 @@ # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software -# Foundation, Inc. +# Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free +# Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives diff --git a/extra/libedit/libedit-20210910-3.1/m4/ltsugar.m4 b/extra/libedit/libedit-20221030-3.1/m4/ltsugar.m4 similarity index 98% rename from extra/libedit/libedit-20210910-3.1/m4/ltsugar.m4 rename to extra/libedit/libedit-20221030-3.1/m4/ltsugar.m4 index 48bc9344a4d6..902508bd93ae 100644 --- a/extra/libedit/libedit-20210910-3.1/m4/ltsugar.m4 +++ b/extra/libedit/libedit-20221030-3.1/m4/ltsugar.m4 @@ -1,6 +1,6 @@ # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software +# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # diff --git a/extra/libedit/libedit-20210910-3.1/m4/ltversion.m4 b/extra/libedit/libedit-20221030-3.1/m4/ltversion.m4 similarity index 66% rename from extra/libedit/libedit-20210910-3.1/m4/ltversion.m4 rename to extra/libedit/libedit-20221030-3.1/m4/ltversion.m4 index fa04b52a3bf8..b155d0aceca3 100644 --- a/extra/libedit/libedit-20210910-3.1/m4/ltversion.m4 +++ b/extra/libedit/libedit-20221030-3.1/m4/ltversion.m4 @@ -1,6 +1,7 @@ # ltversion.m4 -- version numbers -*- Autoconf -*- # -# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. +# Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation, +# Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives @@ -9,15 +10,15 @@ # @configure_input@ -# serial 4179 ltversion.m4 +# serial 4245 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4.6]) -m4_define([LT_PACKAGE_REVISION], [2.4.6]) +m4_define([LT_PACKAGE_VERSION], [2.4.7]) +m4_define([LT_PACKAGE_REVISION], [2.4.7]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.6' -macro_revision='2.4.6' +[macro_version='2.4.7' +macro_revision='2.4.7' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) diff --git a/extra/libedit/libedit-20210910-3.1/missing b/extra/libedit/libedit-20221030-3.1/missing similarity index 100% rename from extra/libedit/libedit-20210910-3.1/missing rename to extra/libedit/libedit-20221030-3.1/missing diff --git a/extra/libedit/libedit-20210910-3.1/src/CMakeLists.txt b/extra/libedit/libedit-20221030-3.1/src/CMakeLists.txt similarity index 88% rename from extra/libedit/libedit-20210910-3.1/src/CMakeLists.txt rename to extra/libedit/libedit-20221030-3.1/src/CMakeLists.txt index fcd1394efca8..e073d5bd871a 100644 --- a/extra/libedit/libedit-20210910-3.1/src/CMakeLists.txt +++ b/extra/libedit/libedit-20221030-3.1/src/CMakeLists.txt @@ -110,6 +110,7 @@ SET(LIBEDIT_SOURCES prompt.c read.c readline.c + reallocarr.c refresh.c search.c sig.c @@ -141,7 +142,13 @@ ENDIF() ADD_LIBRARY(edit STATIC ${LIBEDIT_SOURCES}) TARGET_LINK_LIBRARIES(edit ${CURSES_LIBRARY}) ADD_DEPENDENCIES(edit libedit_vi libedit_emacs libedit_common libedit_fcns libedit_help libedit_func) - +# src/chared.c:679:2: +# error: for loop initial declarations are only allowed in C99 mode +# Do not extend CMAKE_C_FLAGS, as that will affect feature tests. +ADD_COMPILE_FLAGS( + ${LIBEDIT_SOURCES} + COMPILE_FLAGS "-std=c99" + ) # clang may complain: # converts between pointers to integer types with different sign @@ -164,3 +171,15 @@ MY_CHECK_C_COMPILER_FLAG("-Wstringop-truncation" HAVE_STRINGOP_TRUNCATION) IF(HAVE_STRINGOP_TRUNCATION) TARGET_COMPILE_OPTIONS(edit PRIVATE "-Wno-stringop-truncation") ENDIF() + +# warning: comparing the result of pointer addition +MY_CHECK_C_COMPILER_FLAG("-Waddress" HAVE_ADDRESS) +IF(HAVE_ADDRESS) + TARGET_COMPILE_OPTIONS(edit PRIVATE "-Wno-address") +ENDIF() + +# warning: pointer may be used after realloc +MY_CHECK_C_COMPILER_FLAG("-Wuse-after-free" HAVE_USE_AFTER_FREE) +IF(HAVE_USE_AFTER_FREE) + TARGET_COMPILE_OPTIONS(edit PRIVATE "-Wno-use-after-free") +ENDIF() diff --git a/extra/libedit/libedit-20210910-3.1/src/ChangeLog b/extra/libedit/libedit-20221030-3.1/src/ChangeLog similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/ChangeLog rename to extra/libedit/libedit-20221030-3.1/src/ChangeLog diff --git a/extra/libedit/libedit-20210910-3.1/src/Makefile.am b/extra/libedit/libedit-20221030-3.1/src/Makefile.am similarity index 98% rename from extra/libedit/libedit-20210910-3.1/src/Makefile.am rename to extra/libedit/libedit-20221030-3.1/src/Makefile.am index 084246fa35f1..9a0b235498d5 100644 --- a/extra/libedit/libedit-20210910-3.1/src/Makefile.am +++ b/extra/libedit/libedit-20221030-3.1/src/Makefile.am @@ -27,7 +27,7 @@ CLEANFILES = $(BUILT_SOURCES) lib_LTLIBRARIES = libedit.la libedit_la_SOURCES = chared.c common.c el.c eln.c emacs.c hist.c keymacro.c map.c chartype.c parse.c \ prompt.c read.c refresh.c search.c sig.c terminal.c tty.c vi.c \ - wcsdup.c \ + reallocarr.c wcsdup.c \ tokenizer.c tokenizern.c \ history.c historyn.c \ filecomplete.c readline.c chared.h literal.c el.h hist.h \ diff --git a/extra/libedit/libedit-20210910-3.1/src/Makefile.in b/extra/libedit/libedit-20221030-3.1/src/Makefile.in similarity index 95% rename from extra/libedit/libedit-20210910-3.1/src/Makefile.in rename to extra/libedit/libedit-20221030-3.1/src/Makefile.in index 1a1e414655ce..c2313a10b68e 100644 --- a/extra/libedit/libedit-20210910-3.1/src/Makefile.in +++ b/extra/libedit/libedit-20221030-3.1/src/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.16.4 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. @@ -140,13 +140,13 @@ LTLIBRARIES = $(lib_LTLIBRARIES) libedit_la_LIBADD = am__libedit_la_SOURCES_DIST = chared.c common.c el.c eln.c emacs.c \ hist.c keymacro.c map.c chartype.c parse.c prompt.c read.c \ - refresh.c search.c sig.c terminal.c tty.c vi.c wcsdup.c \ - tokenizer.c tokenizern.c history.c historyn.c filecomplete.c \ - readline.c chared.h literal.c el.h hist.h histedit.h \ - keymacro.h map.h chartype.h parse.h prompt.h read.h refresh.h \ - search.h sig.h sys.h terminal.h tty.h vis.h filecomplete.h \ - editline/readline.h literal.h strlcpy.c strlcat.c getline.c \ - vis.c unvis.c + refresh.c search.c sig.c terminal.c tty.c vi.c reallocarr.c \ + wcsdup.c tokenizer.c tokenizern.c history.c historyn.c \ + filecomplete.c readline.c chared.h literal.c el.h hist.h \ + histedit.h keymacro.h map.h chartype.h parse.h prompt.h read.h \ + refresh.h search.h sig.h sys.h terminal.h tty.h vis.h \ + filecomplete.h editline/readline.h literal.h strlcpy.c \ + strlcat.c getline.c vis.c unvis.c @HAVE_STRLCPY_FALSE@am__objects_1 = strlcpy.lo @HAVE_STRLCAT_FALSE@am__objects_2 = strlcat.lo @HAVE_GETLINE_FALSE@am__objects_3 = getline.lo @@ -155,10 +155,10 @@ am__libedit_la_SOURCES_DIST = chared.c common.c el.c eln.c emacs.c \ am_libedit_la_OBJECTS = chared.lo common.lo el.lo eln.lo emacs.lo \ hist.lo keymacro.lo map.lo chartype.lo parse.lo prompt.lo \ read.lo refresh.lo search.lo sig.lo terminal.lo tty.lo vi.lo \ - wcsdup.lo tokenizer.lo tokenizern.lo history.lo historyn.lo \ - filecomplete.lo readline.lo literal.lo $(am__objects_1) \ - $(am__objects_2) $(am__objects_3) $(am__objects_4) \ - $(am__objects_5) + reallocarr.lo wcsdup.lo tokenizer.lo tokenizern.lo history.lo \ + historyn.lo filecomplete.lo readline.lo literal.lo \ + $(am__objects_1) $(am__objects_2) $(am__objects_3) \ + $(am__objects_4) $(am__objects_5) am__objects_6 = nodist_libedit_la_OBJECTS = $(am__objects_6) libedit_la_OBJECTS = $(am_libedit_la_OBJECTS) \ @@ -193,13 +193,13 @@ am__depfiles_remade = ./$(DEPDIR)/chared.Plo ./$(DEPDIR)/chartype.Plo \ ./$(DEPDIR)/keymacro.Plo ./$(DEPDIR)/literal.Plo \ ./$(DEPDIR)/map.Plo ./$(DEPDIR)/parse.Plo \ ./$(DEPDIR)/prompt.Plo ./$(DEPDIR)/read.Plo \ - ./$(DEPDIR)/readline.Plo ./$(DEPDIR)/refresh.Plo \ - ./$(DEPDIR)/search.Plo ./$(DEPDIR)/sig.Plo \ - ./$(DEPDIR)/strlcat.Plo ./$(DEPDIR)/strlcpy.Plo \ - ./$(DEPDIR)/terminal.Plo ./$(DEPDIR)/tokenizer.Plo \ - ./$(DEPDIR)/tokenizern.Plo ./$(DEPDIR)/tty.Plo \ - ./$(DEPDIR)/unvis.Plo ./$(DEPDIR)/vi.Plo ./$(DEPDIR)/vis.Plo \ - ./$(DEPDIR)/wcsdup.Plo + ./$(DEPDIR)/readline.Plo ./$(DEPDIR)/reallocarr.Plo \ + ./$(DEPDIR)/refresh.Plo ./$(DEPDIR)/search.Plo \ + ./$(DEPDIR)/sig.Plo ./$(DEPDIR)/strlcat.Plo \ + ./$(DEPDIR)/strlcpy.Plo ./$(DEPDIR)/terminal.Plo \ + ./$(DEPDIR)/tokenizer.Plo ./$(DEPDIR)/tokenizern.Plo \ + ./$(DEPDIR)/tty.Plo ./$(DEPDIR)/unvis.Plo ./$(DEPDIR)/vi.Plo \ + ./$(DEPDIR)/vis.Plo ./$(DEPDIR)/wcsdup.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -275,6 +275,7 @@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -376,11 +377,11 @@ CLEANFILES = $(BUILT_SOURCES) lib_LTLIBRARIES = libedit.la libedit_la_SOURCES = chared.c common.c el.c eln.c emacs.c hist.c \ keymacro.c map.c chartype.c parse.c prompt.c read.c refresh.c \ - search.c sig.c terminal.c tty.c vi.c wcsdup.c tokenizer.c \ - tokenizern.c history.c historyn.c filecomplete.c readline.c \ - chared.h literal.c el.h hist.h histedit.h keymacro.h map.h \ - chartype.h parse.h prompt.h read.h refresh.h search.h sig.h \ - sys.h terminal.h tty.h vis.h filecomplete.h \ + search.c sig.c terminal.c tty.c vi.c reallocarr.c wcsdup.c \ + tokenizer.c tokenizern.c history.c historyn.c filecomplete.c \ + readline.c chared.h literal.c el.h hist.h histedit.h \ + keymacro.h map.h chartype.h parse.h prompt.h read.h refresh.h \ + search.h sig.h sys.h terminal.h tty.h vis.h filecomplete.h \ editline/readline.h literal.h $(am__append_1) $(am__append_2) \ $(am__append_3) $(am__append_4) $(am__append_5) EXTRA_DIST = makelist shlib_version @@ -484,6 +485,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prompt.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readline.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reallocarr.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refresh.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/search.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sig.Plo@am__quote@ # am--include-marker @@ -705,6 +707,7 @@ distclean: distclean-am -rm -f ./$(DEPDIR)/prompt.Plo -rm -f ./$(DEPDIR)/read.Plo -rm -f ./$(DEPDIR)/readline.Plo + -rm -f ./$(DEPDIR)/reallocarr.Plo -rm -f ./$(DEPDIR)/refresh.Plo -rm -f ./$(DEPDIR)/search.Plo -rm -f ./$(DEPDIR)/sig.Plo @@ -781,6 +784,7 @@ maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/prompt.Plo -rm -f ./$(DEPDIR)/read.Plo -rm -f ./$(DEPDIR)/readline.Plo + -rm -f ./$(DEPDIR)/reallocarr.Plo -rm -f ./$(DEPDIR)/refresh.Plo -rm -f ./$(DEPDIR)/search.Plo -rm -f ./$(DEPDIR)/sig.Plo diff --git a/extra/libedit/libedit-20210910-3.1/src/chared.c b/extra/libedit/libedit-20221030-3.1/src/chared.c similarity index 92% rename from extra/libedit/libedit-20210910-3.1/src/chared.c rename to extra/libedit/libedit-20221030-3.1/src/chared.c index a96322aa6883..ff5545bbe168 100644 --- a/extra/libedit/libedit-20210910-3.1/src/chared.c +++ b/extra/libedit/libedit-20221030-3.1/src/chared.c @@ -1,4 +1,4 @@ -/* $NetBSD: chared.c,v 1.59 2019/07/23 10:18:52 christos Exp $ */ +/* $NetBSD: chared.c,v 1.62 2022/02/08 21:13:22 rillig Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)chared.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: chared.c,v 1.59 2019/07/23 10:18:52 christos Exp $"); +__RCSID("$NetBSD: chared.c,v 1.62 2022/02/08 21:13:22 rillig Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -624,6 +624,69 @@ el_deletestr(EditLine *el, int n) el->el_line.cursor = el->el_line.buffer; } +/* el_deletestr1(): + * Delete characters between start and end + */ +int +el_deletestr1(EditLine *el, int start, int end) +{ + size_t line_length, len; + wchar_t *p1, *p2; + + if (end <= start) + return 0; + + line_length = (size_t)(el->el_line.lastchar - el->el_line.buffer); + + if (start >= (int)line_length || end >= (int)line_length) + return 0; + + len = (size_t)(end - start); + if (len > line_length - (size_t)end) + len = line_length - (size_t)end; + + p1 = el->el_line.buffer + start; + p2 = el->el_line.buffer + end; + for (size_t i = 0; i < len; i++) { + *p1++ = *p2++; + el->el_line.lastchar--; + } + + if (el->el_line.cursor < el->el_line.buffer) + el->el_line.cursor = el->el_line.buffer; + + return end - start; +} + +/* el_wreplacestr(): + * Replace the contents of the line with the provided string + */ +int +el_wreplacestr(EditLine *el, const wchar_t *s) +{ + size_t len; + wchar_t * p; + + if (s == NULL || (len = wcslen(s)) == 0) + return -1; + + if (el->el_line.buffer + len >= el->el_line.limit) { + if (!ch_enlargebufs(el, len)) + return -1; + } + + p = el->el_line.buffer; + for (size_t i = 0; i < len; i++) + *p++ = *s++; + + el->el_line.buffer[len] = '\0'; + el->el_line.lastchar = el->el_line.buffer + len; + if (el->el_line.cursor > el->el_line.lastchar) + el->el_line.cursor = el->el_line.lastchar; + + return 0; +} + /* el_cursor(): * Move the cursor to the left or the right of the current position */ diff --git a/extra/libedit/libedit-20210910-3.1/src/chared.h b/extra/libedit/libedit-20221030-3.1/src/chared.h similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/chared.h rename to extra/libedit/libedit-20221030-3.1/src/chared.h diff --git a/extra/libedit/libedit-20210910-3.1/src/chartype.c b/extra/libedit/libedit-20221030-3.1/src/chartype.c similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/chartype.c rename to extra/libedit/libedit-20221030-3.1/src/chartype.c diff --git a/extra/libedit/libedit-20210910-3.1/src/chartype.h b/extra/libedit/libedit-20221030-3.1/src/chartype.h similarity index 98% rename from extra/libedit/libedit-20210910-3.1/src/chartype.h rename to extra/libedit/libedit-20221030-3.1/src/chartype.h index bfa3d54ec36c..bcdb293a12f4 100644 --- a/extra/libedit/libedit-20210910-3.1/src/chartype.h +++ b/extra/libedit/libedit-20221030-3.1/src/chartype.h @@ -1,4 +1,4 @@ -/* $NetBSD: chartype.h,v 1.36 2019/09/15 21:09:11 christos Exp $ */ +/* $NetBSD: chartype.h,v 1.37 2022/04/11 19:37:20 tnn Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -35,6 +35,7 @@ * been around since 2001... */ #if !defined(__NetBSD__) && \ !defined(__sun) && \ + !defined(__osf__) && \ !(defined(__APPLE__) && defined(__MACH__)) && \ !defined(__OpenBSD__) && \ !defined(__FreeBSD__) && \ diff --git a/extra/libedit/libedit-20210910-3.1/src/common.c b/extra/libedit/libedit-20221030-3.1/src/common.c similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/common.c rename to extra/libedit/libedit-20221030-3.1/src/common.c diff --git a/extra/libedit/libedit-20210910-3.1/src/config.h b/extra/libedit/libedit-20221030-3.1/src/config.h similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/config.h rename to extra/libedit/libedit-20221030-3.1/src/config.h diff --git a/extra/libedit/libedit-20210910-3.1/src/editline/readline.h b/extra/libedit/libedit-20221030-3.1/src/editline/readline.h similarity index 90% rename from extra/libedit/libedit-20210910-3.1/src/editline/readline.h rename to extra/libedit/libedit-20221030-3.1/src/editline/readline.h index e9f941aeb249..2bd0b7e80ab6 100644 --- a/extra/libedit/libedit-20210910-3.1/src/editline/readline.h +++ b/extra/libedit/libedit-20221030-3.1/src/editline/readline.h @@ -1,4 +1,4 @@ -/* $NetBSD: readline.h,v 1.47 2021/08/21 12:34:59 christos Exp $ */ +/* $NetBSD: readline.h,v 1.53 2022/02/19 17:45:02 christos Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -94,6 +94,13 @@ typedef KEYMAP_ENTRY *Keymap; #define RL_PROMPT_START_IGNORE '\1' #define RL_PROMPT_END_IGNORE '\2' +#define RL_STATE_NONE 0x000000 +#define RL_STATE_DONE 0x000001 + +#define RL_SETSTATE(x) (rl_readline_state |= ((unsigned long) x)) +#define RL_UNSETSTATE(x) (rl_readline_state &= ~((unsigned long) x)) +#define RL_ISSTATE(x) (rl_readline_state & ((unsigned long) x)) + /* global variables used by readline enabled applications */ #ifdef __cplusplus extern "C" { @@ -120,8 +127,8 @@ extern int rl_completion_query_items; extern const char *rl_special_prefixes; extern int rl_completion_append_character; extern int rl_inhibit_completion; -extern Function *rl_pre_input_hook; -extern Function *rl_startup_hook; +extern rl_hook_func_t *rl_pre_input_hook; +extern rl_hook_func_t *rl_startup_hook; extern char *rl_terminal_name; extern int rl_already_prompted; extern char *rl_prompt; @@ -153,6 +160,7 @@ extern int _rl_completion_prefix_display_length; extern int _rl_echoing_p; extern int history_max_entries; extern char *rl_display_prompt; +extern int rl_erase_empty_line; /* supported functions */ char *readline(const char *); @@ -180,7 +188,7 @@ int history_search_prefix(const char *, int); int history_search_pos(const char *, int, int); int read_history(const char *); int write_history(const char *); -int history_truncate_file (const char *, int); +int history_truncate_file(const char *, int); int history_expand(char *, char **); char **history_tokenize(const char *); const char *get_history_event(const char *, int *, int); @@ -215,7 +223,7 @@ int rl_add_defun(const char *, rl_command_func_t *, int); HISTORY_STATE *history_get_history_state(void); void rl_get_screen_size(int *, int *); void rl_set_screen_size(int, int); -char *rl_filename_completion_function (const char *, int); +char *rl_filename_completion_function(const char *, int); int _rl_abort_internal(void); int _rl_qsort_string_compare(char **, char **); char **rl_completion_matches(const char *, rl_compentry_func_t *); @@ -226,6 +234,13 @@ void rl_reset_after_signal(void); void rl_echo_signal_char(int); int rl_crlf(void); int rl_ding(void); +char *rl_copy_text(int, int); +void rl_replace_line(const char *, int); +int rl_delete_text(int, int); +void rl_message(const char *format, ...) + __attribute__((__format__(__printf__, 1, 2))); +void rl_save_prompt(void); +void rl_restore_prompt(void); /* * The following are not implemented @@ -236,6 +251,7 @@ void rl_set_keymap(Keymap); Keymap rl_make_bare_keymap(void); int rl_generic_bind(int, const char *, const char *, Keymap); int rl_bind_key_in_map(int, rl_command_func_t *, Keymap); +int rl_set_key(const char *, rl_command_func_t *, Keymap); void rl_cleanup_after_signal(void); void rl_free_line_state(void); int rl_set_keyboard_input_timeout(int); diff --git a/extra/libedit/libedit-20210910-3.1/src/el.c b/extra/libedit/libedit-20221030-3.1/src/el.c similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/el.c rename to extra/libedit/libedit-20221030-3.1/src/el.c diff --git a/extra/libedit/libedit-20210910-3.1/src/el.h b/extra/libedit/libedit-20221030-3.1/src/el.h similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/el.h rename to extra/libedit/libedit-20221030-3.1/src/el.h diff --git a/extra/libedit/libedit-20210910-3.1/src/eln.c b/extra/libedit/libedit-20221030-3.1/src/eln.c similarity index 97% rename from extra/libedit/libedit-20210910-3.1/src/eln.c rename to extra/libedit/libedit-20221030-3.1/src/eln.c index f432a2187c0d..563ec2a672a9 100644 --- a/extra/libedit/libedit-20210910-3.1/src/eln.c +++ b/extra/libedit/libedit-20221030-3.1/src/eln.c @@ -1,4 +1,4 @@ -/* $NetBSD: eln.c,v 1.36 2021/08/15 10:08:41 christos Exp $ */ +/* $NetBSD: eln.c,v 1.37 2022/01/11 18:30:15 christos Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: eln.c,v 1.36 2021/08/15 10:08:41 christos Exp $"); +__RCSID("$NetBSD: eln.c,v 1.37 2022/01/11 18:30:15 christos Exp $"); #endif /* not lint && not SCCSID */ #include @@ -386,3 +386,9 @@ el_insertstr(EditLine *el, const char *str) { return el_winsertstr(el, ct_decode_string(str, &el->el_lgcyconv)); } + +int +el_replacestr(EditLine *el, const char *str) +{ + return el_wreplacestr(el, ct_decode_string(str, &el->el_lgcyconv)); +} diff --git a/extra/libedit/libedit-20210910-3.1/src/emacs.c b/extra/libedit/libedit-20221030-3.1/src/emacs.c similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/emacs.c rename to extra/libedit/libedit-20221030-3.1/src/emacs.c diff --git a/extra/libedit/libedit-20210910-3.1/src/filecomplete.c b/extra/libedit/libedit-20221030-3.1/src/filecomplete.c similarity index 96% rename from extra/libedit/libedit-20210910-3.1/src/filecomplete.c rename to extra/libedit/libedit-20221030-3.1/src/filecomplete.c index 84ae508cb3ca..f3f50c50d814 100644 --- a/extra/libedit/libedit-20210910-3.1/src/filecomplete.c +++ b/extra/libedit/libedit-20221030-3.1/src/filecomplete.c @@ -1,4 +1,4 @@ -/* $NetBSD: filecomplete.c,v 1.68 2021/05/05 14:49:59 christos Exp $ */ +/* $NetBSD: filecomplete.c,v 1.70 2022/03/12 15:29:17 christos Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: filecomplete.c,v 1.68 2021/05/05 14:49:59 christos Exp $"); +__RCSID("$NetBSD: filecomplete.c,v 1.70 2022/03/12 15:29:17 christos Exp $"); #endif /* not lint && not SCCSID */ #include @@ -70,20 +70,21 @@ fn_tilde_expand(const char *txt) char pwbuf[1024]; #endif struct passwd *pass; + const char *pos; char *temp; size_t len = 0; if (txt[0] != '~') return strdup(txt); - temp = strchr(txt + 1, '/'); - if (temp == NULL) { + pos = strchr(txt + 1, '/'); + if (pos == NULL) { temp = strdup(txt + 1); if (temp == NULL) return NULL; } else { /* text until string after slash */ - len = (size_t)(temp - txt + 1); + len = (size_t)(pos - txt + 1); temp = el_calloc(len, sizeof(*temp)); if (temp == NULL) return NULL; @@ -127,7 +128,7 @@ fn_tilde_expand(const char *txt) } static int -needs_escaping(char c) +needs_escaping(wchar_t c) { switch (c) { case '\'': @@ -213,9 +214,10 @@ escape_filename(EditLine * el, const char *filename, int single_match, while (temp != el->el_line.cursor) { /* * If we see a single quote but have not seen a double quote - * so far set/unset s_quote + * so far set/unset s_quote, unless it is already quoted */ - if (temp[0] == '\'' && !d_quoted) + if (temp[0] == '\'' && !d_quoted && + (temp == el->el_line.buffer || temp[-1] != '\\')) s_quoted = !s_quoted; /* * vice versa to the above condition @@ -328,14 +330,15 @@ fn_filename_completion_function(const char *text, int state) static size_t filename_len = 0; struct dirent *entry; char *temp; + const char *pos; size_t len; if (state == 0 || dir == NULL) { - temp = strrchr(text, '/'); - if (temp) { + pos = strrchr(text, '/'); + if (pos) { char *nptr; - temp++; - nptr = el_realloc(filename, (strlen(temp) + 1) * + pos++; + nptr = el_realloc(filename, (strlen(pos) + 1) * sizeof(*nptr)); if (nptr == NULL) { el_free(filename); @@ -343,8 +346,8 @@ fn_filename_completion_function(const char *text, int state) return NULL; } filename = nptr; - (void)strcpy(filename, temp); - len = (size_t)(temp - text); /* including last slash */ + (void)strcpy(filename, pos); + len = (size_t)(pos - text); /* including last slash */ nptr = el_realloc(dirname, (len + 1) * sizeof(*nptr)); @@ -604,13 +607,13 @@ find_word_to_complete(const wchar_t * cursor, const wchar_t * buffer, for (;;) { if (ctemp <= buffer) break; - if (wcschr(word_break, ctemp[-1])) { - if (ctemp - buffer >= 2 && ctemp[-2] == '\\') { - ctemp -= 2; - continue; - } - break; + if (ctemp - buffer >= 2 && ctemp[-2] == '\\' && + needs_escaping(ctemp[-1])) { + ctemp -= 2; + continue; } + if (wcschr(word_break, ctemp[-1])) + break; if (special_prefixes && wcschr(special_prefixes, ctemp[-1])) break; ctemp--; diff --git a/extra/libedit/libedit-20210910-3.1/src/filecomplete.h b/extra/libedit/libedit-20221030-3.1/src/filecomplete.h similarity index 94% rename from extra/libedit/libedit-20210910-3.1/src/filecomplete.h rename to extra/libedit/libedit-20221030-3.1/src/filecomplete.h index 60ea4894414b..796ae7ab3276 100644 --- a/extra/libedit/libedit-20210910-3.1/src/filecomplete.h +++ b/extra/libedit/libedit-20221030-3.1/src/filecomplete.h @@ -1,4 +1,4 @@ -/* $NetBSD: filecomplete.h,v 1.13 2021/03/28 13:38:10 christos Exp $ */ +/* $NetBSD: filecomplete.h,v 1.14 2021/09/26 13:45:54 christos Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ int fn_complete2(EditLine *, char **(*)(const char *, int, int), const wchar_t *, const wchar_t *, const char *(*)(const char *), size_t, int *, int *, int *, int *, unsigned int); -#define FN_QUOTE_MATCH 1 /* Quote the returned match */ +#define FN_QUOTE_MATCH 1U /* Quote the returned match */ void fn_display_match_list(EditLine *, char **, size_t, size_t, const char *(*)(const char *)); diff --git a/extra/libedit/libedit-20210910-3.1/src/getline.c b/extra/libedit/libedit-20221030-3.1/src/getline.c similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/getline.c rename to extra/libedit/libedit-20221030-3.1/src/getline.c diff --git a/extra/libedit/libedit-20210910-3.1/src/hist.c b/extra/libedit/libedit-20221030-3.1/src/hist.c similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/hist.c rename to extra/libedit/libedit-20221030-3.1/src/hist.c diff --git a/extra/libedit/libedit-20210910-3.1/src/hist.h b/extra/libedit/libedit-20221030-3.1/src/hist.h similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/hist.h rename to extra/libedit/libedit-20221030-3.1/src/hist.h diff --git a/extra/libedit/libedit-20210910-3.1/src/histedit.h b/extra/libedit/libedit-20221030-3.1/src/histedit.h similarity index 97% rename from extra/libedit/libedit-20210910-3.1/src/histedit.h rename to extra/libedit/libedit-20221030-3.1/src/histedit.h index 4a4297978314..1e215fc88d1c 100644 --- a/extra/libedit/libedit-20210910-3.1/src/histedit.h +++ b/extra/libedit/libedit-20221030-3.1/src/histedit.h @@ -1,4 +1,4 @@ -/* $NetBSD: histedit.h,v 1.58 2021/08/15 10:08:41 christos Exp $ */ +/* $NetBSD: histedit.h,v 1.61 2022/02/08 21:13:22 rillig Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -179,7 +179,8 @@ void el_resize(EditLine *); const LineInfo *el_line(EditLine *); int el_insertstr(EditLine *, const char *); void el_deletestr(EditLine *, int); - +int el_replacestr(EditLine *, const char *); +int el_deletestr1(EditLine *, int, int); /* * ==== History ==== @@ -282,6 +283,7 @@ int el_cursor(EditLine *, int); const LineInfoW *el_wline(EditLine *); int el_winsertstr(EditLine *, const wchar_t *); #define el_wdeletestr el_deletestr +int el_wreplacestr(EditLine *, const wchar_t *); /* * ==== History ==== diff --git a/extra/libedit/libedit-20210910-3.1/src/history.c b/extra/libedit/libedit-20221030-3.1/src/history.c similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/history.c rename to extra/libedit/libedit-20221030-3.1/src/history.c diff --git a/extra/libedit/libedit-20210910-3.1/src/historyn.c b/extra/libedit/libedit-20221030-3.1/src/historyn.c similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/historyn.c rename to extra/libedit/libedit-20221030-3.1/src/historyn.c diff --git a/extra/libedit/libedit-20210910-3.1/src/keymacro.c b/extra/libedit/libedit-20221030-3.1/src/keymacro.c similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/keymacro.c rename to extra/libedit/libedit-20221030-3.1/src/keymacro.c diff --git a/extra/libedit/libedit-20210910-3.1/src/keymacro.h b/extra/libedit/libedit-20221030-3.1/src/keymacro.h similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/keymacro.h rename to extra/libedit/libedit-20221030-3.1/src/keymacro.h diff --git a/extra/libedit/libedit-20210910-3.1/src/literal.c b/extra/libedit/libedit-20221030-3.1/src/literal.c similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/literal.c rename to extra/libedit/libedit-20221030-3.1/src/literal.c diff --git a/extra/libedit/libedit-20210910-3.1/src/literal.h b/extra/libedit/libedit-20221030-3.1/src/literal.h similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/literal.h rename to extra/libedit/libedit-20221030-3.1/src/literal.h diff --git a/extra/libedit/libedit-20210910-3.1/src/makelist.in b/extra/libedit/libedit-20221030-3.1/src/makelist.in similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/makelist.in rename to extra/libedit/libedit-20221030-3.1/src/makelist.in diff --git a/extra/libedit/libedit-20210910-3.1/src/map.c b/extra/libedit/libedit-20221030-3.1/src/map.c similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/map.c rename to extra/libedit/libedit-20221030-3.1/src/map.c diff --git a/extra/libedit/libedit-20210910-3.1/src/map.h b/extra/libedit/libedit-20221030-3.1/src/map.h similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/map.h rename to extra/libedit/libedit-20221030-3.1/src/map.h diff --git a/extra/libedit/libedit-20210910-3.1/src/parse.c b/extra/libedit/libedit-20221030-3.1/src/parse.c similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/parse.c rename to extra/libedit/libedit-20221030-3.1/src/parse.c diff --git a/extra/libedit/libedit-20210910-3.1/src/parse.h b/extra/libedit/libedit-20221030-3.1/src/parse.h similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/parse.h rename to extra/libedit/libedit-20221030-3.1/src/parse.h diff --git a/extra/libedit/libedit-20210910-3.1/src/prompt.c b/extra/libedit/libedit-20221030-3.1/src/prompt.c similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/prompt.c rename to extra/libedit/libedit-20221030-3.1/src/prompt.c diff --git a/extra/libedit/libedit-20210910-3.1/src/prompt.h b/extra/libedit/libedit-20221030-3.1/src/prompt.h similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/prompt.h rename to extra/libedit/libedit-20221030-3.1/src/prompt.h diff --git a/extra/libedit/libedit-20210910-3.1/src/read.c b/extra/libedit/libedit-20221030-3.1/src/read.c similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/read.c rename to extra/libedit/libedit-20221030-3.1/src/read.c diff --git a/extra/libedit/libedit-20210910-3.1/src/read.h b/extra/libedit/libedit-20221030-3.1/src/read.h similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/read.h rename to extra/libedit/libedit-20221030-3.1/src/read.h diff --git a/extra/libedit/libedit-20210910-3.1/src/readline.c b/extra/libedit/libedit-20221030-3.1/src/readline.c similarity index 95% rename from extra/libedit/libedit-20210910-3.1/src/readline.c rename to extra/libedit/libedit-20221030-3.1/src/readline.c index 63ed3b10e30d..8fdd13c5f368 100644 --- a/extra/libedit/libedit-20210910-3.1/src/readline.c +++ b/extra/libedit/libedit-20221030-3.1/src/readline.c @@ -1,4 +1,4 @@ -/* $NetBSD: readline.c,v 1.167 2021/09/10 13:29:06 christos Exp $ */ +/* $NetBSD: readline.c,v 1.176 2022/09/21 01:33:53 christos Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: readline.c,v 1.167 2021/09/10 13:29:06 christos Exp $"); +__RCSID("$NetBSD: readline.c,v 1.176 2022/09/21 01:33:53 christos Exp $"); #endif /* not lint && not SCCSID */ #include @@ -43,6 +43,7 @@ __RCSID("$NetBSD: readline.c,v 1.167 2021/09/10 13:29:06 christos Exp $"); #include #include #include +#include #include #include #include @@ -116,8 +117,8 @@ const char *rl_basic_quote_characters = "\"'"; rl_compentry_func_t *rl_completion_entry_function = NULL; char *(*rl_completion_word_break_hook)(void) = NULL; rl_completion_func_t *rl_attempted_completion_function = NULL; -Function *rl_pre_input_hook = NULL; -Function *rl_startup1_hook = NULL; +rl_hook_func_t *rl_pre_input_hook = NULL; +rl_hook_func_t *rl_startup1_hook = NULL; int (*rl_getc_function)(FILE *) = NULL; char *rl_terminal_name = NULL; int rl_already_prompted = 0; @@ -126,12 +127,12 @@ int rl_ignore_completion_duplicates = 0; int readline_echoing_p = 1; int _rl_print_completions_horizontally = 0; VFunction *rl_redisplay_function = NULL; -Function *rl_startup_hook = NULL; +rl_hook_func_t *rl_startup_hook = NULL; VFunction *rl_completion_display_matches_hook = NULL; VFunction *rl_prep_term_function = (VFunction *)rl_prep_terminal; VFunction *rl_deprep_term_function = (VFunction *)rl_deprep_terminal; KEYMAP_ENTRY_ARRAY emacs_meta_keymap; -unsigned long rl_readline_state; +unsigned long rl_readline_state = RL_STATE_NONE; int _rl_complete_mark_directories; rl_icppfunc_t *rl_directory_completion_hook; int rl_completion_suppress_append; @@ -140,11 +141,13 @@ int _rl_completion_prefix_display_length; int _rl_echoing_p; int history_max_entries; char *rl_display_prompt; +int rl_erase_empty_line; /* * The current prompt string. */ char *rl_prompt = NULL; +char *rl_prompt_saved = NULL; /* * This is set to character indicating type of completion being done by * rl_complete_internal(); this is available for application completion @@ -282,6 +285,21 @@ rl_set_prompt(const char *prompt) return 0; } +void +rl_save_prompt(void) +{ + rl_prompt_saved = strdup(rl_prompt); +} + +void +rl_restore_prompt(void) +{ + if (!rl_prompt_saved) + return; + rl_prompt = rl_prompt_saved; + rl_prompt_saved = NULL; +} + /* * initialize rl compat stuff */ @@ -297,6 +315,8 @@ rl_initialize(void) if (h != NULL) history_end(h); + RL_UNSETSTATE(RL_STATE_DONE); + if (!rl_instream) rl_instream = stdin; if (!rl_outstream) @@ -429,7 +449,7 @@ readline(const char *p) if (e == NULL || h == NULL) rl_initialize(); if (rl_startup_hook) { - (*rl_startup_hook)(NULL, 0); + (*rl_startup_hook)(); } tty_init(e); @@ -444,7 +464,7 @@ readline(const char *p) goto out; if (rl_pre_input_hook) - (*rl_pre_input_hook)(NULL, 0); + (*rl_pre_input_hook)(); if (rl_event_hook && !(e->el_flags & NO_TTY)) { el_set(e, EL_GETCFN, _rl_event_read_char); @@ -462,10 +482,14 @@ readline(const char *p) ret = el_gets(e, &count); if (ret && count > 0) { + int lastidx; + buf = strdup(ret); if (buf == NULL) goto out; - buf[strcspn(buf, "\n")] = '\0'; + lastidx = count - 1; + if (buf[lastidx] == '\n') + buf[lastidx] = '\0'; } else buf = NULL; @@ -600,7 +624,7 @@ get_history_event(const char *cmd, int *cindex, int qchar) if (sub && cmd[idx] == '?') break; if (!sub && (cmd[idx] == ':' || cmd[idx] == ' ' - || cmd[idx] == '\t' || cmd[idx] == qchar)) + || cmd[idx] == '\t' || cmd[idx] == qchar)) break; idx++; } @@ -828,7 +852,8 @@ _history_expand_command(const char *command, size_t offs, size_t cmdlen, } else { int qchar; - qchar = (offs > 0 && command[offs - 1] == '"')? '"':0; + qchar = (offs > 0 && command[offs - 1] == '"') + ? '"' : '\0'; ptr = get_history_event(command + offs, &idx, qchar); } has_mods = command[offs + (size_t)idx] == ':'; @@ -906,7 +931,7 @@ _history_expand_command(const char *command, size_t offs, size_t cmdlen, switch (*cmd) { case ':': continue; - case 'h': /* remove trailing path */ + case 'h': /* remove trailing path */ if ((aptr = strrchr(tmp, '/')) != NULL) *aptr = '\0'; continue; @@ -1406,7 +1431,7 @@ read_history(const char *filename) return errno; errno = 0; if (history(h, &ev, H_LOAD, filename) == -1) - return errno ? errno : EINVAL; + return errno ? errno : EINVAL; if (history(h, &ev, H_GETSIZE) == 0) history_length = ev.num; if (history_length < 0) @@ -2076,7 +2101,7 @@ static unsigned char rl_bind_wrapper(EditLine *el __attribute__((__unused__)), unsigned char c) { if (map[c] == NULL) - return CC_ERROR; + return CC_ERROR; _rl_update_pos(); @@ -2122,10 +2147,12 @@ rl_callback_read_char(void) if (done == 2) { if ((wbuf = strdup(buf)) != NULL) wbuf[count] = '\0'; + RL_SETSTATE(RL_STATE_DONE); } else wbuf = NULL; (*(void (*)(const char *))rl_linefunc)(wbuf); } + _rl_update_pos(); } void @@ -2153,6 +2180,7 @@ rl_redisplay(void) a[0] = (char)e->el_tty.t_c[TS_IO][C_REPRINT]; a[1] = '\0'; el_push(e, a); + rl_forced_update_display(); } int @@ -2276,6 +2304,56 @@ _rl_update_pos(void) rl_line_buffer[rl_end] = '\0'; } +char * +rl_copy_text(int from, int to) +{ + const LineInfo *li; + size_t len; + char * out; + + if (h == NULL || e == NULL) + rl_initialize(); + + li = el_line(e); + + if (from > to) + return NULL; + + if (li->buffer + from > li->lastchar) + from = (int)(li->lastchar - li->buffer); + + if (li->buffer + to > li->lastchar) + to = (int)(li->lastchar - li->buffer); + + len = (size_t)(to - from); + out = el_malloc((size_t)len + 1); + (void)strlcpy(out, li->buffer + from , len); + + return out; +} + +void +rl_replace_line(const char * text, int clear_undo __attribute__((__unused__))) +{ + if (!text || *text == 0) + return; + + if (h == NULL || e == NULL) + rl_initialize(); + + el_replacestr(e, text); +} + +int +rl_delete_text(int start, int end) +{ + + if (h == NULL || e == NULL) + rl_initialize(); + + return el_deletestr1(e, start, end); +} + void rl_get_screen_size(int *rows, int *cols) { @@ -2285,6 +2363,21 @@ rl_get_screen_size(int *rows, int *cols) el_get(e, EL_GETTC, "co", cols); } +#define MAX_MESSAGE 160 +void +rl_message(const char *format, ...) +{ + char msg[MAX_MESSAGE]; + va_list args; + + va_start(args, format); + vsnprintf(msg, sizeof(msg), format, args); + va_end(args); + + rl_set_prompt(msg); + rl_forced_update_display(); +} + void rl_set_screen_size(int rows, int cols) { @@ -2432,6 +2525,14 @@ rl_bind_key_in_map(int key __attribute__((__unused__)), return 0; } +int +rl_set_key(const char *keyseq __attribute__((__unused__)), + rl_command_func_t *function __attribute__((__unused__)), + Keymap k __attribute__((__unused__))) +{ + return 0; +} + /* unsupported, but needed by python */ void rl_cleanup_after_signal(void) diff --git a/extra/libedit/libedit-20221030-3.1/src/reallocarr.c b/extra/libedit/libedit-20221030-3.1/src/reallocarr.c new file mode 100644 index 000000000000..549573af8cce --- /dev/null +++ b/extra/libedit/libedit-20221030-3.1/src/reallocarr.c @@ -0,0 +1,96 @@ +/* $NetBSD: reallocarr.c,v 1.5 2015/08/20 22:27:49 kamil Exp $ */ + +/*- + * Copyright (c) 2015 Joerg Sonnenberger . + * 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. + * + * 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 HOLDERS 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. + */ + +#if !HAVE_REALLOCARR + +#include "config.h" + +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif + +__RCSID("$NetBSD: reallocarr.c,v 1.5 2015/08/20 22:27:49 kamil Exp $"); + +#include +/* Old POSIX has SIZE_MAX in limits.h */ +#include +#include +#include +#include + +#ifdef _LIBC +#ifdef __weak_alias +__weak_alias(reallocarr, _reallocarr) +#endif +#endif + +#define SQRT_SIZE_MAX (((size_t)1) << (sizeof(size_t) * CHAR_BIT / 2)) + +int +reallocarr(void *ptr, size_t number, size_t size) +{ + int saved_errno, result; + void *optr; + void *nptr; + + saved_errno = errno; + memcpy(&optr, ptr, sizeof(ptr)); + if (number == 0 || size == 0) { + free(optr); + nptr = NULL; + memcpy(ptr, &nptr, sizeof(ptr)); + errno = saved_errno; + return 0; + } + + /* + * Try to avoid division here. + * + * It isn't possible to overflow during multiplication if neither + * operand uses any of the most significant half of the bits. + */ + if ((number|size) >= SQRT_SIZE_MAX && + number > SIZE_MAX / size) { + errno = saved_errno; + return EOVERFLOW; + } + + nptr = realloc(optr, number * size); + if (nptr == NULL) { + result = errno; + } else { + result = 0; + memcpy(ptr, &nptr, sizeof(ptr)); + } + errno = saved_errno; + return result; +} +#endif diff --git a/extra/libedit/libedit-20210910-3.1/src/refresh.c b/extra/libedit/libedit-20221030-3.1/src/refresh.c similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/refresh.c rename to extra/libedit/libedit-20221030-3.1/src/refresh.c diff --git a/extra/libedit/libedit-20210910-3.1/src/refresh.h b/extra/libedit/libedit-20221030-3.1/src/refresh.h similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/refresh.h rename to extra/libedit/libedit-20221030-3.1/src/refresh.h diff --git a/extra/libedit/libedit-20210910-3.1/src/search.c b/extra/libedit/libedit-20221030-3.1/src/search.c similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/search.c rename to extra/libedit/libedit-20221030-3.1/src/search.c diff --git a/extra/libedit/libedit-20210910-3.1/src/search.h b/extra/libedit/libedit-20221030-3.1/src/search.h similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/search.h rename to extra/libedit/libedit-20221030-3.1/src/search.h diff --git a/extra/libedit/libedit-20210910-3.1/src/shlib_version b/extra/libedit/libedit-20221030-3.1/src/shlib_version similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/shlib_version rename to extra/libedit/libedit-20221030-3.1/src/shlib_version diff --git a/extra/libedit/libedit-20210910-3.1/src/sig.c b/extra/libedit/libedit-20221030-3.1/src/sig.c similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/sig.c rename to extra/libedit/libedit-20221030-3.1/src/sig.c diff --git a/extra/libedit/libedit-20210910-3.1/src/sig.h b/extra/libedit/libedit-20221030-3.1/src/sig.h similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/sig.h rename to extra/libedit/libedit-20221030-3.1/src/sig.h diff --git a/extra/libedit/libedit-20210910-3.1/src/strlcat.c b/extra/libedit/libedit-20221030-3.1/src/strlcat.c similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/strlcat.c rename to extra/libedit/libedit-20221030-3.1/src/strlcat.c diff --git a/extra/libedit/libedit-20210910-3.1/src/strlcpy.c b/extra/libedit/libedit-20221030-3.1/src/strlcpy.c similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/strlcpy.c rename to extra/libedit/libedit-20221030-3.1/src/strlcpy.c diff --git a/extra/libedit/libedit-20210910-3.1/src/sys.h b/extra/libedit/libedit-20221030-3.1/src/sys.h similarity index 93% rename from extra/libedit/libedit-20210910-3.1/src/sys.h rename to extra/libedit/libedit-20221030-3.1/src/sys.h index c39192c75bbd..917afe358e92 100644 --- a/extra/libedit/libedit-20210910-3.1/src/sys.h +++ b/extra/libedit/libedit-20221030-3.1/src/sys.h @@ -40,11 +40,10 @@ #ifndef _h_sys #define _h_sys -#ifdef HAVE_SYS_CDEFS_H -#include -#endif +#if defined(HAVE_SYS_TYPES_H) && defined(__sun) #include -#include +#endif +#include // SIZE_MAX #if !defined(__attribute__) && (defined(__cplusplus) || !defined(__GNUC__) || __GNUC__ == 2 && __GNUC_MINOR__ < 8) # define __attribute__(A) @@ -98,6 +97,14 @@ size_t strlcpy(char *dst, const char *src, size_t size); ssize_t getline(char **line, size_t *len, FILE *fp); #endif +#ifndef HAVE_HAVE_REALLOCARR +int reallocarr(void *ptr, size_t number, size_t size); +#endif + +#ifndef HAVE_WCSDUP +wchar_t * wcsdup(const wchar_t *str); +#endif + #ifndef _DIAGASSERT #define _DIAGASSERT(x) #endif diff --git a/extra/libedit/libedit-20210910-3.1/src/terminal.c b/extra/libedit/libedit-20221030-3.1/src/terminal.c similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/terminal.c rename to extra/libedit/libedit-20221030-3.1/src/terminal.c diff --git a/extra/libedit/libedit-20210910-3.1/src/terminal.h b/extra/libedit/libedit-20221030-3.1/src/terminal.h similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/terminal.h rename to extra/libedit/libedit-20221030-3.1/src/terminal.h diff --git a/extra/libedit/libedit-20210910-3.1/src/tokenizer.c b/extra/libedit/libedit-20221030-3.1/src/tokenizer.c similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/tokenizer.c rename to extra/libedit/libedit-20221030-3.1/src/tokenizer.c diff --git a/extra/libedit/libedit-20210910-3.1/src/tokenizern.c b/extra/libedit/libedit-20221030-3.1/src/tokenizern.c similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/tokenizern.c rename to extra/libedit/libedit-20221030-3.1/src/tokenizern.c diff --git a/extra/libedit/libedit-20210910-3.1/src/tty.c b/extra/libedit/libedit-20221030-3.1/src/tty.c similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/tty.c rename to extra/libedit/libedit-20221030-3.1/src/tty.c diff --git a/extra/libedit/libedit-20210910-3.1/src/tty.h b/extra/libedit/libedit-20221030-3.1/src/tty.h similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/tty.h rename to extra/libedit/libedit-20221030-3.1/src/tty.h diff --git a/extra/libedit/libedit-20210910-3.1/src/unvis.c b/extra/libedit/libedit-20221030-3.1/src/unvis.c similarity index 98% rename from extra/libedit/libedit-20210910-3.1/src/unvis.c rename to extra/libedit/libedit-20221030-3.1/src/unvis.c index d2c65aa3d5d8..b88b309fb3d5 100644 --- a/extra/libedit/libedit-20210910-3.1/src/unvis.c +++ b/extra/libedit/libedit-20221030-3.1/src/unvis.c @@ -1,4 +1,4 @@ -/* $NetBSD: unvis.c,v 1.44 2014/09/26 15:43:36 roy Exp $ */ +/* $NetBSD: unvis.c,v 1.45 2022/04/19 20:32:15 rillig Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)unvis.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: unvis.c,v 1.44 2014/09/26 15:43:36 roy Exp $"); +__RCSID("$NetBSD: unvis.c,v 1.45 2022/04/19 20:32:15 rillig Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -506,7 +506,7 @@ strnunvisx(char *dst, size_t dlen, const char *src, int flag) errno = ENOSPC; \ return -1; \ } \ - } while (/*CONSTCOND*/0) + } while (0) while ((c = *src++) != '\0') { again: diff --git a/extra/libedit/libedit-20210910-3.1/src/vi.c b/extra/libedit/libedit-20221030-3.1/src/vi.c similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/vi.c rename to extra/libedit/libedit-20221030-3.1/src/vi.c diff --git a/extra/libedit/libedit-20210910-3.1/src/vis.c b/extra/libedit/libedit-20221030-3.1/src/vis.c similarity index 100% rename from extra/libedit/libedit-20210910-3.1/src/vis.c rename to extra/libedit/libedit-20221030-3.1/src/vis.c diff --git a/extra/libedit/libedit-20210910-3.1/src/vis.h b/extra/libedit/libedit-20221030-3.1/src/vis.h similarity index 97% rename from extra/libedit/libedit-20210910-3.1/src/vis.h rename to extra/libedit/libedit-20221030-3.1/src/vis.h index 23069784ef16..65ee43300e93 100644 --- a/extra/libedit/libedit-20210910-3.1/src/vis.h +++ b/extra/libedit/libedit-20221030-3.1/src/vis.h @@ -1,4 +1,4 @@ -/* $NetBSD: vis.h,v 1.25 2017/04/23 01:57:36 christos Exp $ */ +/* $NetBSD: vis.h,v 1.26 2022/05/20 21:31:24 andvar Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -38,7 +38,7 @@ * to select alternate encoding format */ #define VIS_OCTAL 0x0001 /* use octal \ddd format */ -#define VIS_CSTYLE 0x0002 /* use \[nrft0..] where appropiate */ +#define VIS_CSTYLE 0x0002 /* use \[nrft0..] where appropriate */ /* * to alter set of characters encoded (default is to encode all diff --git a/extra/libedit/libedit-20210910-3.1/src/wcsdup.c b/extra/libedit/libedit-20221030-3.1/src/wcsdup.c similarity index 76% rename from extra/libedit/libedit-20210910-3.1/src/wcsdup.c rename to extra/libedit/libedit-20221030-3.1/src/wcsdup.c index 2a77375e0b74..2405e0d7e3c4 100644 --- a/extra/libedit/libedit-20210910-3.1/src/wcsdup.c +++ b/extra/libedit/libedit-20221030-3.1/src/wcsdup.c @@ -1,4 +1,4 @@ -/* $NetBSD: wcsdup.c,v 1.3 2008/05/26 13:17:48 haad Exp $ */ +/* $NetBSD: wcsdup.c,v 1.6 2022/03/12 17:31:40 christos Exp $ */ /* * Copyright (C) 2006 Aleksey Cheusov @@ -16,11 +16,12 @@ #include "config.h" #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: wcsdup.c,v 1.3 2008/05/26 13:17:48 haad Exp $"); +__RCSID("$NetBSD: wcsdup.c,v 1.6 2022/03/12 17:31:40 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include #include +#include #include wchar_t * @@ -32,9 +33,10 @@ wcsdup(const wchar_t *str) _DIAGASSERT(str != NULL); len = wcslen(str) + 1; - copy = malloc(len * sizeof (wchar_t)); - if (!copy) + copy = NULL; + errno = reallocarr(©, len, sizeof(*copy)); + if (errno) return NULL; return wmemcpy(copy, str, len); diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt index 8fd7d645794b..47f506dab3cc 100644 --- a/libmysql/CMakeLists.txt +++ b/libmysql/CMakeLists.txt @@ -197,6 +197,9 @@ SET(CLIENT_SOURCES ../sql/auth/sha2_password_common.cc ) +DOWNGRADE_OPENSSL3_DEPRECATION_WARNINGS( + ../sql-common/client_authentication.cc) + IF (WIN32 AND OPENSSL_APPLINK_C) SET_SOURCE_FILES_PROPERTIES( ../sql-common/client_authentication.cc diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt index c981b3b36d6e..e7750b435734 100644 --- a/libmysqld/CMakeLists.txt +++ b/libmysqld/CMakeLists.txt @@ -206,7 +206,7 @@ IF(MY_COMPILER_IS_GNU AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11) ADD_COMPILE_FLAGS( ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.cc ${CMAKE_CURRENT_BINARY_DIR}/sql_hints.yy.cc - COMPILE_FLAGS "-Wno-free-nonheap-object") + COMPILE_FLAGS "-Wno-free-nonheap-object -Wno-unused-label") ENDIF() # Handle out-of-source build from source package with possibly broken diff --git a/mysql-test/include/openssl3_legacy_tls.cnf b/mysql-test/include/openssl3_legacy_tls.cnf new file mode 100644 index 000000000000..54a41cbb24ad --- /dev/null +++ b/mysql-test/include/openssl3_legacy_tls.cnf @@ -0,0 +1,11 @@ +# Allow ciphers by default treated as unsecure in OpenSSL 3.0 to allow use of +# legacy TLSv1.0 and TLSv1.1. +# Configuration file should also work for OpenSSL 1.1.1 but will not work with +# for example OpenSSL 1.0. +openssl_conf = openssl_sect +[ openssl_sect ] +ssl_conf = ssl_sect +[ssl_sect] +system_default = system_default_sect +[system_default_sect] +CipherString = DEFAULT:@SECLEVEL=0 diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 179d88830895..317056bfbe30 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2999,6 +2999,18 @@ sub environment_setup { my $pathsep= ":"; $pathsep= ";" if IS_WINDOWS && ! IS_CYGWIN; $ENV{'PATH'}= "$ENV{'PATH'}".$pathsep.$perldir; + + # ---------------------------------------------------- + # openssl3 helper + # ---------------------------------------------------- + # Provide path to openssl configuration file allowing old TLSv1.0 and TLSv1.1. + # In tests that need it add to test cnf-file: + # + # [ENV] + # OPENSSL_CONF=@env.OPENSSL3_LEGACY_TLS_CNF + # + $ENV{'OPENSSL3_LEGACY_TLS_CNF'}= + native_path(${glob_mysql_test_dir}."/include/openssl3_legacy_tls.cnf"); } diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result index 20b279216a32..5701e992bcec 100644 --- a/mysql-test/r/date_formats.result +++ b/mysql-test/r/date_formats.result @@ -25,7 +25,6 @@ STR_TO_DATE('2004.12.12 22.30.61','%Y.%m.%d %T') NULL Warnings: Warning 1411 Incorrect time value: '22.30.61' for function str_to_date -Warning 1411 Incorrect datetime value: '2004.12.12 22.30.61' for function str_to_date SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; Warnings: Warning 3090 Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release. @@ -390,7 +389,6 @@ str_to_date('15-01-2001 12:59:59', GET_FORMAT(DATE,'USA')) NULL Warnings: Warning 1411 Incorrect datetime value: '15-01-2001 12:59:59' for function str_to_date -Warning 1411 Incorrect datetime value: '15-01-2001 12:59:59' for function str_to_date explain extended select makedate(1997,1), addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002"),subtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002"),timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM"),cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME), maketime(23,11,12),microsecond("1997-12-31 23:59:59.000001"); id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used @@ -488,16 +486,12 @@ drop table t1; select str_to_date( 1, NULL ); str_to_date( 1, NULL ) NULL -Warnings: -Warning 1411 Incorrect datetime value: '1' for function str_to_date select str_to_date( NULL, 1 ); str_to_date( NULL, 1 ) NULL select str_to_date( 1, IF(1=1,NULL,NULL) ); str_to_date( 1, IF(1=1,NULL,NULL) ) NULL -Warnings: -Warning 1411 Incorrect datetime value: '1' for function str_to_date SELECT TIME_FORMAT("24:00:00", '%r'); TIME_FORMAT("24:00:00", '%r') 12:00:00 AM @@ -682,3 +676,26 @@ b b in ('121314') b in ('121314', 0) 11:13:14 0 0 12:13:14 1 1 DROP TABLE t1, t2, t3; +# +# Bug#34704094: Mysql str_to_date can correct convert for '2022-11-30' +# +SELECT STR_TO_DATE('31/11/22', '%d/%m/%Y'); +STR_TO_DATE('31/11/22', '%d/%m/%Y') +NULL +Warnings: +Warning 1411 Incorrect datetime value: '31/11/22' for function str_to_date +SELECT STR_TO_DATE('2023-02-31','%Y-%m-%d'); +STR_TO_DATE('2023-02-31','%Y-%m-%d') +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2023-02-31' for function str_to_date +SELECT STR_TO_DATE('2004.09.12 10:61:59','%Y.%m.%d %T'); +STR_TO_DATE('2004.09.12 10:61:59','%Y.%m.%d %T') +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2004.09.12 10:61:59' for function str_to_date +SELECT STR_TO_DATE('0000-00-00','%Y-%m-%d'); +STR_TO_DATE('0000-00-00','%Y-%m-%d') +NULL +Warnings: +Warning 1411 Incorrect datetime value: '0000-00-00' for function str_to_date diff --git a/mysql-test/r/func_set.result b/mysql-test/r/func_set.result index 8ad6882d8893..8ce38686639c 100644 --- a/mysql-test/r/func_set.result +++ b/mysql-test/r/func_set.result @@ -245,7 +245,6 @@ from( make_set( ( extract( minute_second from ) ; Warnings: -Warning 1292 Truncated incorrect date value: '1.01' Warning 1411 Incorrect datetime value: '1.01' for function str_to_date # Bug#21547779 Assertion failed: select_lex->leaf_table_count == 0 CREATE TABLE t(a INTEGER) engine=innodb; diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index a6fe4c4b2851..20732c99e1db 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -1231,9 +1231,7 @@ DROP TABLE t1,t2; set time_zone= @@global.time_zone; select str_to_date('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE; str_to_date('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE -NULL -Warnings: -Warning 1411 Incorrect datetime value: '10:00 PM' for function str_to_date +22:10:00 create table t1 (field DATE); insert into t1 values ('2006-11-06'); select * from t1 where field < '2006-11-06 04:08:36.0'; @@ -1403,8 +1401,6 @@ SET GLOBAL SQL_MODE=DEFAULT; SELECT FORMAT(YEAR(STR_TO_DATE('',GET_FORMAT(TIME,''))),1); FORMAT(YEAR(STR_TO_DATE('',GET_FORMAT(TIME,''))),1) NULL -Warnings: -Warning 1411 Incorrect datetime value: '' for function str_to_date # # Bug#11766126 59166: ANOTHER DATETIME VALGRIND UNINITIALIZED WARNING # diff --git a/mysql-test/r/ignore_strict.result b/mysql-test/r/ignore_strict.result index 2e81b3fed48d..87409a967b0b 100644 --- a/mysql-test/r/ignore_strict.result +++ b/mysql-test/r/ignore_strict.result @@ -508,11 +508,9 @@ ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_da INSERT IGNORE INTO t1 VALUES(STR_TO_DATE('32.10.2004 15.30','%D.%D.%Y %H.%I')); Warnings: Warning 1411 Incorrect datetime value: '32.10.2004 15.30' for function str_to_date -Warning 1411 Incorrect datetime value: '32.10.2004 15.30' for function str_to_date UPDATE IGNORE t1 SET col1=STR_TO_DATE('32.10.2004 15.30','%D.%D.%Y %H.%I') WHERE col1='1000-01-01 00:00:00'; Warnings: Warning 1411 Incorrect datetime value: '32.10.2004 15.30' for function str_to_date -Warning 1411 Incorrect datetime value: '32.10.2004 15.30' for function str_to_date DROP TABLE t1; # #For Error Code : ER_DATETIME_FUNCTION_OVERFLOW diff --git a/mysql-test/r/myisam_icp.result b/mysql-test/r/myisam_icp.result index 2bb265dda215..8b687a9683f2 100644 --- a/mysql-test/r/myisam_icp.result +++ b/mysql-test/r/myisam_icp.result @@ -599,7 +599,7 @@ id select_type table partitions type possible_keys key key_len ref rows filtered 3 SUBQUERY t3 NULL system NULL NULL NULL NULL 1 100.00 NULL Warnings: Note 1276 Field or reference 'test.t1.c1' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select '2' AS `i1` from dual where exists(/* select#2 */ select `test`.`t2`.`c1` from `test`.`t2` where ((`test`.`t2`.`c1` = 'v') and (`test`.`t2`.`c2` = (/* select#3 */ select min('v') from dual)))) +Note 1003 /* select#1 */ select '2' AS `i1` from dual where exists(/* select#2 */ select `test`.`t2`.`c1` from `test`.`t2` where ((`test`.`t2`.`c1` = 'v') and (`test`.`t2`.`c2` = (/* select#3 */ select min('v') from dual)) and ((/* select#3 */ select min('v') from dual) <> 'w'))) SELECT i1 FROM t1 WHERE EXISTS (SELECT t2.c1 diff --git a/mysql-test/r/myisam_icp_all.result b/mysql-test/r/myisam_icp_all.result index 9eecf33fae59..572fabea0aa5 100644 --- a/mysql-test/r/myisam_icp_all.result +++ b/mysql-test/r/myisam_icp_all.result @@ -599,7 +599,7 @@ id select_type table partitions type possible_keys key key_len ref rows filtered 3 SUBQUERY t3 NULL system NULL NULL NULL NULL 1 100.00 NULL Warnings: Note 1276 Field or reference 'test.t1.c1' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select '2' AS `i1` from dual where exists(/* select#2 */ select `test`.`t2`.`c1` from `test`.`t2` where ((`test`.`t2`.`c1` = 'v') and (`test`.`t2`.`c2` = (/* select#3 */ select min('v') from dual)))) +Note 1003 /* select#1 */ select '2' AS `i1` from dual where exists(/* select#2 */ select `test`.`t2`.`c1` from `test`.`t2` where ((`test`.`t2`.`c1` = 'v') and (`test`.`t2`.`c2` = (/* select#3 */ select min('v') from dual)) and ((/* select#3 */ select min('v') from dual) <> 'w'))) SELECT i1 FROM t1 WHERE EXISTS (SELECT t2.c1 diff --git a/mysql-test/r/myisam_icp_none.result b/mysql-test/r/myisam_icp_none.result index 963b76853110..da5855bfffe1 100644 --- a/mysql-test/r/myisam_icp_none.result +++ b/mysql-test/r/myisam_icp_none.result @@ -598,7 +598,7 @@ id select_type table partitions type possible_keys key key_len ref rows filtered 3 SUBQUERY t3 NULL system NULL NULL NULL NULL 1 100.00 NULL Warnings: Note 1276 Field or reference 'test.t1.c1' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select '2' AS `i1` from dual where exists(/* select#2 */ select `test`.`t2`.`c1` from `test`.`t2` where ((`test`.`t2`.`c1` = 'v') and (`test`.`t2`.`c2` = (/* select#3 */ select min('v') from dual)))) +Note 1003 /* select#1 */ select '2' AS `i1` from dual where exists(/* select#2 */ select `test`.`t2`.`c1` from `test`.`t2` where ((`test`.`t2`.`c1` = 'v') and (`test`.`t2`.`c2` = (/* select#3 */ select min('v') from dual)) and ((/* select#3 */ select min('v') from dual) <> 'w'))) SELECT i1 FROM t1 WHERE EXISTS (SELECT t2.c1 diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result index 118bc30c87ea..3f75ad951da5 100644 --- a/mysql-test/r/strict.result +++ b/mysql-test/r/strict.result @@ -243,11 +243,11 @@ ERROR HY000: Incorrect datetime value: '31.0.2004 15.30' for function str_to_dat INSERT INTO t1 (col1) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i')); ERROR HY000: Incorrect datetime value: '0.10.2004 15.30' for function str_to_date INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.9.2004 15.30','%d.%m.%Y %H.%i')); -ERROR 22007: Incorrect date value: '2004-09-31 15:30:00' for column 'col1' at row 1 +ERROR HY000: Incorrect datetime value: '31.9.2004 15.30' for function str_to_date INSERT INTO t1 (col1) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i')); ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_date INSERT INTO t1 (col1) VALUES(STR_TO_DATE('29.02.2003 15.30','%d.%m.%Y %H.%i')); -ERROR 22007: Incorrect date value: '2003-02-29 15:30:00' for column 'col1' at row 1 +ERROR HY000: Incorrect datetime value: '29.02.2003 15.30' for function str_to_date INSERT INTO t1 (col1) VALUES(STR_TO_DATE('15.13.2004 15.30','%d.%m.%Y %H.%i')); ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_date INSERT INTO t1 (col1) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y')); @@ -259,11 +259,11 @@ ERROR HY000: Incorrect datetime value: '31.0.2004 15.30' for function str_to_dat INSERT INTO t1 (col2) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i')); ERROR HY000: Incorrect datetime value: '0.10.2004 15.30' for function str_to_date INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.9.2004 15.30','%d.%m.%Y %H.%i')); -ERROR 22007: Incorrect datetime value: '2004-09-31 15:30:00' for column 'col2' at row 1 +ERROR HY000: Incorrect datetime value: '31.9.2004 15.30' for function str_to_date INSERT INTO t1 (col2) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i')); ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_date INSERT INTO t1 (col2) VALUES(STR_TO_DATE('29.02.2003 15.30','%d.%m.%Y %H.%i')); -ERROR 22007: Incorrect datetime value: '2003-02-29 15:30:00' for column 'col2' at row 1 +ERROR HY000: Incorrect datetime value: '29.02.2003 15.30' for function str_to_date INSERT INTO t1 (col2) VALUES(STR_TO_DATE('15.13.2004 15.30','%d.%m.%Y %H.%i')); ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_date INSERT INTO t1 (col2) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y')); @@ -275,11 +275,11 @@ ERROR HY000: Incorrect datetime value: '31.0.2004 15.30' for function str_to_dat INSERT INTO t1 (col3) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i')); ERROR HY000: Incorrect datetime value: '0.10.2004 15.30' for function str_to_date INSERT INTO t1 (col3) VALUES(STR_TO_DATE('31.9.2004 15.30','%d.%m.%Y %H.%i')); -ERROR 22007: Incorrect datetime value: '2004-09-31 15:30:00' for column 'col3' at row 1 +ERROR HY000: Incorrect datetime value: '31.9.2004 15.30' for function str_to_date INSERT INTO t1 (col3) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i')); ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_date INSERT INTO t1 (col3) VALUES(STR_TO_DATE('29.02.2003 15.30','%d.%m.%Y %H.%i')); -ERROR 22007: Incorrect datetime value: '2003-02-29 15:30:00' for column 'col3' at row 1 +ERROR HY000: Incorrect datetime value: '29.02.2003 15.30' for function str_to_date INSERT INTO t1 (col3) VALUES(STR_TO_DATE('15.13.2004 15.30','%d.%m.%Y %H.%i')); ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_date INSERT INTO t1 (col3) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y')); @@ -1152,9 +1152,6 @@ Warnings: Warning 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date Warning 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date Warning 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date -Warning 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date -Warning 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date -Warning 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date drop table t1; create table t1 (col1 char(3), col2 integer); insert into t1 (col1) values (cast(1000 as char(3))); @@ -1898,3 +1895,68 @@ Level Code Message Warning 1831 Duplicate index 'in_c2' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release. # Clean-up DROP TABLE t1; +# +# Bug#34704094: Mysql str_to_date can correct convert for '2022-11-30' +# +SET sql_mode='NO_ZERO_DATE'; +Warnings: +Warning 3135 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release. +select str_to_date('0000-00-00', '%Y-%m-%d'); +str_to_date('0000-00-00', '%Y-%m-%d') +NULL +Warnings: +Warning 1411 Incorrect datetime value: '0000-00-00' for function str_to_date +# Not compliant with how CAST works +select str_to_date('0000-01-00', '%Y-%m-%d'); +str_to_date('0000-01-00', '%Y-%m-%d') +NULL +Warnings: +Warning 1411 Incorrect datetime value: '0000-01-00' for function str_to_date +# Not compliant with how CAST works +select str_to_date('0000-00-01', '%Y-%m-%d'); +str_to_date('0000-00-01', '%Y-%m-%d') +NULL +Warnings: +Warning 1411 Incorrect datetime value: '0000-00-01' for function str_to_date +select str_to_date('2023-02-31', '%Y-%m-%d'); +str_to_date('2023-02-31', '%Y-%m-%d') +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2023-02-31' for function str_to_date +SET sql_mode='NO_ZERO_IN_DATE'; +Warnings: +Warning 3135 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release. +select str_to_date('0000-00-00', '%Y-%m-%d'); +str_to_date('0000-00-00', '%Y-%m-%d') +0000-00-00 +select str_to_date('0000-01-00', '%Y-%m-%d'); +str_to_date('0000-01-00', '%Y-%m-%d') +NULL +Warnings: +Warning 1411 Incorrect datetime value: '0000-01-00' for function str_to_date +select str_to_date('0000-00-01', '%Y-%m-%d'); +str_to_date('0000-00-01', '%Y-%m-%d') +NULL +Warnings: +Warning 1411 Incorrect datetime value: '0000-00-01' for function str_to_date +select str_to_date('2023-02-31', '%Y-%m-%d'); +str_to_date('2023-02-31', '%Y-%m-%d') +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2023-02-31' for function str_to_date +SET sql_mode='ALLOW_INVALID_DATES'; +select str_to_date('0000-00-00', '%Y-%m-%d'); +str_to_date('0000-00-00', '%Y-%m-%d') +0000-00-00 +select str_to_date('0000-01-00', '%Y-%m-%d'); +str_to_date('0000-01-00', '%Y-%m-%d') +0000-01-00 +select str_to_date('0000-00-01', '%Y-%m-%d'); +str_to_date('0000-00-01', '%Y-%m-%d') +0000-00-01 +select str_to_date('2023-02-31', '%Y-%m-%d'); +str_to_date('2023-02-31', '%Y-%m-%d') +2023-02-31 +SET sql_mode=@org_mode; +Warnings: +Warning 3090 Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release. diff --git a/mysql-test/suite/auth_sec/t/tls.cnf b/mysql-test/suite/auth_sec/t/tls.cnf new file mode 100644 index 000000000000..a4a875bfee1c --- /dev/null +++ b/mysql-test/suite/auth_sec/t/tls.cnf @@ -0,0 +1,3 @@ +!include include/default_my.cnf +[ENV] +OPENSSL_CONF=@env.OPENSSL3_LEGACY_TLS_CNF diff --git a/mysql-test/suite/auth_sec/t/tls12_tls1.cnf b/mysql-test/suite/auth_sec/t/tls12_tls1.cnf new file mode 100644 index 000000000000..a4a875bfee1c --- /dev/null +++ b/mysql-test/suite/auth_sec/t/tls12_tls1.cnf @@ -0,0 +1,3 @@ +!include include/default_my.cnf +[ENV] +OPENSSL_CONF=@env.OPENSSL3_LEGACY_TLS_CNF diff --git a/mysql-test/suite/innodb/include/show_last_deadlock.inc b/mysql-test/suite/innodb/include/show_last_deadlock.inc new file mode 100644 index 000000000000..db496afb114f --- /dev/null +++ b/mysql-test/suite/innodb/include/show_last_deadlock.inc @@ -0,0 +1,20 @@ +DELIMITER !; + +replace_regex + /TRANSACTIONS.*// + /.*LATEST DETECTED DEADLOCK// + /[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/%DATE%/ + /0x[0-9a-f]+/%HEXADECIMAL%/ + /thread handle [0-9]+/thread handle %NUMBER%/ + /\b[0-9]+ sec\b/%NUMBER% sec/ + /heap size [0-9]+/heap size %NUMBER%/ + /thread id [0-9]+/thread id %NUMBER%/ + /TRANSACTION [0-9]+/TRANSACTION %NUMBER%/ + /hex [0-9a-f]+/hex %HEXADECIMAL%/ + /query id [0-9]+ ([^ ]+|[^ ]+ [^ ]+) [^ ]+ statistics/query id %NUMBER% %ADDRESS% %USER% statistics/ + /trx id [0-9]+/trx id %NUMBER%/ + /asc [^;]*;;;?([^;])/asc %ASC%;;\1/ + /space id [0-9]+/space id %NUMBER%/ +! +SHOW ENGINE INNODB STATUS! +DELIMITER ;! diff --git a/mysql-test/suite/innodb/r/deadlock_detect.result b/mysql-test/suite/innodb/r/deadlock_detect.result index 5a3f3864f887..21d50fa5b4d5 100644 --- a/mysql-test/suite/innodb/r/deadlock_detect.result +++ b/mysql-test/suite/innodb/r/deadlock_detect.result @@ -23,3 +23,193 @@ ROLLBACK; DROP TABLE t1; SET GLOBAL innodb_lock_wait_timeout=default; SET GLOBAL innodb_deadlock_detect=default; +# +#Bug #23036096 INNODB LAST DETECTED DEADLOCK NOT SHOWING FULL QUERY +# +SET GLOBAL innodb_deadlock_detect=ON; +SET GLOBAL innodb_lock_wait_timeout=20; +CREATE TABLE bug( +id INT PRIMARY KEY, +ColumnAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA INT, +ColumnBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB INT, +ColumnCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC INT, +ColumnDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD INT, +ColumnEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE INT, +ColumnFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF INT, +ColumnGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG INT, +ColumnHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH INT, +ColumnIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII INT, +ColumnJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ INT, +ColumnKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK INT, +ColumnMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM INT, +ColumnNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN INT, +ColumnOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO INT, +ColumnPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP INT, +ColumnQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ INT, +ColumnRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR INT, +ColumnSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS INT, +ColumnTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT INT, +ColumnUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU INT) +engine = innodb; +INSERT INTO bug(id) VALUES(0), (1); +BEGIN; +SELECT * FROM bug WHERE id = 0 FOR UPDATE; +id ColumnAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ColumnBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB ColumnCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC ColumnDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD ColumnEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE ColumnFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ColumnGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG ColumnHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH ColumnIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII ColumnJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ ColumnKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK ColumnMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM ColumnNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN ColumnOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO ColumnPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP ColumnQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ ColumnRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR ColumnSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS ColumnTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT ColumnUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +BEGIN; +SELECT * FROM bug WHERE id = 1 FOR UPDATE; +id ColumnAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ColumnBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB ColumnCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC ColumnDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD ColumnEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE ColumnFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ColumnGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG ColumnHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH ColumnIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII ColumnJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ ColumnKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK ColumnMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM ColumnNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN ColumnOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO ColumnPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP ColumnQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ ColumnRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR ColumnSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS ColumnTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT ColumnUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU +1 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +SET DEBUG_SYNC = 'lock_wait_will_wait SIGNAL con1_will_wait'; +SELECT * FROM bug WHERE id = 1 AND ColumnAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA = 0 AND ColumnBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB = 0 AND ColumnCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC = 0 AND ColumnDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD = 0 AND ColumnEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE = 0 AND ColumnFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF = 0 AND ColumnGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG = 0 AND ColumnHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH = 0 AND ColumnIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII = 0 AND ColumnJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ = 0 AND ColumnKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK = 0 AND ColumnMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM = 0 AND ColumnNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN = 0 AND ColumnOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO = 0 AND ColumnPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP = 0 AND ColumnQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ = 0 AND ColumnRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR = 0 AND ColumnSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS = 0 AND ColumnTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT = 0 AND ColumnUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU = 0 FOR UPDATE;; +SET DEBUG_SYNC = 'now WAIT_FOR con1_will_wait'; +SELECT * FROM bug WHERE id = 0 +AND ColumnAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA = 0 +AND ColumnBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB = 0 +AND ColumnCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC = 0 +AND ColumnDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD = 0 +AND ColumnEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE = 0 +AND ColumnFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF = 0 +AND ColumnGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG = 0 +AND ColumnHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH = 0 +AND ColumnIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII = 0 +AND ColumnJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ = 0 +AND ColumnKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK = 0 +AND ColumnMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM = 0 +AND ColumnNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN = 0 +AND ColumnOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO = 0 +AND ColumnPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP = 0 +AND ColumnQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ = 0 +AND ColumnRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR = 0 +AND ColumnSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS = 0 +AND ColumnTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT = 0 +AND ColumnUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU = 0 +FOR UPDATE; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +id ColumnAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ColumnBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB ColumnCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC ColumnDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD ColumnEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE ColumnFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ColumnGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG ColumnHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH ColumnIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII ColumnJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ ColumnKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK ColumnMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM ColumnNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN ColumnOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO ColumnPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP ColumnQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ ColumnRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR ColumnSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS ColumnTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT ColumnUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU +ROLLBACK; +SHOW ENGINE INNODB STATUS! +Type Name Status +InnoDB +------------------------ +%DATE% %HEXADECIMAL% +*** (1) TRANSACTION: +TRANSACTION %NUMBER%, ACTIVE 0 sec starting index read +mysql tables in use 1, locked 1 +LOCK WAIT 3 lock struct(s), heap size %NUMBER%, 2 row lock(s) +MySQL thread id %NUMBER%, OS thread handle %NUMBER%, query id %NUMBER% %ADDRESS% %USER% statistics +SELECT * FROM bug WHERE id = 1 AND ColumnAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA = 0 AND ColumnBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB = 0 AND ColumnCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC = 0 AND ColumnDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD = 0 AND ColumnEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE = 0 AND ColumnFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF = 0 AND ColumnGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG = 0 AND ColumnHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH = 0 AND ColumnIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII = 0 AND ColumnJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ = 0 AND ColumnKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK = 0 AND ColumnMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM = 0 AND ColumnNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN = 0 AND ColumnOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO = 0 AND ColumnPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP = 0 AND ColumnQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ = 0 AND ColumnRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR = 0 AND ColumnSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS = 0 AND ColumnTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT = 0 AND ColumnUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU = 0 FOR UPDATE +*** (1) WAITING FOR THIS LOCK TO BE GRANTED: +RECORD LOCKS space id %NUMBER% page no 3 n bits 72 index PRIMARY of table `test`.`bug` trx id %NUMBER% lock_mode X locks rec but not gap waiting +Record lock, heap no 3 PHYSICAL RECORD: n_fields 23; compact format; info bits 0 + 0: len 4; hex %HEXADECIMAL%; asc %ASC%;; + 1: len 6; hex %HEXADECIMAL%; asc %ASC%;; + 2: len 7; hex %HEXADECIMAL%; asc %ASC%;; + 3: SQL NULL; + 4: SQL NULL; + 5: SQL NULL; + 6: SQL NULL; + 7: SQL NULL; + 8: SQL NULL; + 9: SQL NULL; + 10: SQL NULL; + 11: SQL NULL; + 12: SQL NULL; + 13: SQL NULL; + 14: SQL NULL; + 15: SQL NULL; + 16: SQL NULL; + 17: SQL NULL; + 18: SQL NULL; + 19: SQL NULL; + 20: SQL NULL; + 21: SQL NULL; + 22: SQL NULL; + +*** (2) TRANSACTION: +TRANSACTION %NUMBER%, ACTIVE 0 sec starting index read +mysql tables in use 1, locked 1 +3 lock struct(s), heap size %NUMBER%, 2 row lock(s) +MySQL thread id %NUMBER%, OS thread handle %NUMBER%, query id %NUMBER% %ADDRESS% %USER% statistics +SELECT * FROM bug WHERE id = 0 +AND ColumnAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA = 0 +AND ColumnBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB = 0 +AND ColumnCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC = 0 +AND ColumnDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD = 0 +AND ColumnEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE = 0 +AND ColumnFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF = 0 +AND ColumnGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG = 0 +AND ColumnHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH = 0 +AND ColumnIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII = 0 +AND ColumnJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ = 0 +AND ColumnKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK = 0 +AND ColumnMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM = 0 +AND ColumnNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN = 0 +AND ColumnOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO = 0 +AND ColumnPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP = 0 +AND ColumnQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ = 0 +AND ColumnRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR = 0 +AND ColumnSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS = 0 +AND ColumnTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT = 0 +AND ColumnUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU = 0 +FOR UPDATE +*** (2) HOLDS THE LOCK(S): +RECORD LOCKS space id %NUMBER% page no 3 n bits 72 index PRIMARY of table `test`.`bug` trx id %NUMBER% lock_mode X locks rec but not gap +Record lock, heap no 3 PHYSICAL RECORD: n_fields 23; compact format; info bits 0 + 0: len 4; hex %HEXADECIMAL%; asc %ASC%;; + 1: len 6; hex %HEXADECIMAL%; asc %ASC%;; + 2: len 7; hex %HEXADECIMAL%; asc %ASC%;; + 3: SQL NULL; + 4: SQL NULL; + 5: SQL NULL; + 6: SQL NULL; + 7: SQL NULL; + 8: SQL NULL; + 9: SQL NULL; + 10: SQL NULL; + 11: SQL NULL; + 12: SQL NULL; + 13: SQL NULL; + 14: SQL NULL; + 15: SQL NULL; + 16: SQL NULL; + 17: SQL NULL; + 18: SQL NULL; + 19: SQL NULL; + 20: SQL NULL; + 21: SQL NULL; + 22: SQL NULL; + +*** (2) WAITING FOR THIS LOCK TO BE GRANTED: +RECORD LOCKS space id %NUMBER% page no 3 n bits 72 index PRIMARY of table `test`.`bug` trx id %NUMBER% lock_mode X locks rec but not gap waiting +Record lock, heap no 2 PHYSICAL RECORD: n_fields 23; compact format; info bits 0 + 0: len 4; hex %HEXADECIMAL%; asc %ASC%;; + 1: len 6; hex %HEXADECIMAL%; asc %ASC%;; + 2: len 7; hex %HEXADECIMAL%; asc %ASC%;; + 3: SQL NULL; + 4: SQL NULL; + 5: SQL NULL; + 6: SQL NULL; + 7: SQL NULL; + 8: SQL NULL; + 9: SQL NULL; + 10: SQL NULL; + 11: SQL NULL; + 12: SQL NULL; + 13: SQL NULL; + 14: SQL NULL; + 15: SQL NULL; + 16: SQL NULL; + 17: SQL NULL; + 18: SQL NULL; + 19: SQL NULL; + 20: SQL NULL; + 21: SQL NULL; + 22: SQL NULL; + +*** WE ROLL BACK TRANSACTION (2) +------------ + +DROP TABLE bug; +SET GLOBAL innodb_lock_wait_timeout = default; +SET GLOBAL innodb_deadlock_detect = default; diff --git a/mysql-test/suite/innodb/r/virtual_index.result b/mysql-test/suite/innodb/r/virtual_index.result index b08cecdcef81..a588a631e323 100644 --- a/mysql-test/suite/innodb/r/virtual_index.result +++ b/mysql-test/suite/innodb/r/virtual_index.result @@ -211,3 +211,28 @@ t1 CREATE TABLE `t1` ( KEY `n` (`col2`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DROP TABLE t1; +# +# Bug 23014521 - mysqld crash at row_upd_sec_index_entry_low +# +SET @org_mode=@@sql_mode; +SET @@sql_mode=''; +Warnings: +Warning 3090 Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release. +CREATE TABLE t1 ( +col1 blob, +col3 blob, +col4 blob, +col5 blob GENERATED ALWAYS AS ((col1 - col4)) VIRTUAL, +col5x blob GENERATED ALWAYS AS ((col1 / col3)) VIRTUAL, +col9 text, +col2b blob GENERATED ALWAYS AS ((col5x / col5)) VIRTUAL, +KEY idx7 (col9(10), col5(5)), +KEY idx10 (col9(10), col2b(5)) +) ENGINE=InnoDB; +INSERT INTO t1 (col1,col3,col4,col9) VALUES (REPEAT('a',20),REPEAT('a',20),REPEAT('a',20),REPEAT('a',20)); +UPDATE t1 SET col1 = 50; +DELETE FROM t1; +DROP TABLE t1; +SET @@sql_mode=@org_mode; +Warnings: +Warning 3090 Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release. diff --git a/mysql-test/suite/innodb/t/deadlock_detect.test b/mysql-test/suite/innodb/t/deadlock_detect.test index a54a24af11de..3faa8324401f 100644 --- a/mysql-test/suite/innodb/t/deadlock_detect.test +++ b/mysql-test/suite/innodb/t/deadlock_detect.test @@ -1,3 +1,5 @@ +--source include/have_debug_sync.inc + # # wl#9383 INNODB: ADD AN OPTION TO TURN OFF/ON DEADLOCK CHECKER # @@ -54,3 +56,96 @@ disconnect con1; SET GLOBAL innodb_lock_wait_timeout=default; SET GLOBAL innodb_deadlock_detect=default; + + +--echo # +--echo #Bug #23036096 INNODB LAST DETECTED DEADLOCK NOT SHOWING FULL QUERY +--echo # + +#This test will check whether the detected deadlock shows full query or not + +SET GLOBAL innodb_deadlock_detect=ON; +SET GLOBAL innodb_lock_wait_timeout=20; + +connect(con1, localhost, root,,); +connect(con2, localhost, root,,); + +CREATE TABLE bug( + id INT PRIMARY KEY, + ColumnAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA INT, + ColumnBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB INT, + ColumnCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC INT, + ColumnDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD INT, + ColumnEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE INT, + ColumnFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF INT, + ColumnGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG INT, + ColumnHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH INT, + ColumnIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII INT, + ColumnJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ INT, + ColumnKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK INT, + ColumnMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM INT, + ColumnNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN INT, + ColumnOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO INT, + ColumnPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP INT, + ColumnQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ INT, + ColumnRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR INT, + ColumnSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS INT, + ColumnTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT INT, + ColumnUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU INT) + engine = innodb; + +INSERT INTO bug(id) VALUES(0), (1); + +--connection con1 + BEGIN; + SELECT * FROM bug WHERE id = 0 FOR UPDATE; + +--connection con2 + BEGIN; + SELECT * FROM bug WHERE id = 1 FOR UPDATE; + +--connection con1 + SET DEBUG_SYNC = 'lock_wait_will_wait SIGNAL con1_will_wait'; + --send SELECT * FROM bug WHERE id = 1 AND ColumnAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA = 0 AND ColumnBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB = 0 AND ColumnCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC = 0 AND ColumnDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD = 0 AND ColumnEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE = 0 AND ColumnFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF = 0 AND ColumnGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG = 0 AND ColumnHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH = 0 AND ColumnIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII = 0 AND ColumnJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ = 0 AND ColumnKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK = 0 AND ColumnMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM = 0 AND ColumnNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN = 0 AND ColumnOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO = 0 AND ColumnPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP = 0 AND ColumnQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ = 0 AND ColumnRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR = 0 AND ColumnSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS = 0 AND ColumnTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT = 0 AND ColumnUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU = 0 FOR UPDATE; + +--connection con2 + SET DEBUG_SYNC = 'now WAIT_FOR con1_will_wait'; + --error ER_LOCK_DEADLOCK + SELECT * FROM bug WHERE id = 0 + AND ColumnAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA = 0 + AND ColumnBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB = 0 + AND ColumnCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC = 0 + AND ColumnDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD = 0 + AND ColumnEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE = 0 + AND ColumnFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF = 0 + AND ColumnGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG = 0 + AND ColumnHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH = 0 + AND ColumnIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII = 0 + AND ColumnJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ = 0 + AND ColumnKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK = 0 + AND ColumnMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM = 0 + AND ColumnNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN = 0 + AND ColumnOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO = 0 + AND ColumnPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP = 0 + AND ColumnQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ = 0 + AND ColumnRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR = 0 + AND ColumnSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS = 0 + AND ColumnTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT = 0 + AND ColumnUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU = 0 + FOR UPDATE; + +--connection con1 + --reap + ROLLBACK; + +--source suite/innodb/include/show_last_deadlock.inc + +--connection default + DROP TABLE bug; + +disconnect con1; +disconnect con2; + +SET GLOBAL innodb_lock_wait_timeout = default; +SET GLOBAL innodb_deadlock_detect = default; + diff --git a/mysql-test/suite/innodb/t/virtual_index.test b/mysql-test/suite/innodb/t/virtual_index.test index 1faba4ba5db4..cca681f28c15 100644 --- a/mysql-test/suite/innodb/t/virtual_index.test +++ b/mysql-test/suite/innodb/t/virtual_index.test @@ -263,3 +263,28 @@ if (0) DROP TABLE t1; SET sql_mode = default; } + +--echo # +--echo # Bug 23014521 - mysqld crash at row_upd_sec_index_entry_low +--echo # +SET @org_mode=@@sql_mode; +SET @@sql_mode=''; + +CREATE TABLE t1 ( + col1 blob, + col3 blob, + col4 blob, + col5 blob GENERATED ALWAYS AS ((col1 - col4)) VIRTUAL, + col5x blob GENERATED ALWAYS AS ((col1 / col3)) VIRTUAL, + col9 text, + col2b blob GENERATED ALWAYS AS ((col5x / col5)) VIRTUAL, + KEY idx7 (col9(10), col5(5)), + KEY idx10 (col9(10), col2b(5)) +) ENGINE=InnoDB; +INSERT INTO t1 (col1,col3,col4,col9) VALUES (REPEAT('a',20),REPEAT('a',20),REPEAT('a',20),REPEAT('a',20)); +UPDATE t1 SET col1 = 50; +DELETE FROM t1; + +DROP TABLE t1; + +SET @@sql_mode=@org_mode; diff --git a/mysql-test/suite/opt_trace/r/subquery_no_prot.result b/mysql-test/suite/opt_trace/r/subquery_no_prot.result index a97a5c33008d..5bb923a43a5b 100644 --- a/mysql-test/suite/opt_trace/r/subquery_no_prot.result +++ b/mysql-test/suite/opt_trace/r/subquery_no_prot.result @@ -431,6 +431,18 @@ t1.a= (SELECT a FROM t2 LIMIT 1) { "steps": [ { "transformation": "equality_propagation", + "subselect_evaluation": [ + ] /* subselect_evaluation */, + "resulting_condition": "(((/* select#2 */ select `t2`.`b` from `t2` limit 1) <> (/* select#3 */ select `t2`.`a` from `t2` limit 1)) and multiple equal((/* select#2 */ select `t2`.`b` from `t2` limit 1), `t1`.`a`))" + }, + { + "transformation": "constant_propagation", + "subselect_evaluation": [ + ] /* subselect_evaluation */, + "resulting_condition": "(((/* select#2 */ select `t2`.`b` from `t2` limit 1) <> (/* select#3 */ select `t2`.`a` from `t2` limit 1)) and multiple equal((/* select#2 */ select `t2`.`b` from `t2` limit 1), `t1`.`a`))" + }, + { + "transformation": "trivial_condition_removal", "subselect_evaluation": [ { "subselect_execution": { @@ -477,27 +489,8 @@ t1.a= (SELECT a FROM t2 LIMIT 1) { } ] /* steps */ } /* subselect_execution */ - }, - { - "subselect_execution": { - "select#": 2, - "steps": [ - ] /* steps */ - } /* subselect_execution */ } ] /* subselect_evaluation */, - "resulting_condition": "((NULL <> (/* select#3 */ select `t2`.`a` from `t2` limit 1)) and multiple equal((/* select#2 */ select NULL from `t2` limit 1), `t1`.`a`))" - }, - { - "transformation": "constant_propagation", - "subselect_evaluation": [ - ] /* subselect_evaluation */, - "resulting_condition": "((NULL <> (/* select#3 */ select `t2`.`a` from `t2` limit 1)) and multiple equal((/* select#2 */ select NULL from `t2` limit 1), `t1`.`a`))" - }, - { - "transformation": "trivial_condition_removal", - "subselect_evaluation": [ - ] /* subselect_evaluation */, "resulting_condition": null } ] /* steps */ diff --git a/mysql-test/suite/opt_trace/r/subquery_ps_prot.result b/mysql-test/suite/opt_trace/r/subquery_ps_prot.result index 1588d73a2c7a..33798eccf3ab 100644 --- a/mysql-test/suite/opt_trace/r/subquery_ps_prot.result +++ b/mysql-test/suite/opt_trace/r/subquery_ps_prot.result @@ -431,6 +431,18 @@ t1.a= (SELECT a FROM t2 LIMIT 1) { "steps": [ { "transformation": "equality_propagation", + "subselect_evaluation": [ + ] /* subselect_evaluation */, + "resulting_condition": "(((/* select#2 */ select `t2`.`b` from `t2` limit 1) <> (/* select#3 */ select `t2`.`a` from `t2` limit 1)) and multiple equal((/* select#2 */ select `t2`.`b` from `t2` limit 1), `t1`.`a`))" + }, + { + "transformation": "constant_propagation", + "subselect_evaluation": [ + ] /* subselect_evaluation */, + "resulting_condition": "(((/* select#2 */ select `t2`.`b` from `t2` limit 1) <> (/* select#3 */ select `t2`.`a` from `t2` limit 1)) and multiple equal((/* select#2 */ select `t2`.`b` from `t2` limit 1), `t1`.`a`))" + }, + { + "transformation": "trivial_condition_removal", "subselect_evaluation": [ { "subselect_execution": { @@ -477,27 +489,8 @@ t1.a= (SELECT a FROM t2 LIMIT 1) { } ] /* steps */ } /* subselect_execution */ - }, - { - "subselect_execution": { - "select#": 2, - "steps": [ - ] /* steps */ - } /* subselect_execution */ } ] /* subselect_evaluation */, - "resulting_condition": "((NULL <> (/* select#3 */ select `t2`.`a` from `t2` limit 1)) and multiple equal((/* select#2 */ select NULL from `t2` limit 1), `t1`.`a`))" - }, - { - "transformation": "constant_propagation", - "subselect_evaluation": [ - ] /* subselect_evaluation */, - "resulting_condition": "((NULL <> (/* select#3 */ select `t2`.`a` from `t2` limit 1)) and multiple equal((/* select#2 */ select NULL from `t2` limit 1), `t1`.`a`))" - }, - { - "transformation": "trivial_condition_removal", - "subselect_evaluation": [ - ] /* subselect_evaluation */, "resulting_condition": null } ] /* steps */ diff --git a/mysql-test/suite/rpl/t/rpl_ssl1.cnf b/mysql-test/suite/rpl/t/rpl_ssl1.cnf new file mode 100644 index 000000000000..5af2504fc789 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_ssl1.cnf @@ -0,0 +1,3 @@ +!include ../my.cnf +[ENV] +OPENSSL_CONF=@env.OPENSSL3_LEGACY_TLS_CNF diff --git a/mysql-test/t/date_formats.test b/mysql-test/t/date_formats.test index fb48d962c5c0..1460d52e6011 100644 --- a/mysql-test/t/date_formats.test +++ b/mysql-test/t/date_formats.test @@ -452,3 +452,12 @@ SELECT b, b = '121314', SELECT b, b in ('121314'), b in ('121314', 0) FROM t3; DROP TABLE t1, t2, t3; + +--echo # +--echo # Bug#34704094: Mysql str_to_date can correct convert for '2022-11-30' +--echo # + +SELECT STR_TO_DATE('31/11/22', '%d/%m/%Y'); +SELECT STR_TO_DATE('2023-02-31','%Y-%m-%d'); +SELECT STR_TO_DATE('2004.09.12 10:61:59','%Y.%m.%d %T'); +SELECT STR_TO_DATE('0000-00-00','%Y-%m-%d'); diff --git a/mysql-test/t/ssl_deprecated_tls_versions.cnf b/mysql-test/t/ssl_deprecated_tls_versions.cnf new file mode 100644 index 000000000000..a4a875bfee1c --- /dev/null +++ b/mysql-test/t/ssl_deprecated_tls_versions.cnf @@ -0,0 +1,3 @@ +!include include/default_my.cnf +[ENV] +OPENSSL_CONF=@env.OPENSSL3_LEGACY_TLS_CNF diff --git a/mysql-test/t/strict.test b/mysql-test/t/strict.test index 203ca04413b1..d40029ae94d3 100644 --- a/mysql-test/t/strict.test +++ b/mysql-test/t/strict.test @@ -199,11 +199,11 @@ INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i')); INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i')); --error 1411 INSERT INTO t1 (col1) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i')); ---error 1292 +--error 1411 INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.9.2004 15.30','%d.%m.%Y %H.%i')); --error 1411 INSERT INTO t1 (col1) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i')); ---error 1292 +--error 1411 INSERT INTO t1 (col1) VALUES(STR_TO_DATE('29.02.2003 15.30','%d.%m.%Y %H.%i')); --error 1411 INSERT INTO t1 (col1) VALUES(STR_TO_DATE('15.13.2004 15.30','%d.%m.%Y %H.%i')); @@ -220,11 +220,11 @@ INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i')); INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i')); --error 1411 INSERT INTO t1 (col2) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i')); ---error 1292 +--error 1411 INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.9.2004 15.30','%d.%m.%Y %H.%i')); --error 1411 INSERT INTO t1 (col2) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i')); ---error 1292 +--error 1411 INSERT INTO t1 (col2) VALUES(STR_TO_DATE('29.02.2003 15.30','%d.%m.%Y %H.%i')); --error 1411 INSERT INTO t1 (col2) VALUES(STR_TO_DATE('15.13.2004 15.30','%d.%m.%Y %H.%i')); @@ -241,11 +241,11 @@ INSERT INTO t1 (col3) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i')); INSERT INTO t1 (col3) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i')); --error 1411 INSERT INTO t1 (col3) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i')); ---error 1292 +--error 1411 INSERT INTO t1 (col3) VALUES(STR_TO_DATE('31.9.2004 15.30','%d.%m.%Y %H.%i')); --error 1411 INSERT INTO t1 (col3) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i')); ---error 1292 +--error 1411 INSERT INTO t1 (col3) VALUES(STR_TO_DATE('29.02.2003 15.30','%d.%m.%Y %H.%i')); --error 1411 INSERT INTO t1 (col3) VALUES(STR_TO_DATE('15.13.2004 15.30','%d.%m.%Y %H.%i')); @@ -1600,3 +1600,29 @@ ALTER TABLE t1 ADD KEY in_c2(c1); SHOW WARNINGS; --echo # Clean-up DROP TABLE t1; + +--echo # +--echo # Bug#34704094: Mysql str_to_date can correct convert for '2022-11-30' +--echo # + +SET sql_mode='NO_ZERO_DATE'; +select str_to_date('0000-00-00', '%Y-%m-%d'); +--echo # Not compliant with how CAST works +select str_to_date('0000-01-00', '%Y-%m-%d'); +--echo # Not compliant with how CAST works +select str_to_date('0000-00-01', '%Y-%m-%d'); +select str_to_date('2023-02-31', '%Y-%m-%d'); + +SET sql_mode='NO_ZERO_IN_DATE'; +select str_to_date('0000-00-00', '%Y-%m-%d'); +select str_to_date('0000-01-00', '%Y-%m-%d'); +select str_to_date('0000-00-01', '%Y-%m-%d'); +select str_to_date('2023-02-31', '%Y-%m-%d'); + +SET sql_mode='ALLOW_INVALID_DATES'; +select str_to_date('0000-00-00', '%Y-%m-%d'); +select str_to_date('0000-01-00', '%Y-%m-%d'); +select str_to_date('0000-00-01', '%Y-%m-%d'); +select str_to_date('2023-02-31', '%Y-%m-%d'); + +SET sql_mode=@org_mode; diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp index f26453381ba7..71f38d2ad479 100644 --- a/mysql-test/valgrind.supp +++ b/mysql-test/valgrind.supp @@ -1317,6 +1317,153 @@ ... } +{ + OpenSSL 3.0 + Memcheck:Leak + match-leak-kinds: reachable + ... + fun:evp_generic_fetch + ... +} + +{ + OpenSSL 3.0 + Memcheck:Leak + match-leak-kinds: reachable + ... + fun:EVP_KEYMGMT_do_all_provided + ... +} + +{ + OpenSSL 3.0 + Memcheck:Leak + match-leak-kinds: reachable + ... + fun:OSSL_DECODER_CTX_new_for_pkey + ... +} + +{ + OpenSSL 3.0 + Memcheck:Leak + match-leak-kinds: reachable + ... + fun:OSSL_DECODER_do_all_provided + ... +} + +{ + OpenSSL 3.0 + Memcheck:Leak + match-leak-kinds: reachable + ... + fun:OSSL_DECODER_CTX_new_for_pkey + ... +} + +{ + OpenSSL 3.0 + Memcheck:Leak + match-leak-kinds: reachable + ... + fun:RAND_bytes_ex + ... +} + +{ + OpenSSL 3.0 + Memcheck:Leak + match-leak-kinds: reachable + ... + fun:RAND_priv_bytes_ex + ... +} + +{ + OpenSSL 3.0 (strange ERR_set_debug is documented to not call strdup) + Memcheck:Leak + match-leak-kinds: reachable + fun:malloc + fun:CRYPTO_malloc + fun:CRYPTO_strdup + fun:ERR_set_debug + ... +} + +{ + OpenSSL 3.0 + Memcheck:Leak + match-leak-kinds: reachable + fun:malloc + fun:CRYPTO_malloc + fun:ERR_add_error_vdata + ... +} + +{ + OpenSSL 3.0 + Memcheck:Leak + match-leak-kinds: reachable + ... + fun:cache_objects + ... +} + +{ + OpenSSL 3.0 + Memcheck:Leak + match-leak-kinds: reachable + ... + fun:inner_loader_fetch + ... +} + +{ + OpenSSL 3.0 + Memcheck:Leak + match-leak-kinds: reachable + ... + fun:CRYPTO_THREAD_run_once + ... +} + +{ + OpenSSL 3.0 + Memcheck:Leak + match-leak-kinds: reachable + ... + fun:ossl_provider_doall_activated + ... +} + +{ + OpenSSL 3.0 + Memcheck:Leak + match-leak-kinds: reachable + ... + fun:_ZL8init_sslv + ... +} + +{ + OpenSSL 3.0 + Memcheck:Leak + match-leak-kinds: reachable + ... + fun:ssl_load_ciphers + ... +} + +{ + OpenSSL 3.0 + Memcheck:Leak + match-leak-kinds: reachable + ... + fun:RAND_get0_private + ... +} + # # Rules to suppress leaks from plugin dependencies # @@ -1887,11 +2034,21 @@ { AWS_SDK_1_9_s2n_init Memcheck:Leak - match-leak-kinds: reachable,definite,indirect + match-leak-kinds: reachable,definite,indirect,possible ... fun:s2n_init ... } +{ + AWS_SDK_1_9 AWS:Init call too deep in stack + Memcheck:Leak + match-leak-kinds: indirect + fun:realloc + fun:CRYPTO_realloc + ... + fun:asn1_template_ex_d2i + ... +} { AWS_SDK_1_9_curl_init Memcheck:Leak diff --git a/mysys_ssl/CMakeLists.txt b/mysys_ssl/CMakeLists.txt index 953522501da5..9c649fb4f9e0 100644 --- a/mysys_ssl/CMakeLists.txt +++ b/mysys_ssl/CMakeLists.txt @@ -31,6 +31,11 @@ IF(SSL_DEFINES) ADD_DEFINITIONS(${SSL_DEFINES}) ENDIF() +DOWNGRADE_OPENSSL3_DEPRECATION_WARNINGS( + crypt_genhash_impl.cc + my_md5.cc + my_sha1.cc) + SET(MYSYS_AES_IMPLEMENTATION my_aes_openssl.cc) SET(MYSYS_SSL_SOURCES diff --git a/packaging/WiX/CMakeLists.txt b/packaging/WiX/CMakeLists.txt index 4de3a14c4fcb..e4b499db11d0 100644 --- a/packaging/WiX/CMakeLists.txt +++ b/packaging/WiX/CMakeLists.txt @@ -20,59 +20,28 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -IF(NOT WIN32) - RETURN() -ENDIF() - -# Need an extra indirection to access ENV(ProgramFiles(x86)) -SET(MYENV "ProgramFiles(x86)") - -# Look in various paths for 'heat.exe' -# Different installations have different layouts. -# Not really necessary to use V3.8 but keep backward compatibility just in case. -IF(MSVC_VERSION LESS 1900) - FOREACH(path - "$ENV{ProgramFiles}/WiX Toolset V3.8" - "$ENV{ProgramFiles}/WiX Toolset V3.8/bin" - "$ENV{${MYENV}}/WiX Toolset V3.8" - "$ENV{${MYENV}}/WiX Toolset V3.8/bin") - FIND_PATH(WIX_DIR heat.exe "${path}") - MESSAGE(STATUS "WIX_DIR ${WIX_DIR} path ${path}") - IF(WIX_DIR) - BREAK() - ENDIF() - ENDFOREACH() -ELSE() - FOREACH(path - "$ENV{ProgramFiles}/WiX Toolset V3.10" - "$ENV{ProgramFiles}/WiX Toolset V3.10/bin" - "$ENV{${MYENV}}/WiX Toolset V3.10" - "$ENV{${MYENV}}/WiX Toolset V3.10/bin") - FIND_PATH(WIX_DIR heat.exe "${path}") - MESSAGE(STATUS "WIX_DIR ${WIX_DIR} path ${path}") - IF(WIX_DIR) - BREAK() - ENDIF() - ENDFOREACH() +# First we look for "wix.exe" using the CMake variable WIX_DIR, second using the +# environment variable WIX, and then we add "$ENV{USERPROFILE}\\.dotnet\\tools" +# to the PATH before searching the other default locations +IF(NOT WIX_DIR AND "$ENV{WIX}") + SET(WIX_DIR "$ENV{WIX}") ENDIF() - -# Finally, look in environment -IF(NOT WIX_DIR) - FIND_PATH(WIX_DIR heat.exe "$ENV{WIX}") - MESSAGE(STATUS "WIX_DIR ${WIX_DIR} looked at $ENV{WIX}") +FIND_PATH(WIX_DIR wix.exe "$ENV{USERPROFILE}\\.dotnet\\tools") + +IF(NOT _WIX_DIR_CHECKED) + SET(_WIX_DIR_CHECKED 1 CACHE INTERNAL "") + IF(WIX_DIR) + MESSAGE(STATUS "WIX_DIR ${WIX_DIR}") + ELSE() + MESSAGE(STATUS "Cannot find \"wix.exe\", installer project will not be generated") + ENDIF() ENDIF() IF(NOT WIX_DIR) - IF(NOT _WIX_DIR_CHECKED) - SET(_WIX_DIR_CHECKED 1 CACHE INTERNAL "") - MESSAGE(STATUS "Cannot find wix 3, installer project will not be generated") - ENDIF() RETURN() ENDIF() -FIND_PROGRAM(HEAT_EXECUTABLE heat ${WIX_DIR}) -FIND_PROGRAM(CANDLE_EXECUTABLE candle ${WIX_DIR}) -FIND_PROGRAM(LIGHT_EXECUTABLE light ${WIX_DIR}) +FIND_PROGRAM(WIX_EXECUTABLE wix ${WIX_DIR}) # WiX wants the license text as rtf; if there is no rtf license, # we create a fake one from the plain text LICENSE file. @@ -92,9 +61,9 @@ SET(CPACK_WIX_CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/CPackWixConfig.cmake) SET(CPACK_WIX_INCLUDE "${CMAKE_CURRENT_BINARY_DIR}/mysql_server_extra.wxs;${CMAKE_CURRENT_SOURCE_DIR}/custom_ui.wxs") IF(CMAKE_SIZEOF_VOID_P EQUAL 8) - SET(WixWin64 " Win64='yes'") + SET(WixWin64 " Bitness='always64'") ELSE() - SET(WixWin64 " Win64='no'") + SET(WixWin64 " Bitness='always32'") ENDIF() IF("${VERSION}" MATCHES "-ndb-") @@ -111,21 +80,13 @@ IF("${VERSION}" MATCHES "-ndb-") MESSAGE(STATUS "DISPLAY_PATCH_VERSION: ${DISPLAY_PATCH_VERSION}") ENDIF() -#CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_server_extra.wxs.in -# ${CMAKE_CURRENT_BINARY_DIR}/mysql_server_extra.wxs) - -ADD_CUSTOM_TARGET( - configure_mysql_server_extra - COMMAND ${CMAKE_COMMAND} - -DINPUT_FILE=${CMAKE_CURRENT_SOURCE_DIR}/mysql_server_extra.wxs.in - -DOUTPUT_FILE=${CMAKE_CURRENT_BINARY_DIR}/mysql_server_extra.wxs - -DMAJOR_VERSION=${MAJOR_VERSION} - -DMINOR_VERSION=${MINOR_VERSION} - -DWixWin64=${WixWin64} - -P ${CMAKE_CURRENT_SOURCE_DIR}/configure_file.cmake - ) +CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/mysql_server_extra.wxs.in + ${CMAKE_CURRENT_BINARY_DIR}/mysql_server_extra.wxs + @ONLY) -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/create_msi.cmake.in +CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/create_msi.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake @ONLY) @@ -151,7 +112,6 @@ ADD_CUSTOM_TARGET( ${CONFIG_PARAM} -P ${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake ) -ADD_DEPENDENCIES(MSI configure_mysql_server_extra) IF(TARGET remove_INFO_SRC_from_bs) ADD_DEPENDENCIES(MSI remove_INFO_SRC_from_bs) diff --git a/packaging/WiX/CPackWixConfig.cmake b/packaging/WiX/CPackWixConfig.cmake index fd5749657ebd..31feef683c9b 100644 --- a/packaging/WiX/CPackWixConfig.cmake +++ b/packaging/WiX/CPackWixConfig.cmake @@ -41,7 +41,6 @@ IF("${VERSION}" MATCHES "-ndb-") ClusterManagementServer ClusterManagementClient ClusterJ - nodejs ) ENDIF() @@ -156,9 +155,4 @@ IF("${VERSION}" MATCHES "-ndb-") SET(CPACK_COMPONENT_CLUSTERJ_GROUP "Devel") SET(CPACK_COMPONENT_CLUSTERJ_DISPLAY_NAME "ClusterJ Java Connector for Cluster") SET(CPACK_COMPONENT_CLUSTERJ_DESCRIPTION "Installs ClusterJ") - - #Subfeature "nodejs" - SET(CPACK_COMPONENT_NODEJS_GROUP "Devel") - SET(CPACK_COMPONENT_NODEJS_DISPLAY_NAME "nodejs Connector for Cluster") - SET(CPACK_COMPONENT_NODEJS_DESCRIPTION "Installs nodejs connector") ENDIF() diff --git a/packaging/WiX/configure_file.cmake b/packaging/WiX/configure_file.cmake deleted file mode 100644 index 90e15a2a2718..000000000000 --- a/packaging/WiX/configure_file.cmake +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (c) 2017, 2023, Oracle and/or its affiliates. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License, version 2.0, -# as published by the Free Software Foundation. -# -# This program is also distributed with certain software (including -# but not limited to OpenSSL) that is licensed under separate terms, -# as designated in a particular file or component or in included license -# documentation. The authors of MySQL hereby grant you an additional -# permission to link the program and your derivative works with the -# separately licensed software that they have included with MySQL. -# -# 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, version 2.0, 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 St, Fifth Floor, Boston, MA 02110-1301 USA - -CONFIGURE_FILE(${INPUT_FILE} ${OUTPUT_FILE}) diff --git a/packaging/WiX/create_msi.cmake.in b/packaging/WiX/create_msi.cmake.in index acc91c5ccda1..188a48ac0838 100644 --- a/packaging/WiX/create_msi.cmake.in +++ b/packaging/WiX/create_msi.cmake.in @@ -23,8 +23,7 @@ SET(LINK_STATIC_RUNTIME_LIBRARIES "@LINK_STATIC_RUNTIME_LIBRARIES@") SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@") SET(CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@") -SET(CANDLE_EXECUTABLE "@CANDLE_EXECUTABLE@") -SET(LIGHT_EXECUTABLE "@LIGHT_EXECUTABLE@") +SET(WIX_EXECUTABLE "@WIX_EXECUTABLE@") SET(CMAKE_COMMAND "@CMAKE_COMMAND@") SET(CMAKE_CFG_INTDIR "@CMAKE_CFG_INTDIR@") SET(VERSION "@VERSION@") @@ -90,13 +89,11 @@ LIST(APPEND EXCLUDE_FILES ) IF(CMAKE_SIZEOF_VOID_P EQUAL 8) - SET(Win64 " Win64='yes'") + SET(Win64 " Bitness='always64'") SET(Platform x64) - SET(PlatformProgramFilesFolder ProgramFiles64Folder) ELSE() SET(Platform x86) - SET(PlatformProgramFilesFolder ProgramFilesFolder) - SET(Win64 " Win64='no'") + SET(Win64 " Bitness='always32'") ENDIF() SET(ENV{VS_UNICODE_OUTPUT}) @@ -399,36 +396,27 @@ SET(CPACK_WIX_INCLUDES ENDFOREACH() -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_server.wxs.in - ${CMAKE_CURRENT_BINARY_DIR}/mysql_server.wxs) +CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/mysql_server.wxs.in + ${CMAKE_CURRENT_BINARY_DIR}/mysql_server.wxs + @ONLY) -SET(EXTRA_CANDLE_ARGS) -IF("$ENV{EXTRA_CANDLE_ARGS}") - SET(EXTRA_CANDLE_ARGS "$ENV{EXTRA_CANDLE_ARGS}") -ENDIF() - -SET(EXTRA_LIGHT_ARGS) -IF("$ENV{EXTRA_LIGHT_ARGS}") - SET(EXTRA_LIGHT_ARGS "$ENV{EXTRA_LIGHT_ARGS}") -ENDIF() - -FILE(REMOVE mysql_server.wixobj) -EXECUTE_PROCESS( - COMMAND ${CANDLE_EXECUTABLE} -ext WixUtilExtension mysql_server.wxs ${EXTRA_CANDLE_ARGS} - RESULT_VARIABLE CANDLE_RESULT -) - -IF(CANDLE_RESULT) - MESSAGE(FATAL_ERROR "ERROR: can't run candle") +SET(EXTRA_WIX_ARGS) +IF("$ENV{EXTRA_WIX_ARGS}") + SET(EXTRA_WIX_ARGS "$ENV{EXTRA_WIX_ARGS}") ENDIF() EXECUTE_PROCESS( - COMMAND ${LIGHT_EXECUTABLE} -ext WixUIExtension -ext WixUtilExtension - mysql_server.wixobj -out ${CMAKE_BINARY_DIR}/${CPACK_PACKAGE_FILE_NAME}.msi - ${EXTRA_LIGHT_ARGS} - RESULT_VARIABLE LIGHT_RESULT + COMMAND ${WIX_EXECUTABLE} build + -arch ${Platform} + -ext WixToolset.UI.wixext -ext WixToolset.Util.wixext ${EXTRA_WIX_ARGS} + -out ${CMAKE_BINARY_DIR}/${CPACK_PACKAGE_FILE_NAME}.msi + mysql_server.wxs + RESULT_VARIABLE WIX_RESULT + OUTPUT_VARIABLE WIX_OUTPUT + ERROR_VARIABLE WIX_OUTPUT ) -IF(LIGHT_RESULT) - MESSAGE(FATAL_ERROR "ERROR: can't run light") +IF(WIX_RESULT) + MESSAGE(FATAL_ERROR "ERROR: can't run WiX: ${WIX_RESULT} ${WIX_OUTPUT}") ENDIF() diff --git a/packaging/WiX/custom_ui.wxs b/packaging/WiX/custom_ui.wxs index 37db854048c0..5217b879d608 100644 --- a/packaging/WiX/custom_ui.wxs +++ b/packaging/WiX/custom_ui.wxs @@ -1,39 +1,38 @@ - + - 1 + - NOT OLDERVERSIONBEINGUPGRADED - OLDERVERSIONBEINGUPGRADED - + + + @@ -44,26 +43,19 @@ - 1]]> - OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST="P" OR NOT PROMPTROLLBACKCOST) - OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D" - OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D" - (OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST="F") + + + + + - 1 + - - WixUI_InstallMode = "Remove" - - - - diff --git a/packaging/WiX/extra.wxs.in b/packaging/WiX/extra.wxs.in deleted file mode 100644 index 8d0d1517f4b3..000000000000 --- a/packaging/WiX/extra.wxs.in +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - diff --git a/packaging/WiX/mysql_server.wxs.in b/packaging/WiX/mysql_server.wxs.in index 3f4867b0ad6b..ee2d2d115418 100644 --- a/packaging/WiX/mysql_server.wxs.in +++ b/packaging/WiX/mysql_server.wxs.in @@ -1,48 +1,41 @@ - + - + Manufacturer="@MANUFACTURER@" + InstallerVersion="200"> - + Manufacturer='@MANUFACTURER@' /> @@ -67,9 +60,8 @@ OnlyDetect="yes" Property="NEWERVERSIONDETECTED" /> - - NOT NEWERVERSIONDETECTED OR Installed - + @@ -78,37 +70,30 @@ - - Installed OR VS14REDISTX64 - + - - Installed OR VS14REDISTX86 - + - - NOT - Installed - + @@ -126,7 +111,7 @@ - Installed + - INSTALLDIR2 + - - - (NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL") AND (NOT MYSQL_INSTALLER="YES") + - - + @@ -182,14 +166,12 @@ Value="@LICENSE_RTF@"/> - - + - + - - + @CPACK_WIX_FEATURES@ @@ -205,6 +187,5 @@ @CPACK_WIX_INCLUDES@ - - + diff --git a/packaging/WiX/mysql_server_extra.wxs.in b/packaging/WiX/mysql_server_extra.wxs.in index 3734451b59b7..7419a6a6bdf5 100644 --- a/packaging/WiX/mysql_server_extra.wxs.in +++ b/packaging/WiX/mysql_server_extra.wxs.in @@ -1,36 +1,34 @@ - + - - - + - + + ForceDeleteOnUninstall="yes"> @@ -63,21 +61,20 @@ - - + - - + + + ForceDeleteOnUninstall='yes'> - - - @@ -152,8 +146,6 @@ - - &1 --let $XTESTPARAMS= -u user5_mysqlx --password='auth_string' --file=$xtest_file --ssl-cipher='DHE-RSA-AES256-SHA' ---let $ERROR1= /in main, line 0:ERROR: error:00000001:lib\(0\):func\(0\):reason\(1\)/Application terminated with expected error: protocol version mismatch/ ---let $ERROR5= /in main, line 0:ERROR: error:00000005:lib\(0\):func\(0\):DH lib/Application terminated with expected error: socket layer receive error/ /in main, line 0:ERROR: error:00000001:lib\(0\):func\(0\):reason\(1\)/Application terminated with expected error: socket layer receive error/ +--let $ERROR1= /in main, line 0:ERROR: error:00000001:lib\(0\):.*:reason\(1\)/Application terminated with expected error: protocol version mismatch/ +--let $ERROR5= /in main, line 0:ERROR: error:00000005:lib\(0\):.*:DH lib/Application terminated with expected error: socket layer receive error/ /in main, line 0:ERROR: error:00000001:lib\(0\):.*:reason\(1\)/Application terminated with expected error: socket layer receive error/ --exec $MYSQLXTEST $XTESTPARAMS 2>&1 --exec $MYSQLXTEST --tls-version=TLSv1,TLSv1.1,TLSv1.2 $XTESTPARAMS 2>&1 diff --git a/rapid/unittest/gunit/xplugin/CMakeLists.txt b/rapid/unittest/gunit/xplugin/CMakeLists.txt index 4096f715aeeb..64e9a9564ae9 100644 --- a/rapid/unittest/gunit/xplugin/CMakeLists.txt +++ b/rapid/unittest/gunit/xplugin/CMakeLists.txt @@ -40,6 +40,16 @@ MYSQLX_PROTOBUF_GENERATE_CPP_NAMES(protobuf_SRC ${PROTOBUF_MYSQLX_FILES}) IF(MSVC) ADD_COMPILE_FLAGS(${protobuf_SRC} COMPILE_FLAGS "/wd4018") + DOWNGRADE_OPENSSL3_DEPRECATION_WARNINGS( + "${PROJECT_SOURCE_DIR}/rapid/plugin/x/mysqlxtest_src/mysql41_hash.cc") +ELSE() + # DOWNGRADE_OPENSSL3_DEPRECATION_WARNINGS macro does not work in this + # directory when using GCC 4.4.7 compiler. + MY_CHECK_CXX_COMPILER_FLAG("-Wno-deprecated-declarations" + HAVE_NO_DEPRECATED_DECLARATIONS) + IF(HAVE_NO_DEPRECATED_DECLARATIONS) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations") + ENDIF() ENDIF(MSVC) # Turn off some warning flags when compiling GUnit and proto files. diff --git a/sql-common/client.c b/sql-common/client.c index b38a95412abf..fb5cd1e81ccb 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -1011,6 +1011,7 @@ void read_ok_ex(MYSQL *mysql, ulong length) { len = (size_t)net_field_length_ll_safe(mysql, &pos, length, &is_error); if (is_error) return; + if (!buffer_check_remaining(mysql, pos, length, len)) return; pos += len; break; } diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index 5e5e1c3758fa..9a5c08f7333a 100644 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -302,6 +302,14 @@ SET(SQL_SOURCE auth/sha2_password_common.cc ) +DOWNGRADE_OPENSSL3_DEPRECATION_WARNINGS( + ${CMAKE_SOURCE_DIR}/sql-common/client_authentication.cc + ${CMAKE_SOURCE_DIR}/sql/auth/auth_common.h + ${CMAKE_SOURCE_DIR}/sql/auth/sql_authentication.cc + ${CMAKE_SOURCE_DIR}/sql/auth/sql_authentication.h + ${CMAKE_SOURCE_DIR}/sql/des_key_file.cc + ${CMAKE_SOURCE_DIR}/sql/item_strfunc.cc) + IF(NOT WIN32) LIST(APPEND SQL_SOURCE mysqld_daemon.cc) ENDIF() @@ -400,7 +408,7 @@ IF(MY_COMPILER_IS_GNU AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11) ADD_COMPILE_FLAGS( ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.cc ${CMAKE_CURRENT_BINARY_DIR}/sql_hints.yy.cc - COMPILE_FLAGS "-Wno-free-nonheap-object") + COMPILE_FLAGS "-Wno-free-nonheap-object -Wno-unused-label") ENDIF() MY_CHECK_CXX_COMPILER_FLAG("-fno-builtin-memcmp" HAVE_NO_BUILTIN_MEMCMP) @@ -557,9 +565,18 @@ IF(UNIX AND STATIC_SSL_LIBRARY) -Wl,-force_load ${OPENSSL_LIBRARY} ) ELSE() - TARGET_LINK_LIBRARIES(mysqld - -Wl,--whole-archive ${SSL_LIBRARIES} -Wl,--no-whole-archive - ) + # OpenSSL 3.0.8 has an issue with duplicate symbols between static crypto + # and ssl libraries. See https://github.com/openssl/openssl/issues/20238 + IF("${OPENSSL_VERSION}" VERSION_EQUAL "3.0.8") + TARGET_LINK_LIBRARIES(mysqld + -Wl,--whole-archive,--allow-multiple-definition ${SSL_LIBRARIES} + -Wl,--no-whole-archive + ) + ELSE() + TARGET_LINK_LIBRARIES(mysqld + -Wl,--whole-archive ${SSL_LIBRARIES} -Wl,--no-whole-archive + ) + ENDIF() ENDIF() ENDIF() diff --git a/sql/item.cc b/sql/item.cc index 2e4affb2d09b..99a4c8293d5f 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -6187,16 +6187,15 @@ static void convert_zerofill_number_to_string(Item **item, Field_num *field) /** - Set a pointer to the multiple equality the field reference belongs to - (if any). + If field matches a multiple equality, set a pointer to that object in the + field. Also return a pointer to a constant value that can be substituted for + a field (if any). - The function looks for a multiple equality containing the field item - among those referenced by arg. - In the case such equality exists the function does the following. - If the found multiple equality contains a constant, then the field - reference is substituted for this constant, otherwise it sets a pointer - to the multiple equality in the field item. + A constant value is returned only if certain conditions are met (see + implementation). + In addition, a numeric field with a zerofill attribute can be substituted + with a zerofilled value if it is to be used in a character string context. @param arg reference to list of multiple equalities where the field (this object) is to be looked for @@ -6210,37 +6209,35 @@ static void convert_zerofill_number_to_string(Item **item, Field_num *field) - pointer to the field item, otherwise. */ -Item *Item_field::equal_fields_propagator(uchar *arg) -{ - if (no_const_subst) - return this; +Item *Item_field::equal_fields_propagator(uchar *arg) { + if (no_const_subst) return this; item_equal= find_item_equal((COND_EQUAL *) arg); Item *item= 0; - if (item_equal) - item= item_equal->get_const(); + if (item_equal) item = item_equal->get_const(); /* - Disable const propagation for items used in different comparison contexts. - This must be done because, for example, Item_hex_string->val_int() is not - the same as (Item_hex_string->val_str() in BINARY column)->val_int(). - We cannot simply disable the replacement in a particular context ( - e.g. = AND = ) since - Items don't know the context they are in and there are functions like - IF (, 'yes', 'no'). + Disable const propagation if the constant is nullable and this item is not. + If propagation was allowed in this case, it would also be necessary to + propagate the new nullability up to the parents of this item. */ - if (!item || !has_compatible_context(item)) - item= this; - else if (field && (field->flags & ZEROFILL_FLAG) && IS_NUM(field->type())) - { + if (!item || (item->maybe_null && !maybe_null)) { + return this; + } + if ((field->flags & ZEROFILL_FLAG) && cmp_context == STRING_RESULT && + IS_NUM(field->type())) { /* - We don't need to zero-fill timestamp columns here because they will be - first converted to a string (in date/time format) and compared as such if - compared with another string. + Convert numeric constant to a zero-filled string if the field has + the zerofill property and is wanted in a string context. */ - if (item && field->type() != FIELD_TYPE_TIMESTAMP && cmp_context != INT_RESULT - && item->real_item()->type() != Item::REAL_ITEM) - convert_zerofill_number_to_string(&item, (Field_num *)field); - else - item= this; + convert_zerofill_number_to_string(&item, down_cast(field)); + return item; + } + if (!has_compatible_context(item)) { + /* + If the field does not have the zerofill property, the items must have + compatible comparison contexts, otherwise the resolved metadata for + the items and the referencing objects might become invalid. + */ + return this; } return item; } diff --git a/sql/item.h b/sql/item.h index 8c732a974e86..1f01301a17c7 100644 --- a/sql/item.h +++ b/sql/item.h @@ -2181,18 +2181,24 @@ class Item : public Parse_tree_node compared as DATETIME values by the Arg_comparator. FALSE otherwise. */ - inline bool has_compatible_context(Item *item) const - { - /* Same context. */ - if (cmp_context == (Item_result)-1 || item->cmp_context == cmp_context) + inline bool has_compatible_context(Item *item) const { + // If no explicit context has been set, assume the same type as the item + const Item_result this_context = + cmp_context == (Item_result)-1 ? result_type() : cmp_context; + const Item_result other_context = item->cmp_context == (Item_result)-1 + ? item->result_type() + : item->cmp_context; + + // Check if both items have the same context + if (this_context == other_context) { return TRUE; + } /* DATETIME comparison context. */ if (is_temporal_with_date()) - return item->is_temporal_with_date() || - item->cmp_context == STRING_RESULT; + return item->is_temporal_with_date() || other_context == STRING_RESULT; if (item->is_temporal_with_date()) - return is_temporal_with_date() || cmp_context == STRING_RESULT; - return FALSE; + return is_temporal_with_date() || this_context == STRING_RESULT; + return false; } virtual Field::geometry_type get_geometry_type() const { return Field::GEOM_GEOMETRY; }; diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 8d1b555cf87d..2e020f0778b7 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -967,9 +967,10 @@ void Item_func_concat::fix_length_and_dec() if (agg_arg_charsets_for_string_result(collation, args, arg_count)) return; - for (uint i=0 ; i < arg_count ; i++) + for (uint i=0 ; i < arg_count ; i++) { + args[i]->cmp_context = STRING_RESULT; char_length+= args[i]->max_char_length(); - + } fix_char_length_ulonglong(char_length); } @@ -1233,8 +1234,10 @@ void Item_func_concat_ws::fix_length_and_dec() so, (arg_count - 2) is safe here. */ char_length= (ulonglong) args[0]->max_char_length() * (arg_count - 2); - for (uint i=1 ; i < arg_count ; i++) + for (uint i=1 ; i < arg_count ; i++) { + args[i]->cmp_context = STRING_RESULT; char_length+= args[i]->max_char_length(); + } fix_char_length_ulonglong(char_length); } diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 096ddafe4c89..1cbf0136b640 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -148,6 +148,8 @@ static Date_time_format time_24hrs_format= {{0}, '\0', 0, %r) and this parameter is pointer to place where pointer to end of string matching this specifier should be stored. + @param data_type Type of data + @param flags flags used by check_date() @note Possibility to parse strings matching to patterns equivalent to compound @@ -170,7 +172,9 @@ static bool extract_date_time(Date_time_format *format, const char *val, size_t length, MYSQL_TIME *l_time, timestamp_type cached_timestamp_type, const char **sub_pattern_end, - const char *date_time_type) + const char *date_time_type, + enum_field_types data_type, + my_time_flags_t flags) { int weekday= 0, yearday= 0, daypart= 0; int week_number= -1; @@ -364,7 +368,8 @@ static bool extract_date_time(Date_time_format *format, */ if (extract_date_time(&time_ampm_format, val, (uint)(val_end - val), l_time, - cached_timestamp_type, &val, "time")) + cached_timestamp_type, &val, "time", + data_type, flags)) DBUG_RETURN(1); break; @@ -372,7 +377,8 @@ static bool extract_date_time(Date_time_format *format, case 'T': if (extract_date_time(&time_24hrs_format, val, (uint)(val_end - val), l_time, - cached_timestamp_type, &val, "time")) + cached_timestamp_type, &val, "time", + data_type, flags)) DBUG_RETURN(1); break; @@ -474,8 +480,12 @@ static bool extract_date_time(Date_time_format *format, get_date_from_daynr(days,&l_time->year,&l_time->month,&l_time->day); } - if (l_time->month > 12 || l_time->day > 31 || l_time->hour > 23 || - l_time->minute > 59 || l_time->second > 59) + assert(l_time->year <= 9999); + if (data_type == MYSQL_TYPE_TIME) flags &= ~TIME_NO_ZERO_DATE; + int warnings; + if (l_time->month > 12 || l_time->hour > 23 || l_time->minute > 59 || + l_time->second > 59 || + check_date(l_time, non_zero_date(l_time), flags, &warnings)) goto err; if (val != val_end) @@ -3356,6 +3366,22 @@ void Item_func_str_to_date::fix_length_and_dec() } } +/** + Determines whether this date should be NULL (and a warning raised) under the + given sql_mode. Zeroes are allowed in the date if the data type is TIME. + + @param target_type The data type of the time/date. + @param time Date and time data + @param fuzzy_date What sql_mode dictates. + @return Whether the result is valid or NULL. +*/ +static bool date_should_be_null(enum_field_types target_type, + const MYSQL_TIME &time, + my_time_flags_t fuzzy_date) { + return (fuzzy_date & TIME_NO_ZERO_DATE) != 0 && + (target_type != MYSQL_TYPE_TIME) && + (time.year == 0 || time.month == 0 || time.day == 0); +} bool Item_func_str_to_date::val_datetime(MYSQL_TIME *ltime, my_time_flags_t fuzzy_date) @@ -3381,11 +3407,19 @@ bool Item_func_str_to_date::val_datetime(MYSQL_TIME *ltime, memset(ltime, 0, sizeof(*ltime)); date_time_format.format.str= (char*) format->ptr(); date_time_format.format.length= format->length(); - if (extract_date_time(&date_time_format, val->ptr(), val->length(), - ltime, cached_timestamp_type, 0, "datetime") || - ((fuzzy_date & TIME_NO_ZERO_DATE) && - (ltime->year == 0 || ltime->month == 0 || ltime->day == 0))) + if (extract_date_time(&date_time_format, val->ptr(), val->length(), ltime, + cached_timestamp_type, 0, "datetime", field_type(), + fuzzy_date)) goto null_date; + if (date_should_be_null(field_type(), *ltime, fuzzy_date)) { + char buff[128]; + strmake(buff, val->ptr(), min(val->length(), sizeof(buff) - 1)); + push_warning_printf(current_thd, Sql_condition::SL_WARNING, + ER_WRONG_VALUE_FOR_TYPE, + ER_THD(current_thd, ER_WRONG_VALUE_FOR_TYPE), + "datetime", buff, "str_to_date"); + goto null_date; + } ltime->time_type= cached_timestamp_type; if (cached_timestamp_type == MYSQL_TIMESTAMP_TIME && ltime->day) { @@ -3400,14 +3434,6 @@ bool Item_func_str_to_date::val_datetime(MYSQL_TIME *ltime, return 0; null_date: - if (val && (fuzzy_date & TIME_NO_ZERO_DATE) /*warnings*/) - { - char buff[128]; - strmake(buff, val->ptr(), min(val->length(), sizeof(buff)-1)); - push_warning_printf(current_thd, Sql_condition::SL_WARNING, - ER_WRONG_VALUE_FOR_TYPE, ER(ER_WRONG_VALUE_FOR_TYPE), - "datetime", buff, "str_to_date"); - } return (null_value= 1); } diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 3799718604ea..4eaf49fad382 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -6380,7 +6380,7 @@ static SEL_TREE *get_func_mm_tree_from_in_predicate(RANGE_OPT_PARAM *param, if (and_tree == NULL) return NULL; } - or_tree= tree_or(param, and_tree, or_tree); + or_tree= tree_or(param, or_tree, and_tree); } return or_tree; } diff --git a/sql/sql_resolver.cc b/sql/sql_resolver.cc index 430ef4560fed..d035201fb40f 100644 --- a/sql/sql_resolver.cc +++ b/sql/sql_resolver.cc @@ -2471,9 +2471,19 @@ bool SELECT_LEX::merge_derived(THD *thd, TABLE_LIST *derived_table) { Mark_field mf(thd->mark_used_columns); for (ORDER *o = derived_select->order_list.first; o != NULL; - o = o->next) + o = o->next) { o->item[0]->walk(&Item::mark_field_in_map, Item::WALK_POSTFIX, pointer_cast(&mf)); + /* + If the expression in order by was part of the select list + of the merged derived query block and if it is unused in the + outer query block, delete_unused_merged_columns() could + delete the select expression. So, we set that the merged + order by expression is used and therefore should not be deleted. + */ + o->item[0]->walk(&Item::propagate_set_derived_used, + Item::WALK_POSTFIX, NULL); + } } } else diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 703d87d71094..d913bae0647d 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -2018,19 +2018,20 @@ convert_error_code_to_mysql( /*************************************************************//** Prints info of a THD object (== user session thread) to the given file. */ -void -innobase_mysql_print_thd( -/*=====================*/ - FILE* f, /*!< in: output stream */ - THD* thd, /*!< in: MySQL THD object */ - uint max_query_len) /*!< in: max query length to print, or 0 to - use the default max length */ -{ - char buffer[1024]; - - fputs(thd_security_context(thd, buffer, sizeof buffer, - max_query_len), f); - putc('\n', f); +void innobase_mysql_print_thd(FILE *f, /*!< in: output stream */ + THD *thd, /*!< in: MySQL THD object */ + uint max_query_len) /*!< in: max query length to + print, must be positive */ +{ + // This is meant to be an upper bound for non-SQL part of the context, + // such as trx's id, state and stats. + ut_a(0 < max_query_len); + const size_t ADDITIONAL_CTX_LEN = 1024; + std::vector buffer(ADDITIONAL_CTX_LEN + max_query_len); + + fputs(thd_security_context(thd, buffer.data(), buffer.size(), max_query_len), + f); + putc('\n', f); } /******************************************************************//** diff --git a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h index 69c9c0a798f6..31c7b74fb5f7 100644 --- a/storage/innobase/include/ha_prototypes.h +++ b/storage/innobase/include/ha_prototypes.h @@ -161,8 +161,8 @@ innobase_mysql_print_thd( /*=====================*/ FILE* f, /*!< in: output stream */ THD* thd, /*!< in: pointer to a MySQL THD object */ - uint max_query_len); /*!< in: max query length to print, or 0 to - use the default max length */ + uint max_query_len); /*!< in: max query length to print, + must be positive */ /** Converts a MySQL type to an InnoDB type. Note that this function returns the 'mtype' of InnoDB. InnoDB differentiates between MySQL's old <= 4.1 diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h index 3a87b7606eaf..1f8fe7f663cc 100644 --- a/storage/innobase/include/trx0trx.h +++ b/storage/innobase/include/trx0trx.h @@ -378,7 +378,7 @@ trx_print_low( /*!< in: transaction */ ulint max_query_len, /*!< in: max query length to print, - or 0 to use the default max length */ + must be positive */ ulint n_rec_locks, /*!< in: lock_number_of_rows_locked(&trx->lock) */ ulint n_trx_locks, @@ -396,7 +396,7 @@ trx_print_latched( FILE* f, /*!< in: output stream */ const trx_t* trx, /*!< in: transaction */ ulint max_query_len); /*!< in: max query length to print, - or 0 to use the default max length */ + must be positive */ /**********************************************************************//** Prints info about a transaction. @@ -407,7 +407,7 @@ trx_print( FILE* f, /*!< in: output stream */ const trx_t* trx, /*!< in: transaction */ ulint max_query_len); /*!< in: max query length to print, - or 0 to use the default max length */ + must be positive */ /**********************************************************************//** Determine if a transaction is a dictionary operation. diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index a0559fdc0498..528efd49ee79 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -5175,7 +5175,7 @@ lock_trx_print_wait_and_mvcc_state( { fprintf(file, "---"); - trx_print_latched(file, trx, 600); + trx_print_latched(file, trx, 3000); const ReadView* read_view = trx_get_read_view(trx); diff --git a/storage/innobase/lock/lock0wait.cc b/storage/innobase/lock/lock0wait.cc index 6520e079ffe1..62e851e788ed 100644 --- a/storage/innobase/lock/lock0wait.cc +++ b/storage/innobase/lock/lock0wait.cc @@ -312,8 +312,12 @@ lock_wait_suspend_thread( thd_wait_begin(trx->mysql_thd, THD_WAIT_TABLE_LOCK); } + DEBUG_SYNC_C("lock_wait_will_wait"); + os_event_wait(slot->event); + DEBUG_SYNC_C("lock_wait_has_finished_waiting"); + thd_wait_end(trx->mysql_thd); /* After resuming, reacquire the data dictionary latch if diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc index a35dd382a464..36ce6eb6cca7 100644 --- a/storage/innobase/row/row0ftsort.cc +++ b/storage/innobase/row/row0ftsort.cc @@ -486,7 +486,9 @@ row_merge_fts_doc_tokenize( /* Tokenize the data and add each word string, its corresponding doc id and position to sort buffer */ - while (t_ctx->processed_len < doc->text.f_len) { + while (parser == NULL ? + t_ctx->processed_len < doc->text.f_len : + t_ctx->processed_len == 0 || UT_LIST_GET_LEN(t_ctx->fts_token_list) != 0) { ulint idx = 0; ib_uint32_t position; ulint cur_len = 0; @@ -822,7 +824,6 @@ fts_parallel_tokenization( /* Not yet finish processing the "doc" on hand, continue processing it */ ut_ad(doc.text.f_str); - ut_ad(t_ctx.processed_len < doc.text.f_len); } processed = row_merge_fts_doc_tokenize( @@ -833,7 +834,6 @@ fts_parallel_tokenization( /* Current sort buffer full, need to recycle */ if (!processed) { - ut_ad(t_ctx.processed_len < doc.text.f_len); ut_ad(t_ctx.rows_added[t_ctx.buf_used]); break; } diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc index 9237cdc3510b..03c874a56356 100644 --- a/storage/innobase/row/row0upd.cc +++ b/storage/innobase/row/row0upd.cc @@ -1954,9 +1954,26 @@ row_upd_eval_new_vals( } } +/** Copies the data pointed to by the new values for virtual fields to update +@param[in,out] update an update vector */ +static +void +row_upd_dup_v_new_vals( + const upd_t* update) +{ + ut_ad(update != NULL); + + for (ulint j = 0; j < upd_get_n_fields(update); j++) { + upd_field_t *upd_field = upd_get_nth_field(update, j); + if (upd_field->new_val.type.prtype & DATA_VIRTUAL) { + dfield_dup(&upd_field->new_val, update->heap); + } + } +} + /** Stores to the heap the virtual columns that need for any indexes @param[in,out] node row update node -@param[in] update an update vector if it is update +@param[in,out] update an update vector if it is update @param[in] thd mysql thread handle @param[in,out] mysql_table mysql table object */ static @@ -1969,6 +1986,8 @@ row_upd_store_v_row( { mem_heap_t* heap = NULL; dict_index_t* index = dict_table_get_first_index(node->table); + bool new_val_v_cols_dup = false; + const ulint n_upd = update ? upd_get_n_fields(update) : 0; for (ulint col_no = 0; col_no < dict_table_get_n_v_cols(node->table); col_no++) { @@ -1979,8 +1998,6 @@ row_upd_store_v_row( if (col->m_col.ord_part) { dfield_t* dfield = dtuple_get_nth_v_field(node->row, col_no); - ulint n_upd - = update ? upd_get_n_fields(update) : 0; ulint i = 0; /* Check if the value is already in update vector */ @@ -2017,6 +2034,11 @@ row_upd_store_v_row( dfield_copy_data(dfield, vfield); dfield_dup(dfield, node->heap); if (dfield_is_null(dfield)) { + if (!new_val_v_cols_dup) { + row_upd_dup_v_new_vals( + update); + new_val_v_cols_dup = true; + } innobase_get_computed_value( node->row, col, index, &heap, node->heap, NULL, diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc index 31be1bfff9e5..aaab1ea8f0a2 100644 --- a/storage/innobase/trx/trx0trx.cc +++ b/storage/innobase/trx/trx0trx.cc @@ -2516,7 +2516,7 @@ trx_print_low( /*!< in: transaction */ ulint max_query_len, /*!< in: max query length to print, - or 0 to use the default max length */ + must be positive */ ulint n_rec_locks, /*!< in: lock_number_of_rows_locked(&trx->lock) */ ulint n_trx_locks, diff --git a/vio/CMakeLists.txt b/vio/CMakeLists.txt index 1859f6de38fc..1b60e2671af4 100644 --- a/vio/CMakeLists.txt +++ b/vio/CMakeLists.txt @@ -31,6 +31,10 @@ SET(VIO_SOURCES viosslfactories.c ) +DOWNGRADE_OPENSSL3_DEPRECATION_WARNINGS( + viossl.c + viosslfactories.c) + IF(WIN32) LIST(APPEND VIO_SOURCES viopipe.c diff --git a/vio/viossl.c b/vio/viossl.c index 1f12067f118d..2abf9f24de5d 100644 --- a/vio/viossl.c +++ b/vio/viossl.c @@ -193,7 +193,7 @@ size_t vio_ssl_read(Vio *vio, uchar *buf, size_t size) ret= SSL_read(ssl, buf, (int)size); - if (ret >= 0) + if (ret > 0) break; /* Process the SSL I/O error. */ @@ -230,7 +230,7 @@ size_t vio_ssl_write(Vio *vio, const uchar *buf, size_t size) ret= SSL_write(ssl, buf, (int)size); - if (ret >= 0) + if (ret > 0) break; /* Process the SSL I/O error. */ @@ -277,6 +277,7 @@ int vio_ssl_shutdown(Vio *vio) default: /* Shutdown failed */ DBUG_PRINT("vio_error", ("SSL_shutdown() failed, error: %d", SSL_get_error(ssl, r))); + ERR_clear_error(); break; } } @@ -414,6 +415,7 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, } } #endif + ERR_clear_error(); if ((r= ssl_handshake_loop(vio, ssl, func, ssl_errno_holder)) < 1) {