summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-09-03 18:06:55 +0200
committerSergei Golubchik <serg@mariadb.org>2015-09-04 10:33:56 +0200
commitbc12d5fd4382ad021b77a875d4b7dbd5f2c38d1c (patch)
treeed6ce95f6ee9ff57b45c494d10f5a19473237e96
parente3982cead235e9becb1abdbf0e73876c8a6e6b28 (diff)
downloadmariadb-git-bc12d5fd4382ad021b77a875d4b7dbd5f2c38d1c.tar.gz
MDEV-6066: Merge new defaults from 5.6 and 5.7
cosmetic fixes. test fixes.
-rw-r--r--include/my_getopt.h6
-rwxr-xr-xmysql-test/mysql-test-run.pl1
-rw-r--r--mysql-test/r/grant_lowercase_fs.result2
-rw-r--r--mysql-test/r/mysqld--help.result4
-rw-r--r--mysql-test/r/mysqldump.result14
-rw-r--r--mysql-test/suite/roles/grant_role_auto_create_user.result1
-rw-r--r--mysql-test/suite/roles/grant_role_auto_create_user.test2
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff23
-rw-r--r--mysql-test/t/grant_lowercase_fs.test2
-rw-r--r--mysql-test/t/mysqldump.test7
-rw-r--r--mysys/my_getopt.c4
-rw-r--r--sql/set_var.cc2
-rw-r--r--sql/set_var.h6
-rw-r--r--sql/sys_vars.ic70
-rw-r--r--storage/connect/mysql-test/connect/r/grant.result5
-rw-r--r--storage/connect/mysql-test/connect/r/grant2.result1
-rw-r--r--storage/connect/mysql-test/connect/r/xml_grant.result1
-rw-r--r--storage/connect/mysql-test/connect/t/grant.inc1
-rw-r--r--storage/connect/mysql-test/connect/t/grant2.test1
-rw-r--r--unittest/mysys/my_getopt-t.c7
20 files changed, 81 insertions, 79 deletions
diff --git a/include/my_getopt.h b/include/my_getopt.h
index 8c3d2db5cda..584c009464d 100644
--- a/include/my_getopt.h
+++ b/include/my_getopt.h
@@ -39,9 +39,9 @@ C_MODE_START
#define GET_DOUBLE 14
#define GET_FLAGSET 15
-#define GET_ASK_ADDR 128
-#define GET_AUTO 64
-#define GET_TYPE_MASK 63
+#define GET_ASK_ADDR 128
+#define GET_AUTO 64
+#define GET_TYPE_MASK 63
/**
Enumeration of the my_option::arg_type attributes.
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 549bbfa2c5c..02dc1aa1a4e 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -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= [];
diff --git a/mysql-test/r/grant_lowercase_fs.result b/mysql-test/r/grant_lowercase_fs.result
index 5a3087ed5cd..eb27b1d7ea0 100644
--- a/mysql-test/r/grant_lowercase_fs.result
+++ b/mysql-test/r/grant_lowercase_fs.result
@@ -1,4 +1,6 @@
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);
diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result
index 0c92b7785f1..d6371a45f86 100644
--- a/mysql-test/r/mysqld--help.result
+++ b/mysql-test/r/mysqld--help.result
@@ -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
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index e99cbe08fa6..ae4377533cc 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -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' ;;
diff --git a/mysql-test/suite/roles/grant_role_auto_create_user.result b/mysql-test/suite/roles/grant_role_auto_create_user.result
index 674480758fb..dee07aa6b3c 100644
--- a/mysql-test/suite/roles/grant_role_auto_create_user.result
+++ b/mysql-test/suite/roles/grant_role_auto_create_user.result
@@ -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;
diff --git a/mysql-test/suite/roles/grant_role_auto_create_user.test b/mysql-test/suite/roles/grant_role_auto_create_user.test
index 0259d0a8ff6..e673934775e 100644
--- a/mysql-test/suite/roles/grant_role_auto_create_user.test
+++ b/mysql-test/suite/roles/grant_role_auto_create_user.test
@@ -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;
-
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff
index 14db85da8e2..e87f2647f69 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff
@@ -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
diff --git a/mysql-test/t/grant_lowercase_fs.test b/mysql-test/t/grant_lowercase_fs.test
index f57f950ec8c..92191829c58 100644
--- a/mysql-test/t/grant_lowercase_fs.test
+++ b/mysql-test/t/grant_lowercase_fs.test
@@ -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;
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index 8461ebff412..c3267ad7a40 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -1,5 +1,6 @@
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;
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c
index 1f88d51849b..56b6d55a92a 100644
--- a/mysys/my_getopt.c
+++ b/mysys/my_getopt.c
@@ -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);
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 3756da562b9..18f6cbc41fd 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -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)
diff --git a/sql/set_var.h b/sql/set_var.h
index b3538559fbb..43ad7f509d8 100644
--- a/sql/set_var.h
+++ b/sql/set_var.h
@@ -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,
diff --git a/sql/sys_vars.ic b/sql/sys_vars.ic
index ea0e11ed19e..2badd5d997a 100644
--- a/sql/sys_vars.ic
+++ b/sql/sys_vars.ic
@@ -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)
{
diff --git a/storage/connect/mysql-test/connect/r/grant.result b/storage/connect/mysql-test/connect/r/grant.result
index eedeeacaa5b..4e64b983ea7 100644
--- a/storage/connect/mysql-test/connect/r/grant.result
+++ b/storage/connect/mysql-test/connect/r/grant.result
@@ -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();
diff --git a/storage/connect/mysql-test/connect/r/grant2.result b/storage/connect/mysql-test/connect/r/grant2.result
index f4a78f9b891..acefe6df659 100644
--- a/storage/connect/mysql-test/connect/r/grant2.result
+++ b/storage/connect/mysql-test/connect/r/grant2.result
@@ -1,6 +1,7 @@
#
# 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
diff --git a/storage/connect/mysql-test/connect/r/xml_grant.result b/storage/connect/mysql-test/connect/r/xml_grant.result
index f6dc725b259..9eb818bf32f 100644
--- a/storage/connect/mysql-test/connect/r/xml_grant.result
+++ b/storage/connect/mysql-test/connect/r/xml_grant.result
@@ -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();
diff --git a/storage/connect/mysql-test/connect/t/grant.inc b/storage/connect/mysql-test/connect/t/grant.inc
index 8f605a7c1d3..6580c845b56 100644
--- a/storage/connect/mysql-test/connect/t/grant.inc
+++ b/storage/connect/mysql-test/connect/t/grant.inc
@@ -1,6 +1,7 @@
--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,,)
diff --git a/storage/connect/mysql-test/connect/t/grant2.test b/storage/connect/mysql-test/connect/t/grant2.test
index 4d136ec5f5d..8e7d9453e70 100644
--- a/storage/connect/mysql-test/connect/t/grant2.test
+++ b/storage/connect/mysql-test/connect/t/grant2.test
@@ -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;
diff --git a/unittest/mysys/my_getopt-t.c b/unittest/mysys/my_getopt-t.c
index 0eff84e8750..c4c26e88624 100644
--- a/unittest/mysys/my_getopt-t.c
+++ b/unittest/mysys/my_getopt-t.c
@@ -1,4 +1,4 @@
-/* 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();