Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@locus.apache.org Received: (qmail 7271 invoked from network); 18 Oct 2008 14:02:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Oct 2008 14:02:45 -0000 Received: (qmail 21258 invoked by uid 500); 18 Oct 2008 14:02:46 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 21248 invoked by uid 500); 18 Oct 2008 14:02:46 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 21237 invoked by uid 99); 18 Oct 2008 14:02:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Oct 2008 07:02:46 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sorinm@gmail.com designates 209.85.200.173 as permitted sender) Received: from [209.85.200.173] (HELO wf-out-1314.google.com) (209.85.200.173) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Oct 2008 14:01:39 +0000 Received: by wf-out-1314.google.com with SMTP id 24so1161022wfg.15 for ; Sat, 18 Oct 2008 07:02:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=1HSXEmd9xgEpThu9yjXVZo77n6SeEPc48x6loInJvhk=; b=GDSZsgpqaRFeP9siKjKJHaV422eYZf6c/RWSV9UspWNtuOckdtXdEfCL+G5b9bx2s0 V9n7XaMvUO7QNuaLt6AlJA9zXydAgUmjPwpXOUA4rpjqvCL9embyV2SEt1mWZL5u+RmM tyIQP55cmHDScyNGxGl0/QCU+/MDc8tAKSajo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=wU+my0Oaht2Eufu/o/NW9/CdaSvVGWB/7y9uc33s0dEpwIu5C1+Mx5YbO6P3w/GjAW TFnGdOgaTpFnuSZQpENIjo9tMC9AaRccDpjSMTgoU3C2sJqsGL2jjalhcLBMSzS5lvWP s6b8YorbjwSa/zIMz6Wa7oNOyCZImUqLOsYUg= Received: by 10.142.177.5 with SMTP id z5mr2022301wfe.248.1224338527823; Sat, 18 Oct 2008 07:02:07 -0700 (PDT) Received: by 10.143.3.19 with HTTP; Sat, 18 Oct 2008 07:02:07 -0700 (PDT) Message-ID: <20170a030810180702q328db76dy46e07abae4d17c4c@mail.gmail.com> Date: Sat, 18 Oct 2008 16:02:07 +0200 From: "Sorin Manolache" To: modules-dev@httpd.apache.org Subject: Re: mod_dbd and prepared statements (httpd-2.2.9) In-Reply-To: <6456355d0810180620h1539f0aey1b7fcca4326c249a@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <6456355d0810132323h4ea325c5r32aad3b348b4e4e0@mail.gmail.com> <48F883ED.7010208@ez.no> <6456355d0810180620h1539f0aey1b7fcca4326c249a@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org On Sat, Oct 18, 2008 at 15:20, Andrej van der Zee wrote: > Hi, > > I did not find a solution, I just stopped using prepared statements > altogether. But I tried to isolate the problem just now, and found somehow > that I cannot use FLOAT in prepared statement somehow (when I tried INT > columns it even segfaults). Below the source code of a mini-module to > illustrate this. This is the table I created in MySQL: > > CREATE TABLE simple_table (duration FLOAT NOT NULL) ENGINE=INNODEDB; > > And this is what appears in the MySQL log: > > Prepare INSERT INTO simple_table (duration) VALUES (?) > Execute INSERT INTO simple_table (duration) VALUES ('') > > If you want to reproduce it, dont forget to put this in httpd.conf: > LoadModule prep_stmt_module modules/mod_prep_stmt.so > PrepStmt on Hello, I have not reproduced it, it's Saturday :-). I have never worked with mod_dbd but I might have a clue though, although I am not sure. You call ap_dbd_prepare from prep_stmt_config_set_prep_stmt_on. This function is called during the conf parsing phase when there are no apache children processes. cmd->server refers to the server structure of the root apache process (the parent of all future apache children). Then the apr_dbd_pvquery is called from an apache child process, in which the server structure is not the same as the one you passed to ap_dbd_prepare. As I have never worked with mod_dbd, I do not know if this can cause a crash. If your mini-module is inspired from a text-book or some working example, then my hunch is wrong. Try the following: Leave cfg->prep_stmt_on = flag but move the ap_dbd_prepare from the config hook to the child_init hook. S