Skip to content

Commit 53dd4cd

Browse files
Ingo StruewingIngo Struewing
Ingo Struewing
authored and
Ingo Struewing
committed
Merge branch 'mysql-8.0' into mysql-trunk
2 parents 181d1b8 + 87692b6 commit 53dd4cd

File tree

10 files changed

+11
-73
lines changed

10 files changed

+11
-73
lines changed

sql/sql_table.cc

+1-23
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,17 @@
2929
#include <string>
3030
#include <type_traits>
3131

32-
#ifndef UNIV_HOTBACKUP
3332
#include "binary_log_types.h"
3433
#include "binlog_event.h"
3534
#include "lex_string.h"
36-
#endif /* !UNIV_HOTBACKUP */
3735
#include "m_ctype.h"
3836
#include "m_string.h" // my_stpncpy
39-
#ifndef UNIV_HOTBACKUP
4037
#include "my_alloc.h"
4138
#include "my_base.h"
4239
#include "my_check_opt.h" // T_EXTEND
4340
#include "my_compiler.h"
44-
#endif /* !UNIV_HOTBACKUP */
4541
#include "my_dbug.h"
4642
#include "mysql_com.h"
47-
#ifndef UNIV_HOTBACKUP
4843
#include "my_io.h"
4944
#include "my_loglevel.h"
5045
#include "my_psi_config.h"
@@ -136,14 +131,10 @@
136131
#include "sql/sql_tablespace.h" // validate_tablespace_name
137132
#include "sql/sql_time.h" // make_truncated_value_warning
138133
#include "sql/sql_trigger.h" // change_trigger_table_name
139-
#endif /* !UNIV_HOTBACKUP */
140134
#include "sql/strfunc.h" // find_type2
141-
#ifndef UNIV_HOTBACKUP
142135
#include "sql/strfunc.h" // find_type2
143136
#include "sql/system_variables.h"
144-
#endif /* !UNIV_HOTBACKUP */
145137
#include "sql/table.h"
146-
#ifndef UNIV_HOTBACKUP
147138
#include "sql/thd_raii.h"
148139
#include "sql/thr_malloc.h"
149140
#include "sql/transaction.h" // trans_commit_stmt
@@ -189,13 +180,6 @@ static bool prepare_enum_field(THD *thd, Create_field *sql_field);
189180
static uint blob_length_by_type(enum_field_types type);
190181
static const Create_field *get_field_by_index(Alter_info *alter_info, uint idx);
191182

192-
#else /* !UNIV_HOTBACKUP */
193-
/* Branches which use these, should not be taken by backup. */
194-
#define ER_THD_OR_DEFAULT(thd,X) ("Cannot explain file name, MySQL error")
195-
#define get_quote_char_for_identifier(thd, conv_name, len) ('`')
196-
#endif /* !UNIV_HOTBACKUP */
197-
198-
#ifndef UNIV_HOTBACKUP
199183
/**
200184
RAII class to control the atomic DDL commit on slave.
201185
A slave context flag responsible to mark the DDL as committed is
@@ -250,7 +234,6 @@ static bool trans_intermediate_ddl_commit(THD *thd, bool error)
250234
}
251235
return trans_commit_stmt(thd) || trans_commit(thd);
252236
}
253-
#endif /* !UNIV_HOTBACKUP */
254237

255238

256239
/**
@@ -525,7 +508,6 @@ size_t explain_filename(THD* thd,
525508
DBUG_RETURN(static_cast<size_t>(to_p - to));
526509
}
527510

528-
#ifndef UNIV_HOTBACKUP
529511
void parse_filename(const char *filename, size_t filename_length,
530512
const char ** schema_name, size_t *schema_name_length,
531513
const char ** table_name, size_t *table_name_length,
@@ -640,7 +622,7 @@ void parse_filename(const char *filename, size_t filename_length,
640622
*subpartition_name= id_ptr;
641623
*subpartition_name_length= id_length;
642624
}
643-
#endif /* !UNIV_HOTBACKUP */
625+
644626

645627
/*
646628
Translate a file name to a table name (WL #1324).
@@ -675,15 +657,13 @@ size_t filename_to_tablename(const char *from, char *to, size_t to_length,
675657
system_charset_info, to, to_length, &errors);
676658
if (errors) // Old 5.0 name
677659
{
678-
#ifndef UNIV_HOTBACKUP
679660
if (!stay_quiet) {
680661
LogErr(ERROR_LEVEL, ER_INVALID_OR_OLD_TABLE_OR_DB_NAME, from);
681662
}
682663
/*
683664
TODO: add a stored procedure for fix table and database names,
684665
and mention its name in error log.
685666
*/
686-
#endif /* !UNIV_HOTBACKUP */
687667
}
688668
}
689669

@@ -692,7 +672,6 @@ size_t filename_to_tablename(const char *from, char *to, size_t to_length,
692672
}
693673

694674

695-
#ifndef UNIV_HOTBACKUP
696675
/*
697676
Translate a table name to a file name (WL #1324).
698677

@@ -15020,4 +14999,3 @@ static bool check_engine(THD *thd, const char *db_name,
1502014999

1502115000
DBUG_RETURN(false);
1502215001
}
15023-
#endif /* !UNIV_HOTBACKUP */

sql/sql_table.h

-10
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include <utility>
2424
#include <vector>
2525

26-
#ifndef UNIV_HOTBACKUP
2726
#include "dd/string_type.h"
2827
#include "m_ctype.h"
2928
#include "mdl.h"
@@ -56,17 +55,13 @@ typedef mysql_mutex_t mysql_mutex_t;
5655
template<typename T> class List;
5756

5857

59-
#else /* !UNIV_HOTBACKUP */
60-
class THD {};
61-
#endif /* !UNIV_HOTBACKUP */
6258
enum enum_explain_filename_mode
6359
{
6460
EXPLAIN_ALL_VERBOSE= 0,
6561
EXPLAIN_PARTITIONS_VERBOSE,
6662
EXPLAIN_PARTITIONS_AS_COMMENT
6763
};
6864

69-
#ifndef UNIV_HOTBACKUP
7065
/* Maximum length of GEOM_POINT Field */
7166
#define MAX_LEN_GEOM_POINT_FIELD 25
7267

@@ -81,12 +76,10 @@ static const uint NO_FK_CHECKS= 1 << 2;
8176
the table.
8277
*/
8378
static const uint NO_DD_COMMIT= 1 << 3;
84-
#endif /* !UNIV_HOTBACKUP */
8579

8680

8781
size_t filename_to_tablename(const char *from, char *to, size_t to_length,
8882
bool stay_quiet = false);
89-
#ifndef UNIV_HOTBACKUP
9083
size_t tablename_to_filename(const char *from, char *to, size_t to_length);
9184
size_t build_table_filename(char *buff, size_t bufflen, const char *db,
9285
const char *table, const char *ext,
@@ -487,13 +480,11 @@ bool mysql_prepare_create_table(THD *thd,
487480
uint existing_fks_count,
488481
int select_field_count,
489482
bool find_parent_keys);
490-
#endif /* !UNIV_HOTBACKUP */
491483

492484

493485
size_t explain_filename(THD* thd, const char *from, char *to, size_t to_length,
494486
enum_explain_filename_mode explain_mode);
495487

496-
#ifndef UNIV_HOTBACKUP
497488
void parse_filename(const char *filename, size_t filename_length,
498489
const char ** schema_name, size_t *schema_name_length,
499490
const char ** table_name, size_t *table_name_length,
@@ -516,5 +507,4 @@ extern MYSQL_PLUGIN_IMPORT const char *primary_key_name;
516507

517508
bool lock_trigger_names(THD *thd, TABLE_LIST *tables);
518509

519-
#endif /* !UNIV_HOTBACKUP */
520510
#endif /* SQL_TABLE_INCLUDED */

sql/strfunc.cc

-7
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,11 @@
1919

2020
#include "m_ctype.h" // my_charset_latin1
2121
#include "my_dbug.h"
22-
#ifndef UNIV_HOTBACKUP
2322
#include "sql/sql_class.h"
2423
#include "sql/sql_const.h"
25-
#endif /* !UNIV_HOTBACKUP */
2624
#include "sql_string.h"
2725
#include "typelib.h" // TYPELIB
2826

29-
#ifndef UNIV_HOTBACKUP
3027
/*
3128
Return bitmap for strings used in a set
3229
@@ -212,7 +209,6 @@ uint check_word(TYPELIB *lib, const char *val, const char *end,
212209
*end_of_word= ptr;
213210
return res;
214211
}
215-
#endif /* !UNIV_HOTBACKUP */
216212

217213

218214
/*
@@ -290,7 +286,6 @@ size_t strconvert(const CHARSET_INFO *from_cs, const char *from,
290286
}
291287

292288

293-
#ifndef UNIV_HOTBACKUP
294289
char *set_to_string(THD *thd, LEX_STRING *result, ulonglong set,
295290
const char *lib[])
296291
{
@@ -345,5 +340,3 @@ char *flagset_to_string(THD *thd, LEX_STRING *result, ulonglong set,
345340

346341
return result->str;
347342
}
348-
#endif /* !UNIV_HOTBACKUP */
349-

sql/table.h

-16
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <sys/types.h>
2121
#include <string>
2222

23-
#ifndef UNIV_HOTBACKUP
2423
#include "binary_log_types.h"
2524
#include "lex_string.h"
2625
#include "m_ctype.h"
@@ -53,17 +52,11 @@
5352
#include "thr_lock.h"
5453
#include "typelib.h"
5554

56-
#else /* !UNIV_HOTBACKUP */
57-
#ifdef MYSQL_CLIENT
58-
#undef MYSQL_CLIENT
59-
#endif /* MYSQL_CLIENT */
60-
#endif /* !UNIV_HOTBACKUP */
6155

6256
#include "sql/mem_root_array.h"
6357

6458
class Field;
6559

66-
#ifndef UNIV_HOTBACKUP
6760
namespace histograms
6861
{
6962
class Histogram;
@@ -130,14 +123,12 @@ enum class enum_json_diff_operation;
130123
if ((A)->s->null_bytes > 0) \
131124
memset((A)->null_flags, 255, (A)->s->null_bytes);\
132125
}
133-
#endif /* !UNIV_HOTBACKUP */
134126

135127
#define tmp_file_prefix "#sql" /**< Prefix for tmp tables */
136128
#define tmp_file_prefix_length 4
137129
#define TMP_TABLE_KEY_EXTRA 8
138130
#define PLACEHOLDER_TABLE_ROW_ESTIMATE 2
139131

140-
#ifndef UNIV_HOTBACKUP
141132
/**
142133
Enumerate possible types of a table from re-execution
143134
standpoint.
@@ -1163,8 +1154,6 @@ class Blob_mem_storage
11631154
};
11641155

11651156

1166-
#endif /* UNIV_HOTBACKUP */
1167-
11681157
/**
11691158
Class that represents a single change to a column value in partial
11701159
update of a JSON column.
@@ -1212,8 +1201,6 @@ class Binary_diff final
12121201
*/
12131202
using Binary_diff_vector= Mem_root_array<Binary_diff>;
12141203

1215-
#ifndef UNIV_HOTBACKUP
1216-
12171204
/**
12181205
Flags for TABLE::m_status (maximum 8 bits).
12191206
The flags define the state of the row buffer in TABLE::record[0].
@@ -3706,9 +3693,7 @@ extern LEX_STRING MYSQL_TABLESPACE_NAME;
37063693
extern LEX_STRING RLI_INFO_NAME;
37073694
extern LEX_STRING MI_INFO_NAME;
37083695
extern LEX_STRING WORKER_INFO_NAME;
3709-
#endif /* !UNIV_HOTBACKUP */
37103696

3711-
#ifndef UNIV_HOTBACKUP
37123697
inline bool is_infoschema_db(const char *name, size_t len)
37133698
{
37143699
return (INFORMATION_SCHEMA_NAME.length == len &&
@@ -3924,5 +3909,4 @@ bool create_table_share_for_upgrade(THD *thd,
39243909
bool is_fix_view_cols_and_deps);
39253910
//////////////////////////////////////////////////////////////////////////
39263911

3927-
#endif /* !UNIV_HOTBACKUP */
39283912
#endif /* TABLE_INCLUDED */

storage/innobase/dict/dict0dd.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -554,16 +554,16 @@ dd_check_corrupted(dict_table_t*& table)
554554
char db_buf[MAX_DATABASE_NAME_LEN + 1];
555555
char tbl_buf[MAX_TABLE_NAME_LEN + 1];
556556

557+
#ifndef UNIV_HOTBACKUP
557558
dd_parse_tbl_name(
558559
table->name.m_name, db_buf, tbl_buf,
559560
nullptr, nullptr, nullptr);
560-
#ifndef UNIV_HOTBACKUP
561561
my_error(ER_TABLE_CORRUPT, MYF(0),
562562
db_buf, tbl_buf);
563563
#else /* !UNIV_HOTBACKUP */
564564
ib::fatal()
565565
<< "table is corrupt: "
566-
<< db_buf << "." << tbl_buf;
566+
<< table->name.m_name;
567567
#endif /* !UNIV_HOTBACKUP */
568568
}
569569
table = nullptr;
@@ -682,9 +682,11 @@ dd_table_open_on_id(
682682
}
683683
} else {
684684
for (;;) {
685+
#ifndef UNIV_HOTBACKUP
685686
bool ret = dd_parse_tbl_name(
686687
ib_table->name.m_name, db_buf, tbl_buf,
687688
nullptr, nullptr, nullptr);
689+
#endif /* !UNIV_HOTBACKUP */
688690

689691
memset(full_name, 0, MAX_FULL_NAME_LEN + 1);
690692

@@ -694,14 +696,14 @@ dd_table_open_on_id(
694696

695697
mutex_exit(&dict_sys->mutex);
696698

699+
#ifndef UNIV_HOTBACKUP
697700
if (ret == false) {
698701
if (dict_locked) {
699702
mutex_enter(&dict_sys->mutex);
700703
}
701704
return(nullptr);
702705
}
703706

704-
#ifndef UNIV_HOTBACKUP
705707
if (dd_mdl_acquire(thd, mdl, db_buf, tbl_buf)) {
706708
if (dict_locked) {
707709
mutex_enter(&dict_sys->mutex);
@@ -2667,7 +2669,6 @@ dd_fill_dict_table(
26672669

26682670
return(m_table);
26692671
}
2670-
#endif /* !UNIV_HOTBACKUP */
26712672

26722673
/** Parse the tablespace name from filename charset to table name charset
26732674
@param[in] space_name tablespace name
@@ -2719,7 +2720,6 @@ dd_filename_to_spacename(
27192720
ut_ad(tablespace_name->size() < MAX_SPACE_NAME_LEN);
27202721
}
27212722

2722-
#ifndef UNIV_HOTBACKUP
27232723
/* Create metadata for specified tablespace, acquiring exlcusive MDL first
27242724
@param[in,out] dd_client data dictionary client
27252725
@param[in,out] thd THD

storage/innobase/dict/dict0mem.cc

+4
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ operator<<(
8181
std::ostream& s,
8282
const table_name_t& table_name)
8383
{
84+
#ifndef UNIV_HOTBACKUP
8485
return(s << ut_get_name(NULL, table_name.m_name));
86+
#else /* !UNIV_HOTBACKUP */
87+
return(s << table_name.m_name);
88+
#endif /* !UNIV_HOTBACKUP */
8589
}
8690

8791
#ifndef UNIV_HOTBACKUP

storage/innobase/handler/ha_innodb.cc

-2
Original file line numberDiff line numberDiff line change
@@ -3199,7 +3199,6 @@ innobase_quote_identifier(
31993199
putc(q, file);
32003200
}
32013201
}
3202-
#endif /* !UNIV_HOTBACKUP */
32033202

32043203
/** Convert a table name to the MySQL system_charset_info (UTF-8)
32053204
and quote it.
@@ -3275,7 +3274,6 @@ innobase_convert_name(
32753274
return(s);
32763275
}
32773276

3278-
#ifndef UNIV_HOTBACKUP
32793277
/*****************************************************************//**
32803278
A wrapper function of innobase_convert_name(), convert a table name
32813279
to the MySQL system_charset_info (UTF-8) and quote it if needed.

storage/innobase/include/dict0dd.h

-2
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,6 @@ MY_ATTRIBUTE((warn_unused_result))
920920
innodb_session_t*&
921921
thd_to_innodb_session(
922922
THD* thd);
923-
#endif /* !UNIV_HOTBACKUP */
924923

925924
/** Parse a table file name into table name and database name.
926925
Note the table name may have trailing TMP_POSTFIX for temporary table name.
@@ -943,7 +942,6 @@ dd_parse_tbl_name(
943942
char* dd_sub_name,
944943
bool* is_temp);
945944

946-
#ifndef UNIV_HOTBACKUP
947945
/** Look up a column in a table using the system_charset_info collation.
948946
@param[in] dd_table data dictionary table
949947
@param[in] name column name

storage/innobase/include/dict0dd.ic

-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ dd_get_space_id(const dd::Partition& partition)
6060
}
6161
return(id);
6262
}
63-
#endif /* !UNIV_HOTBACKUP */
6463

6564
/** partition name separator */
6665
extern const char* part_sep;
@@ -168,7 +167,6 @@ dd_parse_tbl_name(
168167
return(true);
169168
}
170169

171-
#ifndef UNIV_HOTBACKUP
172170
/** Look up a column in a table using the system_charset_info collation.
173171
@param[in] dd_table data dictionary table
174172
@param[in] name column name

0 commit comments

Comments
 (0)