Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
f88fcf25
Commit
f88fcf25
authored
Oct 30, 2017
by
Alexey Botchkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-12542 Add bind_address system variable.
bind_address variable added.
parent
ecee3c71
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
174 additions
and
3 deletions
+174
-3
mysql-test/suite/sys_vars/r/bind_address_basic.result
mysql-test/suite/sys_vars/r/bind_address_basic.result
+57
-0
mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
...l-test/suite/sys_vars/r/sysvars_server_notembedded.result
+14
-0
mysql-test/suite/sys_vars/t/bind_address_basic.test
mysql-test/suite/sys_vars/t/bind_address_basic.test
+95
-0
sql/mysqld.cc
sql/mysqld.cc
+0
-3
sql/mysqld.h
sql/mysqld.h
+1
-0
sql/sys_vars.cc
sql/sys_vars.cc
+7
-0
No files found.
mysql-test/suite/sys_vars/r/bind_address_basic.result
0 → 100644
View file @
f88fcf25
'#---------------------BS_STVARS_001_01----------------------#'
SELECT COUNT(@@GLOBAL.bind_address);
COUNT(@@GLOBAL.bind_address)
1
1 Expected
'#---------------------BS_STVARS_001_02----------------------#'
SET @@GLOBAL.bind_address=1;
ERROR HY000: Variable 'bind_address' is a read only variable
Expected error 'Read only variable'
SELECT COUNT(@@GLOBAL.bind_address);
COUNT(@@GLOBAL.bind_address)
1
1 Expected
'#---------------------BS_STVARS_001_03----------------------#'
SELECT VARIABLE_VALUE = ''
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='bind_address';
VARIABLE_VALUE = ''
0
0 Expected
SELECT COUNT(@@GLOBAL.bind_address);
COUNT(@@GLOBAL.bind_address)
1
1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='bind_address';
COUNT(VARIABLE_VALUE)
1
1 Expected
'#---------------------BS_STVARS_001_04----------------------#'
SELECT @@bind_address is NULL AND @@GLOBAL.bind_address is NULL;
@@bind_address is NULL AND @@GLOBAL.bind_address is NULL
0
0 Expected
SELECT @@bind_address is NOT NULL AND @@GLOBAL.bind_address is NOT NULL;
@@bind_address is NOT NULL AND @@GLOBAL.bind_address is NOT NULL
1
1 Expected
'#---------------------BS_STVARS_001_05----------------------#'
SELECT COUNT(@@bind_address);
COUNT(@@bind_address)
1
1 Expected
SELECT COUNT(@@local.bind_address);
ERROR HY000: Variable 'bind_address' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@SESSION.bind_address);
ERROR HY000: Variable 'bind_address' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.bind_address);
COUNT(@@GLOBAL.bind_address)
1
1 Expected
SELECT bind_address = @@SESSION.bind_address;
ERROR 42S22: Unknown column 'bind_address' in 'field list'
Expected error 'Readonly variable'
mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
View file @
f88fcf25
...
...
@@ -122,6 +122,20 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME BIND_ADDRESS
SESSION_VALUE NULL
GLOBAL_VALUE 127.0.0.1
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
VARIABLE_COMMENT IP address to bind to.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME BINLOG_ANNOTATE_ROW_EVENTS
SESSION_VALUE ON
GLOBAL_VALUE ON
...
...
mysql-test/suite/sys_vars/t/bind_address_basic.test
0 → 100644
View file @
f88fcf25
################## mysql-test\t\bind_address_basic.test ############################
# #
# Variable Name: bind_address #
# Scope: Global #
# Access Type: Static #
# Data Type: filename #
###############################################################################
--
source
include
/
not_embedded
.
inc
--
echo
'#---------------------BS_STVARS_001_01----------------------#'
####################################################################
# Displaying default value #
####################################################################
SELECT
COUNT
(
@@
GLOBAL
.
bind_address
);
--
echo
1
Expected
--
echo
'#---------------------BS_STVARS_001_02----------------------#'
####################################################################
# Check if Value can set #
####################################################################
--
error
ER_INCORRECT_GLOBAL_LOCAL_VAR
SET
@@
GLOBAL
.
bind_address
=
1
;
--
echo
Expected
error
'Read only variable'
SELECT
COUNT
(
@@
GLOBAL
.
bind_address
);
--
echo
1
Expected
--
echo
'#---------------------BS_STVARS_001_03----------------------#'
#################################################################
# Check if the value in GLOBAL Table matches value in variable #
#################################################################
--
disable_warnings
SELECT
VARIABLE_VALUE
=
''
FROM
INFORMATION_SCHEMA
.
GLOBAL_VARIABLES
WHERE
VARIABLE_NAME
=
'bind_address'
;
--
enable_warnings
--
echo
0
Expected
SELECT
COUNT
(
@@
GLOBAL
.
bind_address
);
--
echo
1
Expected
--
disable_warnings
SELECT
COUNT
(
VARIABLE_VALUE
)
FROM
INFORMATION_SCHEMA
.
GLOBAL_VARIABLES
WHERE
VARIABLE_NAME
=
'bind_address'
;
--
enable_warnings
--
echo
1
Expected
--
echo
'#---------------------BS_STVARS_001_04----------------------#'
################################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
################################################################################
SELECT
@@
bind_address
is
NULL
AND
@@
GLOBAL
.
bind_address
is
NULL
;
--
echo
0
Expected
SELECT
@@
bind_address
is
NOT
NULL
AND
@@
GLOBAL
.
bind_address
is
NOT
NULL
;
--
echo
1
Expected
--
echo
'#---------------------BS_STVARS_001_05----------------------#'
################################################################################
# Check if bind_address can be accessed with and without @@ sign #
################################################################################
SELECT
COUNT
(
@@
bind_address
);
--
echo
1
Expected
--
Error
ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT
COUNT
(
@@
local
.
bind_address
);
--
echo
Expected
error
'Variable is a GLOBAL variable'
--
Error
ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT
COUNT
(
@@
SESSION
.
bind_address
);
--
echo
Expected
error
'Variable is a GLOBAL variable'
SELECT
COUNT
(
@@
GLOBAL
.
bind_address
);
--
echo
1
Expected
--
Error
ER_BAD_FIELD_ERROR
SELECT
bind_address
=
@@
SESSION
.
bind_address
;
--
echo
Expected
error
'Readonly variable'
sql/mysqld.cc
View file @
f88fcf25
...
...
@@ -7297,9 +7297,6 @@ struct my_option my_long_options[]=
{
"autocommit"
,
0
,
"Set default value for autocommit (0 or 1)"
,
&
opt_autocommit
,
&
opt_autocommit
,
0
,
GET_BOOL
,
OPT_ARG
,
1
,
0
,
0
,
0
,
0
,
NULL
},
{
"bind-address"
,
0
,
"IP address to bind to."
,
&
my_bind_addr_str
,
&
my_bind_addr_str
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"binlog-do-db"
,
OPT_BINLOG_DO_DB
,
"Tells the master it should log updates for the specified database, "
"and exclude all others not explicitly mentioned."
,
...
...
sql/mysqld.h
View file @
f88fcf25
...
...
@@ -152,6 +152,7 @@ extern my_bool opt_enable_shared_memory;
extern
ulong
opt_replicate_events_marked_for_skip
;
extern
char
*
default_tz_name
;
extern
Time_zone
*
default_tz
;
extern
char
*
my_bind_addr_str
;
extern
char
*
default_storage_engine
,
*
default_tmp_storage_engine
;
extern
char
*
enforced_storage_engine
;
extern
char
*
gtid_pos_auto_engines
;
...
...
sql/sys_vars.cc
View file @
f88fcf25
...
...
@@ -382,6 +382,13 @@ static Sys_var_charptr Sys_basedir(
READ_ONLY
GLOBAL_VAR
(
mysql_home_ptr
),
CMD_LINE
(
REQUIRED_ARG
,
'b'
),
IN_FS_CHARSET
,
DEFAULT
(
0
));
#ifndef EMBEDDED_LIBRARY
static
Sys_var_charptr
Sys_my_bind_addr
(
"bind_address"
,
"IP address to bind to."
,
READ_ONLY
GLOBAL_VAR
(
my_bind_addr_str
),
CMD_LINE
(
REQUIRED_ARG
),
IN_FS_CHARSET
,
DEFAULT
(
0
));
#endif
static
Sys_var_ulonglong
Sys_binlog_cache_size
(
"binlog_cache_size"
,
"The size of the transactional cache for "
"updates to transactional engines for the binary log. "
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment