github.com/matrixorigin/matrixone@v0.7.0/test/distributed/cases/database/system_variables.sql (about)

     1  -- @suit
     2  
     3  -- @case
     4  -- @desc:test for Some System variables and new variables like ERRORS, INDEXES and so on
     5  -- @label:bvt
     6  
     7  -- auto_increment_increment
     8  show variables like 'auto%';
     9  show variables like 'auto_increment_increment';
    10  set auto_increment_increment = 2;
    11  show variables like 'auto_increment_increment';
    12  set auto_increment_increment = 1+1;
    13  show variables like 'auto_increment_increment';
    14  set auto_increment_increment = 2*3;
    15  show variables like 'auto_increment_increment';
    16  
    17  -- init_connect
    18  show variables like 'init%';
    19  show variables like 'init_connect';
    20  
    21  -- interactive_timeout
    22  show variables like 'interactive%';
    23  show variables like 'interactive_timeout';
    24  set interactive_timeout = 36600;
    25  show variables like 'interactive_timeout';
    26  set interactive_timeout = 30000+100;
    27  show variables like 'interactive_timeout';
    28  set global interactive_timeout = 30000+100;
    29  show variables like 'interactive_timeout';
    30  
    31  -- lower_case_table_names, this is a system variable, read only
    32  show variables like 'lower%';
    33  show variables like 'lower_case_table_names';
    34  
    35  -- net_write_timeout
    36  show variables like 'net_write_timeout';
    37  set net_write_timeout = 70;
    38  show variables like 'net_write_timeout';
    39  set net_write_timeout = 20*20;
    40  show variables like 'net_write_timeout';
    41  set net_write_timeout = 60;
    42  show variables like 'net_write_timeout';
    43  
    44  -- system_time_zone, this is a system variable, read only
    45  show variables like 'system%';
    46  show variables like 'system_time_zone';
    47  
    48  -- transaction_isolation, enum type
    49  show variables like 'trans%';
    50  show variables like 'transaction_isolation';
    51  
    52  -- wait_timeout
    53  show variables like 'wait%';
    54  show variables like 'wait_timeout';
    55  set wait_timeout = 33600;
    56  show variables like 'wait_timeout';
    57  set wait_timeout = 10;
    58  show variables like 'wait_timeout';
    59  
    60  
    61  drop table if exists t;
    62  create table t(
    63                    a int,
    64                    b int,
    65                    c int,
    66                    primary key(a)
    67  );
    68  show indexes from t;
    69  
    70  create account acc_idx ADMIN_NAME 'root' IDENTIFIED BY '123456';
    71  -- @session:id=1&user=acc_idx:root&password=123456
    72  create database db1;
    73  use db1;
    74  drop table if exists t;
    75  create table t(
    76                    a int,
    77                    b int,
    78                    c int,
    79                    primary key(a)
    80  );
    81  show indexes from t;
    82  drop database db1;
    83  -- @session
    84  drop account acc_idx;
    85  
    86  
    87  -- Support More System Views
    88  use information_schema;
    89  show tables;
    90  desc key_column_usage;
    91  select table_name, column_name from key_column_usage limit 2;
    92  desc columns;
    93  select table_name, column_name from columns where table_schema = 'mo_catalog' order by table_name, column_name limit 5;
    94  desc profiling;
    95  select seq, state from profiling;
    96  
    97  desc `PROCESSLIST`;
    98  select * from `PROCESSLIST` limit 2;
    99  
   100  desc user_privileges;
   101  select grantee, table_catalog from user_privileges limit 2;
   102  desc schemata;
   103  select catalog_name, schema_name from schemata where schema_name = 'mo_catalog' or schema_name = 'mo_task' order by catalog_name, schema_name;
   104  desc character_sets;
   105  select character_set_name, description, maxlen from character_sets limit 5;
   106  desc triggers;
   107  select trigger_name, action_order from triggers limit 3;
   108  
   109  use mysql;
   110  desc user;
   111  select host, user from user limit 2;
   112  desc db;
   113  select db, user from db limit 5;
   114  desc procs_priv;
   115  select routine_name, routine_type from procs_priv limit 5;
   116  desc columns_priv;
   117  select table_name, column_name from columns_priv limit 5;
   118  desc tables_priv;
   119  select host, table_name from tables_priv limit 5;
   120  
   121  -- sql_select_limit
   122  show variables like 'sql_select_limit';
   123  set sql_select_limit = 100000;
   124  show variables like 'sql_select_limit';
   125  set sql_select_limit = 1;
   126  show variables like 'sql_select_limit';
   127  SET SQL_SELECT_LIMIT = Default;
   128  show variables like 'sql_select_limit';
   129  
   130  --int type
   131  show variables like 'max_allowed_packet';
   132  set max_allowed_packet = 10000;
   133  show variables like 'max_allowed_packet';
   134  set max_allowed_packet = default;
   135  show variables like 'max_allowed_packet';
   136  
   137  show variables like 'wait_timeout';
   138  set wait_timeout = 10000;
   139  show variables like 'wait_timeout';
   140  set wait_timeout = default;
   141  show variables like 'wait_timeout';
   142  
   143  --string type
   144  show variables like 'character_set_results';
   145  set character_set_server = default;
   146  show variables like 'character_set_results';
   147  
   148  show variables like 'character_set_server';
   149  set character_set_server = default;
   150  show variables like 'character_set_server';
   151  
   152  --enum type
   153  show variables like 'transaction_isolation';
   154  set transaction_isolation = default;
   155  show variables like 'transaction_isolation';
   156  
   157  show variables like 'tx_isolation';
   158  set tx_isolation = default;
   159  show variables like 'tx_isolation';
   160  
   161  select @@sql_mode;
   162  set @@sql_mode = ONLY_FULL_GROUP_BY;
   163  select @@sql_mode;
   164  set @@sql_mode = "ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES";
   165  select @@sql_mode;
   166  set @@sql_mode = default;
   167  select @@sql_mode;
   168  
   169  drop database if exists test;
   170  create database test;
   171  select `configuration` from mo_catalog.mo_mysql_compatbility_mode where dat_name ="test";
   172  drop database test;
   173  select `configuration` from mo_catalog.mo_mysql_compatbility_mode where dat_name ="test";
   174  
   175  drop database if exists test;
   176  create database test;
   177  select `configuration` from mo_catalog.mo_mysql_compatbility_mode where dat_name ="test";
   178  alter database test set mysql_compatbility_mode = '{"version_compatibility": "8.0.30-MatrixOne-v0.7.0"}';
   179  select `configuration` from mo_catalog.mo_mysql_compatbility_mode where dat_name ="test";
   180  drop database test;
   181  
   182  drop database if exists test;
   183  create database test;
   184  use test;
   185  select version();
   186  alter database test set mysql_compatbility_mode = '{"version_compatibility": "8.0.30-MatrixOne-v0.7.0"}';
   187  select version();
   188  drop database test;
   189  
   190  create account abc ADMIN_NAME 'admin' IDENTIFIED BY '123456';
   191  -- @session:id=2&user=abc:admin&password=123456
   192  drop database if exists test;
   193  drop database if exists test1;
   194  create database test;
   195  create database test1;
   196  use test;
   197  select version();
   198  alter database test set mysql_compatbility_mode = '{"version_compatibility": "8.0.30-MatrixOne-v0.7.0"}';
   199  select version();
   200  use test1;
   201  select version();
   202  alter account config abc set mysql_compatbility_mode = '{"version_compatibility": "0.7"}';
   203  select version();
   204  use test1;
   205  select version();
   206  drop database test;
   207  drop database test1;
   208  -- @session