mirror of
https://github.com/MariaDB/server.git
synced 2025-04-13 02:35:32 +02:00
Merge branch '10.1' into bb-10.1-serg
This commit is contained in:
commit
d8e127f9f4
7 changed files with 136 additions and 21 deletions
mysql-test
r
suite
scripts
sql
|
@ -1727,7 +1727,7 @@ Table Create Table
|
|||
SPATIAL_REF_SYS CREATE TEMPORARY TABLE `SPATIAL_REF_SYS` (
|
||||
`SRID` smallint(5) NOT NULL DEFAULT '0',
|
||||
`AUTH_NAME` varchar(512) NOT NULL DEFAULT '',
|
||||
`AUTH_SRID` smallint(5) NOT NULL DEFAULT '0',
|
||||
`AUTH_SRID` int(5) NOT NULL DEFAULT '0',
|
||||
`SRTEXT` varchar(2048) NOT NULL DEFAULT ''
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=utf8
|
||||
create table t1(g GEOMETRY, pt POINT);
|
||||
|
|
|
@ -326,7 +326,7 @@ def information_schema SESSION_STATUS VARIABLE_VALUE 2 NO varchar 2048 6144 NUL
|
|||
def information_schema SESSION_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
def information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NO varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) select
|
||||
def information_schema SPATIAL_REF_SYS AUTH_NAME 2 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select
|
||||
def information_schema SPATIAL_REF_SYS AUTH_SRID 3 0 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) select
|
||||
def information_schema SPATIAL_REF_SYS AUTH_SRID 3 0 NO int NULL NULL 10 0 NULL NULL NULL int(5) select
|
||||
def information_schema SPATIAL_REF_SYS SRID 1 0 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) select
|
||||
def information_schema SPATIAL_REF_SYS SRTEXT 4 NO varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) select
|
||||
def information_schema STATISTICS CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select
|
||||
|
@ -855,7 +855,7 @@ NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datet
|
|||
3.0000 information_schema SESSION_VARIABLES VARIABLE_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
|
||||
NULL information_schema SPATIAL_REF_SYS SRID smallint NULL NULL NULL NULL smallint(5)
|
||||
3.0000 information_schema SPATIAL_REF_SYS AUTH_NAME varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
NULL information_schema SPATIAL_REF_SYS AUTH_SRID smallint NULL NULL NULL NULL smallint(5)
|
||||
NULL information_schema SPATIAL_REF_SYS AUTH_SRID int NULL NULL NULL NULL int(5)
|
||||
3.0000 information_schema SPATIAL_REF_SYS SRTEXT varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
|
||||
3.0000 information_schema STATISTICS TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema STATISTICS TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
|
|
57
mysql-test/suite/roles/show_grants_replicated.result
Normal file
57
mysql-test/suite/roles/show_grants_replicated.result
Normal file
|
@ -0,0 +1,57 @@
|
|||
include/master-slave.inc
|
||||
[connection master]
|
||||
create user u1;
|
||||
create role r1;
|
||||
#
|
||||
# On master SHOW GRANTS work both for the user and the role:
|
||||
show grants for u1;
|
||||
Grants for u1@%
|
||||
GRANT USAGE ON *.* TO 'u1'@'%'
|
||||
show grants for r1;
|
||||
Grants for r1
|
||||
GRANT USAGE ON *.* TO 'r1'
|
||||
#
|
||||
connection slave;
|
||||
#
|
||||
# The role has been replicated,
|
||||
# it's visible in mysql.user and I_S:
|
||||
#
|
||||
select user, host, is_role from mysql.user where user in ('u1', 'r1');
|
||||
user host is_role
|
||||
r1 Y
|
||||
u1 % N
|
||||
select * from information_schema.applicable_roles;
|
||||
GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
|
||||
root@localhost r1 YES NO
|
||||
#
|
||||
# Check show grants for the new user.
|
||||
show grants for u1;
|
||||
Grants for u1@%
|
||||
GRANT USAGE ON *.* TO 'u1'@'%'
|
||||
#
|
||||
# Check show grants for the new role.
|
||||
show grants for r1;
|
||||
Grants for r1
|
||||
GRANT USAGE ON *.* TO 'r1'
|
||||
#
|
||||
# Check if flushing privileges preserves the state.
|
||||
flush privileges;
|
||||
show grants for r1;
|
||||
Grants for r1
|
||||
GRANT USAGE ON *.* TO 'r1'
|
||||
#
|
||||
# Check SHOW GRANTS after setting the role.
|
||||
set role r1;
|
||||
show grants;
|
||||
Grants for root@localhost
|
||||
GRANT r1 TO 'root'@'localhost' WITH ADMIN OPTION
|
||||
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
||||
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
|
||||
GRANT USAGE ON *.* TO 'r1'
|
||||
show grants for r1;
|
||||
Grants for r1
|
||||
GRANT USAGE ON *.* TO 'r1'
|
||||
connection master;
|
||||
drop role r1;
|
||||
drop user u1;
|
||||
include/rpl_end.inc
|
41
mysql-test/suite/roles/show_grants_replicated.test
Normal file
41
mysql-test/suite/roles/show_grants_replicated.test
Normal file
|
@ -0,0 +1,41 @@
|
|||
--source include/master-slave.inc
|
||||
|
||||
--enable_connect_log
|
||||
|
||||
create user u1;
|
||||
create role r1;
|
||||
--echo #
|
||||
--echo # On master SHOW GRANTS work both for the user and the role:
|
||||
show grants for u1;
|
||||
show grants for r1;
|
||||
--echo #
|
||||
--sync_slave_with_master
|
||||
--echo #
|
||||
--echo # The role has been replicated,
|
||||
--echo # it's visible in mysql.user and I_S:
|
||||
--echo #
|
||||
--sorted_result
|
||||
select user, host, is_role from mysql.user where user in ('u1', 'r1');
|
||||
select * from information_schema.applicable_roles;
|
||||
--echo #
|
||||
--echo # Check show grants for the new user.
|
||||
show grants for u1;
|
||||
--echo #
|
||||
--echo # Check show grants for the new role.
|
||||
show grants for r1;
|
||||
--echo #
|
||||
--echo # Check if flushing privileges preserves the state.
|
||||
flush privileges;
|
||||
show grants for r1;
|
||||
--echo #
|
||||
--echo # Check SHOW GRANTS after setting the role.
|
||||
set role r1;
|
||||
show grants;
|
||||
show grants for r1;
|
||||
|
||||
connection master;
|
||||
drop role r1;
|
||||
drop user u1;
|
||||
--disable_connect_log
|
||||
--sync_slave_with_master
|
||||
--source include/rpl_end.inc
|
|
@ -191,9 +191,9 @@ get_transfer()
|
|||
exit 2
|
||||
fi
|
||||
|
||||
if [[ $encrypt -eq 2 || $encrypt -eq 3 ]] && ! socat -V | grep -q WITH_OPENSSL;then
|
||||
wsrep_log_info "NOTE: socat is not openssl enabled, falling back to plain transfer"
|
||||
encrypt=-1
|
||||
if [[ $encrypt -eq 2 || $encrypt -eq 3 ]] && ! socat -V | grep -q "WITH_OPENSSL 1";then
|
||||
wsrep_log_error "Encryption requested, but socat is not OpenSSL enabled (encrypt=$encrypt)"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [[ $encrypt -eq 2 ]];then
|
||||
|
@ -204,25 +204,35 @@ get_transfer()
|
|||
fi
|
||||
stagemsg+="-OpenSSL-Encrypted-2"
|
||||
if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then
|
||||
wsrep_log_info "Decrypting with PEM $tpem, CA: $tcert"
|
||||
tcmd="socat -u openssl-listen:${TSST_PORT},reuseaddr,cert=$tpem,cafile=${tcert}${sockopt} stdio"
|
||||
wsrep_log_info "Decrypting with cert=${tpem}, cafile=${tcert}"
|
||||
tcmd="socat -u openssl-listen:${TSST_PORT},reuseaddr,cert=${tpem},cafile=${tcert}${sockopt} stdio"
|
||||
else
|
||||
wsrep_log_info "Encrypting with PEM $tpem, CA: $tcert"
|
||||
tcmd="socat -u stdio openssl-connect:${REMOTEIP}:${TSST_PORT},cert=$tpem,cafile=${tcert}${sockopt}"
|
||||
wsrep_log_info "Encrypting with cert=${tpem}, cafile=${tcert}"
|
||||
tcmd="socat -u stdio openssl-connect:${REMOTEIP}:${TSST_PORT},cert=${tpem},cafile=${tcert}${sockopt}"
|
||||
fi
|
||||
elif [[ $encrypt -eq 3 ]];then
|
||||
wsrep_log_info "Using openssl based encryption with socat: with key and crt"
|
||||
if [[ -z $tpem || -z $tkey ]];then
|
||||
if [[ -z $tpem || -z $tkey ]];then
|
||||
wsrep_log_error "Both certificate and key files required"
|
||||
exit 22
|
||||
fi
|
||||
stagemsg+="-OpenSSL-Encrypted-3"
|
||||
if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then
|
||||
wsrep_log_info "Decrypting with certificate $tpem, key $tkey"
|
||||
tcmd="socat -u openssl-listen:${TSST_PORT},reuseaddr,cert=$tpem,key=${tkey},verify=0${sockopt} stdio"
|
||||
if [[ -z $tcert ]];then
|
||||
wsrep_log_info "Decrypting with cert=${tpem}, key=${tkey}, verify=0"
|
||||
tcmd="socat -u openssl-listen:${TSST_PORT},reuseaddr,cert=${tpem},key=${tkey},verify=0${sockopt} stdio"
|
||||
else
|
||||
wsrep_log_info "Decrypting with cert=${tpem}, key=${tkey}, cafile=${tcert}"
|
||||
tcmd="socat -u openssl-listen:${TSST_PORT},reuseaddr,cert=${tpem},key=${tkey},cafile=${tcert}${sockopt} stdio"
|
||||
fi
|
||||
else
|
||||
wsrep_log_info "Encrypting with certificate $tpem, key $tkey"
|
||||
tcmd="socat -u stdio openssl-connect:${REMOTEIP}:${TSST_PORT},cert=$tpem,key=${tkey},verify=0${sockopt}"
|
||||
if [[ -z $tcert ]];then
|
||||
wsrep_log_info "Encrypting with cert=${tpem}, key=${tkey}, verify=0"
|
||||
tcmd="socat -u stdio openssl-connect:${REMOTEIP}:${TSST_PORT},cert=${tpem},key=${tkey},verify=0${sockopt}"
|
||||
else
|
||||
wsrep_log_info "Encrypting with cert=${tpem}, key=${tkey}, cafile=${tcert}"
|
||||
tcmd="socat -u stdio openssl-connect:${REMOTEIP}:${TSST_PORT},cert=${tpem},key=${tkey},cafile=${tcert}${sockopt}"
|
||||
fi
|
||||
fi
|
||||
|
||||
else
|
||||
|
|
|
@ -344,14 +344,21 @@ static int fill_spatial_ref_sys(THD *thd, TABLE_LIST *tables, COND *cond)
|
|||
table->field[0]->store(-1, FALSE); /*SRID*/
|
||||
table->field[1]->store(STRING_WITH_LEN("Not defined"), cs); /*AUTH_NAME*/
|
||||
table->field[2]->store(-1, FALSE); /*AUTH_SRID*/
|
||||
table->field[3]->store(STRING_WITH_LEN(""), cs);/*SRTEXT*/
|
||||
table->field[3]->store(STRING_WITH_LEN(
|
||||
"LOCAL_CS[\"Spatial reference wasn't specified\","
|
||||
"LOCAL_DATUM[\"Unknown\",0]," "UNIT[\"m\",1.0]," "AXIS[\"x\",EAST],"
|
||||
"AXIS[\"y\",NORTH]]"), cs);/*SRTEXT*/
|
||||
if (schema_table_store_record(thd, table))
|
||||
goto exit;
|
||||
|
||||
table->field[0]->store(0, TRUE); /*SRID*/
|
||||
table->field[1]->store(STRING_WITH_LEN("Cartesian plane"), cs); /*AUTH_NAME*/
|
||||
table->field[2]->store(0, TRUE); /*AUTH_SRID*/
|
||||
table->field[3]->store(STRING_WITH_LEN(""), cs);/*SRTEXT*/
|
||||
table->field[1]->store(STRING_WITH_LEN("EPSG"), cs); /*AUTH_NAME*/
|
||||
table->field[2]->store(404000, TRUE); /*AUTH_SRID*/
|
||||
table->field[3]->store(STRING_WITH_LEN(
|
||||
"LOCAL_CS[\"Wildcard 2D cartesian plane in metric unit\","
|
||||
"LOCAL_DATUM[\"Unknown\",0]," "UNIT[\"m\",1.0],"
|
||||
"AXIS[\"x\",EAST]," "AXIS[\"y\",NORTH],"
|
||||
"AUTHORITY[\"EPSG\",\"404000\"]]"), cs);/*SRTEXT*/
|
||||
if (schema_table_store_record(thd, table))
|
||||
goto exit;
|
||||
|
||||
|
@ -8978,7 +8985,7 @@ ST_FIELD_INFO spatial_ref_sys_fields_info[]=
|
|||
{
|
||||
{"SRID", 5, MYSQL_TYPE_SHORT, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"AUTH_NAME", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"AUTH_SRID", 5, MYSQL_TYPE_SHORT, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"AUTH_SRID", 5, MYSQL_TYPE_LONG, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"SRTEXT", 2048, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, 0}
|
||||
};
|
||||
|
|
|
@ -12696,7 +12696,7 @@ show_param:
|
|||
MYSQL_YYABORT;
|
||||
Lex->grant_user->user= current_user_and_current_role;
|
||||
}
|
||||
| GRANTS FOR_SYM user_or_role
|
||||
| GRANTS FOR_SYM user_or_role clear_privileges
|
||||
{
|
||||
LEX *lex=Lex;
|
||||
lex->sql_command= SQLCOM_SHOW_GRANTS;
|
||||
|
|
Loading…
Add table
Reference in a new issue