Commit bc12d5fd authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-6066: Merge new defaults from 5.6 and 5.7

cosmetic fixes. test fixes.
parent e3982cea
......@@ -4434,6 +4434,7 @@ sub extract_warning_lines ($$) {
qr|Failed to setup SSL|,
qr|SSL error: Failed to set ciphers to use|,
qr/Plugin 'InnoDB' will be forced to shutdown/,
qr|Could not increase number of max_open_files to more than|,
);
my $matched_lines= [];
......
create database db1;
create user user_1@localhost;
create user USER_1@localhost;
GRANT CREATE ON db1.* to user_1@localhost;
GRANT SELECT ON db1.* to USER_1@localhost;
CREATE TABLE t1(f1 int);
......
......@@ -1415,9 +1415,9 @@ sync-master-info 10000
sync-relay-log 10000
sync-relay-log-info 10000
sysdate-is-now FALSE
table-cache 2000
table-cache 431
table-definition-cache 400
table-open-cache 2000
table-open-cache 431
tc-heuristic-recover COMMIT
thread-cache-size 0
thread-pool-idle-timeout 60
......
......@@ -418,7 +418,7 @@ UNLOCK TABLES;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
set global sql_mode='';
set global sql_mode=default;
drop table t1;
#
# Bug#2705 mysqldump --tab extra output
......@@ -2717,7 +2717,7 @@ a2
SHOW TRIGGERS;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
testref INSERT test1 BEGIN
INSERT INTO test2 SET a2 = NEW.a1; END BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
INSERT INTO test2 SET a2 = NEW.a1; END BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
SELECT * FROM `test1`;
a1
1
......@@ -2789,7 +2789,7 @@ UNLOCK TABLES;
/*!50003 SET character_set_results = latin1 */ ;
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `bug9056_func1`(a INT, b INT) RETURNS int(11)
RETURN a+b ;;
......@@ -2806,7 +2806,7 @@ DELIMITER ;
/*!50003 SET character_set_results = latin1 */ ;
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `bug9056_func2`(f1 char binary) RETURNS char(1) CHARSET latin1
begin
......@@ -2843,7 +2843,7 @@ DELIMITER ;
/*!50003 SET character_set_results = latin1 */ ;
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `bug9056_proc1`(IN a INT, IN b INT, OUT c INT)
BEGIN SELECT a+b INTO c; end ;;
......@@ -2860,7 +2860,7 @@ DELIMITER ;
/*!50003 SET character_set_results = latin1 */ ;
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `bug9056_proc2`(OUT a INT)
BEGIN
......@@ -3849,7 +3849,7 @@ create procedure mysqldump_test_db.sp1() select 'hello';
/*!50003 SET character_set_results = latin1 */ ;
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`user1`@`%` PROCEDURE `sp1`()
select 'hello' ;;
......
......@@ -63,4 +63,5 @@ ERROR 42000: You are not allowed to create a user with GRANT
drop user foo@localhost;
drop user bar@localhost;
drop role auto_create;
drop user auto_create;
drop database db;
......@@ -119,5 +119,5 @@ grant auto_create to foo2@localhost identified by 'pass';
drop user foo@localhost;
drop user bar@localhost;
drop role auto_create;
drop user auto_create;
drop database db;
......@@ -19,13 +19,13 @@
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 65535
@@ -85,7 +85,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
GLOBAL_VALUE_ORIGIN AUTO
DEFAULT_VALUE 150
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT The number of outstanding connection requests MySQL can have. This comes into play when the main MySQL thread gets very many connection requests in a very short time
NUMERIC_MIN_VALUE 1
VARIABLE_COMMENT The number of outstanding connection requests MariaDB can have. This comes into play when the main MySQL thread gets very many connection requests in a very short time
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 65535
@@ -144,7 +144,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
......@@ -243,7 +243,7 @@
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 255
@@ -1275,7 +1275,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
GLOBAL_VALUE_ORIGIN AUTO
DEFAULT_VALUE 128
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
......@@ -278,6 +278,15 @@
VARIABLE_COMMENT Controls what join operations can be executed with join buffers. Odd numbers are used for plain join buffers while even numbers are used for linked buffers
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 8
@@ -1474,7 +1474,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The size of the buffer used for index blocks for MyISAM tables. Increase this to get better index handling (for all reads and multiple writes) to as much as you can afford
NUMERIC_MIN_VALUE 0
-NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_MAX_VALUE 4294967295
NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY NO
@@ -1695,7 +1695,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 31536000
......@@ -307,7 +316,7 @@
NUMERIC_MAX_VALUE 4294967295
@@ -1919,7 +1919,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1048576
DEFAULT_VALUE 4194304
VARIABLE_SCOPE SESSION
-VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_TYPE INT UNSIGNED
......@@ -1162,7 +1171,7 @@
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 524288
@@ -4467,7 +4467,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
GLOBAL_VALUE_ORIGIN AUTO
DEFAULT_VALUE 400
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
......@@ -1172,7 +1181,7 @@
NUMERIC_MAX_VALUE 524288
@@ -4481,7 +4481,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 400
DEFAULT_VALUE 2000
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_TYPE INT UNSIGNED
......
......@@ -6,6 +6,8 @@
# Bug#41049 does syntax "grant" case insensitive?
#
create database db1;
create user user_1@localhost;
create user USER_1@localhost;
GRANT CREATE ON db1.* to user_1@localhost;
GRANT SELECT ON db1.* to USER_1@localhost;
......
call mtr.add_suppression("@003f.frm' \\(errno: 22\\)");
#select * from mysql.user;
#checksum table mysql.user;
# Embedded server doesn't support external clients
--source include/not_embedded.inc
......@@ -139,7 +140,7 @@ create table t1(a int);
set global sql_mode='ANSI_QUOTES';
--exec $MYSQL_DUMP --comments=0 test
--exec $MYSQL_DUMP --comments=0 --compatible=ansi test
set global sql_mode='';
set global sql_mode=default;
drop table t1;
--echo #
......@@ -2488,3 +2489,5 @@ drop table t1;
select * from t1;
drop table t1;
--remove_file $MYSQLTEST_VARDIR/tmp/mysqldump-test.out
#select * from mysql.user;
#checksum table mysql.user;
......@@ -55,7 +55,7 @@ enum enum_special_opt
char *disabled_my_option= (char*) "0";
char *enabled_my_option= (char*) "1";
char *autoset_my_option= (char*) "";
char *autoset_my_option= (char*) "auto";
/*
This is a flag that can be set in client programs. 0 means that
......@@ -467,7 +467,7 @@ int handle_options(int *argc, char ***argv,
if (optend)
{
my_getopt_error_reporter(ERROR_LEVEL,
"%s: automatic setup request of "
"%s: automatically set "
"option '--%s' cannot take an argument",
my_progname, optp->name);
......
......@@ -172,13 +172,13 @@ sys_var::sys_var(sys_var_chain *chain, const char *name_arg,
option.value= (uchar **)global_var_ptr();
option.def_value= def_val;
option.app_type= this;
option.var_type= flags & AUTO_SET ? GET_AUTO : 0;
if (chain->last)
chain->last->next= this;
else
chain->first= this;
chain->last= this;
fix_auto_flag();
}
bool sys_var::update(THD *thd, set_var *var)
......
......@@ -89,12 +89,6 @@ protected:
const char *const deprecation_substitute;
bool is_os_charset; ///< true if the value is in character_set_filesystem
inline void fix_auto_flag()
{
if (flags & AUTO_SET)
option.var_type|= GET_AUTO;
}
public:
sys_var(sys_var_chain *chain, const char *name_arg, const char *comment,
int flag_args, ptrdiff_t off, int getopt_id,
......
......@@ -138,8 +138,7 @@ public:
getopt.arg_type, SHOWT, def_val, lock, binlog_status_arg,
on_check_func, on_update_func, substitute)
{
option.var_type= ARGT;
fix_auto_flag();
option.var_type|= ARGT;
option.min_value= min_val;
option.max_value= max_val;
option.block_size= block_size;
......@@ -159,10 +158,9 @@ public:
{
my_bool fixed= FALSE, unused;
longlong v= var->value->val_int();
ulong vartype= (ARGT & GET_TYPE_MASK);
if ((vartype == GET_HA_ROWS) || (vartype == GET_UINT) ||
(vartype == GET_ULONG) || (vartype == GET_ULL))
if ((ARGT == GET_HA_ROWS) || (ARGT == GET_UINT) ||
(ARGT == GET_ULONG) || (ARGT == GET_ULL))
{
ulonglong uv;
......@@ -345,8 +343,7 @@ public:
binlog_status_arg, on_check_func, on_update_func,
substitute)
{
option.var_type= GET_ENUM;
fix_auto_flag();
option.var_type|= GET_ENUM;
global_var(ulong)= def_val;
SYSVAR_ASSERT(def_val < typelib.count);
SYSVAR_ASSERT(size == sizeof(ulong));
......@@ -397,8 +394,7 @@ public:
binlog_status_arg, on_check_func, on_update_func,
substitute)
{
option.var_type= GET_BOOL;
fix_auto_flag();
option.var_type|= GET_BOOL;
global_var(my_bool)= def_val;
SYSVAR_ASSERT(def_val < 2);
SYSVAR_ASSERT(getopt.arg_type == OPT_ARG || getopt.id < 0);
......@@ -464,8 +460,7 @@ public:
otherwise (GET_STR) you'll never know whether to free it or not.
(think of an exit because of an error right after my_getopt)
*/
option.var_type= (flags & ALLOCATED) ? GET_STR_ALLOC : GET_STR;
fix_auto_flag();
option.var_type|= (flags & ALLOCATED) ? GET_STR_ALLOC : GET_STR;
global_var(const char*)= def_val;
SYSVAR_ASSERT(scope() == GLOBAL);
SYSVAR_ASSERT(size == sizeof(char *));
......@@ -552,8 +547,7 @@ public:
NULL, NULL, NULL)
{
is_os_charset= is_os_charset_arg == IN_FS_CHARSET;
option.var_type= GET_STR;
fix_auto_flag();
option.var_type|= GET_STR;
}
bool do_check(THD *thd, set_var *var)
{
......@@ -609,8 +603,7 @@ public:
NO_ARG, SHOW_CHAR, 0, NULL, VARIABLE_NOT_IN_BINLOG,
NULL, NULL, NULL), opt_id(getopt_id)
{
option.var_type= GET_STR | GET_ASK_ADDR;
fix_auto_flag();
option.var_type|= GET_STR | GET_ASK_ADDR;
}
bool do_check(THD *thd, set_var *var)
......@@ -699,8 +692,7 @@ public:
0, VARIABLE_NOT_IN_BINLOG, on_check_func, on_update_func,
0),max_length(max_length_arg)
{
option.var_type= GET_STR;
fix_auto_flag();
option.var_type|= GET_STR;
SYSVAR_ASSERT(scope() == ONLY_SESSION)
*const_cast<SHOW_TYPE*>(&show_val_type)= SHOW_LEX_STRING;
}
......@@ -787,7 +779,7 @@ public:
getopt.arg_type, SHOW_CHAR, (intptr)def_val,
lock, binlog_status_arg, on_check_func, on_update_func,
substitute)
{ option.var_type= GET_STR; fix_auto_flag(); }
{ option.var_type|= GET_STR; }
bool do_check(THD *thd, set_var *var)
{
char buff[STRING_BUFFER_USUAL_SIZE];
......@@ -1034,8 +1026,7 @@ public:
lock, binlog_status_arg, on_check_func, on_update_func,
substitute)
{
option.var_type= GET_DOUBLE;
fix_auto_flag();
option.var_type|= GET_DOUBLE;
option.min_value= (longlong) getopt_double2ulonglong(min_val);
option.max_value= (longlong) getopt_double2ulonglong(max_val);
global_var(double)= (double)option.def_value;
......@@ -1136,8 +1127,7 @@ public:
binlog_status_arg, on_check_func, on_update_func,
substitute)
{
option.var_type= GET_FLAGSET;
fix_auto_flag();
option.var_type|= GET_FLAGSET;
global_var(ulonglong)= def_val;
SYSVAR_ASSERT(typelib.count > 1);
SYSVAR_ASSERT(typelib.count <= 65);
......@@ -1246,8 +1236,7 @@ public:
binlog_status_arg, on_check_func, on_update_func,
substitute)
{
option.var_type= GET_SET;
fix_auto_flag();
option.var_type|= GET_SET;
global_var(ulonglong)= def_val;
SYSVAR_ASSERT(typelib.count > 0);
SYSVAR_ASSERT(typelib.count <= 64);
......@@ -1352,8 +1341,7 @@ public:
substitute),
plugin_type(plugin_type_arg)
{
option.var_type= GET_STR;
fix_auto_flag();
option.var_type|= GET_STR;
SYSVAR_ASSERT(size == sizeof(plugin_ref));
SYSVAR_ASSERT(getopt.id < 0); // force NO_CMD_LINE
}
......@@ -1469,8 +1457,7 @@ public:
substitute)
{
SYSVAR_ASSERT(scope() == ONLY_SESSION);
option.var_type= GET_STR;
fix_auto_flag();
option.var_type|= GET_STR;
}
bool do_check(THD *thd, set_var *var)
{
......@@ -1562,8 +1549,7 @@ public:
binlog_status_arg, on_check_func, on_update_func,
substitute)
{
option.var_type= GET_BOOL;
fix_auto_flag();
option.var_type|= GET_BOOL;
reverse_semantics= my_count_bits(bitmask_arg) > 1;
bitmask= reverse_semantics ? ~bitmask_arg : bitmask_arg;
set(global_var_ptr(), def_val);
......@@ -1771,8 +1757,7 @@ public:
SYSVAR_ASSERT(is_readonly());
SYSVAR_ASSERT(on_update == 0);
SYSVAR_ASSERT(size == sizeof(enum SHOW_COMP_OPTION));
option.var_type= GET_STR;
fix_auto_flag();
option.var_type|= GET_STR;
}
bool do_check(THD *thd, set_var *var) {
DBUG_ASSERT(FALSE);
......@@ -1834,8 +1819,7 @@ public:
substitute),
name_offset(name_off)
{
option.var_type= GET_ENUM; // because we accept INT and STRING here
fix_auto_flag();
option.var_type|= GET_ENUM; // because we accept INT and STRING here
/*
struct variables are special on the command line - often (e.g. for
charsets) the name cannot be immediately resolved, but only after all
......@@ -1904,8 +1888,7 @@ public:
{
SYSVAR_ASSERT(getopt.id < 0);
SYSVAR_ASSERT(size == sizeof(Time_zone *));
option.var_type= GET_STR;
fix_auto_flag();
option.var_type|= GET_STR;
}
bool do_check(THD *thd, set_var *var)
{
......@@ -2124,8 +2107,7 @@ public:
{
SYSVAR_ASSERT(getopt.id < 0);
SYSVAR_ASSERT(is_readonly());
option.var_type= GET_STR;
fix_auto_flag();
option.var_type|= GET_STR;
}
bool do_check(THD *thd, set_var *var)
{
......@@ -2174,8 +2156,7 @@ public:
{
SYSVAR_ASSERT(getopt.id < 0);
SYSVAR_ASSERT(is_readonly());
option.var_type= GET_STR;
fix_auto_flag();
option.var_type|= GET_STR;
}
bool do_check(THD *thd, set_var *var)
{
......@@ -2222,8 +2203,7 @@ public:
getopt.arg_type, SHOW_CHAR, 0, NULL, VARIABLE_NOT_IN_BINLOG,
NULL, NULL, NULL)
{
option.var_type= GET_STR;
fix_auto_flag();
option.var_type|= GET_STR;
}
bool do_check(THD *thd, set_var *var);
bool session_update(THD *thd, set_var *var)
......@@ -2265,8 +2245,7 @@ public:
getopt.arg_type, SHOW_CHAR, 0, NULL, VARIABLE_NOT_IN_BINLOG,
NULL, NULL, NULL)
{
option.var_type= GET_STR;
fix_auto_flag();
option.var_type|= GET_STR;
}
bool do_check(THD *thd, set_var *var);
bool session_update(THD *thd, set_var *var)
......@@ -2309,8 +2288,7 @@ public:
{
SYSVAR_ASSERT(getopt.id < 0);
SYSVAR_ASSERT(is_readonly());
option.var_type= GET_STR;
fix_auto_flag();
option.var_type|= GET_STR;
}
bool do_check(THD *thd, set_var *var)
{
......
......@@ -71,6 +71,7 @@ DROP USER user@localhost;
#
# Beginning of grant.inc
#
CREATE USER user@localhost;
GRANT ALL PRIVILEGES ON *.* TO user@localhost;
REVOKE FILE ON *.* FROM user@localhost;
SELECT user();
......@@ -165,6 +166,7 @@ DROP USER user@localhost;
#
# Beginning of grant.inc
#
CREATE USER user@localhost;
GRANT ALL PRIVILEGES ON *.* TO user@localhost;
REVOKE FILE ON *.* FROM user@localhost;
SELECT user();
......@@ -259,6 +261,7 @@ DROP USER user@localhost;
#
# Beginning of grant.inc
#
CREATE USER user@localhost;
GRANT ALL PRIVILEGES ON *.* TO user@localhost;
REVOKE FILE ON *.* FROM user@localhost;
SELECT user();
......@@ -353,6 +356,7 @@ DROP USER user@localhost;
#
# Beginning of grant.inc
#
CREATE USER user@localhost;
GRANT ALL PRIVILEGES ON *.* TO user@localhost;
REVOKE FILE ON *.* FROM user@localhost;
SELECT user();
......@@ -447,6 +451,7 @@ DROP USER user@localhost;
#
# Beginning of grant.inc
#
CREATE USER user@localhost;
GRANT ALL PRIVILEGES ON *.* TO user@localhost;
REVOKE FILE ON *.* FROM user@localhost;
SELECT user();
......
#
# MDEV-7574 Security definer views don't work with CONNECT ODBC tables
#
CREATE USER user@localhost;
GRANT ALL PRIVILEGES ON *.* TO user@localhost;
REVOKE FILE ON *.* FROM user@localhost;
# Testing SQLCOM_SELECT
......
......@@ -3,6 +3,7 @@ Warning 1105 No file name. Table will use t1.xml
#
# Beginning of grant.inc
#
CREATE USER user@localhost;
GRANT ALL PRIVILEGES ON *.* TO user@localhost;
REVOKE FILE ON *.* FROM user@localhost;
SELECT user();
......
--echo #
--echo # Beginning of grant.inc
--echo #
CREATE USER user@localhost;
GRANT ALL PRIVILEGES ON *.* TO user@localhost;
REVOKE FILE ON *.* FROM user@localhost;
--connect(user,localhost,user,,)
......
......@@ -9,6 +9,7 @@ let $MYSQLD_DATADIR= `select @@datadir`;
--echo # MDEV-7574 Security definer views don't work with CONNECT ODBC tables
--echo #
CREATE USER user@localhost;
GRANT ALL PRIVILEGES ON *.* TO user@localhost;
REVOKE FILE ON *.* FROM user@localhost;
......
/* Copyright (c) 2015, Monty Program Ab
/* Copyright (c) 2015, MariaDB Corporation
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
......@@ -38,7 +38,7 @@ static struct my_option mopts_options[]=
{"str", 0,
"Something numeric.",
&mopts_str, &mopts_str, 0, GET_STR,
REQUIRED_ARG, (ulong)"ddd", 0, 0, 0, 0, 0},
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"bool", 0,
"Something true or false",
&mopts_bool, &mopts_bool, 0, GET_BOOL,
......@@ -326,6 +326,9 @@ int main(int argc __attribute__((unused)), char **argv)
MY_INIT(argv[0]);
plan(4*8 + 1*4 + 3*4 + 3*2);
/* gcc 4.1.2 doesn't want it in the initializer, we have to do it run-time */
mopts_options[0].def_value= (intptr)"ddd";
test_mopts1();
test_mopts2();
test_mopts3();
......
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