Skip to content

Commit e22d86a

Browse files
committed
fil_create_new_single_table_tablespace(): Correct a bogus nonnull attribute
The parameter path can be passed as NULL. This error was reported by GCC 7.1.0 when compiling CMAKE_BUILD_TYPE=Debug with -O3.
1 parent 956d254 commit e22d86a

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

storage/innobase/fil/fil0fil.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2271,14 +2271,12 @@ fil_op_log_parse_or_replay(
22712271
} else if (log_flags & MLOG_FILE_FLAG_TEMP) {
22722272
/* Temporary table, do nothing */
22732273
} else {
2274-
const char* path = NULL;
2275-
22762274
/* Create the database directory for name, if it does
22772275
not exist yet */
22782276
fil_create_directory_for_tablename(name);
22792277

22802278
if (fil_create_new_single_table_tablespace(
2281-
space_id, name, path, flags,
2279+
space_id, name, NULL, flags,
22822280
DICT_TF2_USE_TABLESPACE,
22832281
FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) {
22842282
ut_error;

storage/innobase/include/fil0fil.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*****************************************************************************
22
33
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
4-
Copyright (c) 2017, MariaDB Corporation. All Rights Reserved.
4+
Copyright (c) 2017, MariaDB Corporation.
55
66
This program is free software; you can redistribute it and/or modify it under
77
the terms of the GNU General Public License as published by the Free Software
@@ -782,7 +782,7 @@ fil_create_new_single_table_tablespace(
782782
ulint size)/*!< in: the initial size of the
783783
tablespace file in pages,
784784
must be >= FIL_IBD_FILE_INITIAL_SIZE */
785-
MY_ATTRIBUTE((nonnull, warn_unused_result));
785+
MY_ATTRIBUTE((nonnull(2), warn_unused_result));
786786
#ifndef UNIV_HOTBACKUP
787787
/********************************************************************//**
788788
Tries to open a single-table tablespace and optionally checks the space id is

storage/xtradb/fil/fil0fil.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2323,14 +2323,12 @@ fil_op_log_parse_or_replay(
23232323
} else if (log_flags & MLOG_FILE_FLAG_TEMP) {
23242324
/* Temporary table, do nothing */
23252325
} else {
2326-
const char* path = NULL;
2327-
23282326
/* Create the database directory for name, if it does
23292327
not exist yet */
23302328
fil_create_directory_for_tablename(name);
23312329

23322330
if (fil_create_new_single_table_tablespace(
2333-
space_id, name, path, flags,
2331+
space_id, name, NULL, flags,
23342332
DICT_TF2_USE_TABLESPACE,
23352333
FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) {
23362334
ut_error;

storage/xtradb/include/fil0fil.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*****************************************************************************
22
33
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
4-
Copyright (c) 2017, MariaDB Corporation. All Rights Reserved.
4+
Copyright (c) 2017, MariaDB Corporation.
55
66
This program is free software; you can redistribute it and/or modify it under
77
the terms of the GNU General Public License as published by the Free Software
@@ -778,7 +778,7 @@ fil_create_new_single_table_tablespace(
778778
ulint size)/*!< in: the initial size of the
779779
tablespace file in pages,
780780
must be >= FIL_IBD_FILE_INITIAL_SIZE */
781-
MY_ATTRIBUTE((nonnull, warn_unused_result));
781+
MY_ATTRIBUTE((nonnull(2), warn_unused_result));
782782
#ifndef UNIV_HOTBACKUP
783783
/********************************************************************//**
784784
Tries to open a single-table tablespace and optionally checks the space id is

0 commit comments

Comments
 (0)