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
b5e1b3f1
Commit
b5e1b3f1
authored
Mar 10, 2005
by
mkanat%kerio.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 285403: LearnAboutColumns does not work on PostgreSQL
Patch By Max Kanat-Alexander <mkanat@kerio.com> r=Tomas.Kopal, a=justdave
parent
190493a5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
22 deletions
+10
-22
DB.pm
Bugzilla/DB.pm
+7
-0
globals.pl
globals.pl
+3
-22
No files found.
Bugzilla/DB.pm
View file @
b5e1b3f1
...
...
@@ -456,6 +456,13 @@ sub bz_get_index_def ($$) {
}
}
# XXX - Should be updated to use _bz_real_schema when we have that,
# if we ever need it.
sub
bz_table_columns
{
my
(
$self
,
$table
)
=
@_
;
return
$self
->
_bz_schema
->
get_table_columns
(
$table
);
}
# XXX - Needs to be made cross-db compatible
sub
bz_table_exists
($)
{
my
(
$self
,
$table
)
=
@_
;
...
...
globals.pl
View file @
b5e1b3f1
...
...
@@ -148,6 +148,8 @@ sub GetFieldID {
# XXXX - this needs to go away
sub
GenerateVersionTable
{
my
$dbh
=
Bugzilla
->
dbh
;
SendSQL
(
"SELECT versions.value, products.name "
.
"FROM versions, products "
.
"WHERE products.id = versions.product_id "
.
...
...
@@ -217,9 +219,8 @@ sub GenerateVersionTable {
$::prodmaxvotes
{
$p
}
=
$votesperuser
;
}
my
$cols
=
LearnAboutColumns
(
"bugs"
);
@::log_columns
=
$dbh
->
bz_table_columns
(
'bugs'
);
@::log_columns
=
@
{
$cols
->
{
"-list-"
}};
foreach
my
$i
(
"bug_id"
,
"creation_ts"
,
"delta_ts"
,
"lastdiffed"
)
{
my
$w
=
lsearch
(
\
@::log_columns
,
$i
);
if
(
$w
>=
0
)
{
...
...
@@ -982,26 +983,6 @@ sub GetLongDescriptionAsText {
return
(
$result
,
$anyprivate
);
}
# Fills in a hashtable with info about the columns for the given table in the
# database. The hashtable has the following entries:
# -list- the list of column names
# <name>,type the type for the given name
sub
LearnAboutColumns
{
my
(
$table
)
=
(
@_
);
my
%
a
;
SendSQL
(
"show columns from $table"
);
my
@list
=
();
my
@row
;
while
(
@row
=
FetchSQLData
())
{
my
(
$name
,
$type
)
=
(
@row
);
$a
{
"$name,type"
}
=
$type
;
push
@list
,
$name
;
}
$a
{
"-list-"
}
=
\
@list
;
return
\%
a
;
}
# Returns a list of all the legal values for a field that has a
# list of legal values, like rep_platform or resolution.
sub
get_legal_field_values
{
...
...
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