summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/DB/Schema.pm2
-rw-r--r--Bugzilla/Series.pm11
-rwxr-xr-xchecksetup.pl8
3 files changed, 15 insertions, 6 deletions
diff --git a/Bugzilla/DB/Schema.pm b/Bugzilla/DB/Schema.pm
index 5f8fe4869..ccbef9834 100644
--- a/Bugzilla/DB/Schema.pm
+++ b/Bugzilla/DB/Schema.pm
@@ -873,7 +873,7 @@ use constant ABSTRACT_SCHEMA => {
frequency => {TYPE => 'INT2', NOTNULL => 1},
last_viewed => {TYPE => 'DATETIME'},
query => {TYPE => 'MEDIUMTEXT', NOTNULL => 1},
- public => {TYPE => 'BOOLEAN', NOTNULL => 1,
+ is_public => {TYPE => 'BOOLEAN', NOTNULL => 1,
DEFAULT => 'FALSE'},
],
INDEXES => [
diff --git a/Bugzilla/Series.pm b/Bugzilla/Series.pm
index db4e1f9f9..521357488 100644
--- a/Bugzilla/Series.pm
+++ b/Bugzilla/Series.pm
@@ -18,6 +18,7 @@
# Rights Reserved.
#
# Contributor(s): Gervase Markham <gerv@gerv.net>
+# Lance Larsh <lance.larsh@oracle.com>
use strict;
use lib ".";
@@ -90,7 +91,7 @@ sub initFromDatabase {
my $dbh = Bugzilla->dbh;
my @series = $dbh->selectrow_array("SELECT series.series_id, cc1.name, " .
"cc2.name, series.name, series.creator, series.frequency, " .
- "series.query, series.public " .
+ "series.query, series.is_public " .
"FROM series " .
"LEFT JOIN series_categories AS cc1 " .
" ON series.category = cc1.id " .
@@ -103,11 +104,11 @@ sub initFromDatabase {
" AND ugm.user_id = " . Bugzilla->user->id .
" AND isbless = 0 " .
"WHERE series.series_id = $series_id AND " .
- "(public = 1 OR creator = " . Bugzilla->user->id . " OR " .
+ "(is_public = 1 OR creator = " . Bugzilla->user->id . " OR " .
"(ugm.group_id IS NOT NULL)) " .
$dbh->sql_group_by('series.series_id', 'cc1.name, cc2.name, ' .
'series.name, series.creator, series.frequency, ' .
- 'series.query, series.public'));
+ 'series.query, series.is_public'));
if (@series) {
$self->initFromParameters(@series);
@@ -189,7 +190,7 @@ sub writeToDatabase {
my $dbh = Bugzilla->dbh;
$dbh->do("UPDATE series SET " .
"category = ?, subcategory = ?," .
- "name = ?, frequency = ?, public = ? " .
+ "name = ?, frequency = ?, is_public = ? " .
"WHERE series_id = ?", undef,
$category_id, $subcategory_id, $self->{'name'},
$self->{'frequency'}, $self->{'public'},
@@ -198,7 +199,7 @@ sub writeToDatabase {
else {
# Insert the new series into the series table
$dbh->do("INSERT INTO series (creator, category, subcategory, " .
- "name, frequency, query, public) VALUES " .
+ "name, frequency, query, is_public) VALUES " .
"($self->{'creator'}, " .
"$category_id, $subcategory_id, " .
$dbh->quote($self->{'name'}) . ", $self->{'frequency'}," .
diff --git a/checksetup.pl b/checksetup.pl
index 1ad8124cf..2c7eca5c1 100755
--- a/checksetup.pl
+++ b/checksetup.pl
@@ -4031,6 +4031,14 @@ if ($dbh->bz_column_info("attachments", "thedata")) {
$dbh->bz_drop_column("attachments", "thedata");
}
+# 2005-09-15 lance.larsh@oracle.com Bug 308717
+if ($dbh->bz_column_info("series", "public")) {
+ # PUBLIC is a reserved word in Oracle, so renaming the column
+ # PUBLIC in table SERIES avoids having to quote the column name
+ # in every query against that table
+ $dbh->bz_rename_column('series', 'public', 'is_public');
+}
+
# If you had to change the --TABLE-- definition in any way, then add your
# differential change code *** A B O V E *** this comment.