| 1 |
/***************************************************************************** |
| 2 |
|
| 3 |
Copyright (c) 1995, 2026, Oracle and/or its affiliates. |
| 4 |
Copyright (c) 2008, Google Inc. |
| 5 |
|
| 6 |
Portions of this file contain modifications contributed and copyrighted by |
| 7 |
Google, Inc. Those modifications are gratefully acknowledged and are described |
| 8 |
briefly in the InnoDB documentation. The contributions by Google are |
| 9 |
incorporated with their permission, and subject to the conditions contained in |
| 10 |
the file COPYING.Google. |
| 11 |
|
| 12 |
This program is free software; you can redistribute it and/or modify it under |
| 13 |
the terms of the GNU General Public License, version 2.0, as published by the |
| 14 |
Free Software Foundation. |
| 15 |
|
| 16 |
This program is designed to work with certain software (including |
| 17 |
but not limited to OpenSSL) that is licensed under separate terms, |
| 18 |
as designated in a particular file or component or in included license |
| 19 |
documentation. The authors of MySQL hereby grant you an additional |
| 20 |
permission to link the program and your derivative works with the |
| 21 |
separately licensed software that they have either included with |
| 22 |
the program or referenced in the documentation. |
| 23 |
|
| 24 |
This program is distributed in the hope that it will be useful, but WITHOUT |
| 25 |
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 26 |
FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, |
| 27 |
for more details. |
| 28 |
|
| 29 |
You should have received a copy of the GNU General Public License along with |
| 30 |
this program; if not, write to the Free Software Foundation, Inc., |
| 31 |
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 32 |
|
| 33 |
*****************************************************************************/ |
| 34 |
|
| 35 |
/** @file buf/buf.cc |
| 36 |
The database buffer buf_pool |
| 37 |
|
| 38 |
Created 11/5/1995 Heikki Tuuri |
| 39 |
*******************************************************/ |
| 40 |
|
| 41 |
#include "page0size.h" |
| 42 |
#include "univ.i" |
| 43 |
|
| 44 |
/** Checks if a page contains only zeroes. |
| 45 |
@param[in] read_buf database page |
| 46 |
@param[in] page_size page size |
| 47 |
@return true if page is filled with zeroes */ |
| 48 |
bool buf_page_is_zeroes(const byte *read_buf, const page_size_t &page_size) { |
| 49 |
for (ulint i = 0; i < page_size.logical(); i++) { |
| 50 |
if (read_buf[i] != 0) { |
| 51 |
return (false); |
| 52 |
} |
| 53 |
} |
| 54 |
return (true); |
| 55 |
} |