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
8d4f43f1
Commit
8d4f43f1
authored
Jan 28, 2005
by
travis%sedsystems.ca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 278010 : checksetup.pl should fix empty group names
Patch by Nick.Barnes@pobox.com r=wurblzap a=myk
parent
e749f733
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
checksetup.pl
checksetup.pl
+29
-0
No files found.
checksetup.pl
View file @
8d4f43f1
...
@@ -4660,6 +4660,35 @@ if (($fielddef = GetFieldDef("logincookies", "lastused")) &&
...
@@ -4660,6 +4660,35 @@ if (($fielddef = GetFieldDef("logincookies", "lastused")) &&
ChangeFieldType
(
'logincookies'
,
'lastused'
,
'DATETIME NOT NULL'
);
ChangeFieldType
(
'logincookies'
,
'lastused'
,
'DATETIME NOT NULL'
);
}
}
# 2005-01-12 Nick Barnes <nb@ravenbrook.com> bug 278010
# Rename any group which has an empty name.
# Note that there can be at most one such group (because of
# the SQL index on the name column).
$sth
=
$dbh
->
prepare
(
"SELECT id FROM groups where name = ''"
);
$sth
->
execute
();
my
(
$emptygroupid
)
=
$sth
->
fetchrow_array
();
if
(
$emptygroupid
)
{
# There is a group with an empty name; find a name to rename it
# as. Must avoid collisions with existing names. Start with
# group_$gid and add _<n> if necessary.
my
$trycount
=
0
;
my
$trygroupname
;
my
$trygroupsth
=
$dbh
->
prepare
(
"SELECT id FROM groups where name = ?"
);
do
{
$trygroupname
=
"group_$emptygroupid"
;
if
(
$trycount
>
0
)
{
$trygroupname
.=
"_$trycount"
;
}
$trygroupsth
->
execute
(
$trygroupname
);
if
(
$trygroupsth
->
rows
>
0
)
{
$trycount
++
;
}
}
while
(
$trygroupsth
->
rows
>
0
);
$sth
=
$dbh
->
prepare
(
"UPDATE groups SET name = ? WHERE id = $emptygroupid"
);
$sth
->
execute
(
$trygroupname
);
print
"Group $emptygroupid had an empty name; renamed as '$trygroupname'.\n"
;
}
#
#
# Final checks...
# Final checks...
...
...
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