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
b6ad4942
Commit
b6ad4942
authored
Sep 02, 2007
by
olav%bkor.dhs.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 394627: bzdbcopy.pl should remove column quoting
Patch By Olav Vitters <olav@bkor.dhs.org> r=mkanat, a=mkanat
parent
d65cf5cc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
bzdbcopy.pl
contrib/bzdbcopy.pl
+6
-0
No files found.
contrib/bzdbcopy.pl
View file @
b6ad4942
...
@@ -53,6 +53,7 @@ print "Connecting to the '" . TARGET_DB_NAME . "' target database on "
...
@@ -53,6 +53,7 @@ print "Connecting to the '" . TARGET_DB_NAME . "' target database on "
.
TARGET_DB_TYPE
.
"...\n"
;
.
TARGET_DB_TYPE
.
"...\n"
;
my
$target_db
=
Bugzilla::DB::
_connect
(
TARGET_DB_TYPE
,
'localhost'
,
my
$target_db
=
Bugzilla::DB::
_connect
(
TARGET_DB_TYPE
,
'localhost'
,
TARGET_DB_NAME
,
undef
,
undef
,
TARGET_DB_USER
,
TARGET_DB_PASSWORD
);
TARGET_DB_NAME
,
undef
,
undef
,
TARGET_DB_USER
,
TARGET_DB_PASSWORD
);
my
$ident_char
=
$target_db
->
get_info
(
29
);
# SQL_IDENTIFIER_QUOTE_CHAR
# We use the table list from the target DB, because if somebody
# We use the table list from the target DB, because if somebody
# has customized their source DB, we still want the script to work,
# has customized their source DB, we still want the script to work,
...
@@ -74,6 +75,11 @@ foreach my $table (@table_list) {
...
@@ -74,6 +75,11 @@ foreach my $table (@table_list) {
print
"Reading data from the source '$table' table on "
print
"Reading data from the source '$table' table on "
.
SOURCE_DB_TYPE
.
"...\n"
;
.
SOURCE_DB_TYPE
.
"...\n"
;
my
@table_columns
=
$target_db
->
bz_table_columns_real
(
$table
);
my
@table_columns
=
$target_db
->
bz_table_columns_real
(
$table
);
# The column names could be quoted using the quote identifier char
# Remove these chars as different databases use different quote chars
@table_columns
=
map
{
s/^\Q$ident_char\E?(.*?)\Q$ident_char\E?$/$1/
;
$_
}
@table_columns
;
my
$select_query
=
"SELECT "
.
join
(
','
,
@table_columns
)
.
" FROM $table"
;
my
$select_query
=
"SELECT "
.
join
(
','
,
@table_columns
)
.
" FROM $table"
;
my
$data_in
=
$source_db
->
selectall_arrayref
(
$select_query
);
my
$data_in
=
$source_db
->
selectall_arrayref
(
$select_query
);
...
...
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