mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into mysql.com:/home/jimw/my/mysql-5.0-clean
This commit is contained in:
@ -586,3 +586,8 @@ use test;
|
|||||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM dummy@localhost;
|
REVOKE ALL PRIVILEGES, GRANT OPTION FROM dummy@localhost;
|
||||||
DROP USER dummy@localhost;
|
DROP USER dummy@localhost;
|
||||||
DROP DATABASE mysqltest;
|
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;
|
REVOKE ALL PRIVILEGES, GRANT OPTION FROM dummy@localhost;
|
||||||
DROP USER dummy@localhost;
|
DROP USER dummy@localhost;
|
||||||
DROP DATABASE mysqltest;
|
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 ()
|
get_full_path ()
|
||||||
{
|
{
|
||||||
case $1 in
|
file=$1
|
||||||
/*) echo "$1";;
|
|
||||||
./*) tmp=`pwd`/$1; echo $tmp | sed -e 's;/\./;/;' ;;
|
# if the file is a symlink, try to resolve it
|
||||||
*) which $1 ;;
|
if [ -h $file ];
|
||||||
esac
|
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`
|
me=`get_full_path $0`
|
||||||
|
@ -2035,7 +2035,8 @@ GRANT_TABLE::GRANT_TABLE(TABLE *form, TABLE *col_privs)
|
|||||||
{
|
{
|
||||||
uint key_prefix_len;
|
uint key_prefix_len;
|
||||||
KEY_PART_INFO *key_part= col_privs->key_info->key_part;
|
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);
|
system_charset_info);
|
||||||
col_privs->field[1]->store(db,(uint) strlen(db), 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);
|
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 */
|
/* Check if table exists */
|
||||||
if (create_info->options & HA_LEX_CREATE_TMP_TABLE)
|
if (create_info->options & HA_LEX_CREATE_TMP_TABLE)
|
||||||
{
|
{
|
||||||
char tmp_table_name[tmp_file_prefix_length+22+22+22+3];
|
my_snprintf(path, sizeof(path), "%s%s%lx_%lx_%x%s",
|
||||||
my_snprintf(tmp_table_name, sizeof(tmp_table_name), "%s%lx_%lx_%x",
|
mysql_tmpdir, tmp_file_prefix, current_pid, thd->thread_id,
|
||||||
tmp_file_prefix, current_pid, thd->thread_id,
|
thd->tmp_table++, reg_ext);
|
||||||
thd->tmp_table++);
|
|
||||||
if (lower_case_table_names)
|
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;
|
create_info->table_options|=HA_CREATE_DELAY_KEY_WRITE;
|
||||||
build_table_path(path, sizeof(path), db, tmp_table_name, reg_ext);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
build_table_path(path, sizeof(path), db, alias, reg_ext);
|
build_table_path(path, sizeof(path), db, alias, reg_ext);
|
||||||
|
Reference in New Issue
Block a user