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
5dd0cf1c
Commit
5dd0cf1c
authored
Dec 01, 2010
by
Marc Alff
Browse files
Options
Browse Files
Download
Plain Diff
Local merge
parents
bb9efb59
52275250
Changes
15
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
336 additions
and
119 deletions
+336
-119
BUILD/build_mccge.sh
BUILD/build_mccge.sh
+223
-70
mysql-test/suite/perfschema/include/privilege.inc
mysql-test/suite/perfschema/include/privilege.inc
+4
-4
mysql-test/suite/perfschema/r/misc.result
mysql-test/suite/perfschema/r/misc.result
+2
-2
mysql-test/suite/perfschema/r/myisam_file_io.result
mysql-test/suite/perfschema/r/myisam_file_io.result
+1
-0
mysql-test/suite/perfschema/r/privilege.result
mysql-test/suite/perfschema/r/privilege.result
+16
-16
mysql-test/suite/perfschema/r/thread_cache.result
mysql-test/suite/perfschema/r/thread_cache.result
+5
-0
mysql-test/suite/perfschema/t/misc.test
mysql-test/suite/perfschema/t/misc.test
+2
-2
mysql-test/suite/perfschema/t/myisam_file_io.test
mysql-test/suite/perfschema/t/myisam_file_io.test
+8
-0
mysql-test/suite/perfschema/t/thread_cache.test
mysql-test/suite/perfschema/t/thread_cache.test
+42
-10
storage/perfschema/ha_perfschema.cc
storage/perfschema/ha_perfschema.cc
+31
-4
storage/perfschema/ha_perfschema.h
storage/perfschema/ha_perfschema.h
+2
-3
storage/perfschema/pfs_engine_table.cc
storage/perfschema/pfs_engine_table.cc
+0
-5
storage/perfschema/table_setup_consumers.cc
storage/perfschema/table_setup_consumers.cc
+0
-1
storage/perfschema/table_setup_instruments.cc
storage/perfschema/table_setup_instruments.cc
+0
-1
storage/perfschema/table_setup_timers.cc
storage/perfschema/table_setup_timers.cc
+0
-1
No files found.
BUILD/build_mccge.sh
View file @
5dd0cf1c
This diff is collapsed.
Click to expand it.
mysql-test/suite/perfschema/include/privilege.inc
View file @
5dd0cf1c
...
...
@@ -100,16 +100,16 @@ create trigger performance_schema.bi_file_instances
before
insert
on
performance_schema
.
file_instances
for
each
row
begin
end
;
--
error
ER_
WRONG_PERFSCHEMA_USAG
E
--
error
ER_
CANT_CREATE_TABL
E
create
table
test
.
t1
(
a
int
)
engine
=
PERFORMANCE_SCHEMA
;
--
error
ER_
WRONG_PERFSCHEMA_USAG
E
--
error
ER_
CANT_CREATE_TABL
E
create
table
test
.
t1
like
performance_schema
.
setup_instruments
;
--
error
ER_
WRONG_PERFSCHEMA_USAG
E
--
error
ER_
CANT_CREATE_TABL
E
create
table
test
.
t1
like
performance_schema
.
events_waits_current
;
--
error
ER_
WRONG_PERFSCHEMA_USAG
E
--
error
ER_
CANT_CREATE_TABL
E
create
table
test
.
t1
like
performance_schema
.
file_instances
;
--
error
ER_TABLEACCESS_DENIED_ERROR
...
...
mysql-test/suite/perfschema/r/misc.result
View file @
5dd0cf1c
...
...
@@ -6,9 +6,9 @@ AND EVENT_NAME IN
WHERE NAME LIKE "wait/synch/%")
LIMIT 1;
create table test.t1(a int) engine=performance_schema;
ERROR HY000:
Invalid performance_schema usage.
ERROR HY000:
Can't create table 'test.t1' (errno: 131)
create table test.t1 like performance_schema.events_waits_current;
ERROR HY000:
Invalid performance_schema usage.
ERROR HY000:
Can't create table 'test.t1' (errno: 131)
create table performance_schema.t1(a int);
ERROR 42000: CREATE command denied to user 'root'@'localhost' for table 't1'
drop table if exists test.ghost;
...
...
mysql-test/suite/perfschema/r/myisam_file_io.result
View file @
5dd0cf1c
...
...
@@ -16,6 +16,7 @@ operation, number_of_bytes,
substring(object_name, locate("no_index_tab", object_name)) as short_name
from performance_schema.events_waits_history_long
where operation not like "tell"
and event_name like "wait/io/file/myisam/%"
order by thread_id, event_id;
event_name short_source operation number_of_bytes short_name
wait/io/file/myisam/kfile mi_create.c: create NULL no_index_tab.MYI
...
...
mysql-test/suite/perfschema/r/privilege.result
View file @
5dd0cf1c
...
...
@@ -152,13 +152,13 @@ before insert on performance_schema.file_instances
for each row begin end;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
create table test.t1(a int) engine=PERFORMANCE_SCHEMA;
ERROR HY000:
Invalid performance_schema usage.
ERROR HY000:
Can't create table 'test.t1' (errno: 131)
create table test.t1 like performance_schema.setup_instruments;
ERROR HY000:
Invalid performance_schema usage.
ERROR HY000:
Can't create table 'test.t1' (errno: 131)
create table test.t1 like performance_schema.events_waits_current;
ERROR HY000:
Invalid performance_schema usage.
ERROR HY000:
Can't create table 'test.t1' (errno: 131)
create table test.t1 like performance_schema.file_instances;
ERROR HY000:
Invalid performance_schema usage.
ERROR HY000:
Can't create table 'test.t1' (errno: 131)
insert into performance_schema.setup_instruments
set name="foo";
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'setup_instruments'
...
...
@@ -250,13 +250,13 @@ before insert on performance_schema.file_instances
for each row begin end;
ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
create table test.t1(a int) engine=PERFORMANCE_SCHEMA;
ERROR HY000:
Invalid performance_schema usage.
ERROR HY000:
Can't create table 'test.t1' (errno: 131)
create table test.t1 like performance_schema.setup_instruments;
ERROR HY000:
Invalid performance_schema usage.
ERROR HY000:
Can't create table 'test.t1' (errno: 131)
create table test.t1 like performance_schema.events_waits_current;
ERROR HY000:
Invalid performance_schema usage.
ERROR HY000:
Can't create table 'test.t1' (errno: 131)
create table test.t1 like performance_schema.file_instances;
ERROR HY000:
Invalid performance_schema usage.
ERROR HY000:
Can't create table 'test.t1' (errno: 131)
insert into performance_schema.setup_instruments
set name="foo";
ERROR 42000: INSERT command denied to user 'pfs_user_1'@'localhost' for table 'setup_instruments'
...
...
@@ -348,13 +348,13 @@ before insert on performance_schema.file_instances
for each row begin end;
ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
create table test.t1(a int) engine=PERFORMANCE_SCHEMA;
ERROR HY000:
Invalid performance_schema usage.
ERROR HY000:
Can't create table 'test.t1' (errno: 131)
create table test.t1 like performance_schema.setup_instruments;
ERROR HY000:
Invalid performance_schema usage.
ERROR HY000:
Can't create table 'test.t1' (errno: 131)
create table test.t1 like performance_schema.events_waits_current;
ERROR HY000:
Invalid performance_schema usage.
ERROR HY000:
Can't create table 'test.t1' (errno: 131)
create table test.t1 like performance_schema.file_instances;
ERROR HY000:
Invalid performance_schema usage.
ERROR HY000:
Can't create table 'test.t1' (errno: 131)
insert into performance_schema.setup_instruments
set name="foo";
ERROR 42000: INSERT command denied to user 'pfs_user_2'@'localhost' for table 'setup_instruments'
...
...
@@ -446,13 +446,13 @@ before insert on performance_schema.file_instances
for each row begin end;
ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
create table test.t1(a int) engine=PERFORMANCE_SCHEMA;
ERROR HY000:
Invalid performance_schema usage.
ERROR HY000:
Can't create table 'test.t1' (errno: 131)
create table test.t1 like performance_schema.setup_instruments;
ERROR HY000:
Invalid performance_schema usage.
ERROR HY000:
Can't create table 'test.t1' (errno: 131)
create table test.t1 like performance_schema.events_waits_current;
ERROR HY000:
Invalid performance_schema usage.
ERROR HY000:
Can't create table 'test.t1' (errno: 131)
create table test.t1 like performance_schema.file_instances;
ERROR HY000:
Invalid performance_schema usage.
ERROR HY000:
Can't create table 'test.t1' (errno: 131)
insert into performance_schema.setup_instruments
set name="foo";
ERROR 42000: INSERT command denied to user 'pfs_user_3'@'localhost' for table 'setup_instruments'
...
...
mysql-test/suite/perfschema/r/thread_cache.result
View file @
5dd0cf1c
flush status;
SET @saved_thread_cache_size = @@global.thread_cache_size;
set global thread_cache_size = 0;
show variables like "thread_cache_size";
...
...
@@ -32,3 +33,7 @@ select @thread_id_increment;
@thread_id_increment
1
set global thread_cache_size = @saved_thread_cache_size;
show status like "performance_schema_thread%";
Variable_name Value
Performance_schema_thread_classes_lost 0
Performance_schema_thread_instances_lost 0
mysql-test/suite/perfschema/t/misc.test
View file @
5dd0cf1c
...
...
@@ -38,14 +38,14 @@ LIMIT 1;
# Bug#45088 Should not be able to create tables of engine PERFORMANCE_SCHEMA
#
--
error
ER_
WRONG_PERFSCHEMA_USAG
E
--
error
ER_
CANT_CREATE_TABL
E
create
table
test
.
t1
(
a
int
)
engine
=
performance_schema
;
#
# Bug#44897 Performance Schema: can create a ghost table in another database
#
--
error
ER_
WRONG_PERFSCHEMA_USAG
E
--
error
ER_
CANT_CREATE_TABL
E
create
table
test
.
t1
like
performance_schema
.
events_waits_current
;
#
...
...
mysql-test/suite/perfschema/t/myisam_file_io.test
View file @
5dd0cf1c
...
...
@@ -46,6 +46,13 @@ insert into no_index_tab set a = 'foo', b = 1;
# Verification
# Note that mi_create.c contains mysql_file_tell() calls in debug only,
# so the result are filtered to remove 'tell'.
# Note that even after setting other instruments to enabled='NO'
# and truncating the events_waits_history_long table,
# some events -- that were already started but not completed --
# for other instruments could still be added in the history.
# To protect against that, an extra where clause
# "and event_name like "wait/io/file/myisam/%"
# is added to the select to filter out the result.
select
event_name
,
left
(
source
,
locate
(
":"
,
source
))
as
short_source
,
...
...
@@ -53,6 +60,7 @@ select event_name,
substring
(
object_name
,
locate
(
"no_index_tab"
,
object_name
))
as
short_name
from
performance_schema
.
events_waits_history_long
where
operation
not
like
"tell"
and
event_name
like
"wait/io/file/myisam/%"
order
by
thread_id
,
event_id
;
# In case of failures, this will tell if file io are lost.
...
...
mysql-test/suite/perfschema/t/thread_cache.test
View file @
5dd0cf1c
...
...
@@ -20,6 +20,8 @@
# Setup
flush
status
;
SET
@
saved_thread_cache_size
=
@@
global
.
thread_cache_size
;
set
global
thread_cache_size
=
0
;
...
...
@@ -40,7 +42,7 @@ let $con2_ID=`select connection_id()`;
let
$con2_THREAD_ID
=
`select thread_id from performance_schema.threads
where PROCESSLIST_ID = connection_id()`
;
connection
default
;
--
connection
default
--
disable_query_log
eval
select
(
$con2_ID
-
$con1_ID
)
into
@
id_increment
;
...
...
@@ -52,7 +54,15 @@ select @id_increment;
# Expect 1, THREAD_ID is incremented for each new connection
select
@
thread_id_increment
;
disconnect
con2
;
--
disconnect
con2
--
connection
default
# Wait for the disconnect con2 to complete
let
$wait_condition
=
select
count
(
*
)
=
2
from
performance_schema
.
threads
where
name
like
"thread/sql/one_connection"
;
--
source
include
/
wait_condition
.
inc
connect
(
con3
,
localhost
,
root
,
,
);
...
...
@@ -61,10 +71,16 @@ let $con3_ID=`select connection_id()`;
let
$con3_THREAD_ID
=
`select thread_id from performance_schema.threads
where PROCESSLIST_ID = connection_id()`
;
disconnect
con3
;
disconnect
con1
;
--
disconnect
con3
--
disconnect
con1
--
connection
default
connection
default
;
# Wait for the disconnect con1 and con3 to complete
let
$wait_condition
=
select
count
(
*
)
=
1
from
performance_schema
.
threads
where
name
like
"thread/sql/one_connection"
;
--
source
include
/
wait_condition
.
inc
--
disable_query_log
eval
select
(
$con3_ID
-
$con2_ID
)
into
@
id_increment
;
...
...
@@ -92,7 +108,7 @@ let $con2_ID=`select connection_id()`;
let
$con2_THREAD_ID
=
`select thread_id from performance_schema.threads
where PROCESSLIST_ID = connection_id()`
;
connection
default
;
--
connection
default
--
disable_query_log
eval
select
(
$con2_ID
-
$con1_ID
)
into
@
id_increment
;
...
...
@@ -102,7 +118,15 @@ eval select ($con2_THREAD_ID - $con1_THREAD_ID) into @thread_id_increment;
select
@
id_increment
;
select
@
thread_id_increment
;
disconnect
con2
;
--
disconnect
con2
--
connection
default
# Wait for the disconnect con2 to complete
let
$wait_condition
=
select
count
(
*
)
=
2
from
performance_schema
.
threads
where
name
like
"thread/sql/one_connection"
;
--
source
include
/
wait_condition
.
inc
connect
(
con3
,
localhost
,
root
,
,
);
...
...
@@ -111,10 +135,16 @@ let $con3_ID=`select connection_id()`;
let
$con3_THREAD_ID
=
`select thread_id from performance_schema.threads
where PROCESSLIST_ID = connection_id()`
;
disconnect
con3
;
disconnect
con1
;
--
disconnect
con3
--
disconnect
con1
connection
default
;
--
connection
default
# Wait for the disconnect con1 and con3 to complete
let
$wait_condition
=
select
count
(
*
)
=
1
from
performance_schema
.
threads
where
name
like
"thread/sql/one_connection"
;
--
source
include
/
wait_condition
.
inc
--
disable_query_log
eval
select
(
$con3_ID
-
$con2_ID
)
into
@
id_increment
;
...
...
@@ -132,3 +162,5 @@ select @thread_id_increment;
set
global
thread_cache_size
=
@
saved_thread_cache_size
;
show
status
like
"performance_schema_thread%"
;
storage/perfschema/ha_perfschema.cc
View file @
5dd0cf1c
...
...
@@ -228,7 +228,6 @@ int ha_perfschema::write_row(uchar *buf)
result
=
m_table_share
->
m_write_row
(
table
,
buf
,
table
->
field
);
else
{
my_error
(
ER_WRONG_PERFSCHEMA_USAGE
,
MYF
(
0
));
result
=
HA_ERR_WRONG_COMMAND
;
}
...
...
@@ -339,7 +338,6 @@ int ha_perfschema::delete_all_rows(void)
result
=
m_table_share
->
m_delete_all_rows
();
else
{
my_error
(
ER_WRONG_PERFSCHEMA_USAGE
,
MYF
(
0
));
result
=
HA_ERR_WRONG_COMMAND
;
}
DBUG_RETURN
(
result
);
...
...
@@ -370,7 +368,6 @@ int ha_perfschema::delete_table(const char *name)
int
ha_perfschema
::
rename_table
(
const
char
*
from
,
const
char
*
to
)
{
DBUG_ENTER
(
"ha_perfschema::rename_table "
);
my_error
(
ER_WRONG_PERFSCHEMA_USAGE
,
MYF
(
0
));
DBUG_RETURN
(
HA_ERR_WRONG_COMMAND
);
}
...
...
@@ -395,7 +392,37 @@ int ha_perfschema::create(const char *name, TABLE *table_arg,
This is not a general purpose engine.
Failure to CREATE TABLE is the expected result.
*/
my_error
(
ER_WRONG_PERFSCHEMA_USAGE
,
MYF
(
0
));
DBUG_RETURN
(
HA_ERR_WRONG_COMMAND
);
}
void
ha_perfschema
::
print_error
(
int
error
,
myf
errflag
)
{
switch
(
error
)
{
case
HA_ERR_TABLE_NEEDS_UPGRADE
:
/*
The error message for ER_TABLE_NEEDS_UPGRADE refers to REPAIR table,
which does not apply to performance schema tables.
*/
my_error
(
ER_WRONG_NATIVE_TABLE_STRUCTURE
,
MYF
(
0
),
table_share
->
db
.
str
,
table_share
->
table_name
.
str
);
break
;
case
HA_ERR_WRONG_COMMAND
:
/*
The performance schema is not a general purpose storage engine,
some operations are not supported, by design.
We do not want to print "Command not supported",
which gives the impression that a command implementation is missing,
and that the failure should be considered a bug.
We print "Invalid performance_schema usage." instead,
to emphasise that the operation attempted is not meant to be legal,
and that the failure returned is indeed the expected result.
*/
my_error
(
ER_WRONG_PERFSCHEMA_USAGE
,
MYF
(
0
));
break
;
default:
handler
::
print_error
(
error
,
errflag
);
break
;
}
}
storage/perfschema/ha_perfschema.h
View file @
5dd0cf1c
...
...
@@ -100,9 +100,6 @@ class ha_perfschema : public handler
double
scan_time
(
void
)
{
return
1.0
;
}
double
read_time
(
ha_rows
)
{
return
1.0
;
}
int
open
(
const
char
*
name
,
int
mode
,
uint
test_if_locked
);
int
close
(
void
);
...
...
@@ -149,6 +146,8 @@ class ha_perfschema : public handler
return
FALSE
;
}
virtual
void
print_error
(
int
error
,
myf
errflags
);
private:
/** MySQL lock */
THR_LOCK_DATA
m_thr_lock
;
...
...
storage/perfschema/pfs_engine_table.cc
View file @
5dd0cf1c
...
...
@@ -232,8 +232,6 @@ int PFS_engine_table::read_row(TABLE *table,
*/
if
(
!
m_share_ptr
->
m_checked
)
{
my_error
(
ER_WRONG_NATIVE_TABLE_STRUCTURE
,
MYF
(
0
),
PERFORMANCE_SCHEMA_str
.
str
,
m_share_ptr
->
m_name
.
str
);
return
HA_ERR_TABLE_NEEDS_UPGRADE
;
}
...
...
@@ -279,8 +277,6 @@ int PFS_engine_table::update_row(TABLE *table,
*/
if
(
!
m_share_ptr
->
m_checked
)
{
my_error
(
ER_WRONG_NATIVE_TABLE_STRUCTURE
,
MYF
(
0
),
PERFORMANCE_SCHEMA_str
.
str
,
m_share_ptr
->
m_name
.
str
);
return
HA_ERR_TABLE_NEEDS_UPGRADE
;
}
...
...
@@ -351,7 +347,6 @@ int PFS_engine_table::update_row_values(TABLE *,
unsigned
char
*
,
Field
**
)
{
my_error
(
ER_WRONG_PERFSCHEMA_USAGE
,
MYF
(
0
));
return
HA_ERR_WRONG_COMMAND
;
}
...
...
storage/perfschema/table_setup_consumers.cc
View file @
5dd0cf1c
...
...
@@ -192,7 +192,6 @@ int table_setup_consumers::update_row_values(TABLE *table,
switch
(
f
->
field_index
)
{
case
0
:
/* NAME */
my_error
(
ER_WRONG_PERFSCHEMA_USAGE
,
MYF
(
0
));
return
HA_ERR_WRONG_COMMAND
;
case
1
:
/* ENABLED */
{
...
...
storage/perfschema/table_setup_instruments.cc
View file @
5dd0cf1c
...
...
@@ -253,7 +253,6 @@ int table_setup_instruments::update_row_values(TABLE *table,
switch
(
f
->
field_index
)
{
case
0
:
/* NAME */
my_error
(
ER_WRONG_PERFSCHEMA_USAGE
,
MYF
(
0
));
return
HA_ERR_WRONG_COMMAND
;
case
1
:
/* ENABLED */
value
=
(
enum_yes_no
)
get_field_enum
(
f
);
...
...
storage/perfschema/table_setup_timers.cc
View file @
5dd0cf1c
...
...
@@ -164,7 +164,6 @@ int table_setup_timers::update_row_values(TABLE *table,
switch
(
f
->
field_index
)
{
case
0
:
/* NAME */
my_error
(
ER_WRONG_PERFSCHEMA_USAGE
,
MYF
(
0
));
return
HA_ERR_WRONG_COMMAND
;
case
1
:
/* TIMER_NAME */
value
=
get_field_enum
(
f
);
...
...
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