1SET @start_value = @@session.identity; 2SELECT @start_value; 3@start_value 40 5'#--------------------FN_DYNVARS_035_01------------------------#' 6SET @@session.identity = 99; 7'Variable is giving error on assigning Default value'; 8SELECT @@session.identity; 9@@session.identity 1099 11'#---------------------FN_DYNVARS_035_02-------------------------#' 12SET @@session.identity = @start_value; 13SELECT @@session.identity = 0; 14@@session.identity = 0 151 16'#--------------------FN_DYNVARS_035_03------------------------#' 17SET @@session.identity = 0; 18SELECT @@session.identity; 19@@session.identity 200 21SET @@session.identity = 1099; 22SELECT @@session.identity; 23@@session.identity 241099 25SET @@session.identity = 1800; 26SELECT @@session.identity; 27@@session.identity 281800 29SET @@session.identity = 65535; 30SELECT @@session.identity; 31@@session.identity 3265535 33'#--------------------FN_DYNVARS_035_04-------------------------#' 34SET @@session.identity = -1; 35Warnings: 36Warning 1292 Truncated incorrect identity value: '-1' 37SELECT @@session.identity; 38@@session.identity 390 40SET @@session.identity = 100000000000; 41SELECT @@session.identity; 42@@session.identity 43100000000000 44SET @@session.identity = 10000.01; 45ERROR 42000: Incorrect argument type to variable 'identity' 46SELECT @@session.identity; 47@@session.identity 48100000000000 49SET @@session.identity = -1024; 50Warnings: 51Warning 1292 Truncated incorrect identity value: '-1024' 52SELECT @@session.identity; 53@@session.identity 540 55SET @@session.identity = 42949672950; 56SELECT @@session.identity; 57@@session.identity 5842949672950 59SET @@session.identity = ON; 60ERROR 42000: Incorrect argument type to variable 'identity' 61SELECT @@session.identity; 62@@session.identity 6342949672950 64SET @@session.identity = 'test'; 65ERROR 42000: Incorrect argument type to variable 'identity' 66SELECT @@session.identity; 67@@session.identity 6842949672950 69'#-------------------FN_DYNVARS_035_05----------------------------#' 70SET @@global.identity = 0; 71ERROR HY000: Variable 'identity' is a SESSION variable and can't be used with SET GLOBAL 72SELECT @@global.identity; 73ERROR HY000: Variable 'identity' is a SESSION variable 74'#----------------------FN_DYNVARS_035_06------------------------#' 75SELECT @@global.identity = VARIABLE_VALUE 76FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 77WHERE VARIABLE_NAME='identity'; 78ERROR HY000: Variable 'identity' is a SESSION variable 79SELECT @@session.identity = VARIABLE_VALUE 80FROM INFORMATION_SCHEMA.SESSION_VARIABLES 81WHERE VARIABLE_NAME='identity'; 82@@session.identity = VARIABLE_VALUE 831 84'#-------------------FN_DYNVARS_035_07----------------------------#' 85SET @@global.identity = 0; 86ERROR HY000: Variable 'identity' is a SESSION variable and can't be used with SET GLOBAL 87SELECT @@global.identity; 88ERROR HY000: Variable 'identity' is a SESSION variable 89'#---------------------FN_DYNVARS_035_08----------------------#' 90SET @@session.identity = TRUE; 91SELECT @@session.identity; 92@@session.identity 931 94SET @@session.identity = FALSE; 95SELECT @@session.identity; 96@@session.identity 970 98'#---------------------FN_DYNVARS_035_09----------------------#' 99SET @@session.identity = 1; 100SELECT @@identity = @@session.identity; 101@@identity = @@session.identity 1021 103SELECT @@session.identity = @@local.identity; 104@@session.identity = @@local.identity 1051 106'#---------------------FN_DYNVARS_035_10----------------------#' 107SET identity = 1; 108SELECT @@identity; 109@@identity 1101 111SELECT local.identity; 112ERROR 42S02: Unknown table 'local' in field list 113SELECT session.identity; 114ERROR 42S02: Unknown table 'session' in field list 115SELECT identity = @@session.identity; 116ERROR 42S22: Unknown column 'identity' in 'field list' 117SET @@session.identity = @start_value; 118SELECT @@session.identity; 119@@session.identity 1200 121