summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-12-22 15:19:51 +0100
committerSergei Golubchik <serg@mariadb.org>2015-12-22 15:19:51 +0100
commitd8e127f9f4eb634be2b84de3384709060db70b43 (patch)
tree94c523e008841950174c8308ce9d6812d4328c02
parent02781512605e311e1ae45fedb154555ed3ed2cba (diff)
parentd58a770201acae10bdae7e840db043368cb48ba0 (diff)
downloadmariadb-git-d8e127f9f4eb634be2b84de3384709060db70b43.tar.gz
Merge branch '10.1' into bb-10.1-serg
-rw-r--r--mysql-test/r/gis.result2
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is.result4
-rw-r--r--mysql-test/suite/roles/show_grants_replicated.result57
-rw-r--r--mysql-test/suite/roles/show_grants_replicated.test41
-rw-r--r--scripts/wsrep_sst_xtrabackup-v2.sh34
-rw-r--r--sql/sql_show.cc17
-rw-r--r--sql/sql_yacc.yy2
7 files changed, 136 insertions, 21 deletions
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index 69a14b20787..33080509114 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -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);
diff --git a/mysql-test/suite/funcs_1/r/is_columns_is.result b/mysql-test/suite/funcs_1/r/is_columns_is.result
index 34ff5ecafee..66a90f1dc87 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_is.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_is.result
@@ -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)
diff --git a/mysql-test/suite/roles/show_grants_replicated.result b/mysql-test/suite/roles/show_grants_replicated.result
new file mode 100644
index 00000000000..0b2e38d3630
--- /dev/null
+++ b/mysql-test/suite/roles/show_grants_replicated.result
@@ -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
diff --git a/mysql-test/suite/roles/show_grants_replicated.test b/mysql-test/suite/roles/show_grants_replicated.test
new file mode 100644
index 00000000000..1d4572bb297
--- /dev/null
+++ b/mysql-test/suite/roles/show_grants_replicated.test
@@ -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
diff --git a/scripts/wsrep_sst_xtrabackup-v2.sh b/scripts/wsrep_sst_xtrabackup-v2.sh
index 68e250d2157..2b432cb1089 100644
--- a/scripts/wsrep_sst_xtrabackup-v2.sh
+++ b/scripts/wsrep_sst_xtrabackup-v2.sh
@@ -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
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 9914099c3ad..dd7a71f15fa 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -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}
};
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index a5a62aeeafb..302c2fda7f0 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -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;