Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61113 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 37088 invoked from network); 7 Jul 2012 15:20:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Jul 2012 15:20:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 209.85.216.49 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.216.49 mail-qa0-f49.google.com Received: from [209.85.216.49] ([209.85.216.49:39669] helo=mail-qa0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 54/10-36077-CC358FF4 for ; Sat, 07 Jul 2012 11:20:45 -0400 Received: by qabj40 with SMTP id j40so1024022qab.8 for ; Sat, 07 Jul 2012 08:20:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :x-enigmail-version:content-type:content-transfer-encoding :x-gm-message-state; bh=QPPxYXqNqo9n2HehSx/ji7ynpF12FNu25k9WGa8CbHM=; b=jChA3CRTm40Ad9Gl9o6ySSp01ApM5uaFMyIP2bJwpgE+LSPZY31x8Q9veQgtsUDjxA d+Zpktq6CcTJLgKUKDnjoMe/wZN8Vosd46ngxOKOruK+vTo5L1aqaxKL1SF67RG5C0F0 mzhapg2iRankBogTERd0RwU0FsELD0e7CyVoYJ6NDMk+7yx/J3h0qDjLtYiJKbi8ceUU 0cJgqVkcGfLtuNsPaQxO/DaLbYPC4eTFZQCQLyhN6+Idms4ZeyJtnuVLpz09yXU58+Io ZHs50CzVv7s+lbYnioZ3HrrETuGAyB39bPwY+8zOOdZ6QjQoW3UHnLIXU5SnLT5wdctD Gb/A== Received: by 10.224.58.201 with SMTP id i9mr60705805qah.39.1341674442099; Sat, 07 Jul 2012 08:20:42 -0700 (PDT) Received: from [172.16.26.30] ([38.106.64.245]) by mx.google.com with ESMTPS id ea5sm13570106qab.2.2012.07.07.08.20.40 (version=SSLv3 cipher=OTHER); Sat, 07 Jul 2012 08:20:41 -0700 (PDT) Message-ID: <4FF853C6.4030503@lerdorf.com> Date: Sat, 07 Jul 2012 08:20:38 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: PHP internals X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQnFmoL8m5sOHiBXjRJSq9LFHhPmgiprPAyx+UEKW81sFaNdulesBoakEF1yCeQZBq+Qo4s4 Subject: MYSQL_OPT_RECONNECT From: rasmus@lerdorf.com (Rasmus Lerdorf) I spent a bit of time looking at a mismatch between pdo_mysql and MYSQL_OPT_RECONNECT. There is some rather odd code in pdo_mysql/mysql_driver.c: http://lxr.php.net/xref/PHP_5_4/ext/pdo_mysql/mysql_driver.c#640 There are two main problems here 1. This code is inside an if(driver_options) conditional so unless you pass a driver option to the constructor this code doesn't get run. if it wasn't for the second bug, we would have this odd side-effect behaviour that setting any random option would also turn on automatic reconnects 2. The #ifdef MYSQL_OPT_RECONNECT doesn't work at all because MySQL options are in an enum and thus obviously not available to the preprocessor. So, because of these bugs when MySQL turned off auto-reconnects in 5.0.3 everyone has been running with them off despite pdo_mysql's intent to turn them back on. Fixing these bugs now to make the code do what it was intended to do would be a BC break. My suggestion is to just expose MYSQL_OPT_RECONNECT as a normal user-settable option (which wouldn't be available under mysqlnd) and leaving it off by default. Looking through the bug db this was actually partially reported a while ago in bug 58863. Johannes/Stas is exposing MYSQL_OPT_RECONNECT ok for 5.3/5.4? I suppose it is a grey area between a feature change and a bug fix in this case. -Rasmus