Merge branch 'merge-perfschema-5.7' into 10.5

This commit is contained in:
Oleksandr Byelkin 2022-01-28 11:57:52 +01:00
commit 880d543554
275 changed files with 1124 additions and 922 deletions

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@ -216,7 +216,7 @@
With the instrumentation, mysql_fclose(NULL, ...) will safely return 0,
which is an extension compared to my_fclose and is therefore compliant.
mysql_fclose is on purpose *not* implementing
@code DBUG_ASSERT(file != NULL) @endcode,
@code assert(file != NULL) @endcode,
since doing so could introduce regressions.
*/
#ifdef HAVE_PSI_FILE_INTERFACE

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2011, 2021, Oracle and/or its affiliates
Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
Copyright (c) 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2013, Oracle and/or its affiliates.
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
Copyright (c) 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -142,3 +142,125 @@ test SHOW WARNINGS 10
test TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1
DROP VIEW test.v1;
DROP TABLE test.t1;
CREATE TABLE test.v1 (a int, b int);
INSERT INTO test.v1 VALUES (1, 100), (2, 200), (3, 300);
CREATE TABLE test.t1 (a int, b int);
INSERT INTO test.t1 VALUES (1, 100), (2, 200), (3, 300);
TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
EXPLAIN SELECT * from test.v1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE v1 ALL NULL NULL NULL NULL 3
EXPLAIN SELECT * from test.v1 where a = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE v1 ALL NULL NULL NULL NULL 3 Using where
EXPLAIN SELECT * from test.v1 where b > 100;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE v1 ALL NULL NULL NULL NULL 3 Using where
EXPLAIN SELECT a, b from test.v1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE v1 ALL NULL NULL NULL NULL 3
EXPLAIN SELECT b, a from test.v1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE v1 ALL NULL NULL NULL NULL 3
SELECT * from test.v1;
a b
1 100
2 200
3 300
SELECT * from test.v1 where a = 1;
a b
1 100
SELECT * from test.v1 where b > 100;
a b
2 200
3 300
SELECT a, b from test.v1;
a b
1 100
2 200
3 300
SELECT b, a from test.v1;
b a
100 1
200 2
300 3
#
# DIGESTS SEEN ON TABLE
#
SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR
FROM performance_schema.events_statements_summary_by_digest
ORDER BY DIGEST_TEXT;
SCHEMA_NAME DIGEST DIGEST_TEXT COUNT_STAR
test 23ae4223590751444a6b28bccc269f28 EXPLAIN SELECT * FROM `test` . `v1` 1
test 1cea0b70727d5ebcf423c7a9f5f11e6a EXPLAIN SELECT * FROM `test` . `v1` WHERE `a` = ? 1
test db9391c55423cefa082674b57b142d3f EXPLAIN SELECT * FROM `test` . `v1` WHERE `b` > ? 1
test 1a1d023e039f4b639d112aff4b1787fd EXPLAIN SELECT `a` , `b` FROM `test` . `v1` 1
test 2f203319e6a88ebe4bd24c3e27007755 EXPLAIN SELECT `b` , `a` FROM `test` . `v1` 1
test c63bf2a3ef2f495ade3c4a629742adb2 SELECT * FROM `test` . `v1` 1
test 9afbda4813b5a6ed6ecfd87a5e24bf70 SELECT * FROM `test` . `v1` WHERE `a` = ? 1
test b062dbe5e87b6251de0d8c66d39aa7ae SELECT * FROM `test` . `v1` WHERE `b` > ? 1
test 5ee734b34d15e310711c33db7f70897e SELECT `a` , `b` FROM `test` . `v1` 1
test fc86a08f68e26afb06d7f52081ea4bee SELECT `b` , `a` FROM `test` . `v1` 1
test 8cbee21c5c16d7162a0569e1f95221af TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1
DROP TABLE test.v1;
CREATE VIEW test.v1 AS SELECT * FROM test.t1;
EXPLAIN SELECT * from test.v1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
EXPLAIN SELECT * from test.v1 where a = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
EXPLAIN SELECT * from test.v1 where b > 100;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
EXPLAIN SELECT a, b from test.v1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
EXPLAIN SELECT b, a from test.v1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
SELECT * from test.v1;
a b
1 100
2 200
3 300
SELECT * from test.v1 where a = 1;
a b
1 100
SELECT * from test.v1 where b > 100;
a b
2 200
3 300
SELECT a, b from test.v1;
a b
1 100
2 200
3 300
SELECT b, a from test.v1;
b a
100 1
200 2
300 3
#
# DIGESTS SEEN ON VIEW
#
SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR
FROM performance_schema.events_statements_summary_by_digest
ORDER BY DIGEST_TEXT;
SCHEMA_NAME DIGEST DIGEST_TEXT COUNT_STAR
test fcffd7e32486e50d54cf33df37ee4844 CREATE VIEW `test` . `v1` AS SELECT * FROM `test` . `t1` 1
test c8ded4479c089b2439ac159e3758e991 DROP TABLE `test` . `v1` 1
test 23ae4223590751444a6b28bccc269f28 EXPLAIN SELECT * FROM `test` . `v1` 2
test 1cea0b70727d5ebcf423c7a9f5f11e6a EXPLAIN SELECT * FROM `test` . `v1` WHERE `a` = ? 2
test db9391c55423cefa082674b57b142d3f EXPLAIN SELECT * FROM `test` . `v1` WHERE `b` > ? 2
test 1a1d023e039f4b639d112aff4b1787fd EXPLAIN SELECT `a` , `b` FROM `test` . `v1` 2
test 2f203319e6a88ebe4bd24c3e27007755 EXPLAIN SELECT `b` , `a` FROM `test` . `v1` 2
test c63bf2a3ef2f495ade3c4a629742adb2 SELECT * FROM `test` . `v1` 2
test 9afbda4813b5a6ed6ecfd87a5e24bf70 SELECT * FROM `test` . `v1` WHERE `a` = ? 2
test b062dbe5e87b6251de0d8c66d39aa7ae SELECT * FROM `test` . `v1` WHERE `b` > ? 2
test 5cec4fed7d65064b4f6dfbcba4caf51b SELECT SCHEMA_NAME , `DIGEST` , `DIGEST_TEXT` , `COUNT_STAR` FROM `performance_schema` . `events_statements_summary_by_digest` ORDER BY `DIGEST_TEXT` 1
test 5ee734b34d15e310711c33db7f70897e SELECT `a` , `b` FROM `test` . `v1` 2
test fc86a08f68e26afb06d7f52081ea4bee SELECT `b` , `a` FROM `test` . `v1` 2
test 8cbee21c5c16d7162a0569e1f95221af TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1
DROP VIEW test.v1;
DROP TABLE test.t1;

View file

@ -414,6 +414,8 @@ SHOW_MODE SOURCE VARIABLE_NAME
5.6 I_S.SESSION_VARIABLES INNODB_STATS_INCLUDE_DELETE_MARKED
5.6 I_S.SESSION_VARIABLES KEYRING_OPERATIONS
5.6 I_S.SESSION_VARIABLES LOG_STATEMENTS_UNSAFE_FOR_BINLOG
5.6 I_S.SESSION_VARIABLES REPLICATION_OPTIMIZE_FOR_STATIC_PLUGIN_CONFIG
5.6 I_S.SESSION_VARIABLES REPLICATION_SENDER_OBSERVE_COMMIT_ONLY
5.6 I_S.SESSION_VARIABLES TLS_VERSION
================================================================================
@ -442,6 +444,8 @@ SHOW_MODE SOURCE VARIABLE_NAME
5.6 I_S.SESSION_VARIABLES INNODB_STATS_INCLUDE_DELETE_MARKED
5.6 I_S.SESSION_VARIABLES KEYRING_OPERATIONS
5.6 I_S.SESSION_VARIABLES LOG_STATEMENTS_UNSAFE_FOR_BINLOG
5.6 I_S.SESSION_VARIABLES REPLICATION_OPTIMIZE_FOR_STATIC_PLUGIN_CONFIG
5.6 I_S.SESSION_VARIABLES REPLICATION_SENDER_OBSERVE_COMMIT_ONLY
5.6 I_S.SESSION_VARIABLES TLS_VERSION
================================================================================

View file

@ -75,3 +75,79 @@ SELECT SCHEMA_NAME, DIGEST_TEXT, COUNT_STAR
DROP VIEW test.v1;
DROP TABLE test.t1;
# ----------------------------------------------------
# Tests for the performance schema statement Digests.
# ----------------------------------------------------
# Test case to show behavior of statements digest when
# using a view
--source include/not_embedded.inc
--source include/have_perfschema.inc
--source include/no_protocol.inc
CREATE TABLE test.v1 (a int, b int);
INSERT INTO test.v1 VALUES (1, 100), (2, 200), (3, 300);
CREATE TABLE test.t1 (a int, b int);
INSERT INTO test.t1 VALUES (1, 100), (2, 200), (3, 300);
TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
#
# test.v1 is a table.
# Every query here is different, and should have a different digest.
#
EXPLAIN SELECT * from test.v1;
EXPLAIN SELECT * from test.v1 where a = 1;
EXPLAIN SELECT * from test.v1 where b > 100;
EXPLAIN SELECT a, b from test.v1;
EXPLAIN SELECT b, a from test.v1;
SELECT * from test.v1;
SELECT * from test.v1 where a = 1;
SELECT * from test.v1 where b > 100;
SELECT a, b from test.v1;
SELECT b, a from test.v1;
--echo #
--echo # DIGESTS SEEN ON TABLE
--echo #
SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR
FROM performance_schema.events_statements_summary_by_digest
ORDER BY DIGEST_TEXT;
DROP TABLE test.v1;
CREATE VIEW test.v1 AS SELECT * FROM test.t1;
#
# test.v1 is now a view.
# the query digests should be unchanged.
#
EXPLAIN SELECT * from test.v1;
EXPLAIN SELECT * from test.v1 where a = 1;
EXPLAIN SELECT * from test.v1 where b > 100;
EXPLAIN SELECT a, b from test.v1;
EXPLAIN SELECT b, a from test.v1;
SELECT * from test.v1;
SELECT * from test.v1 where a = 1;
SELECT * from test.v1 where b > 100;
SELECT a, b from test.v1;
SELECT b, a from test.v1;
--echo #
--echo # DIGESTS SEEN ON VIEW
--echo #
SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR
FROM performance_schema.events_statements_summary_by_digest
ORDER BY DIGEST_TEXT;
DROP VIEW test.v1;
DROP TABLE test.t1;

View file

@ -1,4 +1,4 @@
# Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2009, 2021, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@ -320,8 +320,8 @@ int ha_perfschema::rnd_init(bool scan)
int result;
DBUG_ENTER("ha_perfschema::rnd_init");
DBUG_ASSERT(m_table_share);
DBUG_ASSERT(m_table_share->m_open_table != NULL);
assert(m_table_share);
assert(m_table_share->m_open_table != NULL);
stats.records= 0;
if (m_table == NULL)
@ -339,7 +339,7 @@ int ha_perfschema::rnd_init(bool scan)
int ha_perfschema::rnd_end(void)
{
DBUG_ENTER("ha_perfschema::rnd_end");
DBUG_ASSERT(m_table);
assert(m_table);
delete m_table;
m_table= NULL;
DBUG_RETURN(0);
@ -371,7 +371,7 @@ void ha_perfschema::position(const uchar *record)
{
DBUG_ENTER("ha_perfschema::position");
DBUG_ASSERT(m_table);
assert(m_table);
m_table->get_position(ref);
DBUG_VOID_RETURN;
}
@ -396,7 +396,7 @@ int ha_perfschema::rnd_pos(uchar *buf, uchar *pos)
int ha_perfschema::info(uint flag)
{
DBUG_ENTER("ha_perfschema::info");
DBUG_ASSERT(m_table_share);
assert(m_table_share);
if (flag & HA_STATUS_VARIABLE)
stats.records= m_table_share->get_row_count();
if (flag & HA_STATUS_CONST)
@ -415,7 +415,7 @@ int ha_perfschema::delete_all_rows(void)
if (is_executed_by_slave())
DBUG_RETURN(0);
DBUG_ASSERT(m_table_share);
assert(m_table_share);
if (m_table_share->m_delete_all_rows)
result= m_table_share->m_delete_all_rows();
else

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@ -232,8 +232,8 @@ private:
*/
bool is_executed_by_slave() const
{
DBUG_ASSERT(table != NULL);
DBUG_ASSERT(table->in_use != NULL);
assert(table != NULL);
assert(table->in_use != NULL);
return table->in_use->slave_thread;
}

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@ -74,9 +74,9 @@ static uchar *account_hash_get_key(const uchar *entry, size_t *length,
const PFS_account *account;
const void *result;
typed_entry= reinterpret_cast<const PFS_account* const *> (entry);
DBUG_ASSERT(typed_entry != NULL);
assert(typed_entry != NULL);
account= *typed_entry;
DBUG_ASSERT(account != NULL);
assert(account != NULL);
*length= account->m_key.m_key_length;
result= account->m_key.m_hash_key;
return const_cast<uchar*> (reinterpret_cast<const uchar*> (result));
@ -123,8 +123,8 @@ static void set_account_key(PFS_account_key *key,
const char *user, uint user_length,
const char *host, uint host_length)
{
DBUG_ASSERT(user_length <= USERNAME_LENGTH);
DBUG_ASSERT(host_length <= HOSTNAME_LENGTH);
assert(user_length <= USERNAME_LENGTH);
assert(host_length <= HOSTNAME_LENGTH);
char *ptr= &key->m_hash_key[0];
if (user_length > 0)
@ -653,7 +653,7 @@ void purge_account(PFS_thread *thread, PFS_account *account)
account->m_key.m_key_length));
if (entry && (entry != MY_ERRPTR))
{
DBUG_ASSERT(*entry == account);
assert(*entry == account);
if (account->get_refcount() == 0)
{
lf_hash_delete(&account_hash, pins,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2009, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@ -253,15 +253,15 @@ void pfs_automated_sizing(PFS_global_param *param)
heuristic= estimate_hints(param);
apply_heuristic(param, heuristic);
DBUG_ASSERT(param->m_events_waits_history_sizing >= 0);
DBUG_ASSERT(param->m_events_waits_history_long_sizing >= 0);
DBUG_ASSERT(param->m_events_stages_history_sizing >= 0);
DBUG_ASSERT(param->m_events_stages_history_long_sizing >= 0);
DBUG_ASSERT(param->m_events_statements_history_sizing >= 0);
DBUG_ASSERT(param->m_events_statements_history_long_sizing >= 0);
DBUG_ASSERT(param->m_events_transactions_history_sizing >= 0);
DBUG_ASSERT(param->m_events_transactions_history_long_sizing >= 0);
DBUG_ASSERT(param->m_session_connect_attrs_sizing >= 0);
assert(param->m_events_waits_history_sizing >= 0);
assert(param->m_events_waits_history_long_sizing >= 0);
assert(param->m_events_stages_history_sizing >= 0);
assert(param->m_events_stages_history_long_sizing >= 0);
assert(param->m_events_statements_history_sizing >= 0);
assert(param->m_events_statements_history_long_sizing >= 0);
assert(param->m_events_transactions_history_sizing >= 0);
assert(param->m_events_transactions_history_long_sizing >= 0);
assert(param->m_session_connect_attrs_sizing >= 0);
}
else
{

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@ -159,7 +159,7 @@ public:
void free_array(array_type *array)
{
DBUG_ASSERT(array->m_max > 0);
assert(array->m_max > 0);
PFS_FREE_ARRAY(m_builtin_class,
array->m_max, sizeof(T), array->m_ptr);
@ -259,7 +259,7 @@ public:
iterator_type iterate(uint index)
{
DBUG_ASSERT(index <= m_max);
assert(index <= m_max);
return PFS_buffer_iterator<T, U, V>(this, index);
}
@ -319,7 +319,7 @@ public:
inline value_type* get(uint index)
{
DBUG_ASSERT(index < m_max);
assert(index < m_max);
value_type *pfs= m_array.m_ptr + index;
if (pfs->m_lock.is_populated())
@ -364,7 +364,7 @@ public:
private:
value_type* scan_next(uint & index, uint * found_index)
{
DBUG_ASSERT(index <= m_max);
assert(index <= m_max);
value_type *pfs_first= m_array.get_first();
value_type *pfs= pfs_first + index;
@ -480,9 +480,9 @@ public:
m_full= false;
}
DBUG_ASSERT(m_max_page_count <= PFS_PAGE_COUNT);
DBUG_ASSERT(0 < m_last_page_size);
DBUG_ASSERT(m_last_page_size <= PFS_PAGE_SIZE);
assert(m_max_page_count <= PFS_PAGE_COUNT);
assert(0 < m_last_page_size);
assert(m_last_page_size <= PFS_PAGE_SIZE);
pthread_mutex_init(& m_critical_section, NULL);
return 0;
@ -693,7 +693,7 @@ public:
// ==================================================================
}
DBUG_ASSERT(array != NULL);
assert(array != NULL);
pfs= array->allocate(dirty_state);
if (pfs != NULL)
{
@ -754,7 +754,7 @@ public:
iterator_type iterate(uint index)
{
DBUG_ASSERT(index <= m_max);
assert(index <= m_max);
return PFS_buffer_scalable_iterator<T, PFS_PAGE_SIZE, PFS_PAGE_COUNT, U, V>(this, index);
}
@ -862,7 +862,7 @@ public:
value_type* get(uint index)
{
DBUG_ASSERT(index < m_max);
assert(index < m_max);
uint index_1= index / PFS_PAGE_SIZE;
array_type *page= m_pages[index_1];
@ -959,13 +959,13 @@ private:
{
if (page_index + 1 < m_max_page_count)
return PFS_PAGE_SIZE;
DBUG_ASSERT(page_index + 1 == m_max_page_count);
assert(page_index + 1 == m_max_page_count);
return m_last_page_size;
}
value_type* scan_next(uint & index, uint * found_index)
{
DBUG_ASSERT(index <= m_max);
assert(index <= m_max);
uint index_1= index / PFS_PAGE_SIZE;
uint index_2= index % PFS_PAGE_SIZE;
@ -1180,7 +1180,7 @@ public:
value_type *allocate(pfs_dirty_state *dirty_state, uint partition)
{
DBUG_ASSERT(partition < PFS_PARTITION_COUNT);
assert(partition < PFS_PARTITION_COUNT);
return m_partitions[partition]->allocate(dirty_state);
}
@ -1309,7 +1309,7 @@ private:
value_type* scan_next(uint & partition_index, uint & sub_index, uint * found_partition, uint * found_sub_index)
{
value_type *record= NULL;
DBUG_ASSERT(partition_index < PFS_PARTITION_COUNT);
assert(partition_index < PFS_PARTITION_COUNT);
while (partition_index < PFS_PARTITION_COUNT)
{

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@ -152,9 +152,9 @@ static uchar *digest_hash_get_key(const uchar *entry, size_t *length,
const PFS_statements_digest_stat *digest;
const void *result;
typed_entry= reinterpret_cast<const PFS_statements_digest_stat*const*>(entry);
DBUG_ASSERT(typed_entry != NULL);
assert(typed_entry != NULL);
digest= *typed_entry;
DBUG_ASSERT(digest != NULL);
assert(digest != NULL);
*length= sizeof (PFS_digest_key);
result= & digest->m_digest_key;
return const_cast<uchar*> (reinterpret_cast<const uchar*> (result));
@ -204,7 +204,7 @@ find_or_create_digest(PFS_thread *thread,
const char *schema_name,
uint schema_name_length)
{
DBUG_ASSERT(digest_storage != NULL);
assert(digest_storage != NULL);
if (statements_digest_stat_array == NULL)
return NULL;
@ -282,7 +282,7 @@ search:
}
/* Add a new record in digest stat array. */
DBUG_ASSERT(safe_index < digest_max);
assert(safe_index < digest_max);
pfs= &statements_digest_stat_array[safe_index];
if (pfs->m_lock.is_free())

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@ -146,13 +146,13 @@ bool PFS_table_context::initialize(void)
{
/* Restore context from TLS. */
PFS_table_context *context= static_cast<PFS_table_context *>(my_get_thread_local(m_thr_key));
DBUG_ASSERT(context != NULL);
assert(context != NULL);
if(context)
{
m_last_version= context->m_current_version;
m_map= context->m_map;
DBUG_ASSERT(m_map_size == context->m_map_size);
assert(m_map_size == context->m_map_size);
m_map_size= context->m_map_size;
}
}
@ -160,7 +160,7 @@ bool PFS_table_context::initialize(void)
{
/* Check that TLS is not in use. */
PFS_table_context *context= static_cast<PFS_table_context *>(my_get_thread_local(m_thr_key));
//DBUG_ASSERT(context == NULL);
//assert(context == NULL);
context= this;
@ -525,28 +525,28 @@ void PFS_engine_table::get_normalizer(PFS_instr_class *instr_class)
void PFS_engine_table::set_field_long(Field *f, long value)
{
DBUG_ASSERT(f->real_type() == MYSQL_TYPE_LONG);
assert(f->real_type() == MYSQL_TYPE_LONG);
Field_long *f2= (Field_long*) f;
f2->store(value, false);
}
void PFS_engine_table::set_field_ulong(Field *f, ulong value)
{
DBUG_ASSERT(f->real_type() == MYSQL_TYPE_LONG);
assert(f->real_type() == MYSQL_TYPE_LONG);
Field_long *f2= (Field_long*) f;
f2->store(value, true);
}
void PFS_engine_table::set_field_longlong(Field *f, longlong value)
{
DBUG_ASSERT(f->real_type() == MYSQL_TYPE_LONGLONG);
assert(f->real_type() == MYSQL_TYPE_LONGLONG);
Field_longlong *f2= (Field_longlong*) f;
f2->store(value, false);
}
void PFS_engine_table::set_field_ulonglong(Field *f, ulonglong value)
{
DBUG_ASSERT(f->real_type() == MYSQL_TYPE_LONGLONG);
assert(f->real_type() == MYSQL_TYPE_LONGLONG);
Field_longlong *f2= (Field_longlong*) f;
f2->store(value, true);
}
@ -554,7 +554,7 @@ void PFS_engine_table::set_field_ulonglong(Field *f, ulonglong value)
void PFS_engine_table::set_field_char_utf8(Field *f, const char* str,
uint len)
{
DBUG_ASSERT(f->real_type() == MYSQL_TYPE_STRING);
assert(f->real_type() == MYSQL_TYPE_STRING);
Field_string *f2= (Field_string*) f;
f2->store(str, len, &my_charset_utf8mb3_bin);
}
@ -564,7 +564,7 @@ void PFS_engine_table::set_field_varchar(Field *f,
const char* str,
uint len)
{
DBUG_ASSERT(f->real_type() == MYSQL_TYPE_VARCHAR);
assert(f->real_type() == MYSQL_TYPE_VARCHAR);
Field_varstring *f2= (Field_varstring*) f;
f2->store(str, len, cs);
}
@ -572,7 +572,7 @@ void PFS_engine_table::set_field_varchar(Field *f,
void PFS_engine_table::set_field_varchar_utf8(Field *f, const char* str,
uint len)
{
DBUG_ASSERT(f->real_type() == MYSQL_TYPE_VARCHAR);
assert(f->real_type() == MYSQL_TYPE_VARCHAR);
Field_varstring *f2= (Field_varstring*) f;
f2->store(str, len, &my_charset_utf8mb3_bin);
}
@ -580,7 +580,7 @@ void PFS_engine_table::set_field_varchar_utf8(Field *f, const char* str,
void PFS_engine_table::set_field_longtext_utf8(Field *f, const char* str,
uint len)
{
DBUG_ASSERT(f->real_type() == MYSQL_TYPE_BLOB);
assert(f->real_type() == MYSQL_TYPE_BLOB);
Field_blob *f2= (Field_blob*) f;
f2->store(str, len, &my_charset_utf8mb3_bin);
}
@ -588,14 +588,14 @@ void PFS_engine_table::set_field_longtext_utf8(Field *f, const char* str,
void PFS_engine_table::set_field_blob(Field *f, const char* val,
uint len)
{
DBUG_ASSERT(f->real_type() == MYSQL_TYPE_BLOB);
assert(f->real_type() == MYSQL_TYPE_BLOB);
Field_blob *f2= (Field_blob*) f;
f2->store(val, len, &my_charset_utf8mb3_bin);
}
void PFS_engine_table::set_field_enum(Field *f, ulonglong value)
{
DBUG_ASSERT(f->real_type() == MYSQL_TYPE_ENUM);
assert(f->real_type() == MYSQL_TYPE_ENUM);
Field_enum *f2= (Field_enum*) f;
f2->store_type(value);
}
@ -609,14 +609,14 @@ void PFS_engine_table::set_field_timestamp(Field *f, ulonglong value)
void PFS_engine_table::set_field_double(Field *f, double value)
{
DBUG_ASSERT(f->real_type() == MYSQL_TYPE_DOUBLE);
assert(f->real_type() == MYSQL_TYPE_DOUBLE);
Field_double *f2= (Field_double*) f;
f2->store(value);
}
ulonglong PFS_engine_table::get_field_enum(Field *f)
{
DBUG_ASSERT(f->real_type() == MYSQL_TYPE_ENUM);
assert(f->real_type() == MYSQL_TYPE_ENUM);
Field_enum *f2= (Field_enum*) f;
return f2->val_int();
}
@ -624,7 +624,7 @@ ulonglong PFS_engine_table::get_field_enum(Field *f)
String*
PFS_engine_table::get_field_char_utf8(Field *f, String *val)
{
DBUG_ASSERT(f->real_type() == MYSQL_TYPE_STRING);
assert(f->real_type() == MYSQL_TYPE_STRING);
Field_string *f2= (Field_string*) f;
val= f2->val_str(NULL, val);
return val;
@ -633,7 +633,7 @@ PFS_engine_table::get_field_char_utf8(Field *f, String *val)
String*
PFS_engine_table::get_field_varchar_utf8(Field *f, String *val)
{
DBUG_ASSERT(f->real_type() == MYSQL_TYPE_VARCHAR);
assert(f->real_type() == MYSQL_TYPE_VARCHAR);
Field_varstring *f2= (Field_varstring*) f;
val= f2->val_str(NULL, val);
return val;
@ -729,7 +729,7 @@ static bool allow_drop_table_privilege() {
return false;
}
DBUG_ASSERT(thd->lex != NULL);
assert(thd->lex != NULL);
if ((thd->lex->sql_command != SQLCOM_TRUNCATE) &&
(thd->lex->sql_command != SQLCOM_GRANT)) {
return false;

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@ -101,7 +101,7 @@ void insert_events_stages_history(PFS_thread *thread, PFS_events_stages *stage)
if (unlikely(events_stages_history_per_thread == 0))
return;
DBUG_ASSERT(thread->m_stages_history != NULL);
assert(thread->m_stages_history != NULL);
uint index= thread->m_stages_history_index;
@ -133,7 +133,7 @@ void insert_events_stages_history_long(PFS_events_stages *stage)
if (unlikely(events_stages_history_long_size == 0))
return;
DBUG_ASSERT(events_stages_history_long_array != NULL);
assert(events_stages_history_long_array != NULL);
uint index= PFS_atomic::add_u32(&events_stages_history_long_index.m_u32, 1);

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@ -179,7 +179,7 @@ void insert_events_statements_history(PFS_thread *thread, PFS_events_statements
if (unlikely(events_statements_history_per_thread == 0))
return;
DBUG_ASSERT(thread->m_statements_history != NULL);
assert(thread->m_statements_history != NULL);
uint index= thread->m_statements_history_index;
@ -211,7 +211,7 @@ void insert_events_statements_history_long(PFS_events_statements *statement)
if (unlikely(events_statements_history_long_size == 0))
return ;
DBUG_ASSERT(events_statements_history_long_array != NULL);
assert(events_statements_history_long_array != NULL);
uint index= PFS_atomic::add_u32(&events_statements_history_long_index.m_u32, 1);

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@ -101,7 +101,7 @@ void insert_events_transactions_history(PFS_thread *thread, PFS_events_transacti
if (unlikely(events_transactions_history_per_thread == 0))
return;
DBUG_ASSERT(thread->m_transactions_history != NULL);
assert(thread->m_transactions_history != NULL);
uint index= thread->m_transactions_history_index;
@ -133,7 +133,7 @@ void insert_events_transactions_history_long(PFS_events_transactions *transactio
if (unlikely(events_transactions_history_long_size == 0))
return ;
DBUG_ASSERT(events_transactions_history_long_array != NULL);
assert(events_transactions_history_long_array != NULL);
uint index= PFS_atomic::add_u32(&events_transactions_history_long_index.m_u32, 1);
@ -252,7 +252,7 @@ bool xid_printable(PSI_xid *xid, size_t offset, size_t length)
if (xid->is_null())
return false;
DBUG_ASSERT(offset + length <= MYSQL_XIDDATASIZE);
assert(offset + length <= MYSQL_XIDDATASIZE);
unsigned char *c= (unsigned char*)&xid->data + offset;

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates..
Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights
reserved.
This program is free software; you can redistribute it and/or modify
@ -59,8 +59,8 @@ bool pfs_initialized= false;
*/
void *pfs_malloc(PFS_builtin_memory_class *klass, size_t size, myf flags)
{
DBUG_ASSERT(klass != NULL);
DBUG_ASSERT(size > 0);
assert(klass != NULL);
assert(size > 0);
void *ptr= NULL;
@ -137,9 +137,9 @@ void pfs_free(PFS_builtin_memory_class *klass, size_t size, void *ptr)
*/
void *pfs_malloc_array(PFS_builtin_memory_class *klass, size_t n, size_t size, myf flags)
{
DBUG_ASSERT(klass != NULL);
DBUG_ASSERT(n > 0);
DBUG_ASSERT(size > 0);
assert(klass != NULL);
assert(n > 0);
assert(size > 0);
void *ptr= NULL;
size_t array_size= n * size;
/* Check for overflow before allocating. */
@ -172,7 +172,7 @@ void pfs_free_array(PFS_builtin_memory_class *klass, size_t n, size_t size, void
return;
size_t array_size= n * size;
/* Overflow should have been detected by pfs_malloc_array. */
DBUG_ASSERT(!is_overflow(array_size, n, size));
assert(!is_overflow(array_size, n, size));
return pfs_free(klass, array_size, ptr);
}
@ -215,9 +215,9 @@ uint pfs_get_socket_address(char *host,
const struct sockaddr_storage *src_addr,
socklen_t src_len)
{
DBUG_ASSERT(host);
DBUG_ASSERT(src_addr);
DBUG_ASSERT(port);
assert(host);
assert(src_addr);
assert(port);
memset(host, 0, host_len);
*port= 0;

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@ -175,7 +175,7 @@ inline uint randomized_index(const void *ptr, uint max_size)
seed2= seed1*seed1;
seed1= result;
DBUG_ASSERT(result < max_size);
assert(result < max_size);
return result;
}

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@ -71,9 +71,9 @@ static uchar *host_hash_get_key(const uchar *entry, size_t *length,
const PFS_host *host;
const void *result;
typed_entry= reinterpret_cast<const PFS_host* const *> (entry);
DBUG_ASSERT(typed_entry != NULL);
assert(typed_entry != NULL);
host= *typed_entry;
DBUG_ASSERT(host != NULL);
assert(host != NULL);
*length= host->m_key.m_key_length;
result= host->m_key.m_hash_key;
return const_cast<uchar*> (reinterpret_cast<const uchar*> (result));
@ -119,7 +119,7 @@ static LF_PINS* get_host_hash_pins(PFS_thread *thread)
static void set_host_key(PFS_host_key *key,
const char *host, uint host_length)
{
DBUG_ASSERT(host_length <= HOSTNAME_LENGTH);
assert(host_length <= HOSTNAME_LENGTH);
char *ptr= &key->m_hash_key[0];
if (host_length > 0)
@ -328,7 +328,7 @@ void purge_host(PFS_thread *thread, PFS_host *host)
host->m_key.m_hash_key, host->m_key.m_key_length));
if (entry && (entry != MY_ERRPTR))
{
DBUG_ASSERT(*entry == host);
assert(*entry == host);
if (host->get_refcount() == 0)
{
lf_hash_delete(&host_hash, pins,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@ -107,7 +107,7 @@ int init_instruments(const PFS_global_param *param)
uint index;
/* Make sure init_event_name_sizing is called */
DBUG_ASSERT(wait_class_max != 0);
assert(wait_class_max != 0);
file_handle_max= param->m_file_handle_sizing;
file_handle_full= false;
@ -259,9 +259,9 @@ static uchar *filename_hash_get_key(const uchar *entry, size_t *length,
const PFS_file *file;
const void *result;
typed_entry= reinterpret_cast<const PFS_file* const *> (entry);
DBUG_ASSERT(typed_entry != NULL);
assert(typed_entry != NULL);
file= *typed_entry;
DBUG_ASSERT(file != NULL);
assert(file != NULL);
*length= file->m_filename_length;
result= file->m_filename;
return const_cast<uchar*> (reinterpret_cast<const uchar*> (result));
@ -328,7 +328,7 @@ PFS_mutex* create_mutex(PFS_mutex_class *klass, const void *identity)
*/
void destroy_mutex(PFS_mutex *pfs)
{
DBUG_ASSERT(pfs != NULL);
assert(pfs != NULL);
PFS_mutex_class *klass= pfs->m_class;
/* Aggregate to EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME */
klass->m_mutex_stat.aggregate(& pfs->m_mutex_stat);
@ -376,7 +376,7 @@ PFS_rwlock* create_rwlock(PFS_rwlock_class *klass, const void *identity)
*/
void destroy_rwlock(PFS_rwlock *pfs)
{
DBUG_ASSERT(pfs != NULL);
assert(pfs != NULL);
PFS_rwlock_class *klass= pfs->m_class;
/* Aggregate to EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME */
klass->m_rwlock_stat.aggregate(& pfs->m_rwlock_stat);
@ -420,7 +420,7 @@ PFS_cond* create_cond(PFS_cond_class *klass, const void *identity)
*/
void destroy_cond(PFS_cond *pfs)
{
DBUG_ASSERT(pfs != NULL);
assert(pfs != NULL);
PFS_cond_class *klass= pfs->m_class;
/* Aggregate to EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME */
klass->m_cond_stat.aggregate(& pfs->m_cond_stat);
@ -651,14 +651,14 @@ PFS_metadata_lock *sanitize_metadata_lock(PFS_metadata_lock *unsafe)
*/
void destroy_thread(PFS_thread *pfs)
{
DBUG_ASSERT(pfs != NULL);
assert(pfs != NULL);
pfs->reset_session_connect_attrs();
if (pfs->m_account != NULL)
{
pfs->m_account->release();
pfs->m_account= NULL;
DBUG_ASSERT(pfs->m_user == NULL);
DBUG_ASSERT(pfs->m_host == NULL);
assert(pfs->m_user == NULL);
assert(pfs->m_host == NULL);
}
else
{
@ -752,7 +752,7 @@ find_or_create_file(PFS_thread *thread, PFS_file_class *klass,
{
PFS_file *pfs;
DBUG_ASSERT(klass != NULL || ! create);
assert(klass != NULL || ! create);
LF_PINS *pins= get_filename_hash_pins(thread);
if (unlikely(pins == NULL))
@ -927,7 +927,7 @@ void find_and_rename_file(PFS_thread *thread, const char *old_filename,
{
PFS_file *pfs;
DBUG_ASSERT(thread != NULL);
assert(thread != NULL);
LF_PINS *pins= get_filename_hash_pins(thread);
if (unlikely(pins == NULL))
@ -1070,7 +1070,7 @@ void find_and_rename_file(PFS_thread *thread, const char *old_filename,
*/
void release_file(PFS_file *pfs)
{
DBUG_ASSERT(pfs != NULL);
assert(pfs != NULL);
pfs->m_file_stat.m_open_count--;
}
@ -1081,8 +1081,8 @@ void release_file(PFS_file *pfs)
*/
void destroy_file(PFS_thread *thread, PFS_file *pfs)
{
DBUG_ASSERT(thread != NULL);
DBUG_ASSERT(pfs != NULL);
assert(thread != NULL);
assert(pfs != NULL);
PFS_file_class *klass= pfs->m_class;
/* Aggregate to FILE_SUMMARY_BY_EVENT_NAME */
@ -1093,7 +1093,7 @@ void destroy_file(PFS_thread *thread, PFS_file *pfs)
klass->m_singleton= NULL;
LF_PINS *pins= get_filename_hash_pins(thread);
DBUG_ASSERT(pins != NULL);
assert(pins != NULL);
lf_hash_delete(&pfs_filename_hash, pins,
pfs->m_filename, pfs->m_filename_length);
@ -1187,8 +1187,8 @@ void PFS_table::safe_aggregate_io(const TABLE_SHARE *optional_server_share,
PFS_table_stat *table_stat,
PFS_table_share *table_share)
{
DBUG_ASSERT(table_stat != NULL);
DBUG_ASSERT(table_share != NULL);
assert(table_stat != NULL);
assert(table_share != NULL);
uint key_count= sanitize_index_count(table_share->m_key_count);
@ -1196,7 +1196,7 @@ void PFS_table::safe_aggregate_io(const TABLE_SHARE *optional_server_share,
PFS_table_io_stat *from_stat;
uint index;
DBUG_ASSERT(key_count <= MAX_INDEXES);
assert(key_count <= MAX_INDEXES);
/* Aggregate stats for each index, if any */
for (index= 0; index < key_count; index++)
@ -1250,8 +1250,8 @@ void PFS_table::safe_aggregate_io(const TABLE_SHARE *optional_server_share,
void PFS_table::safe_aggregate_lock(PFS_table_stat *table_stat,
PFS_table_share *table_share)
{
DBUG_ASSERT(table_stat != NULL);
DBUG_ASSERT(table_share != NULL);
assert(table_stat != NULL);
assert(table_share != NULL);
PFS_table_lock_stat *from_stat= & table_stat->m_lock_stat;
@ -1273,7 +1273,7 @@ void PFS_table::safe_aggregate_lock(PFS_table_stat *table_stat,
*/
void destroy_table(PFS_table *pfs)
{
DBUG_ASSERT(pfs != NULL);
assert(pfs != NULL);
pfs->m_share->dec_refcount();
global_table_container.deallocate(pfs);
}
@ -1341,7 +1341,7 @@ PFS_socket* create_socket(PFS_socket_class *klass, const my_socket *fd,
*/
void destroy_socket(PFS_socket *pfs)
{
DBUG_ASSERT(pfs != NULL);
assert(pfs != NULL);
PFS_socket_class *klass= pfs->m_class;
/* Aggregate to SOCKET_SUMMARY_BY_EVENT_NAME */
@ -1408,7 +1408,7 @@ PFS_metadata_lock* create_metadata_lock(void *identity,
void destroy_metadata_lock(PFS_metadata_lock *pfs)
{
DBUG_ASSERT(pfs != NULL);
assert(pfs != NULL);
global_mdl_container.deallocate(pfs);
}
@ -1635,8 +1635,8 @@ void aggregate_all_statements(PFS_statement_stat *from_array,
void aggregate_all_transactions(PFS_transaction_stat *from_array,
PFS_transaction_stat *to_array)
{
DBUG_ASSERT(from_array != NULL);
DBUG_ASSERT(to_array != NULL);
assert(from_array != NULL);
assert(to_array != NULL);
if (from_array->count() > 0)
{
@ -1649,9 +1649,9 @@ void aggregate_all_transactions(PFS_transaction_stat *from_array,
PFS_transaction_stat *to_array_1,
PFS_transaction_stat *to_array_2)
{
DBUG_ASSERT(from_array != NULL);
DBUG_ASSERT(to_array_1 != NULL);
DBUG_ASSERT(to_array_2 != NULL);
assert(from_array != NULL);
assert(to_array_1 != NULL);
assert(to_array_2 != NULL);
if (from_array->count() > 0)
{
@ -2160,9 +2160,9 @@ void clear_thread_account(PFS_thread *thread)
void set_thread_account(PFS_thread *thread)
{
DBUG_ASSERT(thread->m_account == NULL);
DBUG_ASSERT(thread->m_user == NULL);
DBUG_ASSERT(thread->m_host == NULL);
assert(thread->m_account == NULL);
assert(thread->m_user == NULL);
assert(thread->m_host == NULL);
thread->m_account= find_or_create_account(thread,
thread->m_username,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
Copyright (c) 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
@ -410,9 +410,9 @@ static uchar *table_share_hash_get_key(const uchar *entry, size_t *length,
const PFS_table_share *share;
const void *result;
typed_entry= reinterpret_cast<const PFS_table_share* const *> (entry);
DBUG_ASSERT(typed_entry != NULL);
assert(typed_entry != NULL);
share= *typed_entry;
DBUG_ASSERT(share != NULL);
assert(share != NULL);
*length= share->m_key.m_key_length;
result= &share->m_key.m_hash_key[0];
return const_cast<uchar*> (reinterpret_cast<const uchar*> (result));
@ -471,8 +471,8 @@ static void set_table_share_key(PFS_table_share_key *key,
const char *schema_name, size_t schema_name_length,
const char *table_name, size_t table_name_length)
{
DBUG_ASSERT(schema_name_length <= NAME_LEN);
DBUG_ASSERT(table_name_length <= NAME_LEN);
assert(schema_name_length <= NAME_LEN);
assert(table_name_length <= NAME_LEN);
char *saved_schema_name;
char *saved_table_name;
@ -586,7 +586,7 @@ void PFS_table_share::destroy_lock_stat()
PFS_table_share_index*
PFS_table_share::find_index_stat(uint index) const
{
DBUG_ASSERT(index <= MAX_INDEXES);
assert(index <= MAX_INDEXES);
PFS_table_share *that= const_cast<PFS_table_share*>(this);
void *addr= & that->m_race_index_stat[index];
@ -610,7 +610,7 @@ PFS_table_share::find_index_stat(uint index) const
PFS_table_share_index*
PFS_table_share::find_or_create_index_stat(const TABLE_SHARE *server_share, uint index)
{
DBUG_ASSERT(index <= MAX_INDEXES);
assert(index <= MAX_INDEXES);
void *addr= & this->m_race_index_stat[index];
void * volatile * typed_addr= static_cast<void * volatile *>(addr);
@ -763,7 +763,7 @@ int init_table_share_index_stat(uint index_stat_sizing)
PFS_table_share_index*
create_table_share_index_stat(const TABLE_SHARE *server_share, uint server_index)
{
DBUG_ASSERT((server_share != NULL) || (server_index == MAX_INDEXES));
assert((server_share != NULL) || (server_index == MAX_INDEXES));
PFS_table_share_index *pfs= NULL;
pfs_dirty_state dirty_state;
@ -1005,7 +1005,7 @@ static void init_instr_class(PFS_instr_class *klass,
int flags,
PFS_class_type class_type)
{
DBUG_ASSERT(name_length <= PFS_MAX_INFO_NAME_LENGTH);
assert(name_length <= PFS_MAX_INFO_NAME_LENGTH);
memset(klass, 0, sizeof(PFS_instr_class));
strncpy(klass->m_name, name, name_length);
klass->m_name[PFS_MAX_INFO_NAME_LENGTH - 1]= '\0';
@ -1062,7 +1062,7 @@ static void configure_instr_class(PFS_instr_class *entry)
if ((entry->m_name_length == NAME_LENGTH) && \
(strncmp(entry->m_name, NAME, NAME_LENGTH) == 0)) \
{ \
DBUG_ASSERT(entry->m_flags == flags); \
assert(entry->m_flags == flags); \
return (INDEX + 1); \
} \
}
@ -1316,7 +1316,7 @@ PFS_thread_key register_thread_class(const char *name, uint name_length,
if (index < thread_class_max)
{
entry= &thread_class_array[index];
DBUG_ASSERT(name_length <= PFS_MAX_INFO_NAME_LENGTH);
assert(name_length <= PFS_MAX_INFO_NAME_LENGTH);
strncpy(entry->m_name, name, name_length);
entry->m_name_length= name_length;
entry->m_enabled= true;
@ -1883,7 +1883,7 @@ void PFS_table_share::sum_io(PFS_single_stat *result, uint key_count)
uint index;
PFS_table_share_index *stat;
DBUG_ASSERT(key_count <= MAX_INDEXES);
assert(key_count <= MAX_INDEXES);
/* Sum stats for each index, if any */
for (index= 0; index < key_count; index++)
@ -1931,7 +1931,7 @@ void PFS_table_share::aggregate_lock(void)
void release_table_share(PFS_table_share *pfs)
{
DBUG_ASSERT(pfs->get_refcount() > 0);
assert(pfs->get_refcount() > 0);
pfs->dec_refcount();
}

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@ -172,13 +172,13 @@ struct PFS_instr_class
bool is_progress() const
{
DBUG_ASSERT(m_type == PFS_CLASS_STAGE);
assert(m_type == PFS_CLASS_STAGE);
return m_flags & PSI_FLAG_STAGE_PROGRESS;
}
bool is_shared_exclusive() const
{
DBUG_ASSERT(m_type == PFS_CLASS_RWLOCK);
assert(m_type == PFS_CLASS_RWLOCK);
return m_flags & PSI_RWLOCK_FLAG_SX;
}

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2009, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@ -173,7 +173,7 @@ struct pfs_lock
{
uint32 copy= copy_version_state();
/* Make sure the record was ALLOCATED. */
DBUG_ASSERT((copy & STATE_MASK) == PFS_LOCK_ALLOCATED);
assert((copy & STATE_MASK) == PFS_LOCK_ALLOCATED);
/* Keep the same version, set the DIRTY state */
uint32 new_val= (copy & VERSION_MASK) + PFS_LOCK_DIRTY;
/* We own the record, no need to use compare and swap. */
@ -191,7 +191,7 @@ struct pfs_lock
void dirty_to_allocated(const pfs_dirty_state *copy)
{
/* Make sure the record was DIRTY. */
DBUG_ASSERT((copy->m_version_state & STATE_MASK) == PFS_LOCK_DIRTY);
assert((copy->m_version_state & STATE_MASK) == PFS_LOCK_DIRTY);
/* Increment the version, set the ALLOCATED state */
uint32 new_val= (copy->m_version_state & VERSION_MASK) + VERSION_INC + PFS_LOCK_ALLOCATED;
@ -234,7 +234,7 @@ struct pfs_lock
void dirty_to_free(const pfs_dirty_state *copy)
{
/* Make sure the record was DIRTY. */
DBUG_ASSERT((copy->m_version_state & STATE_MASK) == PFS_LOCK_DIRTY);
assert((copy->m_version_state & STATE_MASK) == PFS_LOCK_DIRTY);
/* Keep the same version, set the FREE state */
uint32 new_val= (copy->m_version_state & VERSION_MASK) + PFS_LOCK_FREE;
@ -254,7 +254,7 @@ struct pfs_lock
*/
uint32 copy= copy_version_state();
/* Make sure the record was ALLOCATED. */
DBUG_ASSERT(((copy & STATE_MASK) == PFS_LOCK_ALLOCATED));
assert(((copy & STATE_MASK) == PFS_LOCK_ALLOCATED));
/* Keep the same version, set the FREE state */
uint32 new_val= (copy & VERSION_MASK) + PFS_LOCK_FREE;

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@ -70,9 +70,9 @@ static uchar *program_hash_get_key(const uchar *entry, size_t *length,
const PFS_program *program;
const void *result;
typed_entry= reinterpret_cast<const PFS_program* const *> (entry);
DBUG_ASSERT(typed_entry != NULL);
assert(typed_entry != NULL);
program= *typed_entry;
DBUG_ASSERT(program != NULL);
assert(program != NULL);
*length= program->m_key.m_key_length;
result= program->m_key.m_hash_key;
return const_cast<uchar*> (reinterpret_cast<const uchar*> (result));
@ -109,8 +109,8 @@ static void set_program_key(PFS_program_key *key,
const char *object_name, uint object_name_length,
const char *schema_name, uint schema_name_length)
{
DBUG_ASSERT(object_name_length <= COL_OBJECT_NAME_SIZE);
DBUG_ASSERT(schema_name_length <= COL_OBJECT_SCHEMA_SIZE);
assert(object_name_length <= COL_OBJECT_NAME_SIZE);
assert(schema_name_length <= COL_OBJECT_SCHEMA_SIZE);
/*
To make sure generated key is case insensitive,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@ -211,7 +211,7 @@ initialize_performance_schema(PFS_global_param *param)
static void destroy_pfs_thread(void *key)
{
PFS_thread* pfs= reinterpret_cast<PFS_thread*> (key);
DBUG_ASSERT(pfs);
assert(pfs);
/*
This automatic cleanup is a last resort and best effort to avoid leaks,
and may not work on windows due to the implementation of pthread_key_create().

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@ -70,9 +70,9 @@ static uchar *setup_actor_hash_get_key(const uchar *entry, size_t *length,
const PFS_setup_actor *setup_actor;
const void *result;
typed_entry= reinterpret_cast<const PFS_setup_actor* const *> (entry);
DBUG_ASSERT(typed_entry != NULL);
assert(typed_entry != NULL);
setup_actor= *typed_entry;
DBUG_ASSERT(setup_actor != NULL);
assert(setup_actor != NULL);
*length= setup_actor->m_key.m_key_length;
result= setup_actor->m_key.m_hash_key;
return const_cast<uchar*> (reinterpret_cast<const uchar*> (result));
@ -121,8 +121,8 @@ static void set_setup_actor_key(PFS_setup_actor_key *key,
const char *host, uint host_length,
const char *role, uint role_length)
{
DBUG_ASSERT(user_length <= USERNAME_LENGTH);
DBUG_ASSERT(host_length <= HOSTNAME_LENGTH);
assert(user_length <= USERNAME_LENGTH);
assert(host_length <= HOSTNAME_LENGTH);
char *ptr= &key->m_hash_key[0];
memcpy(ptr, user, user_length);

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@ -70,9 +70,9 @@ static uchar *setup_object_hash_get_key(const uchar *entry, size_t *length,
const PFS_setup_object *setup_object;
const void *result;
typed_entry= reinterpret_cast<const PFS_setup_object* const *> (entry);
DBUG_ASSERT(typed_entry != NULL);
assert(typed_entry != NULL);
setup_object= *typed_entry;
DBUG_ASSERT(setup_object != NULL);
assert(setup_object != NULL);
*length= setup_object->m_key.m_key_length;
result= setup_object->m_key.m_hash_key;
return const_cast<uchar*> (reinterpret_cast<const uchar*> (result));
@ -120,8 +120,8 @@ static void set_setup_object_key(PFS_setup_object_key *key,
const char *schema, uint schema_length,
const char *object, uint object_length)
{
DBUG_ASSERT(schema_length <= NAME_LEN);
DBUG_ASSERT(object_length <= NAME_LEN);
assert(schema_length <= NAME_LEN);
assert(object_length <= NAME_LEN);
char *ptr= &key->m_hash_key[0];
ptr[0]= (char) object_type;
@ -284,7 +284,7 @@ void lookup_setup_object(PFS_thread *thread,
- TABLE foo.bar
- TEMPORARY TABLE foo.bar
*/
DBUG_ASSERT(object_type != OBJECT_TYPE_TEMPORARY_TABLE);
assert(object_type != OBJECT_TYPE_TEMPORARY_TABLE);
LF_PINS* pins= get_setup_object_hash_pins(thread);
if (unlikely(pins == NULL))

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@ -722,7 +722,7 @@ struct PFS_table_stat
PFS_table_io_stat *to_stat_last;
const PFS_table_io_stat *from_stat;
DBUG_ASSERT(key_count <= MAX_INDEXES);
assert(key_count <= MAX_INDEXES);
/* Aggregate stats for each index, if any */
to_stat= & m_index_stat[0];
@ -753,7 +753,7 @@ struct PFS_table_stat
PFS_table_io_stat *stat;
PFS_table_io_stat *stat_last;
DBUG_ASSERT(key_count <= MAX_INDEXES);
assert(key_count <= MAX_INDEXES);
/* Sum stats for each index, if any */
stat= & m_index_stat[0];

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@ -249,7 +249,7 @@ ulonglong get_timer_raw_value(enum_timer_name timer_name)
case TIMER_NAME_TICK:
return my_timer_ticks();
default:
DBUG_ASSERT(false);
assert(false);
}
return 0;
}
@ -275,7 +275,7 @@ ulonglong get_timer_raw_value_and_function(enum_timer_name timer_name, timer_fct
return my_timer_ticks();
default:
*fct= NULL;
DBUG_ASSERT(false);
assert(false);
}
return 0;
}
@ -303,7 +303,7 @@ ulonglong get_timer_pico_value(enum_timer_name timer_name)
break;
default:
result= 0;
DBUG_ASSERT(false);
assert(false);
}
return result;
}
@ -312,8 +312,8 @@ time_normalizer* time_normalizer::get(enum_timer_name timer_name)
{
uint index= static_cast<uint> (timer_name);
DBUG_ASSERT(index >= FIRST_TIMER_NAME);
DBUG_ASSERT(index <= LAST_TIMER_NAME);
assert(index >= FIRST_TIMER_NAME);
assert(index <= LAST_TIMER_NAME);
return & to_pico_data[index];
}

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@ -71,9 +71,9 @@ static uchar *user_hash_get_key(const uchar *entry, size_t *length,
const PFS_user *user;
const void *result;
typed_entry= reinterpret_cast<const PFS_user* const *> (entry);
DBUG_ASSERT(typed_entry != NULL);
assert(typed_entry != NULL);
user= *typed_entry;
DBUG_ASSERT(user != NULL);
assert(user != NULL);
*length= user->m_key.m_key_length;
result= user->m_key.m_hash_key;
return const_cast<uchar*> (reinterpret_cast<const uchar*> (result));
@ -119,7 +119,7 @@ static LF_PINS* get_user_hash_pins(PFS_thread *thread)
static void set_user_key(PFS_user_key *key,
const char *user, uint user_length)
{
DBUG_ASSERT(user_length <= USERNAME_LENGTH);
assert(user_length <= USERNAME_LENGTH);
char *ptr= &key->m_hash_key[0];
if (user_length > 0)
@ -293,7 +293,7 @@ void purge_user(PFS_thread *thread, PFS_user *user)
user->m_key.m_hash_key, user->m_key.m_key_length));
if (entry && (entry != MY_ERRPTR))
{
DBUG_ASSERT(*entry == user);
assert(*entry == user);
if (user->get_refcount() == 0)
{
lf_hash_delete(&user_hash, pins,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
Copyright (c) 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
@ -82,7 +82,7 @@ static inline SHOW_SCOPE show_scope_from_type(enum enum_mysql_show_type type)
*/
bool PFS_system_variable_cache::init_show_var_array(enum_var_type scope, bool strict)
{
DBUG_ASSERT(!m_initialized);
assert(!m_initialized);
m_query_scope= scope;
mysql_prlock_rdlock(&LOCK_system_variables_hash);
@ -172,7 +172,7 @@ int PFS_system_variable_cache::do_materialize_global(void)
{
const char* name= show_var->name;
sys_var *value= (sys_var *)show_var->value;
DBUG_ASSERT(value);
assert(value);
if ((m_query_scope == OPT_GLOBAL) &&
(!my_strcasecmp(system_charset_info, name, "sql_log_bin")))
@ -200,7 +200,7 @@ int PFS_system_variable_cache::do_materialize_global(void)
The assert below will fail once SQL_LOG_BIN really is defined
as SESSION_ONLY (in 5.8), so that this special case can be removed.
*/
DBUG_ASSERT(value->scope() == sys_var::SESSION);
assert(value->scope() == sys_var::SESSION);
continue;
}
@ -330,7 +330,7 @@ int PFS_system_variable_cache::do_materialize_session(PFS_thread *pfs_thread)
mysql_mutex_lock(&LOCK_plugin_delete);
/* The SHOW_VAR array must be initialized externally. */
DBUG_ASSERT(m_initialized);
assert(m_initialized);
/* Use a temporary mem_root to avoid depleting THD mem_root. */
if (m_use_mem_root)
@ -385,7 +385,7 @@ int PFS_system_variable_cache::do_materialize_session(PFS_thread *pfs_thread, ui
mysql_mutex_lock(&LOCK_plugin_delete);
/* The SHOW_VAR array must be initialized externally. */
DBUG_ASSERT(m_initialized);
assert(m_initialized);
/* Get and lock a validated THD from the thread manager. */
if ((m_safe_thd= get_THD(pfs_thread)) != NULL)
@ -524,7 +524,7 @@ void System_variable::init(THD *target_thd, const SHOW_VAR *show_var,
mysql_mutex_lock(&target_thd->LOCK_thd_sysvar);*/
sys_var *system_var= (sys_var *)show_var->value;
DBUG_ASSERT(system_var != NULL);
assert(system_var != NULL);
m_charset= system_var->charset(target_thd);
m_type= system_var->show_type();
m_scope= system_var->scope();
@ -655,8 +655,8 @@ bool PFS_status_variable_cache::match_scope(SHOW_SCOPE variable_scope, bool stri
*/
bool PFS_status_variable_cache::filter_by_name(const SHOW_VAR *show_var)
{
DBUG_ASSERT(show_var);
DBUG_ASSERT(show_var->name);
assert(show_var);
assert(show_var->name);
if (show_var->type == SHOW_ARRAY)
{
@ -765,7 +765,7 @@ bool PFS_status_variable_cache::filter_show_var(const SHOW_VAR *show_var, bool s
*/
bool PFS_status_variable_cache::init_show_var_array(enum_var_type scope, bool strict)
{
DBUG_ASSERT(!m_initialized);
assert(!m_initialized);
/* Resize if necessary. */
m_show_var_array.reserve(all_status_vars.elements + 1);
@ -844,7 +844,7 @@ void PFS_status_variable_cache::expand_show_var_array(const SHOW_VAR *show_var_a
char * PFS_status_variable_cache::make_show_var_name(const char* prefix, const char* name,
char *name_buf, size_t buf_len)
{
DBUG_ASSERT(name_buf != NULL);
assert(name_buf != NULL);
char *prefix_end= name_buf;
if (prefix && *prefix)
@ -960,7 +960,7 @@ int PFS_status_variable_cache::do_materialize_global(void)
int PFS_status_variable_cache::do_materialize_all(THD* unsafe_thd)
{
int ret= 1;
DBUG_ASSERT(unsafe_thd != NULL);
assert(unsafe_thd != NULL);
m_unsafe_thd= unsafe_thd;
m_materialized= false;
@ -1006,7 +1006,7 @@ int PFS_status_variable_cache::do_materialize_all(THD* unsafe_thd)
int PFS_status_variable_cache::do_materialize_session(THD* unsafe_thd)
{
int ret= 1;
DBUG_ASSERT(unsafe_thd != NULL);
assert(unsafe_thd != NULL);
m_unsafe_thd= unsafe_thd;
m_materialized= false;
@ -1053,7 +1053,7 @@ int PFS_status_variable_cache::do_materialize_session(THD* unsafe_thd)
int PFS_status_variable_cache::do_materialize_session(PFS_thread *pfs_thread)
{
int ret= 1;
DBUG_ASSERT(pfs_thread != NULL);
assert(pfs_thread != NULL);
m_pfs_thread= pfs_thread;
m_materialized= false;
@ -1064,7 +1064,7 @@ int PFS_status_variable_cache::do_materialize_session(PFS_thread *pfs_thread)
mysql_mutex_lock(&LOCK_status);
/* The SHOW_VAR array must be initialized externally. */
DBUG_ASSERT(m_initialized);
assert(m_initialized);
/* Get and lock a validated THD from the thread manager. */
if ((m_safe_thd= get_THD(pfs_thread)) != NULL)
@ -1096,7 +1096,7 @@ int PFS_status_variable_cache::do_materialize_session(PFS_thread *pfs_thread)
*/
int PFS_status_variable_cache::do_materialize_client(PFS_client *pfs_client)
{
DBUG_ASSERT(pfs_client != NULL);
assert(pfs_client != NULL);
STATUS_VAR status_totals;
m_pfs_client= pfs_client;
@ -1108,7 +1108,7 @@ int PFS_status_variable_cache::do_materialize_client(PFS_client *pfs_client)
mysql_mutex_lock(&LOCK_status);
/* The SHOW_VAR array must be initialized externally. */
DBUG_ASSERT(m_initialized);
assert(m_initialized);
/*
Generate status totals from active threads and from totals aggregated

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@ -479,7 +479,7 @@ THD *PFS_variable_cache<Var_type>::get_THD(THD *unsafe_thd)
template <class Var_type>
THD *PFS_variable_cache<Var_type>::get_THD(PFS_thread *pfs_thread)
{
DBUG_ASSERT(pfs_thread != NULL);
assert(pfs_thread != NULL);
return get_THD(pfs_thread->m_thd);
}

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@ -64,8 +64,8 @@ void PFS_connection_iterator::visit_global(bool with_hosts, bool with_users,
bool with_THDs,
PFS_connection_visitor *visitor)
{
DBUG_ASSERT(visitor != NULL);
DBUG_ASSERT(! with_threads || ! with_THDs);
assert(visitor != NULL);
assert(! with_threads || ! with_THDs);
visitor->visit_global();
@ -164,8 +164,8 @@ void PFS_connection_iterator::visit_host(PFS_host *host,
bool with_THDs,
PFS_connection_visitor *visitor)
{
DBUG_ASSERT(visitor != NULL);
DBUG_ASSERT(! with_threads || ! with_THDs);
assert(visitor != NULL);
assert(! with_threads || ! with_THDs);
visitor->visit_host(host);
@ -253,8 +253,8 @@ void PFS_connection_iterator::visit_user(PFS_user *user,
bool with_THDs,
PFS_connection_visitor *visitor)
{
DBUG_ASSERT(visitor != NULL);
DBUG_ASSERT(! with_threads || ! with_THDs);
assert(visitor != NULL);
assert(! with_threads || ! with_THDs);
visitor->visit_user(user);
@ -334,8 +334,8 @@ void PFS_connection_iterator::visit_account(PFS_account *account,
bool with_THDs,
PFS_connection_visitor *visitor)
{
DBUG_ASSERT(visitor != NULL);
DBUG_ASSERT(! with_threads || ! with_THDs);
assert(visitor != NULL);
assert(! with_threads || ! with_THDs);
visitor->visit_account(account);
@ -364,7 +364,7 @@ void PFS_connection_iterator::visit_account(PFS_account *account,
void PFS_connection_iterator::visit_THD(THD *thd,
PFS_connection_visitor *visitor)
{
DBUG_ASSERT(visitor != NULL);
assert(visitor != NULL);
visitor->visit_THD(thd);
}
@ -505,7 +505,7 @@ void PFS_instance_iterator::visit_all_file_instances(PFS_instance_visitor *visit
void PFS_instance_iterator::visit_mutex_instances(PFS_mutex_class *klass,
PFS_instance_visitor *visitor)
{
DBUG_ASSERT(visitor != NULL);
assert(visitor != NULL);
visitor->visit_mutex_class(klass);
@ -539,7 +539,7 @@ void PFS_instance_iterator::visit_mutex_instances(PFS_mutex_class *klass,
void PFS_instance_iterator::visit_rwlock_instances(PFS_rwlock_class *klass,
PFS_instance_visitor *visitor)
{
DBUG_ASSERT(visitor != NULL);
assert(visitor != NULL);
visitor->visit_rwlock_class(klass);
@ -573,7 +573,7 @@ void PFS_instance_iterator::visit_rwlock_instances(PFS_rwlock_class *klass,
void PFS_instance_iterator::visit_cond_instances(PFS_cond_class *klass,
PFS_instance_visitor *visitor)
{
DBUG_ASSERT(visitor != NULL);
assert(visitor != NULL);
visitor->visit_cond_class(klass);
@ -607,7 +607,7 @@ void PFS_instance_iterator::visit_cond_instances(PFS_cond_class *klass,
void PFS_instance_iterator::visit_file_instances(PFS_file_class *klass,
PFS_instance_visitor *visitor)
{
DBUG_ASSERT(visitor != NULL);
assert(visitor != NULL);
visitor->visit_file_class(klass);
@ -643,7 +643,7 @@ void PFS_instance_iterator::visit_file_instances(PFS_file_class *klass,
void PFS_instance_iterator::visit_socket_instances(PFS_socket_class *klass,
PFS_instance_visitor *visitor)
{
DBUG_ASSERT(visitor != NULL);
assert(visitor != NULL);
visitor->visit_socket_class(klass);
@ -681,8 +681,8 @@ void PFS_instance_iterator::visit_socket_instances(PFS_socket_class *klass,
PFS_thread *thread,
bool visit_class)
{
DBUG_ASSERT(visitor != NULL);
DBUG_ASSERT(thread != NULL);
assert(visitor != NULL);
assert(thread != NULL);
if (visit_class)
visitor->visit_socket_class(klass);
@ -721,8 +721,8 @@ void PFS_instance_iterator::visit_instances(PFS_instr_class *klass,
PFS_thread *thread,
bool visit_class)
{
DBUG_ASSERT(visitor != NULL);
DBUG_ASSERT(klass != NULL);
assert(visitor != NULL);
assert(klass != NULL);
switch (klass->m_type)
{
@ -790,7 +790,7 @@ private:
void PFS_object_iterator::visit_all_tables(PFS_object_visitor *visitor)
{
DBUG_ASSERT(visitor != NULL);
assert(visitor != NULL);
visitor->visit_global();
@ -827,7 +827,7 @@ private:
void PFS_object_iterator::visit_tables(PFS_table_share *share,
PFS_object_visitor *visitor)
{
DBUG_ASSERT(visitor != NULL);
assert(visitor != NULL);
if (!share->m_enabled)
return;
@ -870,7 +870,7 @@ void PFS_object_iterator::visit_table_indexes(PFS_table_share *share,
uint index,
PFS_object_visitor *visitor)
{
DBUG_ASSERT(visitor != NULL);
assert(visitor != NULL);
if (!share->m_enabled)
return;
@ -906,8 +906,8 @@ void PFS_connection_wait_visitor::visit_global()
For waits, do not sum by connection but by instances,
it is more efficient.
*/
DBUG_ASSERT( (m_index == global_idle_class.m_event_name_index)
|| (m_index == global_metadata_class.m_event_name_index));
assert( (m_index == global_idle_class.m_event_name_index)
|| (m_index == global_metadata_class.m_event_name_index));
if (m_index == global_idle_class.m_event_name_index)
{
@ -969,7 +969,7 @@ PFS_connection_all_wait_visitor::~PFS_connection_all_wait_visitor()
void PFS_connection_all_wait_visitor::visit_global()
{
/* Sum by instances, not by connection */
DBUG_ASSERT(false);
assert(false);
}
void PFS_connection_all_wait_visitor::visit_connection_slice(PFS_connection_slice *pfs)

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@ -115,7 +115,7 @@ int table_accounts::read_row_values(TABLE *table,
return HA_ERR_RECORD_DELETED;
/* Set the null bits */
DBUG_ASSERT(table->s->null_bytes == 1);
assert(table->s->null_bytes == 1);
buf[0]= 0;
for (; (f= *fields) ; fields++)
@ -133,7 +133,7 @@ int table_accounts::read_row_values(TABLE *table,
m_row.m_connection_stat.set_field(f->field_index - 2, f);
break;
default:
DBUG_ASSERT(false);
assert(false);
}
}
}

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,

Some files were not shown because too many files have changed in this diff Show more