MySQL 8.0.40
Source Code Documentation
srs_fetcher.h
Go to the documentation of this file.
1#ifndef SRS_FETCHER_H_INCLUDED
2#define SRS_FETCHER_H_INCLUDED
3
4/*
5 Copyright (c) 2017, 2024, Oracle and/or its affiliates.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License, version 2.0,
9 as published by the Free Software Foundation.
10
11 This program is designed to work with certain software (including
12 but not limited to OpenSSL) that is licensed under separate terms,
13 as designated in a particular file or component or in included license
14 documentation. The authors of MySQL hereby grant you an additional
15 permission to link the program and your derivative works with the
16 separately licensed software that they have either included with
17 the program or referenced in the documentation.
18
19 This program is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU General Public License, version 2.0, for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with this program; if not, write to the Free Software
26 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27*/
28
29#include "sql/gis/geometries.h"
30#include "sql/gis/srid.h"
31#include "sql/mdl.h"
32
33namespace dd {
34class Spatial_reference_system;
35}
36
38 private:
40
41 /**
42 Take an MDL lock on an SRID.
43
44 @param[in] srid Spatial reference system ID
45 @param[in] lock_type Type of lock to take
46
47 @retval false Success.
48 @retval true Locking failed. An error has already been flagged.
49 */
50 bool lock(gis::srid_t srid, enum_mdl_type lock_type);
51
52 public:
53 Srs_fetcher(THD *thd) : m_thd(thd) {}
54
55 /**
56 Acquire an SRS from the data dictionary. Take a shared read lock on the
57 SRID.
58
59 @param[in] srid Spatial reference system ID
60 @param[out] srs The spatial reference system
61
62 @retval false Success.
63 @retval true Locking failed. An error has already been flagged.
64 */
65 bool acquire(gis::srid_t srid, const dd::Spatial_reference_system **srs);
66
67 /**
68 Acquire an SRS from the data dictionary with the intent of modifying
69 it. Take an exclusive lock on the SRID.
70
71 @param[in] srid Spatial reference system ID
72 @param[out] srs The spatial reference system
73
74 @retval false Success.
75 @retval true Locking failed. An error has already been flagged.
76 */
79
80 static bool srs_exists(THD *thd, gis::srid_t srid, bool *exists);
81};
82
83#endif // SRS_FETCHER_H_INCLUDED
Definition: srs_fetcher.h:37
bool acquire_for_modification(gis::srid_t srid, dd::Spatial_reference_system **srs)
Acquire an SRS from the data dictionary with the intent of modifying it.
Definition: item_geofunc_internal.cc:91
THD * m_thd
Definition: srs_fetcher.h:39
Srs_fetcher(THD *thd)
Definition: srs_fetcher.h:53
bool acquire(gis::srid_t srid, const dd::Spatial_reference_system **srs)
Acquire an SRS from the data dictionary.
Definition: item_geofunc_internal.cc:82
bool lock(gis::srid_t srid, enum_mdl_type lock_type)
Take an MDL lock on an SRID.
Definition: item_geofunc_internal.cc:61
static bool srs_exists(THD *thd, gis::srid_t srid, bool *exists)
Definition: item_geofunc_internal.cc:100
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:34
Definition: spatial_reference_system.h:53
This file declares the geometry class hierarchy used by the server as the internal representation of ...
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
std::uint32_t srid_t
A spatial reference system ID (SRID).
Definition: srid.h:33
static int exists(node_address *name, node_list const *nodes, u_int with_uid)
Definition: node_list.cc:106
enum_mdl_type
Type of metadata lock request.
Definition: sql_lexer_yacc_state.h:106