mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-11 00:53:53 +02:00
2017-12-01 Fred Gleason <fredg@paravelsystems.com>
* Added a 'Charset=' directive to the [MySQL] section of rd.conf(5). * Added an 'Collation=' directive to the [MySQL] section of rd.conf(5).
This commit is contained in:
2
lib/rd.h
2
lib/rd.h
@@ -65,6 +65,8 @@
|
||||
#define DEFAULT_MYSQL_DRIVER "QMYSQL3"
|
||||
#define DEFAULT_MYSQL_HEARTBEAT_INTERVAL 360
|
||||
#define DEFAULT_MYSQL_ENGINE "default"
|
||||
#define DEFAULT_MYSQL_CHARSET "latin1"
|
||||
#define DEFAULT_MYSQL_COLLATION "latin1_swedish_ci"
|
||||
#define MYSQL_BUILTIN_DATABASE "mysql"
|
||||
#define POSTGRESQL_BUILTIN_DATABASE "template1"
|
||||
|
||||
|
@@ -187,6 +187,18 @@ QString RDConfig::mysqlEngine() const
|
||||
}
|
||||
|
||||
|
||||
QString RDConfig::mysqlCharset() const
|
||||
{
|
||||
return conf_mysql_charset;
|
||||
}
|
||||
|
||||
|
||||
QString RDConfig::mysqlCollation() const
|
||||
{
|
||||
return conf_mysql_collation;
|
||||
}
|
||||
|
||||
|
||||
QString RDConfig::createTablePostfix() const
|
||||
{
|
||||
return conf_create_table_postfix;
|
||||
@@ -571,12 +583,13 @@ void RDConfig::load()
|
||||
DEFAULT_MYSQL_HEARTBEAT_INTERVAL);
|
||||
conf_mysql_engine=
|
||||
profile->stringValue("mySQL","Engine",DEFAULT_MYSQL_ENGINE);
|
||||
if(conf_mysql_engine.lower()=="default") {
|
||||
conf_create_table_postfix="";
|
||||
}
|
||||
else {
|
||||
conf_create_table_postfix=QString(" engine ")+conf_mysql_engine;
|
||||
}
|
||||
conf_mysql_charset=
|
||||
profile->stringValue("mySQL","Charset",DEFAULT_MYSQL_CHARSET);
|
||||
conf_mysql_collation=
|
||||
profile->stringValue("mySQL","Collation",DEFAULT_MYSQL_COLLATION);
|
||||
conf_create_table_postfix=QString(" engine ")+conf_mysql_engine+" "+
|
||||
"character set "+conf_mysql_charset+" "+
|
||||
"collate "+conf_mysql_collation;
|
||||
|
||||
facility=profile->stringValue("Logs","Facility",DEFAULT_LOG_FACILITY).lower();
|
||||
if(facility=="syslog") {
|
||||
@@ -683,6 +696,8 @@ void RDConfig::clear()
|
||||
conf_mysql_driver="";
|
||||
conf_mysql_heartbeat_interval=DEFAULT_MYSQL_HEARTBEAT_INTERVAL;
|
||||
conf_mysql_engine=DEFAULT_MYSQL_ENGINE;
|
||||
conf_mysql_charset=DEFAULT_MYSQL_CHARSET;
|
||||
conf_mysql_collation=DEFAULT_MYSQL_COLLATION;
|
||||
conf_create_table_postfix="";
|
||||
conf_log_facility=RDConfig::LogSyslog;
|
||||
conf_log_directory="";
|
||||
|
@@ -61,6 +61,8 @@ class RDConfig
|
||||
QString mysqlDriver() const;
|
||||
int mysqlHeartbeatInterval() const;
|
||||
QString mysqlEngine() const;
|
||||
QString mysqlCharset() const;
|
||||
QString mysqlCollation() const;
|
||||
QString createTablePostfix() const;
|
||||
RDConfig::LogFacility logFacility() const;
|
||||
QString logDirectory() const;
|
||||
@@ -127,6 +129,8 @@ class RDConfig
|
||||
QString conf_mysql_password;
|
||||
QString conf_mysql_driver;
|
||||
QString conf_mysql_engine;
|
||||
QString conf_mysql_charset;
|
||||
QString conf_mysql_collation;
|
||||
QString conf_create_table_postfix;
|
||||
int conf_mysql_heartbeat_interval;
|
||||
RDConfig::LogFacility conf_log_facility;
|
||||
|
Reference in New Issue
Block a user