mariadb/mysql-test/suite/sys_vars/r/server_id_basic.result
Monty 1c91569274 Set server_id to 1 by default and disallow to set it to 0
This makes it easier to setup master as on only have to set --log-bin.
Before this patch if one did set up the master with just --log-bin, slaves
could not connect until server_id was set on the master, which could be
both confusing and hard to do.
2016-08-29 20:28:06 +03:00

129 lines
3.5 KiB
Text

SET @@global.general_log= 0;
SET @start_global_value = @@global.server_id;
SELECT @start_global_value;
@start_global_value
1
'#--------------------FN_DYNVARS_144_01-------------------------#'
SET @@global.server_id = 500000;
SET @@global.server_id = DEFAULT;
SELECT @@global.server_id;
@@global.server_id
1
'#--------------------FN_DYNVARS_144_02-------------------------#'
SET @@global.server_id = DEFAULT;
SELECT @@global.server_id = 1;
@@global.server_id = 1
1
'#--------------------FN_DYNVARS_144_03-------------------------#'
SET @@global.server_id = 0;
Warnings:
Warning 1292 Truncated incorrect server_id value: '0'
SELECT @@global.server_id;
@@global.server_id
1
SET @@global.server_id = 1;
SELECT @@global.server_id;
@@global.server_id
1
SET @@global.server_id = 15;
SELECT @@global.server_id;
@@global.server_id
15
SET @@global.server_id = 1024;
SELECT @@global.server_id;
@@global.server_id
1024
SET @@global.server_id = 123456789;
SELECT @@global.server_id;
@@global.server_id
123456789
SET @@global.server_id = 2147483648;
SELECT @@global.server_id;
@@global.server_id
2147483648
SET @@global.server_id = 2147483648*2-1;
SELECT @@global.server_id;
@@global.server_id
4294967295
'#--------------------FN_DYNVARS_144_04-------------------------#'
SELECT @@server_id;
@@server_id
4294967295
SET @@server_id = 2;
SELECT @@server_id;
@@server_id
2
SET @@session.server_id = 3;
SELECT @@server_id;
@@server_id
3
SET @@local.server_id = 4;
'#------------------FN_DYNVARS_144_05-----------------------#'
SET @@global.server_id = -1;
Warnings:
Warning 1292 Truncated incorrect server_id value: '-1'
SELECT @@global.server_id;
@@global.server_id
1
SET @@global.server_id = -2147483648;
Warnings:
Warning 1292 Truncated incorrect server_id value: '-2147483648'
SELECT @@global.server_id;
@@global.server_id
1
SET @@global.server_id = 2147483649*2;
Warnings:
Warning 1292 Truncated incorrect server_id value: '4294967298'
SELECT @@global.server_id;
@@global.server_id
4294967295
SET @@global.server_id = 65530.34;
ERROR 42000: Incorrect argument type to variable 'server_id'
SET @@global.server_id = '125';
ERROR 42000: Incorrect argument type to variable 'server_id'
SET @@global.server_id = 7483649.56;
ERROR 42000: Incorrect argument type to variable 'server_id'
SET @@global.server_id = 1G;
ERROR 42000: Incorrect argument type to variable 'server_id'
'#------------------FN_DYNVARS_144_06-----------------------#'
SET @@global.server_id = 3000;
SELECT @@global.server_id = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='server_id';
@@global.server_id = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_144_07-----------------------#'
SELECT count(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='server_id';
count(VARIABLE_VALUE)
1
'#------------------FN_DYNVARS_144_08-----------------------#'
SET @@global.server_id = TRUE;
SELECT @@global.server_id;
@@global.server_id
1
SET @@global.server_id = FALSE;
Warnings:
Warning 1292 Truncated incorrect server_id value: '0'
SELECT @@global.server_id;
@@global.server_id
1
'#---------------------FN_DYNVARS_001_09----------------------#'
SET @@global.server_id = 512;
SELECT @@server_id = @@global.server_id;
@@server_id = @@global.server_id
1
'#---------------------FN_DYNVARS_001_10----------------------#'
SET server_id = 2048;
SELECT server_id;
ERROR 42S22: Unknown column 'server_id' in 'field list'
SELECT @@server_id;
@@server_id
2048
SET global server_id = 99;
SET @@global.server_id = @start_global_value;
SELECT @@global.server_id;
@@global.server_id
1
SET @@global.general_log= 1;