Fix for bug 95731: "INSERT INTO shadowlog" failed because "Table 'shadowlog' not…

Fix for bug 95731: "INSERT INTO shadowlog" failed because "Table 'shadowlog' not locked", fixed typo in lock tables command. Patch by Myk Melez <myk@mozilla.org> r= justdave@syndicomm.com
parent df2f05d6
......@@ -52,7 +52,7 @@ sub IssuePasswordToken {
# Generate a unique token and insert it into the tokens table.
# We have to lock the tokens table before generating the token,
# since the database must be queried for token uniqueness.
&::SendSQL("LOCK TABLE tokens WRITE");
&::SendSQL("LOCK TABLES tokens WRITE");
my $token = GenerateUniqueToken();
my $quotedtoken = &::SqlQuote($token);
my $quotedipaddr = &::SqlQuote($::ENV{'REMOTE_ADDR'});
......@@ -166,7 +166,7 @@ Cancelled Because: $cancelaction
close SENDMAIL;
# Delete the token from the database.
&::SendSQL("LOCK TABLE tokens WRITE");
&::SendSQL("LOCK TABLES tokens WRITE");
&::SendSQL("DELETE FROM tokens WHERE token = $quotedtoken");
&::SendSQL("UNLOCK TABLES");
}
......
......@@ -52,7 +52,7 @@ sub IssuePasswordToken {
# Generate a unique token and insert it into the tokens table.
# We have to lock the tokens table before generating the token,
# since the database must be queried for token uniqueness.
&::SendSQL("LOCK TABLE tokens WRITE");
&::SendSQL("LOCK TABLES tokens WRITE");
my $token = GenerateUniqueToken();
my $quotedtoken = &::SqlQuote($token);
my $quotedipaddr = &::SqlQuote($::ENV{'REMOTE_ADDR'});
......@@ -166,7 +166,7 @@ Cancelled Because: $cancelaction
close SENDMAIL;
# Delete the token from the database.
&::SendSQL("LOCK TABLE tokens WRITE");
&::SendSQL("LOCK TABLES tokens WRITE");
&::SendSQL("DELETE FROM tokens WHERE token = $quotedtoken");
&::SendSQL("UNLOCK TABLES");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment