Commit 036cd173 authored by unknown's avatar unknown

Merge mysql.com:/home/jimw/my/mysql-4.1-clean

into  mysql.com:/home/jimw/my/mysql-5.0-clean


mysql-test/r/query_cache.result:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
mysql-test/r/grant.result:
  Merge
mysql-test/t/grant.test:
  Merge
parents 711464a1 8218398c
......@@ -586,3 +586,8 @@ use test;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM dummy@localhost;
DROP USER dummy@localhost;
DROP DATABASE mysqltest;
use mysql;
insert into tables_priv values ('','test_db','mysqltest_1','test_table','test_grantor',CURRENT_TIMESTAMP,'Select','Select');
flush privileges;
delete from tables_priv where host = '' and user = 'mysqltest_1';
flush privileges;
......@@ -470,3 +470,12 @@ use test;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM dummy@localhost;
DROP USER dummy@localhost;
DROP DATABASE mysqltest;
#
# Bug #11330: Entry in tables_priv with host = '' causes crash
#
connection default;
use mysql;
insert into tables_priv values ('','test_db','mysqltest_1','test_table','test_grantor',CURRENT_TIMESTAMP,'Select','Select');
flush privileges;
delete from tables_priv where host = '' and user = 'mysqltest_1';
flush privileges;
......@@ -60,11 +60,19 @@ fix_path ()
get_full_path ()
{
case $1 in
/*) echo "$1";;
./*) tmp=`pwd`/$1; echo $tmp | sed -e 's;/\./;/;' ;;
*) which $1 ;;
esac
file=$1
# if the file is a symlink, try to resolve it
if [ -h $file ];
then
file=`ls -l $file | awk '{ print $NF }'`
fi
case $file in
/*) echo "$file";;
*/*) tmp=`pwd`/$file; echo $tmp | sed -e 's;/\./;/;' ;;
*) which $file ;;
esac
}
me=`get_full_path $0`
......
......@@ -2035,7 +2035,8 @@ GRANT_TABLE::GRANT_TABLE(TABLE *form, TABLE *col_privs)
{
uint key_prefix_len;
KEY_PART_INFO *key_part= col_privs->key_info->key_part;
col_privs->field[0]->store(host.hostname,(uint) strlen(host.hostname),
col_privs->field[0]->store(host.hostname,
host.hostname ? (uint) strlen(host.hostname) : 0,
system_charset_info);
col_privs->field[1]->store(db,(uint) strlen(db), system_charset_info);
col_privs->field[2]->store(user,(uint) strlen(user), system_charset_info);
......
......@@ -1550,14 +1550,12 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name,
/* Check if table exists */
if (create_info->options & HA_LEX_CREATE_TMP_TABLE)
{
char tmp_table_name[tmp_file_prefix_length+22+22+22+3];
my_snprintf(tmp_table_name, sizeof(tmp_table_name), "%s%lx_%lx_%x",
tmp_file_prefix, current_pid, thd->thread_id,
thd->tmp_table++);
my_snprintf(path, sizeof(path), "%s%s%lx_%lx_%x%s",
mysql_tmpdir, tmp_file_prefix, current_pid, thd->thread_id,
thd->tmp_table++, reg_ext);
if (lower_case_table_names)
my_casedn_str(files_charset_info, tmp_table_name);
my_casedn_str(files_charset_info, path);
create_info->table_options|=HA_CREATE_DELAY_KEY_WRITE;
build_table_path(path, sizeof(path), db, tmp_table_name, reg_ext);
}
else
build_table_path(path, sizeof(path), db, alias, reg_ext);
......
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