From a46c91543e36ebf4644e022453b47d381220df2e Mon Sep 17 00:00:00 2001 From: "dkl%redhat.com" <> Date: Thu, 8 Jul 2004 09:19:42 +0000 Subject: Patch for bug 190432; saving a named query uses REPLACE INTO (not ANSI); patch by David Lawrence ; r=vladd; a=justdave --- query.cgi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'query.cgi') diff --git a/query.cgi b/query.cgi index c97c07eed..cf601b716 100755 --- a/query.cgi +++ b/query.cgi @@ -84,14 +84,16 @@ if ($user) { my ($name, $cookiename, $value) = (@$ref); if ($value) { my $qname = SqlQuote($name); + SendSQL("LOCK TABLES namedqueries WRITE"); SendSQL("SELECT query FROM namedqueries " . "WHERE userid = $userid AND name = $qname"); my $query = FetchOneColumn(); if (!$query) { - SendSQL("REPLACE INTO namedqueries " . + SendSQL("INSERT INTO namedqueries " . "(userid, name, query) VALUES " . "($userid, $qname, " . SqlQuote($value) . ")"); } + SendSQL("UNLOCK TABLES"); } $cgi->send_cookie(-name => $cookiename, -expires => "Fri, 01-Jan-2038 00:00:00 GMT"); -- cgit v1.2.3-24-g4f1b