mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
Merge
BitKeeper/triggers/post-commit: Auto merged mysql-test/r/lowercase_table2.result: Auto merged mysql-test/r/variables.result: Auto merged mysql-test/t/variables.test: Auto merged sql/mysql_priv.h: Auto merged sql/set_var.cc: Auto merged sql/set_var.h: Auto merged sql/sql_base.cc: Auto merged sql/sql_parse.cc: Auto merged tests/mysql_client_test.c: Auto merged mysql-test/r/system_mysql_db.result: Update results scripts/mysql_create_system_tables.sh: Merge fix for Bug #7617, making enum fields in grant tables case-insensitive. scripts/mysql_fix_privilege_tables.sql: Merge fix for Bug #7617, and fix additional enum/set columns. sql/sql_acl.cc: Hand-merge due to whitespace change sql/sql_lex.cc: Hand-merge bug fix.
This commit is contained in:
commit
90cc9c6bb6
25 changed files with 530 additions and 190 deletions
|
@ -19,6 +19,13 @@ BK_STATUS=$BK_STATUS$BK_COMMIT
|
|||
if [ "$BK_STATUS" = OK ]
|
||||
then
|
||||
|
||||
HAS_ACTUAL_CHANGES=`bk cset -r+ -d | grep -v "^#"`
|
||||
if [ "$HAS_ACTUAL_CHANGES" = "" ]
|
||||
then
|
||||
echo ChangeSet had no real changes, not sending emails
|
||||
exit
|
||||
fi
|
||||
|
||||
CHANGESET=`bk -R prs -r+ -h -d':P:::I:' ChangeSet`
|
||||
BUG=`bk -R prs -r+ -h -d':C:' ChangeSet | sed -ne 's/^.*[Bb][Uu][Gg] *# *\([0-9][0-9]*\).*$/\1/p'`
|
||||
WL=`bk -R prs -r+ -h -d':C:' ChangeSet | sed -ne 's/^.*[Ww][Ll] *# *\([0-9][0-9]*\).*$/ WL#\1/p'`
|
||||
|
|
|
@ -311,7 +311,7 @@ rl_generic_bind (type, keyseq, data, map)
|
|||
mapped to something, `abc' to be mapped to something else,
|
||||
and the function bound to `a' to be executed when the user
|
||||
types `abx', leaving `bx' in the input queue. */
|
||||
if (k.function /* && k.type == ISFUNC */)
|
||||
if (k.function && ((k.type == ISFUNC && k.function != rl_do_lowercase_version) || k.type == ISMACR))
|
||||
{
|
||||
map[ANYOTHERKEY] = k;
|
||||
k.function = 0;
|
||||
|
|
|
@ -91,3 +91,7 @@ sjis_bin 6109
|
|||
sjis_bin 61
|
||||
sjis_bin 6120
|
||||
drop table t1;
|
||||
SET NAMES sjis;
|
||||
SELECT HEX('佐淘 \圭') FROM DUAL;
|
||||
HEX('佐淘 \圭')
|
||||
8DB2939181408C5C
|
||||
|
|
|
@ -141,3 +141,21 @@ select * from T1;
|
|||
a b
|
||||
1 abc
|
||||
drop table T1;
|
||||
create database mysqltest_LC2;
|
||||
use mysqltest_LC2;
|
||||
create table myUC (i int);
|
||||
insert into myUC values (1),(2),(3);
|
||||
select * from myUC;
|
||||
i
|
||||
1
|
||||
2
|
||||
3
|
||||
use test;
|
||||
drop database mysqltest_LC2;
|
||||
create database mysqltest_LC2;
|
||||
use mysqltest_LC2;
|
||||
create table myUC (i int);
|
||||
select * from myUC;
|
||||
i
|
||||
use test;
|
||||
drop database mysqltest_LC2;
|
||||
|
|
23
mysql-test/r/lowercase_table_grant.result
Normal file
23
mysql-test/r/lowercase_table_grant.result
Normal file
|
@ -0,0 +1,23 @@
|
|||
use mysql;
|
||||
create database MYSQLtest;
|
||||
grant all on MySQLtest.* to mysqltest_1@localhost;
|
||||
show grants for mysqltest_1@localhost;
|
||||
Grants for mysqltest_1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
|
||||
GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
|
||||
select * from db where user = 'mysqltest_1';
|
||||
Host Db User Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Grant_priv References_priv Index_priv Alter_priv Create_tmp_table_priv Lock_tables_priv
|
||||
localhost mysqltest mysqltest_1 Y Y Y Y Y Y N Y Y Y Y Y
|
||||
update db set db = 'MYSQLtest' where db = 'mysqltest' and user = 'mysqltest_1' and host = 'localhost';
|
||||
flush privileges;
|
||||
show grants for mysqltest_1@localhost;
|
||||
Grants for mysqltest_1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
|
||||
GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
|
||||
select * from db where user = 'mysqltest_1';
|
||||
Host Db User Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Grant_priv References_priv Index_priv Alter_priv Create_tmp_table_priv Lock_tables_priv
|
||||
localhost MYSQLtest mysqltest_1 Y Y Y Y Y Y N Y Y Y Y Y
|
||||
delete from db where db = 'MYSQLtest' and user = 'mysqltest_1' and host = 'localhost';
|
||||
flush privileges;
|
||||
drop user mysqltest_1@localhost;
|
||||
drop database MYSQLtest;
|
7
mysql-test/r/skip_name_resolve.result
Normal file
7
mysql-test/r/skip_name_resolve.result
Normal file
|
@ -0,0 +1,7 @@
|
|||
GRANT ALL ON test.* TO mysqltest_1@'127.0.0.1/255.255.255.255';
|
||||
SHOW GRANTS FOR mysqltest_1@'127.0.0.1/255.255.255.255';
|
||||
Grants for mysqltest_1@127.0.0.1/255.255.255.255
|
||||
GRANT USAGE ON *.* TO 'mysqltest_1'@'127.0.0.1/255.255.255.255'
|
||||
GRANT ALL PRIVILEGES ON `test`.* TO 'mysqltest_1'@'127.0.0.1/255.255.255.255'
|
||||
REVOKE ALL ON test.* FROM mysqltest_1@'127.0.0.1/255.255.255.255';
|
||||
DROP USER mysqltest_1@'127.0.0.1/255.255.255.255';
|
|
@ -24,23 +24,23 @@ db CREATE TABLE `db` (
|
|||
`Host` char(60) collate utf8_bin NOT NULL default '',
|
||||
`Db` char(64) collate utf8_bin NOT NULL default '',
|
||||
`User` char(16) collate utf8_bin NOT NULL default '',
|
||||
`Select_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Insert_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Update_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Delete_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Create_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Drop_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Grant_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`References_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Index_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Alter_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Create_tmp_table_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Lock_tables_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Create_view_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Show_view_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Create_routine_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Alter_routine_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Execute_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Select_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Insert_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Update_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Delete_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Create_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Drop_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Grant_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`References_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Index_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Alter_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Create_tmp_table_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Lock_tables_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Create_view_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Show_view_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Create_routine_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Alter_routine_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Execute_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
PRIMARY KEY (`Host`,`Db`,`User`),
|
||||
KEY `User` (`User`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Database privileges'
|
||||
|
@ -49,20 +49,20 @@ Table Create Table
|
|||
host CREATE TABLE `host` (
|
||||
`Host` char(60) collate utf8_bin NOT NULL default '',
|
||||
`Db` char(64) collate utf8_bin NOT NULL default '',
|
||||
`Select_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Insert_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Update_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Delete_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Create_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Drop_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Grant_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`References_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Index_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Alter_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Create_tmp_table_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Lock_tables_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Create_view_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Show_view_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Select_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Insert_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Update_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Delete_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Create_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Drop_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Grant_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`References_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Index_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Alter_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Create_tmp_table_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Lock_tables_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Create_view_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Show_view_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
PRIMARY KEY (`Host`,`Db`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Host privileges; Merged with database privileges'
|
||||
show create table user;
|
||||
|
@ -71,32 +71,32 @@ user CREATE TABLE `user` (
|
|||
`Host` char(60) collate utf8_bin NOT NULL default '',
|
||||
`User` char(16) collate utf8_bin NOT NULL default '',
|
||||
`Password` char(41) collate utf8_bin NOT NULL default '',
|
||||
`Select_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Insert_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Update_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Delete_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Create_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Drop_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Reload_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Shutdown_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Process_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`File_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Grant_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`References_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Index_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Alter_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Show_db_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Super_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Create_tmp_table_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Lock_tables_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Execute_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Repl_slave_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Repl_client_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Create_view_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Show_view_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Create_routine_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Alter_routine_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`ssl_type` enum('','ANY','X509','SPECIFIED') collate utf8_bin NOT NULL default '',
|
||||
`Select_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Insert_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Update_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Delete_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Create_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Drop_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Reload_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Shutdown_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Process_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`File_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Grant_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`References_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Index_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Alter_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Show_db_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Super_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Create_tmp_table_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Lock_tables_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Execute_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Repl_slave_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Repl_client_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Create_view_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Show_view_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Create_routine_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Alter_routine_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`ssl_type` enum('','ANY','X509','SPECIFIED') character set utf8 NOT NULL default '',
|
||||
`ssl_cipher` blob NOT NULL,
|
||||
`x509_issuer` blob NOT NULL,
|
||||
`x509_subject` blob NOT NULL,
|
||||
|
@ -112,7 +112,7 @@ func CREATE TABLE `func` (
|
|||
`name` char(64) collate utf8_bin NOT NULL default '',
|
||||
`ret` tinyint(1) NOT NULL default '0',
|
||||
`dl` char(128) collate utf8_bin NOT NULL default '',
|
||||
`type` enum('function','aggregate') collate utf8_bin NOT NULL default 'function',
|
||||
`type` enum('function','aggregate') character set utf8 NOT NULL default 'function',
|
||||
PRIMARY KEY (`name`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User defined functions'
|
||||
show create table tables_priv;
|
||||
|
@ -124,8 +124,8 @@ tables_priv CREATE TABLE `tables_priv` (
|
|||
`Table_name` char(64) collate utf8_bin NOT NULL default '',
|
||||
`Grantor` char(77) collate utf8_bin NOT NULL default '',
|
||||
`Timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
|
||||
`Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') collate utf8_bin NOT NULL default '',
|
||||
`Column_priv` set('Select','Insert','Update','References') collate utf8_bin NOT NULL default '',
|
||||
`Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') character set utf8 NOT NULL default '',
|
||||
`Column_priv` set('Select','Insert','Update','References') character set utf8 NOT NULL default '',
|
||||
PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`),
|
||||
KEY `Grantor` (`Grantor`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Table privileges'
|
||||
|
@ -138,7 +138,7 @@ columns_priv CREATE TABLE `columns_priv` (
|
|||
`Table_name` char(64) collate utf8_bin NOT NULL default '',
|
||||
`Column_name` char(64) collate utf8_bin NOT NULL default '',
|
||||
`Timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
|
||||
`Column_priv` set('Select','Insert','Update','References') collate utf8_bin NOT NULL default '',
|
||||
`Column_priv` set('Select','Insert','Update','References') character set utf8 NOT NULL default '',
|
||||
PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Column privileges'
|
||||
show create table procs_priv;
|
||||
|
|
|
@ -515,3 +515,8 @@ SET GLOBAL MYISAM_DATA_POINTER_SIZE= 8;
|
|||
SHOW VARIABLES LIKE 'MYISAM_DATA_POINTER_SIZE';
|
||||
Variable_name Value
|
||||
myisam_data_pointer_size 8
|
||||
SET GLOBAL table_cache=-1;
|
||||
SHOW VARIABLES LIKE 'table_cache';
|
||||
Variable_name Value
|
||||
table_cache 1
|
||||
SET GLOBAL table_cache=DEFAULT;
|
||||
|
|
|
@ -68,3 +68,10 @@ SET collation_connection='sjis_japanese_ci';
|
|||
-- source include/ctype_filesort.inc
|
||||
SET collation_connection='sjis_bin';
|
||||
-- source include/ctype_filesort.inc
|
||||
|
||||
# Check parsing of string literals in SJIS with multibyte characters that
|
||||
# have an embedded \ in them. (Bug #8303)
|
||||
|
||||
--character_set sjis
|
||||
SET NAMES sjis;
|
||||
SELECT HEX('佐淘 \圭') FROM DUAL;
|
||||
|
|
|
@ -111,3 +111,20 @@ select * from T1;
|
|||
alter table T1 add index (a);
|
||||
select * from T1;
|
||||
drop table T1;
|
||||
|
||||
#
|
||||
# Bug #8355: Tables not dropped from table cache on drop db
|
||||
#
|
||||
create database mysqltest_LC2;
|
||||
use mysqltest_LC2;
|
||||
create table myUC (i int);
|
||||
insert into myUC values (1),(2),(3);
|
||||
select * from myUC;
|
||||
use test;
|
||||
drop database mysqltest_LC2;
|
||||
create database mysqltest_LC2;
|
||||
use mysqltest_LC2;
|
||||
create table myUC (i int);
|
||||
select * from myUC;
|
||||
use test;
|
||||
drop database mysqltest_LC2;
|
||||
|
|
1
mysql-test/t/lowercase_table_grant-master.opt
Normal file
1
mysql-test/t/lowercase_table_grant-master.opt
Normal file
|
@ -0,0 +1 @@
|
|||
--lower_case_table_names
|
25
mysql-test/t/lowercase_table_grant.test
Normal file
25
mysql-test/t/lowercase_table_grant.test
Normal file
|
@ -0,0 +1,25 @@
|
|||
# Test of grants when lower_case_table_names is on
|
||||
use mysql;
|
||||
|
||||
# mixed-case database name for testing
|
||||
create database MYSQLtest;
|
||||
|
||||
# check that database name gets forced to lowercase
|
||||
grant all on MySQLtest.* to mysqltest_1@localhost;
|
||||
show grants for mysqltest_1@localhost;
|
||||
|
||||
# now force it to mixed case, but see that it is lowercased in the acl cache
|
||||
select * from db where user = 'mysqltest_1';
|
||||
update db set db = 'MYSQLtest' where db = 'mysqltest' and user = 'mysqltest_1' and host = 'localhost';
|
||||
flush privileges;
|
||||
show grants for mysqltest_1@localhost;
|
||||
select * from db where user = 'mysqltest_1';
|
||||
|
||||
# clear out the user we created
|
||||
#
|
||||
# can't use REVOKE because of the mixed-case database name
|
||||
delete from db where db = 'MYSQLtest' and user = 'mysqltest_1' and host = 'localhost';
|
||||
flush privileges;
|
||||
drop user mysqltest_1@localhost;
|
||||
|
||||
drop database MYSQLtest;
|
1
mysql-test/t/skip_name_resolve-master.opt
Normal file
1
mysql-test/t/skip_name_resolve-master.opt
Normal file
|
@ -0,0 +1 @@
|
|||
--skip-name-resolve
|
5
mysql-test/t/skip_name_resolve.test
Normal file
5
mysql-test/t/skip_name_resolve.test
Normal file
|
@ -0,0 +1,5 @@
|
|||
# Bug #8471: IP address with mask fail when skip-name-resolve is on
|
||||
GRANT ALL ON test.* TO mysqltest_1@'127.0.0.1/255.255.255.255';
|
||||
SHOW GRANTS FOR mysqltest_1@'127.0.0.1/255.255.255.255';
|
||||
REVOKE ALL ON test.* FROM mysqltest_1@'127.0.0.1/255.255.255.255';
|
||||
DROP USER mysqltest_1@'127.0.0.1/255.255.255.255';
|
|
@ -380,3 +380,11 @@ drop table t1;
|
|||
|
||||
SET GLOBAL MYISAM_DATA_POINTER_SIZE= 8;
|
||||
SHOW VARIABLES LIKE 'MYISAM_DATA_POINTER_SIZE';
|
||||
|
||||
#
|
||||
# Bug #6958: negative arguments to integer options wrap around
|
||||
#
|
||||
|
||||
SET GLOBAL table_cache=-1;
|
||||
SHOW VARIABLES LIKE 'table_cache';
|
||||
SET GLOBAL table_cache=DEFAULT;
|
||||
|
|
|
@ -581,6 +581,23 @@ ulong escape_string_for_mysql(CHARSET_INFO *charset_info, char *to,
|
|||
from--;
|
||||
continue;
|
||||
}
|
||||
/*
|
||||
If the next character appears to begin a multi-byte character, we
|
||||
escape that first byte of that apparent multi-byte character. (The
|
||||
character just looks like a multi-byte character -- if it were actually
|
||||
a multi-byte character, it would have been passed through in the test
|
||||
above.)
|
||||
|
||||
Without this check, we can create a problem by converting an invalid
|
||||
multi-byte character into a valid one. For example, 0xbf27 is not
|
||||
a valid GBK character, but 0xbf5c is. (0x27 = ', 0x5c = \)
|
||||
*/
|
||||
if (use_mb_flag && (l= my_mbcharlen(charset_info, *from)) > 1)
|
||||
{
|
||||
*to++= '\\';
|
||||
*to++= *from;
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
switch (*from) {
|
||||
case 0: /* Must be escaped for 'mysql' */
|
||||
|
|
|
@ -55,23 +55,23 @@ then
|
|||
c_d="$c_d Host char(60) binary DEFAULT '' NOT NULL,"
|
||||
c_d="$c_d Db char(64) binary DEFAULT '' NOT NULL,"
|
||||
c_d="$c_d User char(16) binary DEFAULT '' NOT NULL,"
|
||||
c_d="$c_d Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d References_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Create_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Alter_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_d="$c_d PRIMARY KEY Host (Host,Db,User),"
|
||||
c_d="$c_d KEY User (User)"
|
||||
c_d="$c_d ) engine=MyISAM"
|
||||
|
@ -91,20 +91,20 @@ then
|
|||
c_h="$c_h CREATE TABLE host ("
|
||||
c_h="$c_h Host char(60) binary DEFAULT '' NOT NULL,"
|
||||
c_h="$c_h Db char(64) binary DEFAULT '' NOT NULL,"
|
||||
c_h="$c_h Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h References_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h PRIMARY KEY Host (Host,Db)"
|
||||
c_h="$c_h ) engine=MyISAM"
|
||||
c_h="$c_h CHARACTER SET utf8 COLLATE utf8_bin"
|
||||
|
@ -121,32 +121,32 @@ then
|
|||
c_u="$c_u Host char(60) binary DEFAULT '' NOT NULL,"
|
||||
c_u="$c_u User char(16) binary DEFAULT '' NOT NULL,"
|
||||
c_u="$c_u Password char(41) binary DEFAULT '' NOT NULL,"
|
||||
c_u="$c_u Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Process_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u File_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u References_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Super_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Create_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Alter_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL,"
|
||||
c_u="$c_u Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_u="$c_u ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL,"
|
||||
c_u="$c_u ssl_cipher BLOB NOT NULL,"
|
||||
c_u="$c_u x509_issuer BLOB NOT NULL,"
|
||||
c_u="$c_u x509_subject BLOB NOT NULL,"
|
||||
|
@ -191,7 +191,7 @@ then
|
|||
c_f="$c_f name char(64) binary DEFAULT '' NOT NULL,"
|
||||
c_f="$c_f ret tinyint(1) DEFAULT '0' NOT NULL,"
|
||||
c_f="$c_f dl char(128) DEFAULT '' NOT NULL,"
|
||||
c_f="$c_f type enum ('function','aggregate') NOT NULL,"
|
||||
c_f="$c_f type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL,"
|
||||
c_f="$c_f PRIMARY KEY (name)"
|
||||
c_f="$c_f ) engine=MyISAM"
|
||||
c_f="$c_f CHARACTER SET utf8 COLLATE utf8_bin"
|
||||
|
@ -211,8 +211,8 @@ then
|
|||
c_t="$c_t Table_name char(64) binary DEFAULT '' NOT NULL,"
|
||||
c_t="$c_t Grantor char(77) DEFAULT '' NOT NULL,"
|
||||
c_t="$c_t Timestamp timestamp(14),"
|
||||
c_t="$c_t Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL,"
|
||||
c_t="$c_t Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL,"
|
||||
c_t="$c_t Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL,"
|
||||
c_t="$c_t Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL,"
|
||||
c_t="$c_t PRIMARY KEY (Host,Db,User,Table_name),"
|
||||
c_t="$c_t KEY Grantor (Grantor)"
|
||||
c_t="$c_t ) engine=MyISAM"
|
||||
|
@ -233,7 +233,7 @@ then
|
|||
c_c="$c_c Table_name char(64) binary DEFAULT '' NOT NULL,"
|
||||
c_c="$c_c Column_name char(64) binary DEFAULT '' NOT NULL,"
|
||||
c_c="$c_c Timestamp timestamp(14),"
|
||||
c_c="$c_c Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL,"
|
||||
c_c="$c_c Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL,"
|
||||
c_c="$c_c PRIMARY KEY (Host,Db,User,Table_name,Column_name)"
|
||||
c_c="$c_c ) engine=MyISAM"
|
||||
c_c="$c_c CHARACTER SET utf8 COLLATE utf8_bin"
|
||||
|
@ -362,7 +362,7 @@ then
|
|||
|
||||
c_tz="$c_tz CREATE TABLE time_zone ("
|
||||
c_tz="$c_tz Time_zone_id int unsigned NOT NULL auto_increment,"
|
||||
c_tz="$c_tz Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,"
|
||||
c_tz="$c_tz Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||
c_tz="$c_tz PRIMARY KEY TzId (Time_zone_id)"
|
||||
c_tz="$c_tz ) engine=MyISAM CHARACTER SET utf8"
|
||||
c_tz="$c_tz comment='Time zones';"
|
||||
|
|
|
@ -9,55 +9,23 @@
|
|||
-- this sql script.
|
||||
-- On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql'
|
||||
|
||||
-- Convert all tables to UTF-8 with binary collation
|
||||
-- and reset all char columns to correct width
|
||||
ALTER TABLE user
|
||||
MODIFY Host char(60) NOT NULL default '',
|
||||
MODIFY User char(16) NOT NULL default '',
|
||||
MODIFY Password char(41) NOT NULL default '',
|
||||
ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
ALTER TABLE db
|
||||
MODIFY Host char(60) NOT NULL default '',
|
||||
MODIFY Db char(64) NOT NULL default '',
|
||||
MODIFY User char(16) NOT NULL default '',
|
||||
ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
ALTER TABLE host
|
||||
MODIFY Host char(60) NOT NULL default '',
|
||||
MODIFY Db char(64) NOT NULL default '',
|
||||
ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
ALTER TABLE func
|
||||
ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
ALTER TABLE columns_priv
|
||||
MODIFY Host char(60) NOT NULL default '',
|
||||
MODIFY Db char(64) NOT NULL default '',
|
||||
MODIFY User char(16) NOT NULL default '',
|
||||
MODIFY Table_name char(64) NOT NULL default '',
|
||||
MODIFY Column_name char(64) NOT NULL default '',
|
||||
ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
ALTER TABLE tables_priv
|
||||
MODIFY Host char(60) NOT NULL default '',
|
||||
MODIFY Db char(64) NOT NULL default '',
|
||||
MODIFY User char(16) NOT NULL default '',
|
||||
MODIFY Table_name char(64) NOT NULL default '',
|
||||
MODIFY Grantor char(77) NOT NULL default '',
|
||||
ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
ALTER TABLE procs_priv type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
ALTER TABLE user add File_priv enum('N','Y') NOT NULL;
|
||||
CREATE TABLE IF NOT EXISTS func (
|
||||
name char(64) binary DEFAULT '' NOT NULL,
|
||||
ret tinyint(1) DEFAULT '0' NOT NULL,
|
||||
dl char(128) DEFAULT '' NOT NULL,
|
||||
type enum ('function','aggregate') NOT NULL,
|
||||
type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL,
|
||||
PRIMARY KEY (name)
|
||||
) CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
|
||||
ALTER TABLE user add File_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL;
|
||||
|
||||
-- Detect whether or not we had the Grant_priv column
|
||||
SET @hadGrantPriv:=0;
|
||||
SELECT @hadGrantPriv:=1 FROM user WHERE Grant_priv LIKE '%';
|
||||
|
||||
ALTER TABLE user add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') NOT NULL,add Index_priv enum('N','Y') NOT NULL,add Alter_priv enum('N','Y') NOT NULL;
|
||||
ALTER TABLE host add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') NOT NULL,add Index_priv enum('N','Y') NOT NULL,add Alter_priv enum('N','Y') NOT NULL;
|
||||
ALTER TABLE db add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') NOT NULL,add Index_priv enum('N','Y') NOT NULL,add Alter_priv enum('N','Y') NOT NULL;
|
||||
ALTER TABLE user add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL;
|
||||
ALTER TABLE host add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL;
|
||||
ALTER TABLE db add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL;
|
||||
|
||||
--- Fix privileges for old tables
|
||||
UPDATE user SET Grant_priv=File_priv,References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0;
|
||||
|
@ -69,7 +37,7 @@ UPDATE host SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Cr
|
|||
-- Adding columns needed by GRANT .. REQUIRE (openssl)"
|
||||
|
||||
ALTER TABLE user
|
||||
ADD ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL,
|
||||
ADD ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci NOT NULL,
|
||||
ADD ssl_cipher BLOB NOT NULL,
|
||||
ADD x509_issuer BLOB NOT NULL,
|
||||
ADD x509_subject BLOB NOT NULL;
|
||||
|
@ -86,10 +54,17 @@ CREATE TABLE IF NOT EXISTS tables_priv (
|
|||
Table_name char(64) binary DEFAULT '' NOT NULL,
|
||||
Grantor char(77) DEFAULT '' NOT NULL,
|
||||
Timestamp timestamp(14),
|
||||
Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL,
|
||||
Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL,
|
||||
Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
|
||||
Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
|
||||
PRIMARY KEY (Host,Db,User,Table_name)
|
||||
) CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
-- Fix collation of set fields
|
||||
ALTER TABLE tables_priv
|
||||
modify Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
|
||||
modify Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL;
|
||||
ALTER TABLE procs_priv type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
ALTER TABLE procs_priv
|
||||
modify Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS columns_priv (
|
||||
Host char(60) DEFAULT '' NOT NULL,
|
||||
|
@ -98,22 +73,25 @@ CREATE TABLE IF NOT EXISTS columns_priv (
|
|||
Table_name char(64) DEFAULT '' NOT NULL,
|
||||
Column_name char(64) DEFAULT '' NOT NULL,
|
||||
Timestamp timestamp(14),
|
||||
Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL,
|
||||
Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
|
||||
PRIMARY KEY (Host,Db,User,Table_name,Column_name)
|
||||
) CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
-- Fix collation of set fields
|
||||
ALTER TABLE columns_priv
|
||||
MODIFY Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL;
|
||||
|
||||
|
||||
--
|
||||
-- Name change of Type -> Column_priv from MySQL 3.22.12
|
||||
--
|
||||
|
||||
ALTER TABLE columns_priv change Type Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL;
|
||||
ALTER TABLE columns_priv change Type Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL;
|
||||
|
||||
--
|
||||
-- Add the new 'type' column to the func table.
|
||||
--
|
||||
|
||||
ALTER TABLE func add type enum ('function','aggregate') NOT NULL;
|
||||
ALTER TABLE func add type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL;
|
||||
|
||||
--
|
||||
-- Change the user,db and host tables to MySQL 4.0 format
|
||||
|
@ -124,13 +102,13 @@ SET @hadShowDbPriv:=0;
|
|||
SELECT @hadShowDbPriv:=1 FROM user WHERE Show_db_priv LIKE '%';
|
||||
|
||||
ALTER TABLE user
|
||||
ADD Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Alter_priv,
|
||||
ADD Super_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Show_db_priv,
|
||||
ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Super_priv,
|
||||
ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_tmp_table_priv,
|
||||
ADD Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Lock_tables_priv,
|
||||
ADD Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Execute_priv,
|
||||
ADD Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Repl_slave_priv;
|
||||
ADD Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_priv,
|
||||
ADD Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_db_priv,
|
||||
ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Super_priv,
|
||||
ADD Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_tmp_table_priv,
|
||||
ADD Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv,
|
||||
ADD Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Execute_priv,
|
||||
ADD Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Repl_slave_priv;
|
||||
|
||||
-- Convert privileges so that users have similar privileges as before
|
||||
|
||||
|
@ -151,11 +129,11 @@ ADD max_connections int(11) unsigned NOT NULL DEFAULT 0 AFTER max_updates;
|
|||
--
|
||||
|
||||
ALTER TABLE db
|
||||
ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL;
|
||||
ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
ADD Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL;
|
||||
ALTER TABLE host
|
||||
ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL;
|
||||
ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
ADD Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL;
|
||||
|
||||
alter table user change max_questions max_questions int(11) unsigned DEFAULT 0 NOT NULL;
|
||||
alter table tables_priv add KEY Grantor (Grantor);
|
||||
|
@ -167,6 +145,95 @@ alter table func comment='User defined functions';
|
|||
alter table tables_priv comment='Table privileges';
|
||||
alter table columns_priv comment='Column privileges';
|
||||
|
||||
-- Convert all tables to UTF-8 with binary collation
|
||||
-- and reset all char columns to correct width
|
||||
ALTER TABLE user
|
||||
MODIFY Host char(60) NOT NULL default '',
|
||||
MODIFY User char(16) NOT NULL default '',
|
||||
MODIFY Password char(41) NOT NULL default '',
|
||||
ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
ALTER TABLE user
|
||||
MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL;
|
||||
ALTER TABLE db
|
||||
MODIFY Host char(60) NOT NULL default '',
|
||||
MODIFY Db char(64) NOT NULL default '',
|
||||
MODIFY User char(16) NOT NULL default '',
|
||||
ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
ALTER TABLE db
|
||||
MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL;
|
||||
ALTER TABLE host
|
||||
MODIFY Host char(60) NOT NULL default '',
|
||||
MODIFY Db char(64) NOT NULL default '',
|
||||
ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
ALTER TABLE host
|
||||
MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL;
|
||||
ALTER TABLE func
|
||||
ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
ALTER TABLE func
|
||||
MODIFY type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL;
|
||||
ALTER TABLE columns_priv
|
||||
MODIFY Host char(60) NOT NULL default '',
|
||||
MODIFY Db char(64) NOT NULL default '',
|
||||
MODIFY User char(16) NOT NULL default '',
|
||||
MODIFY Table_name char(64) NOT NULL default '',
|
||||
MODIFY Column_name char(64) NOT NULL default '',
|
||||
ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
ALTER TABLE columns_priv
|
||||
MODIFY Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL;
|
||||
ALTER TABLE tables_priv
|
||||
MODIFY Host char(60) NOT NULL default '',
|
||||
MODIFY Db char(64) NOT NULL default '',
|
||||
MODIFY User char(16) NOT NULL default '',
|
||||
MODIFY Table_name char(64) NOT NULL default '',
|
||||
MODIFY Grantor char(77) NOT NULL default '',
|
||||
ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
ALTER TABLE tables_priv
|
||||
MODIFY Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
|
||||
MODIFY Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL;
|
||||
|
||||
#
|
||||
# Detect whether we had Create_view_priv
|
||||
#
|
||||
|
@ -233,7 +300,7 @@ User char(16) binary DEFAULT '' NOT NULL,
|
|||
Routine_name char(64) binary DEFAULT '' NOT NULL,
|
||||
Grantor char(77) DEFAULT '' NOT NULL,
|
||||
Timestamp timestamp(14),
|
||||
Proc_priv set('Execute','Alter Routine','Grant') DEFAULT '' NOT NULL,
|
||||
Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
|
||||
PRIMARY KEY (Host,Db,User,Routine_name),
|
||||
KEY Grantor (Grantor)
|
||||
) CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges';
|
||||
|
@ -282,9 +349,12 @@ PRIMARY KEY Name (Name)
|
|||
|
||||
CREATE TABLE IF NOT EXISTS time_zone (
|
||||
Time_zone_id int unsigned NOT NULL auto_increment,
|
||||
Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,
|
||||
Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||
PRIMARY KEY TzId (Time_zone_id)
|
||||
) CHARACTER SET utf8 comment='Time zones';
|
||||
-- Make enum field case-insensitive
|
||||
ALTER TABLE time_zone
|
||||
MODIFY Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS time_zone_transition (
|
||||
Time_zone_id int unsigned NOT NULL,
|
||||
|
|
|
@ -867,7 +867,7 @@ bool close_temporary_table(THD *thd, const char *db, const char *table_name);
|
|||
void close_temporary(TABLE *table, bool delete_table=1);
|
||||
bool rename_temporary_table(THD* thd, TABLE *table, const char *new_db,
|
||||
const char *table_name);
|
||||
void remove_db_from_cache(const my_string db);
|
||||
void remove_db_from_cache(const char *db);
|
||||
void flush_tables();
|
||||
bool remove_table_from_cache(THD *thd, const char *db, const char *table,
|
||||
bool return_if_owned_by_thd=0);
|
||||
|
|
|
@ -1309,6 +1309,12 @@ static void fix_server_id(THD *thd, enum_var_type type)
|
|||
server_id_supplied = 1;
|
||||
}
|
||||
|
||||
bool sys_var_long_ptr::check(THD *thd, set_var *var)
|
||||
{
|
||||
longlong v= var->value->val_int();
|
||||
var->save_result.ulonglong_value= v < 0 ? 0 : v;
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool sys_var_long_ptr::update(THD *thd, set_var *var)
|
||||
{
|
||||
|
|
|
@ -87,6 +87,7 @@ public:
|
|||
sys_var_long_ptr(const char *name_arg, ulong *value_ptr,
|
||||
sys_after_update_func func)
|
||||
:sys_var(name_arg,func), value(value_ptr) {}
|
||||
bool check(THD *thd, set_var *var);
|
||||
bool update(THD *thd, set_var *var);
|
||||
void set_default(THD *thd, enum_var_type type);
|
||||
SHOW_TYPE type() { return SHOW_LONG; }
|
||||
|
|
|
@ -141,6 +141,8 @@ my_bool acl_init(THD *org_thd, bool dont_read_acl_tables)
|
|||
MYSQL_LOCK *lock;
|
||||
my_bool return_val=1;
|
||||
bool check_no_resolve= specialflag & SPECIAL_NO_RESOLVE;
|
||||
char tmp_name[NAME_LEN+1];
|
||||
|
||||
DBUG_ENTER("acl_init");
|
||||
|
||||
if (!acl_cache)
|
||||
|
@ -199,6 +201,24 @@ my_bool acl_init(THD *org_thd, bool dont_read_acl_tables)
|
|||
ACL_HOST host;
|
||||
update_hostname(&host.host,get_field(&mem, table->field[0]));
|
||||
host.db= get_field(&mem, table->field[1]);
|
||||
if (lower_case_table_names)
|
||||
{
|
||||
/*
|
||||
We make a temporary copy of the database, force it to lower case,
|
||||
and then copy it back over the original name. We can't just update
|
||||
the host.db pointer, because tmp_name is allocated on the stack.
|
||||
*/
|
||||
(void)strmov(tmp_name, host.db);
|
||||
my_casedn_str(files_charset_info, tmp_name);
|
||||
if (strcmp(host.db, tmp_name) != 0)
|
||||
{
|
||||
sql_print_warning("'host' entry '%s|%s' had database in mixed "
|
||||
"case that has been forced to lowercase because "
|
||||
"lower_case_table_names is set.",
|
||||
host.host.hostname, host.db);
|
||||
(void)strmov(host.db, tmp_name);
|
||||
}
|
||||
}
|
||||
host.access= get_access(table,2);
|
||||
host.access= fix_rights_for_db(host.access);
|
||||
host.sort= get_sort(2,host.host.hostname,host.db);
|
||||
|
@ -409,6 +429,24 @@ my_bool acl_init(THD *org_thd, bool dont_read_acl_tables)
|
|||
}
|
||||
db.access=get_access(table,3);
|
||||
db.access=fix_rights_for_db(db.access);
|
||||
if (lower_case_table_names)
|
||||
{
|
||||
/*
|
||||
We make a temporary copy of the database, force it to lower case,
|
||||
and then copy it back over the original name. We can't just update
|
||||
the db.db pointer, because tmp_name is allocated on the stack.
|
||||
*/
|
||||
(void)strmov(tmp_name, db.db);
|
||||
my_casedn_str(files_charset_info, tmp_name);
|
||||
if (strcmp(db.db, tmp_name) != 0)
|
||||
{
|
||||
sql_print_warning("'db' entry '%s %s@%s' had database in mixed "
|
||||
"case that has been forced to lowercase because "
|
||||
"lower_case_table_names is set.",
|
||||
db.db, db.user, db.host.hostname, db.host.hostname);
|
||||
(void)strmov(db.db, tmp_name);
|
||||
}
|
||||
}
|
||||
db.sort=get_sort(3,db.host.hostname,db.db,db.user);
|
||||
#ifndef TO_BE_REMOVED
|
||||
if (table->s->fields <= 9)
|
||||
|
@ -1447,7 +1485,7 @@ bool hostname_requires_resolving(const char *hostname)
|
|||
return FALSE;
|
||||
for (; (cur=*hostname); hostname++)
|
||||
{
|
||||
if ((cur != '%') && (cur != '_') && (cur != '.') &&
|
||||
if ((cur != '%') && (cur != '_') && (cur != '.') && (cur != '/') &&
|
||||
((cur < '0') || (cur > '9')))
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -3586,8 +3586,18 @@ static void mysql_rm_tmp_tables(void)
|
|||
** and afterwards delete those marked unused.
|
||||
*/
|
||||
|
||||
void remove_db_from_cache(const my_string db)
|
||||
void remove_db_from_cache(const char *db)
|
||||
{
|
||||
char name_buff[NAME_LEN+1];
|
||||
if (db && lower_case_table_names)
|
||||
{
|
||||
/*
|
||||
convert database to lower case for comparision.
|
||||
*/
|
||||
strmake(name_buff, db, sizeof(name_buff)-1);
|
||||
my_casedn_str(files_charset_info, name_buff);
|
||||
db= name_buff;
|
||||
}
|
||||
for (uint idx=0 ; idx < open_cache.records ; idx++)
|
||||
{
|
||||
TABLE *table=(TABLE*) hash_element(&open_cache,idx);
|
||||
|
|
|
@ -296,7 +296,18 @@ static char *get_text(LEX *lex)
|
|||
found_escape=1;
|
||||
if (lex->ptr == lex->end_of_query)
|
||||
return 0;
|
||||
yySkip();
|
||||
#ifdef USE_MB
|
||||
int l;
|
||||
if (use_mb(cs) &&
|
||||
(l = my_ismbchar(cs,
|
||||
(const char *)lex->ptr,
|
||||
(const char *)lex->end_of_query))) {
|
||||
lex->ptr += l;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
yySkip();
|
||||
}
|
||||
else if (c == sep)
|
||||
{
|
||||
|
@ -324,6 +335,10 @@ static char *get_text(LEX *lex)
|
|||
else
|
||||
{
|
||||
uchar *to;
|
||||
|
||||
/* Re-use found_escape for tracking state of escapes */
|
||||
found_escape= 0;
|
||||
|
||||
for (to=start ; str != end ; str++)
|
||||
{
|
||||
#ifdef USE_MB
|
||||
|
@ -337,7 +352,8 @@ static char *get_text(LEX *lex)
|
|||
continue;
|
||||
}
|
||||
#endif
|
||||
if (!(lex->thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) &&
|
||||
if (!found_escape &&
|
||||
!(lex->thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) &&
|
||||
*str == '\\' && str+1 != end)
|
||||
{
|
||||
switch(*++str) {
|
||||
|
@ -364,15 +380,20 @@ static char *get_text(LEX *lex)
|
|||
*to++= '\\'; // remember prefix for wildcard
|
||||
/* Fall through */
|
||||
default:
|
||||
*to++ = *str;
|
||||
found_escape= 1;
|
||||
str--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (*str == sep)
|
||||
*to++= *str++; // Two ' or "
|
||||
else if (!found_escape && *str == sep)
|
||||
{
|
||||
found_escape= 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
*to++ = *str;
|
||||
|
||||
found_escape= 0;
|
||||
}
|
||||
}
|
||||
*to=0;
|
||||
lex->yytoklen=(uint) (to-start);
|
||||
|
|
|
@ -12584,6 +12584,54 @@ static void test_bug7990()
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
Test mysql_real_escape_string() with gbk charset
|
||||
|
||||
The important part is that 0x27 (') is the second-byte in a invalid
|
||||
two-byte GBK character here. But 0xbf5c is a valid GBK character, so
|
||||
it needs to be escaped as 0x5cbf27
|
||||
*/
|
||||
#define TEST_BUG8378_IN "\xef\xbb\xbf\x27\xbf\x10"
|
||||
#define TEST_BUG8378_OUT "\xef\xbb\x5c\xbf\x5c\x27\x5c\xbf\x10"
|
||||
|
||||
static void test_bug8378()
|
||||
{
|
||||
MYSQL *lmysql;
|
||||
char out[9]; /* strlen(TEST_BUG8378)*2+1 */
|
||||
int len;
|
||||
|
||||
myheader("test_bug8378");
|
||||
|
||||
if (!opt_silent)
|
||||
fprintf(stdout, "\n Establishing a test connection ...");
|
||||
if (!(lmysql= mysql_init(NULL)))
|
||||
{
|
||||
myerror("mysql_init() failed");
|
||||
exit(1);
|
||||
}
|
||||
if (mysql_options(lmysql, MYSQL_SET_CHARSET_NAME, "gbk"))
|
||||
{
|
||||
myerror("mysql_options() failed");
|
||||
exit(1);
|
||||
}
|
||||
if (!(mysql_real_connect(lmysql, opt_host, opt_user,
|
||||
opt_password, current_db, opt_port,
|
||||
opt_unix_socket, 0)))
|
||||
{
|
||||
myerror("connection failed");
|
||||
exit(1);
|
||||
}
|
||||
if (!opt_silent)
|
||||
fprintf(stdout, " OK");
|
||||
|
||||
len= mysql_real_escape_string(lmysql, out, TEST_BUG8378_IN, 4);
|
||||
|
||||
/* No escaping should have actually happened. */
|
||||
DIE_UNLESS(memcmp(out, TEST_BUG8378_OUT, len) == 0);
|
||||
|
||||
mysql_close(lmysql);
|
||||
}
|
||||
|
||||
/*
|
||||
Read and parse arguments and MySQL options from my.cnf
|
||||
*/
|
||||
|
@ -12804,6 +12852,7 @@ static struct my_tests_st my_tests[]= {
|
|||
{ "test_truncation_option", test_truncation_option },
|
||||
{ "test_bug8330", test_bug8330 },
|
||||
{ "test_bug7990", test_bug7990 },
|
||||
{ "test_bug8378", test_bug8378 },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue