Skip to content
Snippets Groups Projects
Commit 284243ce authored by terry%mozilla.org's avatar terry%mozilla.org
Browse files

Work with older versions of mysqltcl.

parent 20031238
No related merge requests found
......@@ -37,7 +37,8 @@ set userdomain somedomain
# User and password for access to the MySQL bonsai database
# use empty string ("") for password if you want to access the database
# without using a password (not recommended)
# without using a password (not recommended). If you are using an older
# version of mysqltcl, you may also need to set the username to be "".
set mysqluser nobody
set mysqlpassword ""
......
......@@ -73,11 +73,16 @@ if {[info exists tcl_version] && $tcl_version >= 8.0} {
proc NOTDEF {foo} {
}
proc ConnectToDatabase {} {
global mysqlhandle mysqluser mysqlpassword
if {![info exists mysqlhandle]} {
if { $mysqlpassword == "" } {
set mysqlhandle [mysqlconnect -user "$mysqluser"]
if { $mysqluser == "" } {
set mysqlhandle [mysqlconnect]
} else {
set mysqlhandle [mysqlconnect -user "$mysqluser"]
}
} else {
set mysqlhandle [mysqlconnect -user "$mysqluser" -password "$mysqlpassword"]
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment