OK to push. Regards, Igor. On 09/28/2011 07:23 AM, Timour Katchaounov wrote:
Hi Igor,
Could you please review the following fix. It is very much related to a bug you fixed: https://bugs.launchpad.net/bugs/702301
Thanks, Timour
-------- Original Message -------- Return-Path: <commits-bounces@mariadb.org> X-Original-To: timour@montyprogram.com Delivered-To: timour@montyprogram.com Received: from localhost (localhost.localdomain [127.0.0.1]) by hasky.askmonty.org (Postfix) with ESMTP id DFD38D0DCB; Wed, 28 Sep 2011 17:20:59 +0300 (EEST) X-Virus-Scanned: Debian amavisd-new at mail.askmonty.org Received: from hasky.askmonty.org ([127.0.0.1]) by localhost (mail.askmonty.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lpHLfsC2eNw9; Wed, 28 Sep 2011 17:20:59 +0300 (EEST) Received: from hasky.askmonty.org (localhost.localdomain [127.0.0.1]) by hasky.askmonty.org (Postfix) with ESMTP id BE79DC8236; Wed, 28 Sep 2011 17:20:59 +0300 (EEST) Received: by hasky.askmonty.org (Postfix) id 38FC0C8234; Wed, 28 Sep 2011 17:20:58 +0300 (EEST) Delivered-To: commits@mariadb.org Received: from localhost (localhost.localdomain [127.0.0.1]) by hasky.askmonty.org (Postfix) with ESMTP id 31622C8236 for <commits@mariadb.org>; Wed, 28 Sep 2011 17:20:58 +0300 (EEST) X-Virus-Scanned: Debian amavisd-new at mail.askmonty.org Received: from hasky.askmonty.org ([127.0.0.1]) by localhost (mail.askmonty.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BvGNnoY8SHUx for <commits@mariadb.org>; Wed, 28 Sep 2011 17:20:52 +0300 (EEST) Received: from localhost6.localdomain6 (unknown [212.91.171.126]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by hasky.askmonty.org (Postfix) with ESMTPSA id 24886C8234 for <commits@mariadb.org>; Wed, 28 Sep 2011 17:20:52 +0300 (EEST) Content-Type: multipart/mixed; boundary="===============0198351398646356273==" MIME-Version: 1.0 From: <timour@askmonty.org> User-Agent: bzr/2.3.4 To: <commits@mariadb.org> Message-Id: <20110928142052.24886C8234@hasky.askmonty.org> Date: Wed, 28 Sep 2011 17:20:52 +0300 (EEST) Subject: [Commits] Rev 3199: Fix bug lp:858148. in file:///home/tsk/mprog/src/5.3/ X-BeenThere: commits@mariadb.org X-Mailman-Version: 2.1.9 Precedence: list Reply-To: maria-developers@lists.launchpad.net List-Id: MariaDB Commits List <commits.mariadb.org> List-Unsubscribe: <https://lists.askmonty.org/cgi-bin/mailman/listinfo/commits>, <mailto:commits-request@mariadb.org?subject=unsubscribe> List-Archive: <http://lists.askmonty.org/pipermail/commits> List-Post: <mailto:commits@mariadb.org> List-Help: <mailto:commits-request@mariadb.org?subject=help> List-Subscribe: <https://lists.askmonty.org/cgi-bin/mailman/listinfo/commits>, <mailto:commits-request@mariadb.org?subject=subscribe> Sender: commits-bounces@mariadb.org Errors-To: commits-bounces@mariadb.org
At file:///home/tsk/mprog/src/5.3/
------------------------------------------------------------ revno: 3199 revision-id: timour@askmonty.org-20110928142043-b88ob3qytbroxdks parent: psergey@askmonty.org-20110928090147-izz3ebqbcrnakndu fixes bug(s): https://launchpad.net/bugs/858148 committer: timour@askmonty.org branch nick: 5.3 timestamp: Wed 2011-09-28 17:20:43 +0300 message: Fix bug lp:858148.
Analysis: The crash is a result of the same cause as all similar bugs (lp:827416, lp:718763, lp:778413, lp:806943, lp:611690). The general pattern is that some optimization requires the evaluation of some condition (e.g. the WHERE clause), and this condition contains a subquery, such that the subquery itself requires a temporary table for its execution. During the subquery execution the original tables in the FROM clause are replaced by the temporary table needed for the final GROUP or ORDER operation. All this happens during optimization of the outer query. Later when EXPLAIN is run for the subquery, explain attempts to print the name of the tables in the FROM clause, but it finds there a temporary table without a corresponding TABLE_LIST object. The attempt to print the name of a NULL table list results in a crash.
Solution: This patch extends the fix to bug lp:702301, and dissalows constant substitution of aggregate functions if the filter condition used to check MIN/MAX keys is an expensive condition.