1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

P_S 5.7.28

This commit is contained in:
Sergei Golubchik
2019-12-10 15:35:00 +01:00
parent dfe6e914e5
commit 0ea717f51a
942 changed files with 174739 additions and 20780 deletions

View File

@@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
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,
@@ -26,7 +26,7 @@
*/
#include "my_global.h"
#include "my_pthread.h"
#include "my_thread.h"
#include "pfs_instr.h"
#include "pfs_column_types.h"
#include "pfs_column_values.h"
@@ -34,6 +34,8 @@
#include "table_setup_objects.h"
#include "table_helper.h"
#include "pfs_global.h"
#include "pfs_buffer_container.h"
#include "field.h"
THR_LOCK table_setup_objects::m_table_lock;
@@ -46,15 +48,16 @@ table_setup_objects::m_share=
table_setup_objects::write_row,
table_setup_objects::delete_all_rows,
table_setup_objects::get_row_count,
1000, /* records */
sizeof(PFS_simple_index),
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE setup_objects("
"OBJECT_TYPE ENUM ('TABLE') not null default 'TABLE',"
"OBJECT_TYPE ENUM ('EVENT','FUNCTION','PROCEDURE','TABLE','TRIGGER') not null default 'EVENT',"
"OBJECT_SCHEMA VARCHAR(64) default '%',"
"OBJECT_NAME VARCHAR(64) not null default '%',"
"ENABLED ENUM ('YES', 'NO') not null default 'YES',"
"TIMED ENUM ('YES', 'NO') not null default 'YES')") }
"TIMED ENUM ('YES', 'NO') not null default 'YES')") },
false /* perpetual */
};
int update_derived_flags()
@@ -64,6 +67,7 @@ int update_derived_flags()
return HA_ERR_OUT_OF_MEM;
update_table_share_derived_flags(thread);
update_program_share_derived_flags(thread);
update_table_derived_flags();
return 0;
}
@@ -116,7 +120,9 @@ int table_setup_objects::write_row(TABLE *table, const unsigned char *buf,
}
/* Reject illegal enum values in OBJECT_TYPE */
if (object_type != OBJECT_TYPE_TABLE)
if (object_type < FIRST_OBJECT_TYPE ||
object_type > LAST_OBJECT_TYPE ||
object_type == OBJECT_TYPE_TEMPORARY_TABLE)
return HA_ERR_NO_REFERENCED_ROW;
/* Reject illegal enum values in ENABLED */
@@ -147,7 +153,7 @@ int table_setup_objects::delete_all_rows(void)
ha_rows table_setup_objects::get_row_count(void)
{
return setup_object_count();
return global_setup_object_container.get_row_count();
}
table_setup_objects::table_setup_objects()
@@ -165,17 +171,14 @@ int table_setup_objects::rnd_next(void)
{
PFS_setup_object *pfs;
for (m_pos.set_at(&m_next_pos);
m_pos.m_index < setup_object_max;
m_pos.next())
m_pos.set_at(&m_next_pos);
PFS_setup_object_iterator it= global_setup_object_container.iterate(m_pos.m_index);
pfs= it.scan_next(& m_pos.m_index);
if (pfs != NULL)
{
pfs= &setup_object_array[m_pos.m_index];
if (pfs->m_lock.is_populated())
{
make_row(pfs);
m_next_pos.set_after(&m_pos);
return 0;
}
make_row(pfs);
m_next_pos.set_after(&m_pos);
return 0;
}
return HA_ERR_END_OF_FILE;
@@ -187,9 +190,8 @@ int table_setup_objects::rnd_pos(const void *pos)
set_position(pos);
DBUG_ASSERT(m_pos.m_index < setup_object_max);
pfs= &setup_object_array[m_pos.m_index];
if (pfs->m_lock.is_populated())
pfs= global_setup_object_container.get(m_pos.m_index);
if (pfs != NULL)
{
make_row(pfs);
return 0;
@@ -200,7 +202,7 @@ int table_setup_objects::rnd_pos(const void *pos)
void table_setup_objects::make_row(PFS_setup_object *pfs)
{
pfs_lock lock;
pfs_optimistic_state lock;
m_row_exists= false;