config root man

Current Path : /home/usr.opt/mysql57/mysql-test/suite/x/t/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //home/usr.opt/mysql57/mysql-test/suite/x/t/performance_schema.test

## Tests detecting presence of xplugin objects in PERFORMANCE_SCHEMA.

## Preamble
--source ../include/have_performance_schema_threads.inc
--source ../include/xplugin_preamble.inc

# Tests
--write_file $MYSQL_TMP_DIR/performance_schema.tmp
-->quiet
-->sql
update performance_schema.setup_instruments set ENABLED='YES' where NAME like '%mysqlx%';

update performance_schema.setup_instruments set ENABLED='NO' where NAME like 'wait/synch/mutex/mysqlx/lock_list_access';
update performance_schema.setup_instruments set ENABLED='NO' where NAME like 'wait/synch/mutex/mysqlx/scheduler_dynamic_worker_pending';
update performance_schema.setup_instruments set ENABLED='NO' where NAME like 'wait/synch/cond/mysqlx/scheduler_dynamic_worker_pending';

update performance_schema.setup_consumers set ENABLED='YES' where NAME like 'events_waits%';

TRUNCATE TABLE performance_schema.events_waits_history_long;
TRUNCATE TABLE performance_schema.events_waits_history;

SELECT DISTINCT name FROM performance_schema.threads WHERE name 
LIKE 'thread/mysqlx/%' ORDER BY name;

SELECT DISTINCT name FROM performance_schema.mutex_instances WHERE name 
LIKE 'wait/synch/mutex/mysqlx/%' ORDER BY name;

SELECT DISTINCT name FROM performance_schema.cond_instances WHERE name 
LIKE 'wait/synch/cond/mysqlx/%' ORDER BY name;

SELECT DISTINCT name FROM performance_schema.rwlock_instances WHERE name 
LIKE 'wait/synch/rwlock/mysqlx/%' ORDER BY name;

SELECT * FROM performance_schema.setup_instruments WHERE name like '%mysqlx%';


# Threads Table Functional Scenario
##########################################################################
update performance_schema.threads
  set instrumented= 'NO' where PROCESSLIST_ID=connection_id();

select instrumented from performance_schema.threads
  where PROCESSLIST_ID=connection_id();

update performance_schema.threads
  set instrumented= 'YES' where PROCESSLIST_ID=connection_id();

select instrumented from performance_schema.threads
  where PROCESSLIST_ID=connection_id();

LOCK TABLES performance_schema.threads READ;
UNLOCK TABLES;

LOCK TABLES performance_schema.threads WRITE;
UNLOCK TABLES;


###########################################################################
# DDL and DML Error Scenarios
###########################################################################

# DDL Operations Check
###########################################################################
# error ER_DBACCESS_DENIED_ERROR
-->endsql
-->expecterror 1044
-->sql
alter table performance_schema.mutex_instances add column foo integer;
-->endsql
-->expecterror 1044
-->sql
alter table performance_schema.cond_instances add column foo integer;
-->endsql
-->expecterror 1044
-->sql
alter table performance_schema.threads add column foo integer;
-->endsql
-->expecterror 1044
-->sql
alter table performance_schema.rwlock_instances add column foo integer;
-->endsql
-->expecterror 1044
-->sql
alter table performance_schema.socket_instances add column foo integer;
-->endsql
-->expecterror 1044
-->sql
alter table performance_schema.socket_summary_by_event_name add column foo integer;
-->endsql
-->expecterror 1044
-->sql
alter table performance_schema.socket_summary_by_instance add column foo integer;

# error ER_WRONG_PERFSCHEMA_USAGE
-->endsql
-->expecterror 1683
-->sql
truncate table performance_schema.mutex_instances;
-->endsql
-->expecterror 1683
-->sql
truncate table performance_schema.cond_instances;
-->endsql
-->expecterror 1683
-->sql
truncate table performance_schema.threads;
-->endsql
-->expecterror 1683
-->sql
truncate table performance_schema.rwlock_instances;
-->endsql
-->expecterror 1683
-->sql
truncate table performance_schema.socket_instances;
-->endsql
-->expecterror 1683
-->sql
truncate table performance_schema.socket_summary_by_event_name;
-->endsql
-->expecterror 1683
-->sql
truncate table performance_schema.socket_summary_by_instance;

# error ER_DBACCESS_DENIED_ERROR
-->endsql
-->expecterror 1044
-->sql
ALTER TABLE performance_schema.mutex_instances ADD INDEX test_index(NAME);
-->endsql
-->expecterror 1044
-->sql
ALTER TABLE performance_schema.cond_instances ADD INDEX test_index(NAME);
-->endsql
-->expecterror 1044
-->sql
ALTER TABLE performance_schema.threads ADD INDEX test_index(PROCESSLIST_ID);
-->endsql
-->expecterror 1044
-->sql
ALTER TABLE performance_schema.rwlock_instances ADD INDEX test_index(NAME);
-->endsql
-->expecterror 1044
-->sql
ALTER TABLE performance_schema.rwlock_instances ADD INDEX socket_instances(STATE);
-->endsql
-->expecterror 1044
-->sql
ALTER TABLE performance_schema.rwlock_instances ADD INDEX socket_summary_by_event_name(EVENT_NAME);
-->endsql
-->expecterror 1044
-->sql
ALTER TABLE performance_schema.rwlock_instances ADD INDEX socket_summary_by_instance(EVENT_NAME);

# error ER_DBACCESS_DENIED_ERROR
-->endsql
-->expecterror 1044
-->sql
CREATE UNIQUE INDEX test_index ON performance_schema.mutex_instances(NAME);
-->endsql
-->expecterror 1044
-->sql
CREATE UNIQUE INDEX test_index ON performance_schema.cond_instances(NAME);
-->endsql
-->expecterror 1044
-->sql
CREATE UNIQUE INDEX test_index ON performance_schema.threads(PROCESSLIST_ID);
-->endsql
-->expecterror 1044
-->sql
CREATE UNIQUE INDEX test_index ON performance_schema.rwlock_instances(NAME);
-->endsql
-->expecterror 1044
-->sql
CREATE UNIQUE INDEX test_index ON performance_schema.socket_instances(STATE);
-->endsql
-->expecterror 1044
-->sql
CREATE UNIQUE INDEX test_index ON performance_schema.socket_summary_by_event_name(EVENT_NAME);
-->endsql
-->expecterror 1044
-->sql
CREATE UNIQUE INDEX test_index ON performance_schema.socket_summary_by_instance(EVENT_NAME);

# DML Operations Check
###########################################################################
# error ER_TABLEACCESS_DENIED_ERROR
-->endsql
-->expecterror 1142
-->sql
insert into performance_schema.mutex_instances
  set name='FOO', object_instance_begin=12;
-->endsql
-->expecterror 1142
-->sql
insert into performance_schema.cond_instances
  set name='FOO', object_instance_begin=12;
-->endsql
-->expecterror 1142
-->sql
insert into performance_schema.threads
  set name='FOO', thread_id=1, processlist_id=2;
-->endsql
-->expecterror 1142
-->sql
insert into performance_schema.rwlock_instances
  set name='FOO', object_instance_begin=12;
-->endsql
-->expecterror 1142
-->sql
insert into performance_schema.socket_instances
  set ip='', port=12;
-->endsql
-->expecterror 1142
-->sql
insert into performance_schema.socket_summary_by_event_name
  set event_name='FOO', count_read=12;
-->endsql
-->expecterror 1142
-->sql
insert into performance_schema.socket_summary_by_instance
  set event_name='FOO', count_misc=12;

# error ER_TABLEACCESS_DENIED_ERROR
-->endsql
-->expecterror 1142
-->sql
update performance_schema.mutex_instances
  set name='FOO';
-->endsql
-->expecterror 1142
-->sql
update performance_schema.cond_instances
  set name='FOO';
-->endsql
-->expecterror 1683
-->sql
update performance_schema.threads
  set thread_id=12 where PROCESSLIST_ID=connection_id();
-->endsql
-->expecterror 1683
-->sql
update performance_schema.threads
  set thread_id=12;
-->endsql
-->expecterror 1142
-->sql
update performance_schema.rwlock_instances
  set name='FOO';
-->endsql
-->expecterror 1142
-->sql
update performance_schema.socket_instances
  set ip='FOO';
-->endsql
-->expecterror 1142
-->sql
update performance_schema.socket_summary_by_event_name
  set event_name='FOO';
-->endsql
-->expecterror 1142
-->sql
update performance_schema.socket_summary_by_instance
  set event_name='FOO';

# error ER_TABLEACCESS_DENIED_ERROR
-->endsql
-->expecterror 1142
-->sql
delete from performance_schema.mutex_instances
  where name like "wait/%";
-->endsql
-->expecterror 1142
-->sql
delete from performance_schema.cond_instances
  where name like "wait/%";
-->endsql
-->expecterror 1142
-->sql
delete from performance_schema.threads
  where id=1;
-->endsql
-->expecterror 1142
-->sql
delete from performance_schema.rwlock_instances
  where name like "wait/%";
-->endsql
-->expecterror 1142
-->sql
delete from performance_schema.socket_instances
  where event_name like "wait/%";
-->endsql
-->expecterror 1142
-->sql
delete from performance_schema.socket_summary_by_event_name
  where event_name like "wait/%";
-->endsql
-->expecterror 1142
-->sql
delete from performance_schema.socket_summary_by_instance
  where event_name like "wait/%";

# error ER_TABLEACCESS_DENIED_ERROR
-->endsql
-->expecterror 1142
-->sql
delete from performance_schema.mutex_instances;
-->endsql
-->expecterror 1142
-->sql
delete from performance_schema.cond_instances;
-->endsql
-->expecterror 1142
-->sql
delete from performance_schema.threads;
-->endsql
-->expecterror 1142
-->sql
delete from performance_schema.rwlock_instances;
-->endsql
-->expecterror 1142
-->sql
delete from performance_schema.socket_instances;
-->endsql
-->expecterror 1142
-->sql
delete from performance_schema.socket_summary_by_event_name;
-->endsql
-->expecterror 1142
-->sql
delete from performance_schema.socket_summary_by_instance;

# error ER_TABLEACCESS_DENIED_ERROR
-->endsql
-->expecterror 1142
-->sql
LOCK TABLES performance_schema.mutex_instances READ;
UNLOCK TABLES;
-->endsql
-->expecterror 1142
-->sql
LOCK TABLES performance_schema.cond_instances READ;
UNLOCK TABLES;
-->endsql
-->expecterror 1142
-->sql
LOCK TABLES performance_schema.rwlock_instances READ;
UNLOCK TABLES;
-->endsql
-->expecterror 1142
-->sql
LOCK TABLES performance_schema.socket_instances READ;
UNLOCK TABLES;
-->endsql
-->expecterror 1142
-->sql
LOCK TABLES performance_schema.socket_summary_by_event_name READ;
UNLOCK TABLES;
-->endsql
-->expecterror 1142
-->sql
LOCK TABLES performance_schema.socket_summary_by_instance READ;
UNLOCK TABLES;

# error ER_TABLEACCESS_DENIED_ERROR
-->endsql
-->expecterror 1142
-->sql
LOCK TABLES performance_schema.mutex_instances WRITE;
UNLOCK TABLES;
-->endsql
-->expecterror 1142
-->sql
LOCK TABLES performance_schema.cond_instances WRITE;
UNLOCK TABLES;
-->endsql
-->expecterror 1142
-->sql
LOCK TABLES performance_schema.rwlock_instances WRITE;
UNLOCK TABLES;
-->endsql
-->expecterror 1142
-->sql
LOCK TABLES performance_schema.socket_instances WRITE;
UNLOCK TABLES;
-->endsql
-->expecterror 1142
-->sql
LOCK TABLES performance_schema.socket_summary_by_event_name WRITE;
UNLOCK TABLES;
-->endsql
-->expecterror 1142
-->sql
LOCK TABLES performance_schema.socket_summary_by_instance WRITE;
UNLOCK TABLES;
-->endsql

# Checking the tables with Mysql Crud Find
#================================================

Mysqlx.Crud.Find {
  collection {
    name: "threads"
    schema: "performance_schema"
  }
  data_model: TABLE
  projection {
    source {
      type: FUNC_CALL
      function_call {
        name {
          name: "DISTINCT"
        }
        param {
          type: IDENT
          identifier {
            name: "name"
          }
        }
      }
    }
    alias: "name"
  }
  criteria {
    type: OPERATOR
    operator {
      name: "like"
      param {
        type: IDENT
        identifier {
          name: "name"
        }
      }
      param {
        type: LITERAL
        literal {
           type: V_OCTETS
           v_octets {value:"%mysqlx%"}
        }
      }
    }
  }
  order {
    expr {
      type: IDENT
      identifier {
  		name: "name"
      }
    }
  }
}
-->recvresult

Mysqlx.Crud.Find {
  collection {
    name: "mutex_instances"
    schema: "performance_schema"
  }
  data_model: TABLE
  projection {
    source {
      type: FUNC_CALL
      function_call {
        name {
          name: "DISTINCT"
        }
        param {
          type: IDENT
          identifier {
            name: "name"
          }
        }
      }
    }
    alias: "name"
  }
  criteria {
    type: OPERATOR
    operator {
      name: "like"
      param {
        type: IDENT
        identifier {
          name: "name"
        }
      }
      param {
        type: LITERAL
        literal {
           type: V_OCTETS
           v_octets {value:"%mysqlx%"}
        }
      }
    }
  }
  order {
    expr {
      type: IDENT
      identifier {
  		name: "name"
      }
    }
  }
}
-->recvresult

Mysqlx.Crud.Find {
  collection {
    name: "cond_instances"
    schema: "performance_schema"
  }
  data_model: TABLE
  projection {
    source {
      type: FUNC_CALL
      function_call {
        name {
          name: "DISTINCT"
        }
        param {
          type: IDENT
          identifier {
            name: "name"
          }
        }
      }
    }
    alias: "name"
  }
  criteria {
    type: OPERATOR
    operator {
      name: "like"
      param {
        type: IDENT
        identifier {
          name: "name"
        }
      }
      param {
        type: LITERAL
        literal {
          type: V_OCTETS
          v_octets {value:"%mysqlx%"}
        }
      }
    }
  }
  order {
    expr {
      type: IDENT
      identifier {
  		name: "name"
      }
    }
  }
}
-->recvresult

Mysqlx.Crud.Find {
  collection {
    name: "rwlock_instances"
    schema: "performance_schema"
  }
  data_model: TABLE
  projection {
    source {
      type: FUNC_CALL
      function_call {
        name {
          name: "DISTINCT"
        }
        param {
          type: IDENT
          identifier {
            name: "name"
          }
        }
      }
    }
    alias: "name"
  }
  criteria {
    type: OPERATOR
    operator {
      name: "like"
      param {
        type: IDENT
        identifier {
          name: "name"
        }
      }
      param {
        type: LITERAL
        literal {
          type: V_OCTETS
          v_octets {value:"%mysqlx%"}
        }
      }
    }
  }
  order {
    expr {
      type: IDENT
      identifier {
  		name: "name"
      }
    }
  }
}
-->recvresult

Mysqlx.Crud.Find {
  collection {
    name: "socket_instances"
    schema: "performance_schema"
  }
  data_model: TABLE
  projection {
    source {
      type: FUNC_CALL
      function_call {
        name {
          name: "DISTINCT"
        }
        param {
          type: IDENT
          identifier {
           name: "event_name"
          }
        }
      }
    }
    alias: "event_name"
  }
  criteria {
    type: OPERATOR
    operator {
      name: "&&"
      param {
        type: OPERATOR
        operator {
          name: "like"
          param {
            type: IDENT
            identifier {
              name: "event_name"
            }
          }
          param {
            type: LITERAL
            literal {
               type: V_OCTETS
               v_octets {value:"%mysqlx%"}
            }
          }
        }
      }
      param {
        type: OPERATOR
        operator {
          name: "not_like"
          param {
            type: IDENT
            identifier {
              name: "event_name"
            }
          }
          param {
            type: LITERAL
            literal {
               type: V_OCTETS
               v_octets {value:"%unix%"}
            }
          }
        }
      }
    }
  }
  order {
    expr {
      type: IDENT
      identifier {
      name: "event_name"
      }
    }
  }
}
-->recvresult

Mysqlx.Crud.Find {
  collection {
    name: "socket_instances"
    schema: "performance_schema"
  }
  data_model: TABLE
  projection {
    source {
      type: FUNC_CALL
      function_call {
        name {
          name: "DISTINCT"
        }
        param {
          type: IDENT
          identifier {
            name: "event_name"
          }
        }
      }
    }
    alias: "event_name"
  }
  criteria {
    type: OPERATOR
    operator {
      name: "&&"
      param {
        type: OPERATOR
        operator {
          name: "like"
          param {
            type: IDENT
            identifier {
              name: "event_name"
            }
          }
          param {
            type: LITERAL
            literal {
               type: V_OCTETS
               v_octets {value:"%mysqlx%"}
            }
          }
        }
      }
      param {
        type: OPERATOR
        operator {
          name: "not_like"
          param {
            type: IDENT
            identifier {
              name: "event_name"
            }
          }
          param {
            type: LITERAL
            literal {
               type: V_OCTETS
               v_octets {value:"%unix%"}
            }
          }
        }
      }
    }
  }
  order {
    expr {
      type: IDENT
      identifier {
      name: "event_name"
      }
    }
  }
}
-->recvresult

Mysqlx.Crud.Find {
  collection {
    name: "socket_summary_by_event_name"
    schema: "performance_schema"
  }
  data_model: TABLE
  projection {
    source {
      type: FUNC_CALL
      function_call {
        name {
          name: "DISTINCT"
        }
        param {
          type: IDENT
          identifier {
            name: "event_name"
          }
        }
      }
    }
    alias: "event_name"
  }
  criteria {
    type: OPERATOR
    operator {
      name: "&&"
      param {
        type: OPERATOR
        operator {
          name: "like"
          param {
            type: IDENT
            identifier {
              name: "event_name"
            }
          }
          param {
            type: LITERAL
            literal {
               type: V_OCTETS
               v_octets {value:"%mysqlx%"}
            }
          }
        }
      }
      param {
        type: OPERATOR
        operator {
          name: "not_like"
          param {
            type: IDENT
            identifier {
              name: "event_name"
            }
          }
          param {
            type: LITERAL
            literal {
               type: V_OCTETS
               v_octets {value:"%unix%"}
            }
          }
        }
      }
    }
  }
  order {
    expr {
      type: IDENT
      identifier {
      name: "event_name"
      }
    }
  }
}
-->recvresult

Mysqlx.Crud.Find {
  collection {
    name: "socket_summary_by_instance"
    schema: "performance_schema"
  }
  data_model: TABLE
  projection {
    source {
      type: FUNC_CALL
      function_call {
        name {
          name: "DISTINCT"
        }
        param {
          type: IDENT
          identifier {
            name: "event_name"
          }
        }
      }
    }
    alias: "event_name"
  }
  criteria {
    type: OPERATOR
    operator {
      name: "&&"
      param {
        type: OPERATOR
        operator {
          name: "like"
          param {
            type: IDENT
            identifier {
              name: "event_name"
            }
          }
          param {
            type: LITERAL
            literal {
               type: V_OCTETS
               v_octets {value:"%mysqlx%"}
            }
          }
        }
      }
      param {
        type: OPERATOR
        operator {
          name: "not_like"
          param {
            type: IDENT
            identifier {
              name: "event_name"
            }
          }
          param {
            type: LITERAL
            literal {
               type: V_OCTETS
               v_octets {value:"%unix%"}
            }
          }
        }
      }
    }
  }
  order {
    expr {
      type: IDENT
      identifier {
      name: "event_name"
      }
    }
  }
}
-->recvresult

-->stmtadmin ping
-->stmtsql select sleep(1);
-->stmtadmin ping
-->stmtadmin ping
-->recvresult
-->recvresult
-->recvresult
-->recvresult

#
# Bug#22859462: SQL STMT EXECUTED THROUGH PLUGIN SERVICE API DON'T APPEAR IN PERFORMANCE SCHEMA
#
-->sql
TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
SELECT 1;
SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR from performance_schema.events_statements_summary_by_digest ORDER BY DIGEST;
-->endsql

EOF


--exec $MYSQLXTEST -uroot --password='' --file=$MYSQL_TMP_DIR/performance_schema.tmp 2>&1

## Needs rework
## select DISTINCT EVENT_NAME from performance_schema.events_waits_current 
## where EVENT_NAME like '%mysqlx%' ORDER BY EVENT_NAME; 
select DISTINCT EVENT_NAME from performance_schema.events_waits_history 
where EVENT_NAME rlike '^wait/synch/mutex/mysqlx/(client_session|obuffer|queue)$' ORDER BY EVENT_NAME;
select DISTINCT EVENT_NAME from performance_schema.events_waits_history_long 
where EVENT_NAME rlike '^wait/synch/(cond|mutex)/mysqlx/(queue|client_session|obuffer|queue)$' ORDER BY EVENT_NAME;


## Cleanup
--remove_file $MYSQL_TMP_DIR/performance_schema.tmp

## Postamble
UNINSTALL PLUGIN mysqlx;
update performance_schema.setup_instruments set ENABLED='YES'
where NAME rlike '^wait/synch/(cond|mutex)/mysqlx/(lock_list_access|scheduler_dynamic_worker_pending)$';

Man Man