Bug 308717: Column name "PUBLIC" in SERIES table is an Oracle reserved word
Patch By Lance Larsh <lance.larsh@oracle.com> r=mkanat, a=justdave git-svn-id: svn://10.0.0.236/trunk@180858 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
ebe8153cd1
commit
09b4a44990
@ -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 => [
|
||||
|
||||
@ -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'}," .
|
||||
|
||||
@ -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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user