@@ -83,7 +83,7 @@ bool DBUtil::initialize()
83
83
84
84
if (dbcfg.db_passwordEncrypt )
85
85
{
86
- // 如果小于64则表示目前还是明文密码
86
+ // 如果小于64则表示目前还是明文密码
87
87
if (strlen (dbcfg.db_password ) < 64 )
88
88
{
89
89
WARNING_MSG (fmt::format (" DBUtil::createInterface: db password is not encrypted!\n please use password(rsa):\n {}\n " ,
@@ -121,19 +121,19 @@ DBInterface* DBUtil::createInterface(bool showinfo)
121
121
dbinterface = new DBInterfaceMysql (dbcfg.db_unicodeString_characterSet , dbcfg.db_unicodeString_collation );
122
122
}
123
123
124
+ if (dbinterface == NULL )
125
+ {
126
+ ERROR_MSG (" DBUtil::createInterface: can't create dbinterface!\n " );
127
+ return NULL ;
128
+ }
129
+
124
130
kbe_snprintf (dbinterface->db_type_ , MAX_BUF, " %s" , dbcfg.db_type );
125
131
dbinterface->db_port_ = dbcfg.db_port ;
126
132
kbe_snprintf (dbinterface->db_ip_ , MAX_IP, " %s" , dbcfg.db_ip );
127
133
kbe_snprintf (dbinterface->db_username_ , MAX_BUF, " %s" , dbcfg.db_username );
128
134
dbinterface->db_numConnections_ = dbcfg.db_numConnections ;
129
135
kbe_snprintf (dbinterface->db_password_ , MAX_BUF, " %s" , dbcfg.db_password );
130
136
131
- if (dbinterface == NULL )
132
- {
133
- ERROR_MSG (" DBUtil::createInterface: can't create dbinterface!\n " );
134
- return NULL ;
135
- }
136
-
137
137
if (!dbinterface->attach (DBUtil::dbname ()))
138
138
{
139
139
ERROR_MSG (fmt::format (" DBUtil::createInterface: can't attach to database!\n\t dbinterface={0:p}\n\t args={1}" ,
0 commit comments