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
f910d39f
Commit
f910d39f
authored
May 20, 2000
by
cyeh%bluemartini.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove dependency on Mysql, use DBI instead. Patch submitted by
sstock@iconnect-inc.com, reworked slightly by cyeh@bluemartini.com to update it to the tip
parent
10c004c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
globals.pl
globals.pl
+6
-5
No files found.
globals.pl
View file @
f910d39f
...
@@ -61,7 +61,7 @@ my $db_pass = "";
...
@@ -61,7 +61,7 @@ my $db_pass = "";
do
'localconfig'
;
do
'localconfig'
;
use
Mysql
;
use
DBI
;
use
Date::
Format
;
# For time2str().
use
Date::
Format
;
# For time2str().
use
Date::
Parse
;
# For str2time().
use
Date::
Parse
;
# For str2time().
...
@@ -85,7 +85,7 @@ sub ConnectToDatabase {
...
@@ -85,7 +85,7 @@ sub ConnectToDatabase {
$name
=
Param
(
"shadowdb"
);
$name
=
Param
(
"shadowdb"
);
$::dbwritesallowed
=
0
;
$::dbwritesallowed
=
0
;
}
}
$::db
=
Mysql
->
Connect
(
$db_host
,
$name
,
$db_user
,
$db_pass
)
$::db
=
DBI
->
connect
(
"DBI:mysql:host=$db_host;database=$name"
,
$db_user
,
$db_pass
)
||
die
"Can't connect to database server."
;
||
die
"Can't connect to database server."
;
}
}
}
}
...
@@ -130,7 +130,8 @@ sub SendSQL {
...
@@ -130,7 +130,8 @@ sub SendSQL {
$str
=~
s/^LOCK TABLES/LOCK TABLES shadowlog WRITE, /i
;
$str
=~
s/^LOCK TABLES/LOCK TABLES shadowlog WRITE, /i
;
}
}
SqlLog
(
$str
);
SqlLog
(
$str
);
$::currentquery
=
$::db
->
query
(
$str
)
$::currentquery
=
$::db
->
prepare
(
$str
);
$::currentquery
->
execute
||
die
"$str: "
.
$::db
->
errmsg
;
||
die
"$str: "
.
$::db
->
errmsg
;
SqlLog
(
"Done"
);
SqlLog
(
"Done"
);
if
(
!
$dontshadow
&&
$iswrite
&&
Param
(
"shadowdb"
))
{
if
(
!
$dontshadow
&&
$iswrite
&&
Param
(
"shadowdb"
))
{
...
@@ -152,7 +153,7 @@ sub MoreSQLData {
...
@@ -152,7 +153,7 @@ sub MoreSQLData {
if
(
defined
@::fetchahead
)
{
if
(
defined
@::fetchahead
)
{
return
1
;
return
1
;
}
}
if
(
@::fetchahead
=
$::currentquery
->
fetchrow
()
)
{
if
(
@::fetchahead
=
$::currentquery
->
fetchrow
_array
)
{
return
1
;
return
1
;
}
}
return
0
;
return
0
;
...
@@ -164,7 +165,7 @@ sub FetchSQLData {
...
@@ -164,7 +165,7 @@ sub FetchSQLData {
undef
@::fetchahead
;
undef
@::fetchahead
;
return
@result
;
return
@result
;
}
}
return
$::currentquery
->
fetchrow
()
;
return
$::currentquery
->
fetchrow
_array
;
}
}
...
...
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