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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Ivlev
bugzilla
Commits
ea946eb2
You need to sign in or sign up before continuing.
Commit
ea946eb2
authored
Aug 29, 2011
by
Max Kanat-Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 629529: Make SQLite installs able to use jobqueue.pl
r=glob, a=mkanat
parent
8e5e72fc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
0 deletions
+58
-0
Sqlite.pm
Bugzilla/DB/Schema/Sqlite.pm
+17
-0
Sqlite.pm
Bugzilla/DB/Sqlite.pm
+41
-0
No files found.
Bugzilla/DB/Schema/Sqlite.pm
View file @
ea946eb2
...
...
@@ -162,6 +162,23 @@ sub get_create_database_sql {
die
"Reached an unreachable point"
;
}
sub
_get_create_table_ddl
{
my
$self
=
shift
;
my
(
$table
)
=
@_
;
my
$ddl
=
$self
->
SUPER::
_get_create_table_ddl
(
@_
);
# TheSchwartz uses its own driver to access its tables, meaning
# that it doesn't understand "COLLATE bugzilla" and in fact
# SQLite throws an error when TheSchwartz tries to access its
# own tables, if COLLATE bugzilla is on them. We don't have
# to fix this elsewhere currently, because we only create
# TheSchwartz's tables, we never modify them.
if
(
$table
=~
/^ts_/
)
{
$ddl
=~
s/ COLLATE bugzilla//g
;
}
return
$ddl
;
}
sub
get_type_ddl
{
my
$self
=
shift
;
my
$def
=
dclone
(
$_
[
0
]);
...
...
Bugzilla/DB/Sqlite.pm
View file @
ea946eb2
...
...
@@ -25,6 +25,7 @@ use base qw(Bugzilla::DB);
use
Bugzilla::
Constants
;
use
Bugzilla::
Error
;
use
Bugzilla::Install::
Util
qw(install_string)
;
use
DateTime
;
use
POSIX
();
...
...
@@ -246,6 +247,46 @@ sub sql_string_until {
# bz_ methods #
###############
sub
bz_setup_database
{
my
$self
=
shift
;
$self
->
SUPER::
bz_setup_database
(
@_
);
# If we created TheSchwartz tables with COLLATE bugzilla (during the
# 4.1.x development series) re-create them without it.
my
@tables
=
$self
->
bz_table_list
();
my
@ts_tables
=
grep
{
/^ts_/
}
@tables
;
my
$drop_ok
;
foreach
my
$table
(
@ts_tables
)
{
my
$create_table
=
$self
->
_bz_real_schema
->
_sqlite_create_table
(
$table
);
if
(
$create_table
=~
/COLLATE bugzilla/
)
{
if
(
!
$drop_ok
)
{
_sqlite_jobqueue_drop_message
();
$drop_ok
=
1
;
}
$self
->
bz_drop_table
(
$table
);
$self
->
bz_add_table
(
$table
);
}
}
}
sub
_sqlite_jobqueue_drop_message
{
# This is not translated because this situation will only happen if
# you are updating from a 4.1.x development version of Bugzilla using
# SQLite, and we don't want to maintain this string in strings.txt.pl
# forever for just this one uncommon circumstance.
print
<<END;
WARNING: We have to re-create all the database tables used by jobqueue.pl.
If there are any pending jobs in the database (that is, emails that
haven't been sent), they will be deleted.
END
unless
(
Bugzilla
->
installation_answers
->
{
NO_PAUSE
})
{
print
install_string
(
'enter_or_ctrl_c'
);
getc
;
}
}
# XXX This needs to be implemented.
sub
bz_explain
{
}
...
...
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