Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
d8e58467
Commit
d8e58467
authored
Mar 22, 2005
by
mkanat%kerio.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 287138: INSERT IGNORE is not ANSI SQL
Patch By Tomas Kopal <Tomas.Kopal@altap.cz> r=mkanat, a=justdave
parent
946aa227
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
editgroups.cgi
editgroups.cgi
+12
-7
No files found.
editgroups.cgi
View file @
d8e58467
...
...
@@ -57,19 +57,24 @@ sub RederiveRegexp ($$)
my
$gid
=
shift
;
my
$dbh
=
Bugzilla
->
dbh
;
my
$sth
=
$dbh
->
prepare
(
"SELECT userid, login_name FROM profiles"
);
my
$sthadd
=
$dbh
->
prepare
(
"INSERT IGNORE INTO user_group_map
(user_id, group_id, grant_type, isbless)
VALUES (?, ?, ?, 0)"
);
my
$sthqry
=
$dbh
->
prepare
(
"SELECT 1 FROM user_group_map
WHERE user_id = ? AND group_id = ?
AND grant_type = ? and isbless = 0"
);
my
$sthadd
=
$dbh
->
prepare
(
"INSERT INTO user_group_map
(user_id, group_id, grant_type, isbless)
VALUES (?, ?, ?, 0)"
);
my
$sthdel
=
$dbh
->
prepare
(
"DELETE FROM user_group_map
WHERE user_id = ? AND group_id = ?
AND grant_type = ? and isbless = 0"
);
WHERE user_id = ? AND group_id = ?
AND grant_type = ? and isbless = 0"
);
$sth
->
execute
();
while
(
my
(
$uid
,
$login
)
=
$sth
->
fetchrow_array
())
{
my
$present
=
$dbh
->
selectrow_array
(
$sthqry
,
undef
,
$uid
,
$gid
,
GRANT_REGEXP
);
if
((
$regexp
=~
/\S+/
)
&&
(
$login
=~
m/$regexp/i
))
{
$sthadd
->
execute
(
$uid
,
$gid
,
GRANT_REGEXP
);
$sthadd
->
execute
(
$uid
,
$gid
,
GRANT_REGEXP
)
unless
$present
;
}
else
{
$sthdel
->
execute
(
$uid
,
$gid
,
GRANT_REGEXP
);
$sthdel
->
execute
(
$uid
,
$gid
,
GRANT_REGEXP
)
if
$present
;
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment