Commit e22d86a3 authored by Marko Mäkelä's avatar Marko Mäkelä

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.
parent 956d2540
...@@ -2271,14 +2271,12 @@ fil_op_log_parse_or_replay( ...@@ -2271,14 +2271,12 @@ fil_op_log_parse_or_replay(
} else if (log_flags & MLOG_FILE_FLAG_TEMP) { } else if (log_flags & MLOG_FILE_FLAG_TEMP) {
/* Temporary table, do nothing */ /* Temporary table, do nothing */
} else { } else {
const char* path = NULL;
/* Create the database directory for name, if it does /* Create the database directory for name, if it does
not exist yet */ not exist yet */
fil_create_directory_for_tablename(name); fil_create_directory_for_tablename(name);
if (fil_create_new_single_table_tablespace( if (fil_create_new_single_table_tablespace(
space_id, name, path, flags, space_id, name, NULL, flags,
DICT_TF2_USE_TABLESPACE, DICT_TF2_USE_TABLESPACE,
FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) { FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) {
ut_error; ut_error;
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation. All Rights Reserved. Copyright (c) 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
...@@ -782,7 +782,7 @@ fil_create_new_single_table_tablespace( ...@@ -782,7 +782,7 @@ fil_create_new_single_table_tablespace(
ulint size) /*!< in: the initial size of the ulint size) /*!< in: the initial size of the
tablespace file in pages, tablespace file in pages,
must be >= FIL_IBD_FILE_INITIAL_SIZE */ must be >= FIL_IBD_FILE_INITIAL_SIZE */
MY_ATTRIBUTE((nonnull, warn_unused_result)); MY_ATTRIBUTE((nonnull(2), warn_unused_result));
#ifndef UNIV_HOTBACKUP #ifndef UNIV_HOTBACKUP
/********************************************************************//** /********************************************************************//**
Tries to open a single-table tablespace and optionally checks the space id is Tries to open a single-table tablespace and optionally checks the space id is
......
...@@ -2323,14 +2323,12 @@ fil_op_log_parse_or_replay( ...@@ -2323,14 +2323,12 @@ fil_op_log_parse_or_replay(
} else if (log_flags & MLOG_FILE_FLAG_TEMP) { } else if (log_flags & MLOG_FILE_FLAG_TEMP) {
/* Temporary table, do nothing */ /* Temporary table, do nothing */
} else { } else {
const char* path = NULL;
/* Create the database directory for name, if it does /* Create the database directory for name, if it does
not exist yet */ not exist yet */
fil_create_directory_for_tablename(name); fil_create_directory_for_tablename(name);
if (fil_create_new_single_table_tablespace( if (fil_create_new_single_table_tablespace(
space_id, name, path, flags, space_id, name, NULL, flags,
DICT_TF2_USE_TABLESPACE, DICT_TF2_USE_TABLESPACE,
FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) { FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) {
ut_error; ut_error;
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation. All Rights Reserved. Copyright (c) 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
...@@ -778,7 +778,7 @@ fil_create_new_single_table_tablespace( ...@@ -778,7 +778,7 @@ fil_create_new_single_table_tablespace(
ulint size) /*!< in: the initial size of the ulint size) /*!< in: the initial size of the
tablespace file in pages, tablespace file in pages,
must be >= FIL_IBD_FILE_INITIAL_SIZE */ must be >= FIL_IBD_FILE_INITIAL_SIZE */
MY_ATTRIBUTE((nonnull, warn_unused_result)); MY_ATTRIBUTE((nonnull(2), warn_unused_result));
#ifndef UNIV_HOTBACKUP #ifndef UNIV_HOTBACKUP
/********************************************************************//** /********************************************************************//**
Tries to open a single-table tablespace and optionally checks the space id is Tries to open a single-table tablespace and optionally checks the space id is
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment