MXS-2013 Move or remove STR-macros

- The ones that were not used were removed.
- The ones that were used were moved close to the actual type.
  In most cases some values were missing and if the definition is
  close to the type there is a remote chance that they will stay
  in sync. If detached, they surely will not.
This commit is contained in:
Johan Wikman
2018-08-14 15:58:44 +03:00
parent ae43e4f0f2
commit f975035e53
8 changed files with 66 additions and 147 deletions

View File

@ -69,6 +69,13 @@ enum select_criteria_t
LAST_CRITERIA /**< not used except for an index */
};
#define STRCRITERIA(c) ((c) == UNDEFINED_CRITERIA ? "UNDEFINED_CRITERIA" : \
((c) == LEAST_GLOBAL_CONNECTIONS ? "LEAST_GLOBAL_CONNECTIONS" : \
((c) == LEAST_ROUTER_CONNECTIONS ? "LEAST_ROUTER_CONNECTIONS" : \
((c) == LEAST_BEHIND_MASTER ? "LEAST_BEHIND_MASTER" : \
((c) == LEAST_CURRENT_OPERATIONS ? "LEAST_CURRENT_OPERATIONS" : \
"Unknown criteria")))))
/**
* Controls how master failure is handled
*/

View File

@ -295,3 +295,11 @@ private:
* @return The internal ID of the prepared statement that the buffer contents refer to
*/
uint32_t get_internal_ps_id(RWSplitSession* rses, GWBUF* buffer);
#define STRTARGET(t) (t == TARGET_ALL ? "TARGET_ALL" : \
(t == TARGET_MASTER ? "TARGET_MASTER" : \
(t == TARGET_SLAVE ? "TARGET_SLAVE" : \
(t == TARGET_NAMED_SERVER ? "TARGET_NAMED_SERVER" : \
(t == TARGET_RLAG_MAX ? "TARGET_RLAG_MAX" : \
(t == TARGET_UNDEFINED ? "TARGET_UNDEFINED" : \
"Unknown target value"))))))