Commit 004b19e5 authored by marko's avatar marko

branches/zip: ibuf_use_t: Add the constant IBUF_USE_COUNT, to eliminate

a gcc warning about an assertion that trivially holds.
The warning was introduced in r4061, in the merge of
branches/innodb+ -r4053.

ibuf_insert(): Let an assertion fail if ibuf_use is unknown.
parent c3dc038c
...@@ -188,7 +188,7 @@ bool nw_panic = FALSE; ...@@ -188,7 +188,7 @@ bool nw_panic = FALSE;
#endif #endif
/** Allowed values of innodb_change_buffering */ /** Allowed values of innodb_change_buffering */
static const char* innobase_change_buffering_values[IBUF_USE_INSERT + 1] = { static const char* innobase_change_buffering_values[IBUF_USE_COUNT] = {
"none", /* IBUF_USE_NONE */ "none", /* IBUF_USE_NONE */
"inserts" /* IBUF_USE_INSERT */ "inserts" /* IBUF_USE_INSERT */
}; };
...@@ -9421,7 +9421,7 @@ innodb_change_buffering_update( ...@@ -9421,7 +9421,7 @@ innodb_change_buffering_update(
{ {
ut_a(var_ptr != NULL); ut_a(var_ptr != NULL);
ut_a(save != NULL); ut_a(save != NULL);
ut_a((*(ibuf_use_t*) save) <= IBUF_USE_INSERT); ut_a((*(ibuf_use_t*) save) < IBUF_USE_COUNT);
ibuf_use = *(const ibuf_use_t*) save; ibuf_use = *(const ibuf_use_t*) save;
......
...@@ -2768,13 +2768,18 @@ ibuf_insert( ...@@ -2768,13 +2768,18 @@ ibuf_insert(
ut_a(!dict_index_is_clust(index)); ut_a(!dict_index_is_clust(index));
switch (ibuf_use) { switch (UNIV_EXPECT(ibuf_use, IBUF_USE_INSERT)) {
case IBUF_USE_NONE: case IBUF_USE_NONE:
return(FALSE); return(FALSE);
case IBUF_USE_INSERT: case IBUF_USE_INSERT:
goto do_insert;
case IBUF_USE_COUNT:
break; break;
} }
ut_error; /* unknown value of ibuf_use */
do_insert:
entry_size = rec_get_converted_size(index, entry, 0); entry_size = rec_get_converted_size(index, entry, 0);
if (entry_size if (entry_size
......
...@@ -17,10 +17,14 @@ Created 7/19/1997 Heikki Tuuri ...@@ -17,10 +17,14 @@ Created 7/19/1997 Heikki Tuuri
#include "ibuf0types.h" #include "ibuf0types.h"
#include "fsp0fsp.h" #include "fsp0fsp.h"
/** Combinations of operations that can be buffered. */ /** Combinations of operations that can be buffered. Because the enum
values are used for indexing innobase_change_buffering_values[], they
should start at 0 and there should not be any gaps. */
typedef enum { typedef enum {
IBUF_USE_NONE = 0, IBUF_USE_NONE = 0,
IBUF_USE_INSERT /* insert */ IBUF_USE_INSERT, /* insert */
IBUF_USE_COUNT /* number of entries in ibuf_use_t */
} ibuf_use_t; } ibuf_use_t;
/** Operations that can currently be buffered. */ /** Operations that can currently be buffered. */
......
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