aboutsummaryrefslogtreecommitdiffstats
path: root/query.cgi
diff options
context:
space:
mode:
authordkl%redhat.com <>2004-07-08 09:19:42 +0000
committerdkl%redhat.com <>2004-07-08 09:19:42 +0000
commita46c91543e36ebf4644e022453b47d381220df2e (patch)
tree7b1ecc46a6878f9123f18909dc2a1d86104e83d2 /query.cgi
parente09a3eae0f1068e40ae8e09f4ba7e090fd4b54e4 (diff)
downloadbugs-a46c91543e36ebf4644e022453b47d381220df2e.tar
bugs-a46c91543e36ebf4644e022453b47d381220df2e.tar.gz
bugs-a46c91543e36ebf4644e022453b47d381220df2e.tar.bz2
bugs-a46c91543e36ebf4644e022453b47d381220df2e.tar.xz
bugs-a46c91543e36ebf4644e022453b47d381220df2e.zip
Patch for bug 190432; saving a named query uses REPLACE INTO (not ANSI); patch by David Lawrence <dkl@redhat.com>; r=vladd; a=justdave
Diffstat (limited to 'query.cgi')
-rwxr-xr-xquery.cgi4
1 files changed, 3 insertions, 1 deletions
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");