Commit 0cc2e140 authored by msvensson@pilot.blaudden's avatar msvensson@pilot.blaudden

Merge pilot.blaudden:/home/msvensson/mysql/bug20166/my50-bug20166

into  pilot.blaudden:/home/msvensson/mysql/bug20166/my51-bug20166
parents 104995f2 6caa0a23
......@@ -903,6 +903,14 @@ select @@&;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '&' at line 1
select @@@;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@' at line 1
select @@hostname;
@@hostname
#
set @@hostname= "anothername";
ERROR HY000: Variable 'hostname' is a read only variable
show variables like 'hostname';
Variable_name Value
hostname #
End of 5.0 tests
set global binlog_cache_size =@my_binlog_cache_size;
set global connect_timeout =@my_connect_timeout;
......
......@@ -689,6 +689,17 @@ select @@&;
--error ER_PARSE_ERROR
select @@@;
#
# Bug#20166 mysql-test-run.pl does not test system privilege tables creation
#
# Don't actually output, since it depends on the system
--replace_column 1 #
select @@hostname;
--error 1238
set @@hostname= "anothername";
--replace_column 2 #
show variables like 'hostname';
--echo End of 5.0 tests
# This is at the very after the versioned tests, since it involves doing
......
......@@ -2297,7 +2297,7 @@ const char *MYSQL_LOG::generate_name(const char *log_name,
TODO: The following should be using fn_format(); We just need to
first change fn_format() to cut the file name if it's too long.
*/
strmake(buff, glob_hostname, FN_REFLEN - 5);
strmake(buff, pidfile_name, FN_REFLEN - 5);
strmov(fn_ext(buff), suffix);
return (const char *)buff;
}
......
......@@ -2677,9 +2677,15 @@ static int init_common_variables(const char *conf_file_name, int argc,
*/
mysql_bin_log.init_pthread_objects();
if (gethostname(glob_hostname,sizeof(glob_hostname)-4) < 0)
strmov(glob_hostname,"mysql");
strmake(pidfile_name, glob_hostname, sizeof(pidfile_name)-5);
if (gethostname(glob_hostname,sizeof(glob_hostname)) < 0)
{
strmake(glob_hostname, STRING_WITH_LEN("localhost"));
sql_print_warning("gethostname failed, using '%s' as hostname",
glob_hostname);
strmake(pidfile_name, STRING_WITH_LEN("mysql"));
}
else
strmake(pidfile_name, glob_hostname, sizeof(pidfile_name)-5);
strmov(fn_ext(pidfile_name),".pid"); // Add proper extension
/*
......
......@@ -655,6 +655,10 @@ sys_var_thd_time_zone sys_time_zone("time_zone");
/* Read only variables */
/* Global read-only variable containing hostname */
sys_var_const_str sys_hostname("hostname", glob_hostname);
sys_var_have_variable sys_have_compress("have_compress", &have_compress);
sys_var_have_variable sys_have_crypt("have_crypt", &have_crypt);
sys_var_have_variable sys_have_csv_db("have_csv", &have_csv_db);
......@@ -779,6 +783,7 @@ SHOW_VAR init_vars[]= {
{sys_var_general_log.name, (char*) &opt_log, SHOW_MY_BOOL},
{sys_var_general_log_path.name, (char*) &sys_var_general_log_path, SHOW_SYS},
{sys_group_concat_max_len.name, (char*) &sys_group_concat_max_len, SHOW_SYS},
{sys_hostname.name, (char*) &sys_hostname, SHOW_SYS},
{sys_have_compress.name, (char*) &have_compress, SHOW_HAVE},
{sys_have_crypt.name, (char*) &have_crypt, SHOW_HAVE},
{sys_have_csv_db.name, (char*) &have_csv_db, SHOW_HAVE},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment