Roxen.git / server / base_server / roxenloader.pike

version» Context lines:

Roxen.git/server/base_server/roxenloader.pike:1652:   protected string dist_version;   protected string dist_os;   protected int roxen_is_cms;   protected string roxen_product_name;   protected string roxen_product_code;      protected string mysql_product_name;   protected string mysql_version;      protected constant mysql_good_versions = ({ "5.5.*", "5.6.*" }); - protected constant mariadb_good_versions = ({ "5.5.*", "10.0.*", "10.1.*" }); + protected constant mariadb_good_versions = ({ "5.5.*", "10.0.*", "10.1.*", "10.3.*" });   protected constant mysql_maybe_versions = ({ "5.*", "6.*" });   protected constant mariadb_maybe_versions = ({ "5.*", "10.*", "11.*" }); -  + protected constant mysql_bad_versions = ({}); + protected constant mariadb_bad_versions = ({ "10.2.*" });      string roxen_version()   //! @appears roxen_version   {    // Note: roxen_release is usually "-cvs" at the time this is compiled.    return roxen_ver+"."+roxen_build+(release||roxen_release);   }      //! @appears roxen_path   //!
Roxen.git/server/base_server/roxenloader.pike:2298:      string query_mysql_socket()   {   #ifdef __NT__    return replace(combine_path(query_mysql_data_dir(), "pipe"), ":", "_");   #else    return combine_path(query_mysql_data_dir(), "socket");   #endif   }    + string query_mysql_config_file(string|void datadir) + { +  datadir = datadir || query_mysql_data_dir(); +  return datadir + "/my.cfg"; + } +    string my_mysql_path;      string query_configuration_dir()   {    return configuration_dir;   }      protected mapping(string:array(SQLTimeout)) sql_free_list = ([ ]);   protected Thread.Local sql_reuse_in_thread = Thread.Local();   mapping(string:int) sql_active_list = ([ ]);
Roxen.git/server/base_server/roxenloader.pike:2970:    return;       Stdio.File devnull   #ifndef __NT__    = Stdio.File( "/dev/null", "w" )   #endif    ;       report_debug("Checking MySQL tables with %O...\n", args*" ");    mixed err = catch { -  Process.Process(({ myisamchk }) + -  args + sort(files), +  Process.Process(({ myisamchk, +  "--defaults-file=" + query_mysql_config_file(datadir), +  }) + args + sort(files),    ([    "stdin":devnull,    "stdout":errlog,    "stderr":errlog    ]))->wait();    };    if(err)    werror(describe_backtrace(err));   }   
Roxen.git/server/base_server/roxenloader.pike:3027:    version = version[sizeof (mysql_location->mysqld)..];    if (sscanf(lower_case(version), "%*s ver %[0-9.]%s",    mysql_version, trailer) < 2) {    version_fatal_error =    sprintf("Failed to parse MySQL version string - got %q from:\n"    "%O\n\n", version, orig_version);   #ifndef YES_I_KNOW_WHAT_I_AM_DOING    } else {    array(string) good_versions = mysql_good_versions;    array(string) maybe_versions = mysql_maybe_versions; +  array(string) bad_versions = mysql_bad_versions;    mysql_product_name = "MySQL";    if (has_prefix(trailer, "-mariadb")) {    mysql_product_name = "MariaDB";    good_versions = mariadb_good_versions;    maybe_versions = mariadb_maybe_versions; -  +  bad_versions = mariadb_bad_versions;    }    // Determine if version is acceptable    if (has_value(glob(good_versions[*], mysql_version), 1)) {    // Everything is fine    } else if (has_value(glob(maybe_versions[*], mysql_version), 1)) { -  +  if (has_value(glob(bad_versions[*], mysql_version), 1)) { +  version_fatal_error = +  sprintf("This version of %s (%s) is known to not work " +  "with Roxen:\n\n" +  " %s\n", +  mysql_product_name, mysql_version, orig_version); +  } else {    // Don't allow unless user gives special define   #ifdef ALLOW_UNSUPPORTED_MYSQL    report_debug("\nWARNING: Forcing Roxen to run with unsupported "    "%s version (%s).\n",    mysql_product_name, mysql_version);   #else    version_fatal_error =    sprintf("This version of %s (%s) is not officially supported "    "with Roxen.\n"    "If you want to override this restriction, use this "    "option:\n\n"    " -DALLOW_UNSUPPORTED_MYSQL\n\n",    mysql_product_name, mysql_version);   #endif -  +  }    } else {    // Version not recognized (maybe too old or too new) so bail out    version_fatal_error =    sprintf("%s version %s detected:\n\n"    " %s\n", mysql_product_name, mysql_version, orig_version);    }   #endif   #ifdef RUN_SELF_TEST    if (version_fatal_error) {    report_debug ("\n%s"
Roxen.git/server/base_server/roxenloader.pike:3158:    "--general-log-file=/dev/stdout",    "--general-log",    });    } else {    // NB: Deprecated in MySQL 5.1.29 and removed in MySQL 5.6.1.    args += ({"--log=/dev/stdout"});    }    }       // Create the configuration file. -  int force = !file_stat( datadir+"/my.cfg" ); -  string cfg_file = (Stdio.read_bytes(datadir + "/my.cfg") || +  int force = !file_stat( query_mysql_config_file(datadir) ); +  string cfg_file = (Stdio.read_bytes(query_mysql_config_file(datadir)) ||    "[mysqld]\n"    "max_allowed_packet = 128M\n"    "net_buffer_length = 8K\n"    "query-cache-type = 2\n"    "query-cache-size = 32M\n"    "default-storage-engine = MYISAM\n"    "innodb-data-file-path=ibdata1:10M:autoextend\n"   #ifndef UNSAFE_MYSQL    "local-infile = 0\n"   #endif
Roxen.git/server/base_server/roxenloader.pike:3184:    (uid ? "user = " + uid : "") + "\n");       string normalized_cfg_file = replace(cfg_file, "_", "-");       // Check if we need to update the contents of the config file.    //    // NB: set-variable became optional after MySQL 4.0.2,    // and was deprecated in MySQL 5.5.    if (has_value(normalized_cfg_file, "set-variable=") ||    has_value(normalized_cfg_file, "set-variable =")) { -  report_debug("Repairing pre Mysql 4.0.2 syntax in %s/my.cfg.\n", datadir); +  report_debug("Repairing pre Mysql 4.0.2 syntax in %s.\n", +  query_mysql_config_file(datadir));    cfg_file = replace(cfg_file,    ({ "set-variable=",    "set-variable = ", "set-variable =",    "set_variable=",    "set_variable = ", "set_variable =",    }),    ({ "", "", "", "", "", "",    }));    force = 1;    }       if ((normalized_mysql_version > "005.000.") &&    !has_value(normalized_cfg_file, "innodb-data-file-path")) {    // It seems the defaults for this variable have changed    // from "ibdata1:10M:autoextend" to "ibdata1:12M:autoextend".    // For some reason InnoDB doesn't always auto-detect correctly.    // cf [bug 7264].    array a = cfg_file/"[mysqld]";    if (sizeof(a) > 1) { -  report_debug("Adding innodb-data-file-path to %s/my.cfg.\n", -  datadir); +  report_debug("Adding innodb-data-file-path to %s.\n", +  query_mysql_config_file(datadir));    int initial = 10; // 10 MB -- The traditional setting.    int bytes = Stdio.file_size(datadir + "/ibdata1");    if (bytes) {    // ibdata1 grows in increments of 8 MB.    // Assumes that the initial default size won't grow to 18 MB.    initial = ((bytes / (1024 * 1024)) % 8) + 8;    if (initial < 10) initial += 8;    }    report_debug("%O\n",    "ibdata1:" + initial + "M:autoextend");    a[1] = "\n"    "innodb-data-file-path=ibdata1:" + initial + "M:autoextend" + a[1];    cfg_file = a * "[mysqld]";    force = 1;    } else { -  report_warning("Mysql configuration file %s/my.cfg lacks\n" +  report_warning("Mysql configuration file %s lacks\n"    "InnoDB data file path entry, "    "and automatic repairer failed.\n", -  datadir); +  query_mysql_config_file(datadir));    }    }       if ((normalized_mysql_version > "005.002.") &&    !has_value(normalized_cfg_file, "character-set-server")) {    // The default character set was changed sometime    // during the MySQL 5.x series. We need to set    // the default to latin1 to avoid breaking old    // internal tables (like eg roxen/dbs) where fields    // otherwise shrink to a third.    array a = cfg_file/"[mysqld]";    if (sizeof(a) > 1) { -  report_debug("Adding default character set entries to %s/my.cfg.\n", -  datadir); +  report_debug("Adding default character set entries to %s.\n", +  query_mysql_config_file(datadir));    a[1] = "\n"    "character-set-server=latin1\n"    "collation-server=latin1_swedish_ci" + a[1];    cfg_file = a * "[mysqld]";    force = 1;    } else { -  report_warning("Mysql configuration file %s/my.cfg lacks\n" +  report_warning("Mysql configuration file %s lacks\n"    "character set entry, and automatic repairer failed.\n", -  datadir); +  query_mysql_config_file(datadir));    }    }       if ((normalized_mysql_version > "005.005.") &&    !has_value(normalized_cfg_file, "default-storage-engine")) {    // The default storage engine was changed to InnoDB in MySQL 5.5.    // We need to set the default to MyISAM to avoid breaking old code    // due to different parameter limits (eg key lengths).    array a = cfg_file/"[mysqld]";    if (sizeof(a) > 1) { -  report_debug("Adding default storage engine entry to %s/my.cfg.\n", -  datadir); +  report_debug("Adding default storage engine entry to %s.\n", +  query_mysql_config_file(datadir));    a[1] = "\n"    "default-storage-engine = MYISAM" + a[1];    cfg_file = a * "[mysqld]";    force = 1;    } else { -  report_warning("Mysql configuration file %s/my.cfg lacks\n" +  report_warning("Mysql configuration file %s lacks\n"    "storage engine entry, and automatic repairer failed.\n", -  datadir); +  query_mysql_config_file(datadir));    }    }       if ((normalized_mysql_version > "010.002.003") &&    !has_value(normalized_cfg_file, "sql_mode")) {    // Since MariaDB 10.2.4, SQL_MODE is by default set to NO_AUTO_CREATE_USER,    // NO_ENGINE_SUBSTITUTION, STRICT_TRANS_TABLES, ERROR_FOR_DIVISION_BY_ZERO.    // In earlier versions of MariaDB 10.2, and since MariaDB 10.1.7, SQL_MODE    // is by default set to NO_ENGINE_SUBSTITUTION, NO_AUTO_CREATE_USER.    // For earlier versions of MariaDB 10.1, and MariaDB 10.0 and before, no
Roxen.git/server/base_server/roxenloader.pike:3306:    "sql_mode entry, and automatic repairer failed.\n",    datadir);    }    }      #ifdef __NT__    cfg_file = replace(cfg_file, ({ "\r\n", "\n" }), ({ "\r\n", "\r\n" }));   #endif /* __NT__ */       if(force) -  catch(Stdio.write_file(datadir+"/my.cfg", cfg_file)); +  catch(Stdio.write_file(query_mysql_config_file(datadir), cfg_file));       // Keep mysql's logging to stdout and stderr when running in --once    // mode, to get it more synchronous.    Stdio.File errlog = !once_mode && Stdio.File( err_log, "wct" );       string mysql_table_check =    Stdio.read_file(combine_path(query_configuration_dir(),    "_mysql_table_check"));    if(!mysql_table_check)    mysql_table_check = "--force --silent --fast\n"